''Pop-Up Content Warning (Custom CSS Required)''
(if: $firstplay is not true)[(set: $projecturl to "")(set: $contentwarning to "")(set: $cwhex to "")(set: $cwthex to "")(set: $firstplay to true)]Project URL with https://
(input-box:2bind $projecturl,"XXXXX=",1)(text-colour:#adb5bd)[Example: https://npckc.itch.io/example]
Content warning text
(input-box:2bind $contentwarning,"XXXXX=",2)(text-colour:#adb5bd)[Example: Includes jump scares]
Content warning hex code without #
(input-box:2bind $cwhex,"X=",1)(text-colour:#adb5bd)[Example: fa5c5c (Theme link colour recommended)]
Content warning text hex code without #
(input-box:2bind $cwthex,"X=",1)(text-colour:#adb5bd)[Example: ffffff (Black/white recommended)]
[[SUBMIT->TEST]]
[[RETURN->SELECT]][(set: $cwhex to (trimmed: "#", $cwhex))][(set: $cwthex to (trimmed: "#", $cwthex))]Copy the following to ''Edit project'' > ''Description (HTML input)''
(font:"Roboto Mono")[<span style="font-size: 55%; line-height: 110%;">(b4r:"solid")+(b4r-size:0.5)+(b4r-colour:black)[`<`(print: "a href='" + $projecturl + "#cwseen'") `class="custom-hide" name="cwseen"><b>CONTENT WARNING:</b><br>`$contentwarning`</a>`]</span>]
(text-colour:#adb5bd)[(Switch to ''HTML input'' by pressing the ''<>'' button on the left.)]
Copy the following to ''Edit theme'' > ''Custom CSS''
(font:"Roboto Mono")[<span style="font-size: 55%; line-height: 110%;">(b4r:"solid")+(b4r-size:0.5)+(b4r-colour:black)[`/* This defines how the button looks*/
.custom-hide {
` `position:fixed;
` `display:block;
` `z-index: 1000;
` `border-radius: 5px;
` `background: #`$cwhex`;
` `padding: 30px;
` `text-align: center;
` `left: 20%;
` `right: 20%;
` `top: 40%;
}
/* This changes button size on browsers with smaller widths*/
@media screen and (max-width: 1080px) {
` `.custom-hide {
` `left:5%;
` `right:5%;
` `}
}
/* This defines the colour of the link*/
a.custom-hide:link, a.custom-hide:visited, a.custom-hide:active {
` `color: #`$cwthex`;
` `text-decoration:none;
}
/* This adds an underline when hovered*/
a.custom-hide:hover {
` `color: #`$cwthex`;
` `text-decoration:underline;
}
/* This hides the button on click*/
.custom-hide:target {
` `display:none;
}`]</span>]
You should now have a pop-up content warning on your game page.
[[START AGAIN->SELECT]](if: $projecturl's (a:1,2,3,4,5,6,7,8) is not "https://" and $projecturl is not "")[(alert:"Double-check your project URL."),(go-to: "SUBMIT")]
(else-if: $projecturl is not "" and $contentwarning is not "" and $cwhex is not "" and $cwthex is not "")[(go-to: "OUTPUT")]
(else:)[(alert:"Fill in all the boxes first."),(go-to: "SUBMIT")]
#Content Warning
#Generator
(align:"==>")+(box:"X")[<span style="font-size: 200%; line-height: 150%">Create content warnings
for your itch.io games</span>]''Content Warning Generator''
[[Make a pop-up content warning (requires custom CSS)->SUBMIT]]
[[Make an embedded content warning (no custom CSS required)->SIMPLESUBMIT]]''Embedded Content Warning (No Custom CSS)''
(if: $firstplay is not true)[(set: $contentwarning to "")(set: $firstplay to true)]Content warning text
(input-box:2bind $contentwarning,"XXXXX=",1)(text-colour:#adb5bd)[Example: Includes jump scares]
[[SUBMIT->SIMPLEOUTPUT]]
[[RETURN->SELECT]]Copy the following to ''Edit project'' > ''Description (HTML input)''
(font:"Roboto Mono")[<span style="font-size: 55%; line-height: 110%;">(b4r:"solid")+(b4r-size:0.5)+(b4r-colour:black)[`<details><summary>CONTENT WARNING</summary>`$contentwarning`</details>`]</span>]
(text-colour:#adb5bd)[(Switch to ''HTML input'' by pressing the ''<>'' button on the left.)]
You should now have an embedded content warning on your game page.
[[START AGAIN->SELECT]]