Module:Sandbox/Andreyyshore/ESC countdown: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 8:
local month2 = tonumber(frame.args.month2 or frame.args[5])
local day2 = tonumber(frame.args.day2 or frame.args[6])
local messageendtext = frame.args.messageendtext or "End of Event"
local livetext = frame.args.livetext or "Live Event"
local text = frame.args.text
local time1 = nil
local time2 = nil
local bgcolor = "#999999777777"
local textcolor = "#333333DDDDDD"
local span = mw.html.create("span")
span:css{
["text-aligndisplay"] = "centerinline-block",
["font-weight"] = "bold",
["font-style"] = "italic",
Line 24 ⟶ 26:
}
if messagetext ~= nil or day1 == nil or month1 == nil or year1 == nil then
span
:css{background = bgcolor, color = textcolor}
:wikitext(messagetext or "Invalid input")
return tostring(span)
end
Line 51 ⟶ 53:
if time1 > 0 then
bgcolor = "#FF7E00C66320"
messagetext = time1 .. " day"
if time1 > 1 then messagetext = messagetext .. "s" end
messagetext = messagetext .. " to go"
elseif time2 < 0 then
bgcolor = "#FF0033AA1111"
text = endtext
message = "End of Event"
else
bgcolor = "#00800000B000"
messagetext = "Live Event"livetext
end
Line 67 ⟶ 69:
span
:css{background = bgcolor, color = textcolor}
:wikitext(messagetext)
return tostring(span)