Module:Mainpage title

-- -- TODO: Clean up to only use one builder; shouldn't use mw.html.create more than once local p = {} local title_data = require('Module:Mainpage title/data')

local function make_table(data) local grad, tag grad = 'linear-gradient(#000,' .. data.grad_end .. ')' tag = mw.html.create('td') tag	 :addClass('mp-ctitle') :css({					color = 'black',					['font-family'] = "'League Spartan', sans-serif",					['letter-spacing'] = '2px',					['line-height'] = '2em',					['padding-left'] = '15px',					['padding-right'] = '15px',					['background-image'] = '-webkit-'..grad,					['-webkit-background-clip'] = 'text',					['-webkit-text-fill-color'] = 'transparent',					['-moz-text-fill-color'] = 'black',					['text-fill-color'] = 'black',				}) :tag('span') :css('font-size', '14px') :wikitext('THE') :done :tag('br'):done :tag('span') :css('font-size', '30px') :wikitext('R') :done :tag('span') :css('font-size', '25px') :wikitext('UNE') :done :tag('span') :css('font-size', '30px') :wikitext('S') :done :tag('span') :css('font-size', '25px') :wikitext('CAPE') :done :wikitext(' ') :tag('span') :css('font-size', '30px') :wikitext('W') :done :tag('span') :css('font-size', '25px') :wikitext('IKI') :done :done return mw.html.create('table') :addClass('mp-title') :attr('align', 'center') :tag('tr') :tag('td') :addClass('mp-ltitle') :wikitext('') :done :node(tag) :tag('td') :addClass('mp-rtitle') :wikitext('') :done :done :done end

p.main = function(frame) math.randomseed(os.time) local t = make_table(title_data[math.random(#title_data)]) local d1, d2	d1 = mw.html.create('div') :addClass('center') :wikitext("The wiki devoted to RuneScape that anyone can edit.") :done d2 = mw.html.create('div') :addClass('center') :wikitext(mw.getContentLanguage:formatNum(mw.site.stats.articles) .. " articles since 8 April 2005.") :done return tostring(t)..'\n'..tostring(d1)..'\n'..tostring(d2) end

return p