| 此模块使用Lua语言: |
基于User:朵茜雅/UserInfo(以下称“源模板”)模块化后的模板,同时取消了对已经或即将不受支持的{{#cscore:}}和{{#forargs:}}等魔术字的依赖。
需要从源模板迁移至本模板的用户可以参考#如何迁移至本模板一节修改调用的源代码。
本文档功能方面的绝大部分说明文字参考自源模板的模板文档。
属性名::属性值填写即可,项目顺序都可以随意调整。效果见右侧上方。
{{User:GuoPC/UserInfo
|uname=朵茜雅
|本名::{{黑幕|[[这是禁止事项| ]]|这是禁止事项}}
|英文名::Toxiad
|日文名::{{lj|一ノ濑七海}}
|昵称::朵茜雅、低价回收、<del>高价贱卖</del>、御坂14020
|性别::[[秀吉|这是禁止事项]]
|sp::
|生日::9月15日
|年龄::[[永远的十七岁|17]]{{黑幕|至少3600}}
|身高::165
|体重::47
|发色::白
|瞳色::蓝
|三围::
|萌点::[[白毛]]、[[JK]]、[[贫乳]]、[[百合(萌属性)|百合]]
|所属团体::[[御坂网络]]
|检体编号::14020
|勋章::{{粉丝勋章|条条|17|link=COP}} {{粉丝勋章|勋章|17|link=ilem}} {{粉丝勋章|御坂喵|15|link=御坂美琴}}
|XP::[[百合(萌属性)|百合]]、[[贫乳]]、[[JK]]
|sp1::
|ulink_bili::109103079
}}
{{User:GuoPC/UserInfo
|属性名::属性值<!-- 所有属性均可以随意添加调整,显示顺序与此处排列顺序有关 -->
}}
(不填写的项目将会自动隐藏)
注意:此节涉及的所有参数应按参数名=参数值的格式填写。
效果见右侧上方。
{{User:GuoPC/UserInfo
|color=#6cf
|unamecolor=#e00
}}
{{User:GuoPC/UserInfo
|style=dark
}}
属性名=属性值格式改为属性名::属性值:
sp=及相关参数需修改为sp::;ulink_bili=需修改为ulink_bili::,而ulink_bili_v=不需要;属性值中的特殊符号需处理,如=需替换为{{=}}。User:GuoPC/UserInfo。local p = {}
local getArgs = require('Module:Arguments').getArgs
function p.main(frame)
local args = getArgs(frame)
return p._main(frame, args)
end
function p._main(frame, args)
if not frame then
frame = mw.getCurrentFrame()
end
local style = args["style"]
local uname = args["uname"]
local eximg = args["eximg"] or ""
local inimg = args["inimg"] or ""
local width = args["width"] or ""
local color = args["color"] or ""
local unamecolor = args["unamecolor"] or ""
local ulink_bili_v = args["ulink_bili_v"]
local spKeyMap = {
sp = true,
sp1 = true,
sp2 = true,
sp3 = true,
sp4 = true,
sp5 = true,
}
local function isSplitLineKey(key)
return spKeyMap[key] == true
end
if style ~= "dark" then
style = ""
end
local avatar = ""
if eximg ~= "" then
avatar = eximg
elseif inimg ~= "" then
avatar = string.format('[[Image:%s|280px|class=kwiinfo-kwiface]]', inimg)
else
avatar = frame:callParserFunction{ name = "#avatar", args = { uname, class = "kwiinfo-kwiface" } }
end
local props = {}
for _, arg in ipairs(args) do
local k, v = string.match(arg, '^%s*(.-)%s*::%s*(.-)%s*$')
if isSplitLineKey(k) then
table.insert(props, '<div class="split-line"></div>')
else
if k == "ulink_bili" then
table.insert(props,
string.format(
'[https://space.bilibili.com/%s '
.. '<div class="kwiinfo-properties ulink">'
.. '<span class="ulink-content">'
.. '<span style="margin-right:5px;">[[File:Bilibili Logo Blue.svg|40px|link=]]</span>'
.. '<span class="properties-cont">%s</span>'
.. '</span>'
.. '</div>'
.. ']', v, ulink_bili_v)
)
elseif v and v ~= "" then
table.insert(props,
string.format(
'<div class="kwiinfo-properties">'
.. '<span class="properties-text">%s</span>'
.. '<span class="properties-cont">%s</span>'
.. '</div>', k, v)
)
end
end
end
local props_out = table.concat(props, "\n")
local out = string.format(
'<div class="kwiinfo %s">'
.. '<div class="kwiinfo-face" style="width:%s;height:%s;background:%s;">'
.. '<div class="kwiinfo-face_img">%s</div>'
.. '</div>'
.. '<div class="kwiinfo-box">'
.. '<div class="kwiinfo-content">'
.. '<div class="kwiinfo-username" style="color:%s;">%s</div>'
.. '%s'
.. '</div>'
.. '</div>'
.. '</div>',
style, width, width, color, avatar, unamecolor, uname, props_out)
return out
end
return p