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",					['font-weight'] = 790,					['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', '34px') :wikitext('THE') :done :tag('br'):done :tag('span') :css('font-size', '50px') :wikitext('ZA') :done :tag('span') :css('font-size', '50px') :wikitext('MO') :done :tag('span') :css('font-size', '50px') :wikitext('RAK') :done :wikitext(' ') :tag('span') :css('font-size', '50px') :wikitext('W') :done :tag('span') :css('font-size', '45px') :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	d1 = mw.html.create('div') :addClass('center') :wikitext(mw.getContentLanguage:formatNum(mw.site.stats.articles) .. " articles since 5th of May 2016.") :done return tostring(t)..'\n'..tostring(d1) end

return p