Module:User:Bitomic

local p = {}

local function create_tag( container, interwiki, wiki, color ) color = color or '#4b251b' local tag = mw.html.create( 'div' ):css{ [ 'border' ] = '1px solid ' .. color, [ 'border-radius' ] = '3px', [ 'display' ] = 'inline-flex', [ 'font-size' ] = '0.85em', [ 'padding' ] = '0em 0.5em', [ 'margin' ] = '0.25em 0' }	local bullet = mw.html.create( 'div' ):wikitext( '•' ):css{ [ 'color' ] = color, [ 'font-size' ] = '2em', [ 'font-weight' ] = 'bold', [ 'line-height' ] = '1.25rem', [ 'margin-right' ] = '5px' }	local wiki = mw.html.create( 'div' ):wikitext(		( '%s' ):format( interwiki, wiki )	) tag:node( bullet ):node( wiki ) container:node( tag ) end

function p.herobox( frame ) local args = frame:getParent.args local color = args.color local comment = args.comment local user = args.user

local container = mw.html.create( 'div' ):css{ [ 'align-items' ] = 'center', [ 'border' ] = '1px solid ' .. color, [ 'border-radius' ] = '3px', [ 'column-gap' ] = '1em', [ 'display' ] = 'grid', [ 'grid-template-columns' ] = 'auto 1fr'; [ 'padding' ] = '0.5em', [ 'width' ] = '400px' }	local image = mw.html.create( 'div' ):wikitext(		frame:expandTemplate{ title = 'AvatarFinder', args = { user, '125' } }	):css{ [ 'border-radius' ] = '10px', [ 'grid-row' ] = '1 / 3', [ 'overflow' ] = 'hidden' }	container:node( image ) local name = mw.html.create( 'div' ):wikitext(		( '%s' ):format( user, user )	):css{ [ 'border-bottom' ] = '1px solid ' .. color, [ 'font-size' ] = '1.5em', [ 'font-weight' ] = 'bold', [ 'text-align' ] = 'center' }	container:node( name ) local tags = mw.html.create( 'div' ):css{ [ 'align-self' ] = 'start', [ 'text-align' ] = 'center' }	container:node( tags ) local idx = 0 while true do		idx = idx + 1 local color = args[ 'color ' .. idx ] local interwiki = args[ 'interwiki ' .. idx ] local wiki = args[ 'wiki ' .. idx ] if not interwiki then break end create_tag( tags, interwiki, wiki, color ) end if comment then local commentDiv = mw.html.create( 'div' ):wikitext( comment ):css{ [ 'grid-column' ] = '1 / 3', [ 'font-size' ] = '0.9em', [ 'font-style' ] = 'italic', [ 'margin-top' ] = '0.5em', [ 'text-align' ] = 'center' }		container:node( commentDiv ) end return container end

return p