• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Difference between revisions of "Template:Timer"

From Kancolle Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
<includeonly><div style="{{{style|text-align:center;font-size:18px;font-weight:bold;color:red;margin:0px 0px 10px 0px}}};{{{extra_style|}}}">
 
<includeonly><div style="{{{style|text-align:center;font-size:18px;font-weight:bold;color:red;margin:0px 0px 10px 0px}}};{{{extra_style|}}}">
<span class="countdown" data-options="no-leading-zeros" data-end="toggle" data-toggle=".{{{class|{{{endClass|countdownComplete1}}}}}}" style="display:none">
+
<span class="countdown" data-options="no-leading-zeros" data-end="toggle" data-toggle=".{{{class|{{{endClass|countdownComplete{{{2|1}}}}}}}}}" style="display:none">
<span class="countdowndate">{{{time|}}}</span>
+
<span class="countdowndate">{{{1|{{{time|}}}}}}</span>
 
</span>
 
</span>
<span class="{{{class|{{{endClass|countdownComplete1}}}}}}" style="display:none">{{{text|{{{endText|Countdown complete!}}}}}}</span>
+
<span class="{{{class|{{{endClass|countdownComplete{{{2|1}}}}}}}}}" style="display:none">{{{text|{{{endText|Countdown complete!}}}}}}</span>
 
</div></includeonly><noinclude>
 
</div></includeonly><noinclude>
 
Displays a countdown timer.
 
Displays a countdown timer.
 
==Parameters==
 
==Parameters==
* <code>time</code> : [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse time] to countdown to, required.
+
* <code>time</code> or <code>[1]</code> : [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse time] to countdown to, required.
 +
* <code>class</code> : specify when multiple timers are used on the page, <code>countdownComplete1</code> by default, e.g., <code>countdownComplete2</code> for a second timer, etc.
 +
** <code>[2]</code> : alternatively, to only specify a number, e.g. <code>2</code> for a second timer.
 +
* <code>text</code> : optional completion text, <code>Countdown complete!</code> by default.
 
* <code>style</code> : custom style, optional.
 
* <code>style</code> : custom style, optional.
 
* <code>extra_style</code> : extra style to add to the default style, optional.
 
* <code>extra_style</code> : extra style to add to the default style, optional.
<!--* <code>class</code> : specify when multiple timers are used on the page, <code>countdownComplete1</code> by default, e.g., <code>countdownComplete2</code> for a second timer, etc.-->
 
* <code>text</code> : optional completion text, <code>Countdown complete!</code> by default.
 
 
See [[MediaWiki:Gadget-Countdown.js]] for JS implementation details.
 
See [[MediaWiki:Gadget-Countdown.js]] for JS implementation details.
 
==Examples==
 
==Examples==
 
<pre>
 
<pre>
{{Timer|time = January 1 2021 00:00:00 +0900|extra_style = text-align:left}}
+
{{Timer|January 1 2021 00:00:00 +0900|extra_style = text-align:left}}
 
</pre>
 
</pre>
{{Timer|time = January 1 2021 00:00:00 +0900|extra_style = text-align:left}}
+
{{Timer|January 1 2021 00:00:00 +0900|extra_style = text-align:left}}
 
<pre>
 
<pre>
{{Timer|time = January 1 2025 00:00:00 +0900|style = font-style:italic|text = Not yet.}}
+
{{Timer|January 1 2030 00:00:00 +0900|2|style = font-style:italic|text = Not yet.}}
 
</pre>
 
</pre>
{{Timer|time = January 1 2025 00:00:00 +0900|style = font-style:italic|text = Not yet.}}
+
{{Timer|January 1 2030 00:00:00 +0900|2|style = font-style:italic|text = Not yet.}}
 
<pre>
 
<pre>
{{Timer|time = January 19 2038 12:14:07 +0900|style = font-weight:bold|text = The time is now!}}
+
{{Timer|January 19 2038 12:14:07 +0900|3|style = font-weight:bold|text = The time is now!}}
 
</pre>
 
</pre>
{{Timer|time = January 19 2038 12:14:07 +0900|style = font-weight:bold|text = The time is now!}}
+
{{Timer|January 19 2038 12:14:07 +0900|3|style = font-weight:bold|text = The time is now!}}
 
</noinclude>
 
</noinclude>

Revision as of 09:24, 1 May 2021

Displays a countdown timer.

Parameters

  • time or [1] : time to countdown to, required.
  • class : specify when multiple timers are used on the page, countdownComplete1 by default, e.g., countdownComplete2 for a second timer, etc.
    • [2] : alternatively, to only specify a number, e.g. 2 for a second timer.
  • text : optional completion text, Countdown complete! by default.
  • style : custom style, optional.
  • extra_style : extra style to add to the default style, optional.

See MediaWiki:Gadget-Countdown.js for JS implementation details.

Examples

{{Timer|January 1 2021 00:00:00 +0900|extra_style = text-align:left}}

{{Timer|January 1 2030 00:00:00 +0900|2|style = font-style:italic|text = Not yet.}}

{{Timer|January 19 2038 12:14:07 +0900|3|style = font-weight:bold|text = The time is now!}}