Editing Module:MovementTabsGive feedback
Jump to navigation
Jump to search
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 8: | Line 8: | ||
local current = mw.title.getCurrentTitle().fullText | local current = mw.title.getCurrentTitle().fullText | ||
local rootPage = args[1] or current | local rootPage = args[1] or current | ||
local lang_code = lang_module.get_lang_code() | local lang_code = lang_module.get_lang_code() | ||
local lang_suffix = (lang_code ~= "en") and ("/" .. lang_code) or "" | local lang_suffix = (lang_code ~= "en") and ("/" .. lang_code) or "" | ||
| Line 17: | Line 20: | ||
end | end | ||
local html = mw.html.create("div") | |||
local html = mw.html.create("div"): | :css{ | ||
["border-radius"]="8px", | |||
["background-image"]="linear-gradient(#987556, #483728)", | |||
["color"]="#FFF5E8", | |||
["display"]="flex", | |||
["flex-wrap"]="wrap", | |||
["justify-content"]="center", | |||
["gap"]="1em", | |||
["font-family"]="Retail Demo, Radiance, sans-serif", | |||
["text-transform"]="uppercase", | |||
["font-weight"]="bold", | |||
["font-size"]="15px", | |||
["padding"]="0px" | |||
} | |||
for _, tab in ipairs(tabs) do | for _, tab in ipairs(tabs) do | ||
| Line 31: | Line 47: | ||
local active = current == pagePlain or current == pagePlain .. lang_suffix | local active = current == pagePlain or current == pagePlain .. lang_suffix | ||
local div = html:tag("div"): | local div = html:tag("div") | ||
:css{ | |||
["padding"]="4px 8px", | |||
["cursor"]="pointer", | |||
["border-radius"]=active and "4px 4px 0 0" or nil, | |||
["background-color"]=active and "#FFF0D6" or nil | |||
} | |||
if active then | if active then | ||
div:wikitext(string.format('[[:%s|<span style="color:#483728;">%s</span>]]', pageTarget, tab)) | |||
div:wikitext(string.format('[[:%s|%s]]', pageTarget, tab)) | |||
else | else | ||
div:wikitext(string.format('[[:%s|<span | div:wikitext(string.format('[[:%s|<span style="color:#FFF0D6; text-shadow: 0px 2px 2px black, 0px 0px 2px black;">%s</span>]]', pageTarget, tab)) | ||
end | end | ||
end | end | ||