打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
登录后可编辑和发表评论。

Module:倾斜文本

来自Vocawiki

此模块的文档可以在Module:倾斜文本/doc创建

local p = {}

function p.main(frame)
    local args = frame:getParent().args
    local result = {}
    
    local style = args.style or ""
    local rotate = args.rotate or "0deg"
    local color = args.color or ""
    
    local i = 1
    while args[i] ~= nil do
        if args[i] == "" then
            table.insert(result, "<br />")
        else
            local wordStyle = "display:inline-block;"
            
            local wordRotate = args["ro" .. i] or rotate
            wordStyle = wordStyle .. "transform:rotate(" .. wordRotate .. ");"
            
            if style ~= "" then
                wordStyle = wordStyle .. style .. ";"
            end
            if color ~= "" then
                wordStyle = wordStyle .. "color:" .. color .. ";"
            end
            if args["st" .. i] then
                wordStyle = wordStyle .. args["st" .. i]
            end
            
            table.insert(result, '<span style="' .. wordStyle .. '">' .. args[i] .. '</span>')
        end
        i = i + 1
    end
    
    return table.concat(result)
end

return p