Module:WikiProject banner/sandbox: Difference between revisions

Content deleted Content added
design 2 now implemented verbatim
adding option 6, gradated but paler colours; a bit messy but this is just for prototyping
Line 89:
end
 
local bubble = function(text, shortText, colour, option)
local out = mw.html.create('span')
option = tonumber(option)
:addClass('wpb-header-bubbles')
if option==6 then
:css('background', colour)
local paleColours = {
:css('border', '0.075em solid ' .. colour)
["FA"] = "#BED3FF",
:wikitext(text)
["FL"] = "#BED3FF",
["FM"] = "#BED3FF",
["A"] = "#C0FFFF",
["AL"] = "#C0FFFF",
["GA"] = "#C0FFC0",
["B"] = "#5AA70E",
["C"] = "#FFFFBE",
["Start"] = "#FFDBBF",
["Stub"] = "#FFC0C0",
["List"] = "#D2C0FF",
["NA"] = "#f5f5f5",
["Top"] = "#FFB8FF",
["High"] = "#FFC6FF",
["Mid"] = "#FFD5FF",
["Low"] = "#FFE7FF"}
local paleColour = paleColours[shortText]
out = mw.html.create('span')
:addClass('wpb-header-bubbles')
:css('color', paleColour)
:css('border', '0.16em solid ' .. paleColour)
:wikitext(text)
else
out = mw.html.create('span')
:addClass('wpb-header-bubbles')
:css('background', colour)
:css('border', '0.075em solid ' .. colour)
:wikitext(text)
end
return tostring(out)
end
Line 329 ⟶ 357:
local new_bubble = bubble(
class .. '‑class',
'#EEFDFF'class,
'#EEFDFF',
args.mockup
)
table.insert(nested_ratings, 1, new_bubble)
Line 335 ⟶ 365:
local new_bubble = bubble(
class .. '‑class',
class,
frame:expandTemplate{ title = 'Class/colour', args = {class} },
args.mockup
)
table.insert(nested_ratings, 1, new_bubble)
Line 381 ⟶ 413:
local new_bubble = bubble(
importance .. '‑' .. importance_name,
'#FFE6FF'importance,
'#FFE6FF',
args.mockup
)
table.insert(nested_ratings, new_bubble)
Line 387 ⟶ 421:
local new_bubble = bubble(
importance .. '‑' .. importance_name,
importance,
frame:expandTemplate{ title = 'Importance/colour', args = {importance} },
args.mockup
)
table.insert(nested_ratings, new_bubble)