Template:Spoil: Difference between revisions

From 118Wiki
Jump to navigation Jump to search
(usage & limitations)
(Template Data; no longer WIP)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#CSS:  
<includeonly>{{#CSS:  
   .tmpl-spoil-jvn {
   .tmpl-spoil-text, .tmpl-spoil-text a {
    opacity: 0;
  }
 
  .tmpl-spoil-bg {
     background-color: black;
     background-color: black;
    color: black;
   }
   }


   .tmpl-spoil-jvn:hover {
   .tmpl-spoil-text:hover, .tmpl-spoil-text:hover a {
     background-color: lightgrey;
     opacity: 1;
   }
   }
}}<span class="tmpl-spoil-jvn">{{{1|}}}</span></includeonly><noinclude>
{{Documentation|Content={{UnderConstruction|Jovenan}}


  .tmpl-spoil-bg:hover {
    background: lightgrey;
  }
}}<span class="tmpl-spoil-bg"><span class="tmpl-spoil-text">{{{1|}}}</span></span></includeonly><noinclude>
{{Documentation|Content=
This template functions as spoiler tags, i.e. hides a portion of text that can be revealed if the reader wants to read it.
This template functions as spoiler tags, i.e. hides a portion of text that can be revealed if the reader wants to read it.


Line 23: Line 29:


The hidden text can be multiple lines long.
The hidden text can be multiple lines long.
=== Limitations ===
Typical links can be seen through the black bar even when they should be hidden. This is caused by the fact that the links are different colour from the text. In order to avoid links being visible, consider using [[Template:Blacklink]] or [[Template:ColoredLink]]. Note that the link text will remain black even when the text is revealed, which might cause readers not to recognize it as a link. Mobile users might also accidentally click on a hidden link when trying to reveal the text. Linking templates such as [[Template:USS]] might not be usable.


== Examples ==
== Examples ==
Line 33: Line 35:
Lt. Commander Data is {{spoil|an android}}.
Lt. Commander Data is {{spoil|an android}}.


<pre>Lieutenant '''Jovenan''' is an {{spoil|{{blacklink|Edo}} Starfleet officer}}. She is currently serving as the Chief Science Officer aboard the {{USS|Artemis|A}}. {{spoil|Born on the Edo homeworld in 2373, she enrolled in the University of Hurkos in 2390, when the planet was ending its isolation. Upon graduation with degree in Planetary Sciences, she entered the Starfleet Academy. In 2399, she received the commission as ensign and was posted on the {{blacklink|USS Excalibur-A|USS ''Excalibur''-A}}, later transferring to the ''Artemis''}} with much of the ''Excalibur'' crew.</pre>
<pre>Lieutenant '''Jovenan''' is an {{spoil|[[Edo]] Starfleet officer}}. She is currently serving as the Chief Science Officer aboard the {{USS|Artemis|A}}. {{spoil|Born on the Edo homeworld in 2373, she enrolled in the University of Hurkos in 2390, when the planet was ending its isolation. Upon graduation with degree in Planetary Sciences, she entered the Starfleet Academy. In 2399, she received the commission as ensign and was posted on the {{USS|Excalibur|A}}, later transferring to the ''Artemis''}} with much of the ''Excalibur'' crew.</pre>
Lieutenant '''Jovenan''' is an {{spoil|{{blacklink|Edo}} Starfleet officer}}. She is currently serving as the Chief Science Officer aboard the {{USS|Artemis|A}}. {{spoil|Born on the Edo homeworld in 2373, she enrolled in the University of Hurkos in 2390, when the planet was ending its isolation. Upon graduation with degree in Planetary Sciences, she entered the Starfleet Academy. In 2399, she received the commission as ensign and was posted on the {{blacklink|USS Excalibur-A|USS ''Excalibur''-A}}, later transferring to the ''Artemis''}} with much of the ''Excalibur'' crew.}}
Lieutenant '''Jovenan''' is an {{spoil|[[Edo]] Starfleet officer}}. She is currently serving as the Chief Science Officer aboard the {{USS|Artemis|A}}. {{spoil|Born on the Edo homeworld in 2373, she enrolled in the University of Hurkos in 2390, when the planet was ending its isolation. Upon graduation with degree in Planetary Sciences, she entered the Starfleet Academy. In 2399, she received the commission as ensign and was posted on the {{USS|Excalibur|A}}, later transferring to the ''Artemis''}} with much of the ''Excalibur'' crew.
</noinclude>
 
{{Navbox|title=Template Data|
<templatedata>
{
"params": {
"1": {
"label": "Text",
"description": "The spoiler text",
"type": "string",
"required": true
}
},
"description": "Produces a spoiler bar over text that can be made visible by hovering over.",
"format": "inline"
}
</templatedata>}}
 
[[Category:Templates]]}}</noinclude>

Latest revision as of 17:18, 26 January 2024

Template Documentation
This template functions as spoiler tags, i.e. hides a portion of text that can be revealed if the reader wants to read it.

Usage

Code:

{{spoil| }}

Write the hidden text as the unnamed parameter. Please see the examples below!

The template produces a black bar over the hidden text. If the reader chooses to view the hidden text, this bar will turn light grey, revealing the hidden text. On computer, the text is revealed by hovering the cursor over the text. Once the cursor is off from the text, the text will be hidden again. On mobile devices, the reader must click on the bar to reveal the hidden text. Clicking elsewhere on the screen, including another bar, will cause the text to be hidden again.

The hidden text can be multiple lines long.

Examples

Lt. Commander Data is {{spoil|an android}}.

Lt. Commander Data is an android.

Lieutenant '''Jovenan''' is an {{spoil|[[Edo]] Starfleet officer}}. She is currently serving as the Chief Science Officer aboard the {{USS|Artemis|A}}. {{spoil|Born on the Edo homeworld in 2373, she enrolled in the University of Hurkos in 2390, when the planet was ending its isolation. Upon graduation with degree in Planetary Sciences, she entered the Starfleet Academy. In 2399, she received the commission as ensign and was posted on the {{USS|Excalibur|A}}, later transferring to the ''Artemis''}} with much of the ''Excalibur'' crew.

Lieutenant Jovenan is an Edo Starfleet officer. She is currently serving as the Chief Science Officer aboard the USS Artemis-A. Born on the Edo homeworld in 2373, she enrolled in the University of Hurkos in 2390, when the planet was ending its isolation. Upon graduation with degree in Planetary Sciences, she entered the Starfleet Academy. In 2399, she received the commission as ensign and was posted on the USS Excalibur-A, later transferring to the Artemis with much of the Excalibur crew.

Template Data

Produces a spoiler bar over text that can be made visible by hovering over.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Text1

The spoiler text

Stringrequired