Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 687

Help: Rainmeter Skins • Christmas Countdown

$
0
0
ChristmasCountdown_2025.rmskin

Code:

[Rainmeter]Update=900DynamicWindowSize=1AccurateText=1[MeasureNow]Measure=Time[MeasureYear]Measure=TimeFormat=%Y[MeasureChristmas]Measure=TimeDynamicVariables=1TimeStamp=12/25/[MeasureYear] 00:00:00TimeStampFormat=%m/%d/%Y %H:%M:%S[MeasureSecondsDiff]Measure=CalcFormula=([MeasureChristmas:TimeStamp] - [MeasureNow:TimeStamp])DynamicVariables=1IfCondition=MeasureSecondsDiff <= 0 IfTrueAction=[!SetOption MeterChristmasHeader Text "Merry Christmas!"]IfFalseAction=[!SetOption MeterChristmasHeader Text "Christmas is in"][MeasureFormatSeconds]Measure=ScriptScriptFile=FormatSeconds.lua[MeterChristmasHeader]Meter=StringFontSize=54FontFace=KingThings Christmas 2InlineSetting=GradientColor | 180 | 240,34,34 ; 0.1 | 92,240,34 ; 0.5 | 34,181,240 ; 1.0InlinePattern=.*SolidColor=0,0,0,1AntiAlias=1Text=Christmas is in[MeterChristmasCountdown]Meter=StringY=-5RFontSize=15InlineSetting=GradientColor | 180 | 240,34,34 ; 0.1 | 92,240,34 ; 0.5 | 34,181,240 ; 1.0InlinePattern=.*SolidColor=0,0,0,1AntiAlias=1
FormatSeconds.lua:

Code:

function Initialize()measureSecondsDiff = SKIN:GetMeasure('MeasureSecondsDiff')endfunction Update()secondsDiff = measureSecondsDiff:GetValue()diffDays, diffHours, diffMinutes, diffSeconds = FormatSeconds(math.abs(secondsDiff))if diffDays == 1 thenoutputDays = diffDays..' Day'elseoutputDays = diffDays..' Days'end   if diffHours == 1 thenoutputHours = diffHours..' Hour'elseoutputHours = diffHours..' Hours'end   if diffMinutes == 1 thenoutputMinutes = diffMinutes..' Minute'elseoutputMinutes = diffMinutes..' Minutes'end      if diffSeconds == 1 thenoutputSeconds = diffSeconds..' Second'elseoutputSeconds = diffSeconds..' Seconds'endif diffDays > 0 thenoutputString = outputDays..'  '..outputHours..'  '..outputMinutes..'  '..outputSecondselseif diffHours > 0 thenoutputString = outputHours..'  '..outputMinutes..'  '..outputSecondselseif diffMinutes > 0 thenoutputString = outputMinutes..'  '..outputSecondselseoutputString = outputSecondsend      SKIN:Bang('!SetOption', 'MeterChristmasCountdown', 'Text', outputString)return secondsDiffendfunction FormatSeconds(secondsArg)   local days = math.floor(secondsArg / 86400)   local remainder = secondsArg % 86400   local hours = math.floor(remainder / 3600)   local remainder = remainder % 3600   local minutes = math.floor(remainder / 60)   local seconds = remainder % 60      return days, hours, minutes, seconds   end

1.jpg

Statistics: Posted by jsmorley — Today, 12:39 pm



Viewing all articles
Browse latest Browse all 687

Trending Articles