Module:Splash: Difference between revisions

687 bytes added ,  12 March 2023
m
Added special date splashes
imported>Ttv pedro270707
mNo edit summary
imported>Ttv pedro270707
m (Added special date splashes)
Line 4: Line 4:
function p.generateSplash()
function p.generateSplash()
math.randomseed(os.time())
math.randomseed(os.time())
local randomSplash = splashes.splashes[math.random(#splashes.splashes)]
local randomSplash = "missingno"
if os.date("*t", os.time()).month == 1 and os.date("*t", os.time()).day == 19 then
randomSplash = "Happy birthday, jonkadelic!"
elseif os.date("*t", os.time()).month == 4 and os.date("*t", os.time()).day == 29 then
randomSplash = "Happy birthday, MaggAndGeez!"
elseif os.date("*t", os.time()).month == 5 and os.date("*t", os.time()).day == 17 then
randomSplash = "Happy birthday, Minecraft!"
elseif os.date("*t", os.time()).month == 12 and os.date("*t", os.time()).day == 24 then
randomSplash = "Merry X-mas!"
elseif os.date("*t", os.time()).month == 1 and os.date("*t", os.time()).day == 1 then
randomSplash = "Happy new year!"
else
randomSplash = splashes.splashes[math.random(#splashes.splashes)]
end
 
local div = mw.html.create('div')
local div = mw.html.create('div')
:addClass('splash-text')
:addClass('splash-text')