Module:Ups and downs sharpness: Difference between revisions
ArrowHead294 (talk | contribs) mNo edit summary |
ArrowHead294 (talk | contribs) mNo edit summary |
||
| Line 9: | Line 9: | ||
function p.ud_sharpness(frame) -- generate table | function p.ud_sharpness(frame) -- generate table | ||
local sharp = sharp_n(frame.args["edo"]) | local sharp = sharp_n(frame.args["edo"]) | ||
local arrow_marg = "-2.5px" | |||
local sharp_marg = "-15px" | |||
local double_sharp_marg = "-20px" | |||
local flat_marg = "-12.5px" | |||
local natural_marg = "-17.5px" | |||
local tab | local tab | ||
| Line 16: | Line 21: | ||
tab = "{{sharpness-flat1}}" | tab = "{{sharpness-flat1}}" | ||
elseif sharp == 0 then | elseif sharp == 0 then | ||
local spanf = "| <span style=\"display: inline-block; margin-bottom: -45px; transform: translate(0, %s); white-space: nowrap;\">%s</span>\n" | |||
tab = "{| class=\"wikitable center-all\"\n" | tab = "{| class=\"wikitable center-all\"\n" | ||
.. "|-\n" | .. "|-\n" | ||
| Line 22: | Line 28: | ||
.. "|-\n" | .. "|-\n" | ||
.. "! Symbol\n" | .. "! Symbol\n" | ||
.. | .. string.format(spanf, arrow_marg, string.rep(" [[File:Down narrow.svg|9px]]", 3)) | ||
.. string.format(spanf, arrow_marg, string.rep(" [[File:Down narrow.svg|9px]]", 2)) | |||
.. | .. string.format(spanf, arrow_marg, " [[File:Down narrow.svg|9px]]") | ||
.. string.format(spanf, natural_marg, " [[File:Heji18.svg|15px]]") | |||
.. string.format(spanf, arrow_marg, " [[File:Up narrow.svg|9px]]") | |||
.. | .. string.format(spanf, arrow_marg, string.rep(" [[File:Up narrow.svg|9px]]", 2)) | ||
.. string.format(spanf, arrow_marg, string.rep(" [[File:Up narrow.svg|9px]]", 3)) | |||
.. | |||
.. | |||
.. | |||
.. | |||
.. "|}" | .. "|}" | ||
elseif sharp == 1 then | elseif sharp == 1 then | ||
| Line 60: | Line 52: | ||
tab = tab .. "| <span style=\"display: inline-block; margin-bottom: -45px; transform: translate(0, " | tab = tab .. "| <span style=\"display: inline-block; margin-bottom: -45px; transform: translate(0, " | ||
if cs == 0 then | if cs == 0 then | ||
tab = tab .. | tab = tab .. arrow_marg | ||
elseif cs == 1 then | elseif cs == 1 then | ||
tab = tab .. | tab = tab .. sharp_marg | ||
elseif cs == 2 then | elseif cs == 2 then | ||
tab = tab .. | tab = tab .. double_sharp_marg | ||
end | end | ||
tab = tab .. "); white-space: nowrap;\">" | tab = tab .. "); white-space: nowrap;\">" | ||
| Line 102: | Line 94: | ||
tab = tab .. "| <span style=\"display: inline-block; margin-bottom: -45px; transform: translate(0, " | tab = tab .. "| <span style=\"display: inline-block; margin-bottom: -45px; transform: translate(0, " | ||
if cs == 1 or cs == 2 then | if cs == 1 or cs == 2 then | ||
tab = tab .. | tab = tab .. flat_marg | ||
end | end | ||
tab = tab .. "); white-space: nowrap;\">" | tab = tab .. "); white-space: nowrap;\">" | ||