Module:Card

local p = {} local metahtml = getmetatable(mw.html.create).__index

function metahtml:_card(args) local size = tonumber(args.size:match'(%d+)') or 144 local box = self:tag('div') box:addClass('loliCard') :cssText('position:relative;display:inline-flex;flex-direction:column;margin:3px;font-size:11px;padding-right:100px') box:tag('div'):addClass('card-top') :cssText('border:2px solid #17111b;font-weight:bold;border-bottom:none;text-align:center;background:#17111b;color:#eee;padding:2px;width:'..(size-4)..'px') :wikitext(args.top) box:tag('div'):addClass('card-belowtop') :cssText('border:2px solid #17111b;border-bottom:none;text-align:left;background:#17111b;color:#eee;padding:2px') :wikitext(args.belowtop) box:tag('div'):addClass('card-left') :cssText('position:absolute;top:30px;left:5px;display:flex;flex-flow:column wrap') :wikitext(args.left) box:tag('div'):addClass('card-right') :cssText('position:absolute;top:30px;right:5px;display:flex;flex-flow:column wrap;align-items:flex-end') :wikitext(args.right)

box:tag('div'):addClass('card-rightSeries') :cssText('border:2px solid #17111b;position:absolute;top:0%;right:0%;width:100px;height:50%;text-align:center; background:#17111b;color:#eee;flex-flow:column wrap;align-items:flex-end') :wikitext(args.rightSeries) box:tag('div'):addClass('card-rightName') :cssText('border:2px solid #17111b;position:absolute;bottom:0%;right:0%;width:100px;height:50%;text-align:center; background:#17111b;color:#eee;flex-flow:column wrap;align-items:flex-end') :wikitext(args.rightName)

if args.bottom and args.bottom~='' then box:tag('div'):addClass('card-bottom') :cssText('border:3px solid #17111b;text-align:center;color:#17111b;background:#eee;height:200px;object-fit:cover') :wikitext(args.bottom) end return self end

function metahtml:Card(args, style) local arg2 = {} style = style or {} arg2.img = '' arg2.size = style.Size or '144px' arg2.top = ' '.. args.Name ..' ' arg2.belowtop = ' '.. args.Series ..' ' arg2.rightSeries = ' '.. args.Series ..' ' arg2.right = args.Right~='' and args.Right or nil arg2.bottom = "" return self:_card(arg2) end

function p.Card(args, style) return mw.html.create:Card(args, style) end