Template:PoketimeClock: Difference between revisions

From Pokemon Revolution Online Wiki
Jump to navigation Jump to search
m Marginally shortened up the tabular width.
Modularized the template so that Poketime auto-elapses in real time on the page, as opposed to manually refreshing and recalculating the current time. Will fiddle around with the offset to synchronize it with the current Poketime.
Line 1: Line 1:
<includeonly>
<includeonly><table id="coloration" style="padding: 3px; width: 28%; text-align: center; border-radius: 25px;">
{{#vardefine:offset|{{{Offset|}}}}}
<tr><td colspan="2" id="background" style="border-radius: 25px; border-radius: 25px; font-weight: bold;">Pokéclock</td></tr>
{{#vardefine:totalseconds|{{#expr:({{#time:i|{{#var:offset}}}} * 60) + ({{#time:H|{{#var:offset}}}} * 60) * 60 + {{#time:s|{{#var:offset}}}}}}}}
<tr><td id="icon" width="33%" style="border-radius: 25px 1px 1px 25px; font-weight: bold; font-size: 15px;"></td><td id="poketime" style="background-color:#FFFFFF; color: #000000; border-radius: 1px 25px 25px 1px;"></td></tr>
{{#vardefine:pokeseconds|{{#expr:{{#var:totalseconds}} * 4}}}}
{{#vardefine:poketime|{{#time: H:i|{{#var:offset}} +{{#var:pokeseconds}} second}}}}
{{#vardefine:pokehour|{{#time:G|{{#var:offset}} +{{#var:pokeseconds}} second}}}}
{{#vardefine:phase|{{#switch:{{#var:pokehour}}|0=Night|1=Night|2=Night|3=Night|4=Morning|5=Morning|6=Morning|7=Morning|8=Morning|9=Morning|10=Day|11=Day|12=Day|13=Day|14=Day|15=Day|16=Day|17=Day|18=Day|19=Day|#default=Night}}}}
{{#vardefine:cell|#{{{{#var:phase}}_color_light}}}}{{#vardefine:background|#{{{{#var:phase}}_color}}}}{{#vardefine:border|#{{{{#var:phase}}_color_dark}}}}
<table style="border-radius: 25px; border: 3px solid {{#var:background}}; background-color: {{#var:border}}; padding: 3px; width: 28%; text-align: center;">
<tr><td colspan="2" style="border-radius: 25px; border: 1px solid {{#var:border}}; color: {{#var:border}}; font-weight: bold; background-color: {{#var:cell}};">Pokéclock</td></tr>
<tr><td width="33%" style="border-radius: 25px 1px 1px 25px; border: 1px solid {{#var:border}}; background-color: {{#var:background}}; color: {{#var:border}}; font-weight: bold;">[[File:{{#var:phase}}.png|Alt={{#var:phase}}-time|{{#var:phase}}]]</td><td style="background-color:#FFFFFF; border-radius: 1px 25px 25px 1px; border: 1px solid {{#var:border}};">{{#var:poketime}}</td></tr>
</table></includeonly>
</table></includeonly>

Revision as of 01:31, 22 August 2019