模块:ItemInfo:修订间差异

添加110字节 、​ 2024年6月8日 (星期六)
完善
(样式优化)
(完善)
第134行: 第134行:


         local type = tonumber(item.type)
         local type = tonumber(item.type)
         -- 之后要替换为图片,提供更好的视觉效果
         -- 之后要替换为图片及标题的::before元素,提供更好的视觉效果
         local icon = '<span style="background-color: ' .. p.gcType[type + 1] .. '; padding: 0 .25em; color: white">' .. item.level .. '</span>'
         local icon = '<span style="background-color: ' .. p.gcType[type + 1] .. '; padding: 0 .25em; color: white">' .. item.level .. '</span>'
         local section = '==' .. icon .. item.name .. '==\n' .. item.desc
         local section = '==' .. item.name .. '==\n' .. item.desc
         local html = mw.html.create('table'):addClass('wikitable')
         local html = mw.html.create('table'):addClass('wikitable')


         html:tag('tr')
         html:tag('tr')
            :tag('th'):wikitext('类型'):done()
             :tag('th'):wikitext('品质'):done()
             :tag('th'):wikitext('品质'):done()
             :tag('th'):wikitext('GD'):done()
             :tag('th'):wikitext('GD'):done()
第147行: 第148行:
          
          
         html:tag('tr')
         html:tag('tr')
            :tag('th'):wikitext(icon):done()
             :tag('td'):wikitext(item.quality):done()
             :tag('td'):wikitext(item.quality):done()
             :tag('td'):wikitext(item.gd):done()
             :tag('td'):wikitext(item.gd):done()
第157行: 第159行:
         table.insert(result, section .. tostring(html) .. '\n' .. list)
         table.insert(result, section .. tostring(html) .. '\n' .. list)
     end         
     end         
     return table.concat(result, '\n\n')
     return table.concat(result, '\n')
end
end


return p
return p
1,075

个编辑