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"
.. "| <span style=\"display: inline-block; margin-bottom: -45px; transform: translate(0, -2.5px); white-space: nowrap;>"
.. string.format(spanf, arrow_marg, string.rep("&#x202F;[[File:Down narrow.svg|9px]]", 3))
.. string.rep("&#x202F;[[File:Down narrow.svg|9px]]", 3)
.. string.format(spanf, arrow_marg, string.rep("&#x202F;[[File:Down narrow.svg|9px]]", 2))
.. "</span>\n"
.. string.format(spanf, arrow_marg, "&#x202F;[[File:Down narrow.svg|9px]]")
.. "| <span style=\"display: inline-block; margin-bottom: -45px; transform: translate(0, -2.5px); white-space: nowrap;>"
.. string.format(spanf, natural_marg, "&#x202F;[[File:Heji18.svg|15px]]")
.. string.rep("&#x202F;[[File:Down narrow.svg|9px]]", 2)
.. string.format(spanf, arrow_marg, "&#x202F;[[File:Up narrow.svg|9px]]")
.. "</span>\n"
.. string.format(spanf, arrow_marg, string.rep("&#x202F;[[File:Up narrow.svg|9px]]", 2))
.. "| <span style=\"display: inline-block; margin-bottom: -45px; transform: translate(0, -2.5px); white-space: nowrap;>"
.. string.format(spanf, arrow_marg, string.rep("&#x202F;[[File:Up narrow.svg|9px]]", 3))
.. "&#x202F;[[File:Down narrow.svg|9px]]"
.. "</span>\n"
.. "| <span style=\"display: inline-block; margin-bottom: -45px; transform: translate(0, -17.5px); white-space: nowrap;>"
.. "&#x202F;[[File:Heji18.svg|15px]]"
.. "</span>\n"
.. "| <span style=\"display: inline-block; margin-bottom: -45px; transform: translate(0, -2.5px); white-space: nowrap;>"
.. "&#x202F;[[File:Up narrow.svg|9px]]"
.. "</span>\n"
.. "| <span style=\"display: inline-block; margin-bottom: -45px; transform: translate(0, -2.5px); white-space: nowrap;>"
.. string.rep("&#x202F;[[File:Up narrow.svg|9px]]", 2)
.. "</span>\n"
.. "| <span style=\"display: inline-block; margin-bottom: -45px; transform: translate(0, -2.5px); white-space: nowrap;>"
.. string.rep("&#x202F;[[File:Up narrow.svg|9px]]", 3)
.. "</span>\n"
.. "|}"
.. "|}"
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 .. "-2.5px"
tab = tab .. arrow_marg
elseif cs == 1 then
elseif cs == 1 then
tab = tab .. "-15px"
tab = tab .. sharp_marg
elseif cs == 2 then
elseif cs == 2 then
tab = tab .. "-20px"
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 .. "-12.5px"
tab = tab .. flat_marg
end
end
tab = tab .. "); white-space: nowrap;\">"
tab = tab .. "); white-space: nowrap;\">"