Module:UnitInfo

local cargo = mw.ext.cargo local p = {}

local escp = function (str) return (mw.ustring.gsub(str == nil and '' or tostring(str), "'", "\\'")) end

function p.Unit(frame) local fire = frame.args.fire local ice = frame.args.ice local wood = frame.args.wood local thunder = frame.args.thunder local light = frame.args.light local dark = frame.args.dark

local tbl = mw.html.create('table') :addClass('wikitable') :css('background','rgba(28,28,28,1)') :css('border','red') :css('margin','auto') :css('border','collapse') :css('border-radius','5px')

-- frame:expandTemplate{title='UnitTypeIcon', args = {frame.args.type, 'x12px'}}

local subtype = frame:expandTemplate{title='UnitTypeIcon', args = {'args1', 'x12px'}}

-- Attributes Icons

local fireIcon = mw.html.create('div') :css('display','inline-block') :css('position','relative') :css('margin-right','5px') :wikitext('')

fireIcon:tag('span') -- Fire Icon :css('position','absolute') :css('left','50%') :css('color','#00ff00') :css('top','82%') :css('font-size','85%') :css('font-weight','bold') :css('text-align','center') :css('text-shadow','-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000,1px 1px 0 #000') :css('transform','translate(-50%,-50%)') :wikitext(fire)

local iceIcon= mw.html.create('div') :css('display','inline-block') :css('position','relative') :css('margin-right','5px') :wikitext('')

iceIcon:tag('span') -- Ice Icon :css('position','absolute') :css('left','9%') :css('top','10%') :wikitext('+15')

local woodIcon = mw.html.create('div') :css('display','inline-block') :css('position','relative') :css('margin-right','5px') :wikitext('')

woodIcon:tag('span') -- Wood Icon :css('position','absolute') :css('left','50%') :css('color','#00ff00') :css('top','82%') :css('font-size','85%') :css('font-weight','bold') :css('text-align','center') :css('text-shadow','-1px -1px 0 #000,1px -1px 0 #000,-1px 1px 0 #000,1px 1px 0 #000') :css('transform','translate(-50%,-50%)') :wikitext('+25')

local thunderIcon = mw.html.create('div') :css('display','inline-block') :css('position','relative') :css('margin-right','5px') :wikitext('')

thunderIcon:tag('span') -- Thunder Icon :css('position','absolute') :css('left','9%') :css('top','10%') :wikitext('+15')

local lightIcon = mw.html.create('div') :css('display','inline-block') :css('position','relative') :css('margin-right','5px') :wikitext('')

lightIcon:tag('span') -- Light Icon :css('position','absolute') :css('left','9%') :css('top','10%') :wikitext('+15')

local darkIcon = mw.html.create('div') :css('display','inline-block') :css('position','relative') :css('margin-right','5px') :wikitext('')

darkIcon:tag('span') -- Dark Icon :css('position','absolute') :css('left','9%') :css('top','10%') :wikitext(dark)

tbl:tag('tr') tbl:tag('td') :wikitext(subtype) tbl:tag('td') :wikitext('Attribute Resistance') tbl:tag('tr') tbl:tag('td') :css('background','rgba(28,28,28,1)') :css('border-radius','5px') :wikitext(tostring(fireIcon)) :wikitext(tostring(iceIcon)) :wikitext(tostring(woodIcon)) :wikitext(tostring(thunderIcon)) :wikitext(tostring(lightIcon)) :wikitext(tostring(darkIcon)) tbl:tag('tr') tbl:tag('td') :wikitext('Attributes') tbl:tag('tr') :tag('td') -- :attr('colspan','3') :css('text-align', 'right') :css('background','rgba(28,28,28,1)') :css('border-radius','5px') :wikitext(tostring(fireIcon)) :wikitext(tostring(iceIcon)) :wikitext(tostring(woodIcon)) :wikitext(tostring(thunderIcon)) :wikitext(tostring(lightIcon)) :wikitext(tostring(darkIcon))

return tostring(tbl)

end return p