local getArgs = require('Module:Arguments').getArgs
local p = {}
function p.main(frame)
local args = getArgs(frame)
local colors = { SSR = '#FFD391', SR = '#C9BAD4', R = '#A5C1CF' }
local out = { '<table>' }
local i = 1
while args['Name' .. i] do
local name = args['Name' .. i]
local color = colors[args['Rarity' .. i]] or '#C4C4C4'
local story = args['Story' .. i] or ''
local note = args['Note' .. i] and '实装于' .. args['Note' .. i] or '剧情卡池常驻'
table.insert(out, '<tr><td rowspan="2">[[File:拓印-' .. name .. '.png|200px]]</td>')
table.insert(out, '<td style="text-align:center;border-radius:3px;background:' .. color .. [[;">'''-{]] .. name .. [[}-'''</td></tr>]])
table.insert(out, '<tr><td rowspan="2"><div style="height:275px;overflow-x:auto">')
table.insert(out, frame:callParserFunction('#tag', 'poem', story))
table.insert(out, '</div></td></tr>')
table.insert(out, '<tr><td style="font-size:0.7em;color:grey;display:block;width:200px">' .. note .. '</td></tr>')
i = i + 1
end
table.insert(out, '</table>')
if args['Other1'] then
table.insert(out, '<dl><dt>仅卡面出场拓印</dt></dl>')
-- table.insert(out, '<span style="font-size:0.7em;color:grey">点击拓印名称可跳转至详情。</span>')
table.insert(out, '<table><tr>')
local otherImgs, otherTxts = {}, {}
local j = 1
while args['Other' .. j] do
local other = args['Other' .. j]
table.insert(otherImgs, '<td>[[File:拓印-' .. other .. '.png|150px]]</td>')
table.insert(otherTxts, '<td style="text-align:center;font-family:Source Han Serif CN,Source Han Serif,Noto Serif,serif;">' .. other .. '</td>')
j = j + 1
end
table.insert(out, table.concat(otherImgs))
table.insert(out, '</tr><tr>')
table.insert(out, table.concat(otherTxts))
table.insert(out, '</tr></table>')
end
return table.concat(out)
end
return p