Module:GuyPerfect

From Inkipedia, the Splatoon wiki
Revision as of 01:01, 16 April 2021 by GuyPerfect (talk | contribs)

Documentation for this module may be created at Module:GuyPerfect/doc

local GAMES = {
    S  = "Splatoon",
    S2 = "Splatoon 2"
}

return {
    gear = function(frame)
        local game     = frame.args[1]
        local category = frame.args[2]
        local name     = frame.args[3]
        local color    = frame:expandTemplate
            { title = "SiteColor", args = { GAMES[game] } }

        -- Outer container
        local ret = "<div style=\"border: 1px solid #" .. color ..
            "; border-width: 8px 1px; border-radius: 8px; " ..
            "background: #ffffff; display: inline-block; width: 300px;\">"

        -- Inner client area
        ret = ret .. "<div style=\"background: #" .. color .. "40; " ..
            "box-shadow: 0 0 16px #ffffff inset; padding: 8px;\">"

        -- Name
        ret = ret .. "<div style=\"border: 1px solid #" .. color .. "; " ..
            "border-width: 1px 4px; border-radius: 4px; " ..
            "background: #" .. color .. "40; text-align: center; " ..
            "font-size: 20px; font-weight: bold; padding: 8px;\">" ..
            name .. "</div>"

        ret = ret .. "</div></div>"
        return ret
    end
}