Difference between revisions of "User:Tsutomu25/sandbox/Cover3"

From Detective Conan Wiki
(Blanked the page)
(Tag: Blanking)
Line 1: Line 1:
 +
<includeonly><span id="spoiler-box-{{{1}}}">[[#spoiler-target-{{{1}}}|<span id="show-button-{{{1}}}" class="button-{{{1}}}">Show Spoilers</span>]][[#null|<span id="hide-button-{{{1}}}" class="button-{{{1}}}">Hide Spoilers</span>]]<span id="spoiler-target-{{{1}}}"></span><span id="spoiler-text-{{{1}}}">{{{2}}}</span></span>
 +
{{code
 +
|css=
 +
/* Styles for the spoiler box */
 +
#spoiler-box-{{{1}}}{
 +
display: inline-block;
 +
position: relative;
 +
background-color: #909199;
 +
transition: 0.3s;
 +
}
  
 +
/* Styles for the buttons */
 +
.button-{{{1}}}{
 +
display: flex;
 +
justify-content: center;
 +
align-items: center;
 +
position: absolute;
 +
bottom: calc(100% + 7px);
 +
left: 50%;
 +
transform: translateX(-50%);
 +
width: 90px;
 +
height: 20px;
 +
background-color: white;
 +
background-clip: content-box;
 +
border: solid black;
 +
border-width: 1px 2px 2px 1px;
 +
border-radius: 5px;
 +
text-wrap: nowrap;
 +
text-decoration: none;
 +
color: black;
 +
font-size: 10pt;
 +
transition: 0.3s;
 +
transition-delay: 0.1s;
 +
visibility: hidden;
 +
opacity: 0;
 +
z-index: 0;
 +
-webkit-user-select: none;
 +
-ms-user-select: none;
 +
user-select: none;
 +
}
 +
#spoiler-box-{{{1}}}:hover #show-button-{{{1}}}{   
 +
visibility: visible;
 +
opacity: 1;
 +
z-index: 5;
 +
}
 +
 +
/* Hiding the target div */
 +
#spoiler-target-{{{1}}}{
 +
display: none;
 +
}
 +
 +
/* Styles to hide the spoiler text */
 +
#spoiler-text-{{{1}}}{
 +
opacity: 0;
 +
transition: 0.3s;
 +
-webkit-user-select: none; /* Safari */
 +
-ms-user-select: none; /* IE 10 and IE 11 */
 +
user-select: none; /* Standard syntax */
 +
}
 +
 +
/* Styles to reveal the spoiler text */
 +
#spoiler-box-{{{1}}}:has(#spoiler-target-{{{1}}}:target){
 +
background-color: #e3e3e5;
 +
}
 +
#spoiler-target-{{{1}}}:target ~ #spoiler-text-{{{1}}}{
 +
opacity: 1;
 +
background-color: #e3e3e5;
 +
-webkit-user-select: text;
 +
-ms-user-select: text;
 +
user-select: text;
 +
}
 +
 +
/* Styles to hide the show button and reveal the hide button */
 +
#spoiler-box-{{{1}}}:hover:has(#spoiler-target-{{{1}}}:target) #show-button-{{{1}}}{
 +
/* display: none; */
 +
visibility: hidden;
 +
opacity: 0;
 +
z-index: 0;
 +
}
 +
#spoiler-box-{{{1}}}:hover:has(#spoiler-target-{{{1}}}:target) #hide-button-{{{1}}}{
 +
/* display: flex; */
 +
visibility: visible;
 +
opacity: 1;
 +
z-index: 5;
 +
}
 +
}}
 +
</includeonly><noinclude>
 +
It hides the given input of spoiler text and reveals them when the user clicks on them. It takes two values. One is the name of the spoiler and another one is the actual spoiler text. Every time the template is used, every element has to have a unique id and class. Hence spoiler name is required.
 +
 +
== Usage ==
 +
The following is a list of required parameters:
 +
<pre>
 +
{{User:Tsutomu25/sandbox/Cover2|<spoiler name>|<spoiler text>}}
 +
</pre>
 +
 +
== Limitations ==
 +
* When the template is used multiple times on the same page, only one spoiler can remain visible at a time. If the user reveals another spoiler, the previously opened one will automatically be hidden.
 +
* If the page is refreshed while a spoiler is revealed, that spoiler will remain open even after the page reloads.
 +
 +
== Examples==
 +
Result is {{User:Tsutomu25/sandbox/Cover3|weapon|The weapon is Knife}}
 +
Result is {{User:Tsutomu25/sandbox/Cover3|motive|The motive is {{font color|#ff0000|Love}}}}
 +
Result is {{User:Tsutomu25/sandbox/Cover3|culprit|The culprit is [[Gosho Aoyama]]}}
 +
 +
[[Category:Templates]]
 +
</noinclude>

Revision as of 07:26, 23 August 2025

It hides the given input of spoiler text and reveals them when the user clicks on them. It takes two values. One is the name of the spoiler and another one is the actual spoiler text. Every time the template is used, every element has to have a unique id and class. Hence spoiler name is required.

Usage

The following is a list of required parameters:

{{User:Tsutomu25/sandbox/Cover2|<spoiler name>|<spoiler text>}}

Limitations

  • When the template is used multiple times on the same page, only one spoiler can remain visible at a time. If the user reveals another spoiler, the previously opened one will automatically be hidden.
  • If the page is refreshed while a spoiler is revealed, that spoiler will remain open even after the page reloads.

Examples

Result is Show SpoilersHide SpoilersThe weapon is Knife

Result is Show SpoilersHide SpoilersThe motive is Love

Result is Show SpoilersHide SpoilersThe culprit is Gosho Aoyama