393
edits
(combatEffects) |
(definitely not chatgpt nonsense) Tag: Reverted |
||
Line 53: | Line 53: | ||
end | end | ||
local html = mw.html.create('div') | local html = mw.html.create('div'):addClass('skill-tree-container'):css({ | ||
['position'] = 'relative', | |||
['width'] = '100%', | |||
['height'] = 'auto' | |||
}) | |||
for _, node in ipairs(skillNodes) do | for _, node in ipairs(skillNodes) do | ||
local nodeDiv = html:tag('div'):css({ | |||
['position'] = 'absolute', | |||
['width'] = '225px', | |||
['height'] = '150px', | |||
['top'] = node.top .. 'px', | |||
['left'] = node.left .. 'px', | |||
}) | |||
nodeDiv:tag('span'):wikitext(node.name):css({ | |||
['position'] = 'absolute', | |||
['top'] = '6px', | |||
['left'] = '6px', | |||
['z-index'] = 1, | |||
['font-size'] = 'smaller', | |||
['font-weight'] = '700', | |||
}):done() | |||
nodeDiv:tag('img'):attr('src', node.imageSrc):css({ | |||
['border'] = '2px solid ' .. (node.locked and 'red' or 'green') | |||
}):done() | |||
nodeDiv:tag('div'):wikitext(node.description):css({ | |||
['text-align'] = 'center', | |||
['overflow-y'] = 'auto', | |||
['padding'] = '10px' | |||
}):done() | |||
if node.connections then | |||
for _, connection in ipairs(node.connections) do | |||
html:tag('svg') | |||
:attr('width', '100%') | |||
:attr('height', '100%') | |||
:attr('preserveAspectRatio', 'none') | |||
:tag('path'):attr('d', connection.path) | |||
:css({ | |||
['stroke'] = connection.strokeColor, | |||
['stroke-width'] = '3px', | |||
['fill'] = 'none' | |||
}):done() | |||
end | |||
end | |||
html:done() | |||
end | |||
return tostring(html) | |||
end | |||
return p | return p |
edits