×
Create a new article
Write your page title here:
We currently have 2 articles on NOISZ Wiki. Type your article name above or click on one of the titles below and start writing!



NOISZ Wiki
2Articles

User:RiceEmpress: Difference between revisions

m (1 revision imported: yolo import of unofficial noisz wiki pt. 4)
No edit summary
 
Line 1: Line 1:
 
there is only rice
=={{Header Box|Text=Happy birthday, Asuka!}}==
 
<div align="center">[[File:Asuka Fujita.png|200px|link=Asuka Fujita]]</div>
 
<div align="center">July 30th marks the birthday of a ray of sunshine in everyone's lives, [[Asuka Fujita]]!</div>
 
<gallery type="slider" position=center>
Asuka Fujita Ingame.png
Swimsuit Asuka.png
Asuka Fujita Screenshot 1.jpg
</gallery>
<gallery columns=4 position=center>
Titelloses_1294_20230729203518.jpg|Art by  [https://www.instagram.com/artisticmouse Mus Rattus]
Asuka-birthday-yipeeee.png|Art by [https://twitter.com/TheoreticalFire Jaré]
Asuka_cosmo_hbd.jpg|Art by [https://twitter.com/gmcosmo_Rebirth cosmo-aura]
hbdasuka.png|Art by [https://angel-blood-art.tumblr.com/ Angel Blood Art]
</gallery>


HI i'm ruby! this is my testbed
HI i'm ruby! this is my testbed
=To Do=
==Technical Stuff==
* Include V-Ignition data on event info style pages
==Writing==
*Artist profiles on "Songs featuring (artist)" category pages
==Future==
*Song/release info on each song page
*Story chapter key quotes
*Nova difficulty additions to song pages
*Affiliate with other wikis???????




Line 84: Line 53:


If you look at the clocks' codes, you can see the "data-callback"; this calls the relevant Javascript function defined by this variable. The function is defined in MediaWiki/Common.js. EventCountdown is where it's properly used; you can see it uses the "selfNullEdit" defined in common.js, where the function finds the element with id "ca-null-edit" - the Null Edit Button - and clicks it using jQuery.
If you look at the clocks' codes, you can see the "data-callback"; this calls the relevant Javascript function defined by this variable. The function is defined in MediaWiki/Common.js. EventCountdown is where it's properly used; you can see it uses the "selfNullEdit" defined in common.js, where the function finds the element with id "ca-null-edit" - the Null Edit Button - and clicks it using jQuery.
{{Random Smile}}

Latest revision as of 07:04, 5 May 2025

there is only rice

HI i'm ruby! this is my testbed


Event Cycle

The countdown timers are all based on the countdown clock extension for Fandom. A typical template for the countdowns looks something like:

{{NOISZ SL Recursive Events|cyclestart=2023-03-15 04:00 +0000}}

Where cyclestart is a variable determining the beginning of an 8-week cycle. The widgets use this 8-week cycle to determine what events are currently running - or rather, how far it is into an 8-week cycle. Synthetic and Recursive events currently run on the same clock. If you look at the NOISZ SL Recursive Events, it may look daunting, but a lot of it is just text operations; the only variable here is the currenly running, event, seen in things such as {{CurrentNoiszSLEvent|cyclestart={{{cyclestart|}}}}}, {{EventCountdown|eventstyle=Nuclear Drip|cyclestart={{{cyclestart|}}}|countdown=True}} and {{EventTimeLeft|cyclestart={{{cyclestart|}}}}}. Note that {{{cyclestart|}}} sets a variable within the template, and whatever goes after the pipe at the end is set as the default for that variable if nothing is entered.

CurrentNoiszSLEvent uses that 8-week cycle to determine what events are running. EventCountdown uses the Countdown widget until a certain mark in that 8-week timer, and EventTimeLeft does the same, but for a mark 2 weeks after that.

If you look at CurrentNoiszSLEvent, it uses a case/switch statement depending on EventCycleTime, which returns how many seconds we are into an 8-week cycle.

EventCycleTime is simply: {{#expr:({{#time:U|now}} -{{#time:U|{{{cyclestart|2023-04-01 04:00 +0000}}}}})mod4838400}} ie, it looks at the time between now and any past date set as the beginning of a cycle, which is defined as the moment Recursive Event 01 goes live. It uses mod4838400 to divide that time elapsed by the total number of seconds in an 8-week cycle, and returns the remainder, which is how many seconds we are.

To recap, it does that, and CurrentNoiszSLEvent uses that time to determine where in an 8-week cycle we are in seconds; if we are less than 1209600 seconds into a cycle, which is two weeks, it determines the currently running Recursive Event is Attitude Mint. If it's more than that, the case switch moves onto the next statement, and so, if we're more than 1209600 seconds but less than 2419200 (4 weeks) in, then the current event is Blue Moon, and so on.

Countdown Clocks

EventTimeLeft

EventTimeLeftUnix: {{#expr:1209600 - {{EventCycleTime|cyclestart={{{cyclestart|}}}}}mod1209600}}
{{#expr:1209600 - {{#expr:({{#time:U|now}} -{{#time:U|2023-03-29 04:00 +0000}})mod6048000}}mod1209600}}

The countdown clocks for EventTimeLeft and EventCountdown use markers to count down to. EventTimeLeftUnix looks at how many seconds we are into a cycle and divides it by 1209600, and returns a remainder. It subtracts that from 1209600, the amount of seconds in two weeks; this returns the amount of seconds left in this mini 2-week cycle within the greater 8-week cycle.

EventTimeLeft is the countdown clock itself, and is:

<includeonly><span class="countdown" data-end="stop" data-callback="myFunction" data-options="short-format" style="display:none;">Ends: <span class="countdowndate">{{#time:r|@{{#expr:{{EventTimeLeftUnix|cyclestart={{{cyclestart}}}}} + {{#time:U|now}}}}}}</span></span>

The time it's counting down to is {{#time:r|@{{#expr:{{EventTimeLeftUnix|cyclestart={{{cyclestart}}}}} + {{#time:U|now}}}}}}, which adds the seconds left in the 2-week cycle that is a single event to the current time, and then counts down to it.

EventCountdown

EventTimeCountdownUnix looks at where we are in the 8-week cycle and accordingly counts down to the next 2-week marker using a case/switch. The "if time > 0" condition in there is to deal with the possibility that a date in the future was set to determine the 8-week cycle.


EventCountdown is the clock itself: {{#if: {{{countdown|}}} | <span class="countdown" data-options="short-format" style="display:none;" data-end="stop" data-callback="console.log('countdown ended!')">Starts: <span class="countdowndate">{{#time:F d, Y H:i T|@{{#expr:{{EventTimeCountdownUnix|cyclestart={{{cyclestart|}}}|eventstyle={{{eventstyle|Attitude Mint}}}}} + {{#time:U|now}}}}}}</span></span> | Starts: {{#time:F d, Y H:i T|@{{#expr:{{EventTimeCountdownUnix|cyclestart={{{cyclestart|}}}|eventstyle={{{eventstyle|Attitude Mint}}}}} + {{#time:U|now}}}}}} }}

Where the time it counts down to is: {{#time:F d, Y H:i T|@{{#expr:{{EventTimeCountdownUnix|cyclestart={{{cyclestart|}}}|eventstyle={{{eventstyle|Attitude Mint}}}}} + {{#time:U|now}}}}}}

This adds the time left until the next two-week marker to now, and tells the clock to count down to it. If nothing is defined, it decides the next style will be Attitude Mint.

Countdown clock end

If you look at the dev.fandom.com link above, you can see that a countdown clock ends many ways. One problem with the clocks currently is that the wiki does not update its own internal clock until something forces it to wake up, usually in the form of an edit or a null edit. Once an event ends, the event cycle doesn't update until null edits are made to the relevant pages, forcing it to recalculate everything.

If you look at the clocks' codes, you can see the "data-callback"; this calls the relevant Javascript function defined by this variable. The function is defined in MediaWiki/Common.js. EventCountdown is where it's properly used; you can see it uses the "selfNullEdit" defined in common.js, where the function finds the element with id "ca-null-edit" - the Null Edit Button - and clicks it using jQuery.