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

From Detective Conan Wiki
 
(12 intermediate revisions by the same user not shown)
Line 36: Line 36:
 
  opacity: 0;
 
  opacity: 0;
 
  transition: 0.3s;
 
  transition: 0.3s;
  -webkit-user-select: none; /* Safari */
+
  -webkit-user-select: none;
  -ms-user-select: none; /* IE 10 and IE 11 */
+
  -ms-user-select: none;
  user-select: none; /* Standard syntax */
+
  user-select: none;
 
}
 
}
  
 
/* 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 64: Line 67:
  
 
}}
 
}}
</includeonly>
+
</includeonly><noinclude>
<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>
  
<pre>{{User:Tsutomu25/sandbox/Cover2|The culprit is Gosho Aoyama}}</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.
 +
* 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.
  
Results in {{User:Tsutomu25/sandbox/Cover2|weapon|The weapon is Knife}}
+
== Examples==
Results in {{User:Tsutomu25/sandbox/Cover2|motive|The motive is {{font color|#ff0000|Love}}}}
+
Result: {{User:Tsutomu25/sandbox/Cover2|weapon|The weapon is Knife}}
Results in {{User:Tsutomu25/sandbox/Cover2|culprit|The culprit is [[Gosho Aoyama]]}}
+
Result: {{User:Tsutomu25/sandbox/Cover2|motive|The culprit wore {{font color|#ffa500|Orange}} clothes}}
 +
Result: {{User:Tsutomu25/sandbox/Cover2|culprit|The culprit is [[Gosho Aoyama]]}}
  
 +
[[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