Module:Splash: Difference between revisions
imported>Ttv pedro270707 m (Added special date splashes) |
imported>Ttv pedro270707 m (Added special date splashes) |
(No difference)
| |
Revision as of 14:47, 12 March 2023
Documentation for this module may be created at Module:Splash/doc
local p = {}
local splashes = require("Module:Splash/splashes")
function p.generateSplash()
math.randomseed(os.time())
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')
:addClass('splash-text')
:attr('id', 'splash-text')
:wikitext(randomSplash)
:css('font-size', tostring(2880 / (#randomSplash*6 + 32)) .. 'px')
return div
end
return p