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

From Detective Conan Wiki
 
(4 intermediate revisions by the same user not shown)
Line 17: Line 17:
 
  width: 100%;
 
  width: 100%;
 
  height: 100%;
 
  height: 100%;
pointer-events: none;
 
user-drag: none;
 
-webkit-user-drag: none;
 
-webkit-user-select: none; /* Safari */
 
-ms-user-select: none; /* IE 10 and IE 11 */
 
user-select: none; /* Standard syntax */
 
 
}
 
}
 
#show-button-{{{1}}}{     
 
#show-button-{{{1}}}{     
Line 48: Line 42:
  
 
/* Styles to reveal the spoiler text */
 
/* Styles to reveal the spoiler text */
 +
#spoiler-box-{{{1}}}:hover{
 +
background-color: #70717a;
 +
}
 
#spoiler-box-{{{1}}}:has(#spoiler-target-{{{1}}}:target), #spoiler-box:has(#spoiler-target:target){
 
#spoiler-box-{{{1}}}:has(#spoiler-target-{{{1}}}:target), #spoiler-box:has(#spoiler-target:target){
 
  background-color: #e3e3e5;
 
  background-color: #e3e3e5;
Line 82: Line 79:
 
* 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.
 
* 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.
 
* The hyperlinks are not clickable when used inside the template.
 
* The hyperlinks are not clickable when used inside the template.
 +
* If the page is refreshed while a spoiler is revealed, that spoiler will remain open even after the page reloads.
  
 
== Examples==
 
== Examples==
Result is {{User:Tsutomu25/sandbox/Cover2|weapon|The weapon is Knife}}
+
Result: {{User:Tsutomu25/sandbox/Cover2|weapon|The weapon is Knife}}
Result is {{User:Tsutomu25/sandbox/Cover2|motive|The motive is {{font color|#ff0000|Love}}}}
+
Result: {{User:Tsutomu25/sandbox/Cover2|motive|The culprit wore {{font color|#ffa500|Orange}} clothes}}
Result is {{User:Tsutomu25/sandbox/Cover2|culprit|The culprit is [[Gosho Aoyama]]}}
+
Result: {{User:Tsutomu25/sandbox/Cover2|culprit|The culprit is [[Gosho Aoyama]]}}
  
 
[[Category:Templates]]
 
[[Category:Templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 10:38, 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.
  • The hyperlinks are not clickable when used inside the template.
  • If the page is refreshed while a spoiler is revealed, that spoiler will remain open even after the page reloads.

Examples

Result: The weapon is Knife

Result: The culprit wore Orange clothes

Result: The culprit is Gosho Aoyama