Anonymous user
Module:Splash: Difference between revisions
m
no edit summary
imported>Ttv pedro270707 (Initial splash module) |
imported>Ttv pedro270707 mNo edit summary |
||
Line 3: | Line 3: | ||
function p.generateSplash() | function p.generateSplash() | ||
math.randomseed(os.time()) | |||
local randomSplash = splashes.splashes[math.random(#splashes.splashes)] | local randomSplash = splashes.splashes[math.random(#splashes.splashes)] | ||
mw.html.create('div') | local div = mw.html.create('div') | ||
:addClass('splash-text') | :addClass('splash-text') | ||
:attr('id', 'splash-text') | :attr('id', 'splash-text') | ||
:wikitext(randomSplash) | :wikitext(randomSplash) | ||
:css('font-size', tostring(2880 / (#randomSplash*6 + 32)) .. 'px') | :css('font-size', tostring(2880 / (#randomSplash*6 + 32)) .. 'px') | ||
return div | |||
end | end | ||
return p | return p |