七日内新公告:全站维护公告
  • 你好~!欢迎来到萌娘百科镜像站!如需查看或编辑,请联系本站管理员注册账号。
  • 本镜像站和其他萌娘百科的镜像站无关,请注意分别。

Module:ImasscAvatar

猛汉♂百科,万男皆可猛的百科全书!转载请标注来源页面的网页链接,并声明引自猛汉百科。内容不可商用。
跳转到导航 跳转到搜索
local getArgs = require('Module:Arguments').getArgs

local p = {}

-- 位置与颜色数据,格式:['<name>'] = { <index>, '<color>' },
local data = {
	['樱木真乃']   = {  1, '#FFBAD6' },
	['风野灯织']   = {  2, '#144384' },
	['八宫巡']     = {  3, '#FFE012' },
	['月冈恋钟']   = {  4, '#F84CAD' },
	['田中摩美美'] = {  5, '#A846FB' },
	['白濑咲耶']   = {  6, '#006047' },
	['三峰结华']   = {  7, '#3B91C4' },
	['幽谷雾子']   = {  8, '#D9F2FF' },
	['小宫果穗']   = {  9, '#E5461C' },
	['园田智代子'] = { 10, '#F93B90' },
	['西城树里']   = { 11, '#FFC602' },
	['杜野凛世']   = { 12, '#97CBEF' },
	['有栖川夏叶'] = { 13, '#90E667' },
	['大崎甘奈']   = { 14, '#F54275' },
	['大崎甜花']   = { 15, '#E75BEC' },
	['桑山千雪']   = { 16, '#FBFAFA' },
	['芹泽朝日']   = { 17, '#F30100' },
	['黛冬优子']   = { 18, '#5CE626' },
	['和泉爱依']   = { 19, '#FF00FF' },
	['浅仓透']     = { 20, '#50D0D0' },
	['樋口圆香']   = { 21, '#BE1E3E' },
	['福丸小糸']   = { 22, '#7967C3' },
	['市川雏菜']   = { 23, '#FFC639' },
	['七草日花']   = { 24, '#A6CEB6' },
	['绯田美琴']   = { 25, '#760F10' },
	['斑鸠路加']   = { 26, '#23120C' },
	['铃木羽那']   = { 27, '#E0B5D3' },
	['郁田阳希']   = { 28, '#EAD7A4' },
}

function p.main(frame)
	local args = getArgs(frame)
	local name = args[1]
	local size = tonumber(args[2]) or 180
	local index = data[name] and data[name][1] or name
	local color = data[name] and data[name][2] or '#000000'
	local hasBorder = args['border'] and true or false
	local style = args['style'] or ''

	return '<span class="imas-sc-sprite" '
			  .. 'style="height:' .. size .. 'px;width:' .. size .. 'px;'
					 .. 'background-size:' .. 10 * size .. 'px ' .. 3 * size .. 'px;'
					 .. 'background-position:-' .. math.fmod(index - 1, 10) * size .. 'px -' .. math.floor((index - 1) / 10) * size .. 'px;'
					 .. (hasBorder and ('border:medium solid ' .. color) or '') .. ';' .. style .. '"></span>'
end

return p