Module:Splash

From BTA-Mirror
Revision as of 03:04, 5 March 2023 by imported>Ttv pedro270707

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 = splashes.splashes[math.random(#splashes.splashes)]
	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