diff --git a/favicons/apple-touch-icon-114x114.png b/favicons/apple-touch-icon-114x114.png new file mode 100644 index 0000000..0197c8f Binary files /dev/null and b/favicons/apple-touch-icon-114x114.png differ diff --git a/favicons/apple-touch-icon-120x120.png b/favicons/apple-touch-icon-120x120.png new file mode 100644 index 0000000..297c97a Binary files /dev/null and b/favicons/apple-touch-icon-120x120.png differ diff --git a/favicons/apple-touch-icon-144x144.png b/favicons/apple-touch-icon-144x144.png new file mode 100644 index 0000000..9587c05 Binary files /dev/null and b/favicons/apple-touch-icon-144x144.png differ diff --git a/favicons/apple-touch-icon-152x152.png b/favicons/apple-touch-icon-152x152.png new file mode 100644 index 0000000..4982218 Binary files /dev/null and b/favicons/apple-touch-icon-152x152.png differ diff --git a/favicons/apple-touch-icon-57x57.png b/favicons/apple-touch-icon-57x57.png new file mode 100644 index 0000000..fc97560 Binary files /dev/null and b/favicons/apple-touch-icon-57x57.png differ diff --git a/favicons/apple-touch-icon-60x60.png b/favicons/apple-touch-icon-60x60.png new file mode 100644 index 0000000..86168a0 Binary files /dev/null and b/favicons/apple-touch-icon-60x60.png differ diff --git a/favicons/apple-touch-icon-72x72.png b/favicons/apple-touch-icon-72x72.png new file mode 100644 index 0000000..4f394b3 Binary files /dev/null and b/favicons/apple-touch-icon-72x72.png differ diff --git a/favicons/apple-touch-icon-76x76.png b/favicons/apple-touch-icon-76x76.png new file mode 100644 index 0000000..910f1fc Binary files /dev/null and b/favicons/apple-touch-icon-76x76.png differ diff --git a/favicons/favicon-128.png b/favicons/favicon-128.png new file mode 100644 index 0000000..69a0b7c Binary files /dev/null and b/favicons/favicon-128.png differ diff --git a/favicons/favicon-16x16.png b/favicons/favicon-16x16.png new file mode 100644 index 0000000..bc7c96b Binary files /dev/null and b/favicons/favicon-16x16.png differ diff --git a/favicons/favicon-196x196.png b/favicons/favicon-196x196.png new file mode 100644 index 0000000..d458f6b Binary files /dev/null and b/favicons/favicon-196x196.png differ diff --git a/favicons/favicon-32x32.png b/favicons/favicon-32x32.png new file mode 100644 index 0000000..f78378b Binary files /dev/null and b/favicons/favicon-32x32.png differ diff --git a/favicons/favicon-96x96.png b/favicons/favicon-96x96.png new file mode 100644 index 0000000..a158a6c Binary files /dev/null and b/favicons/favicon-96x96.png differ diff --git a/fonts/PT-Sans-Bold.ttf b/fonts/PT-Sans-Bold.ttf new file mode 100644 index 0000000..d288c1d Binary files /dev/null and b/fonts/PT-Sans-Bold.ttf differ diff --git a/fonts/PT-Sans-Narrow-Regular.ttf b/fonts/PT-Sans-Narrow-Regular.ttf new file mode 100644 index 0000000..d865659 Binary files /dev/null and b/fonts/PT-Sans-Narrow-Regular.ttf differ diff --git a/fonts/PT-Sans-Regular.ttf b/fonts/PT-Sans-Regular.ttf new file mode 100644 index 0000000..ed0372d Binary files /dev/null and b/fonts/PT-Sans-Regular.ttf differ diff --git a/images/autumn/autumn-splash.svg b/images/autumn/autumn-splash.svg new file mode 100644 index 0000000..c7aad1f --- /dev/null +++ b/images/autumn/autumn-splash.svg @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/autumn/backgrounds/DANGERD33-1.jpg b/images/autumn/backgrounds/DANGERD33-1.jpg new file mode 100644 index 0000000..e934e90 Binary files /dev/null and b/images/autumn/backgrounds/DANGERD33-1.jpg differ diff --git a/images/autumn/backgrounds/InternetExplorer8-1.jpg b/images/autumn/backgrounds/InternetExplorer8-1.jpg new file mode 100644 index 0000000..d2b8cde Binary files /dev/null and b/images/autumn/backgrounds/InternetExplorer8-1.jpg differ diff --git a/images/autumn/backgrounds/MrsAverageMan-1.jpg b/images/autumn/backgrounds/MrsAverageMan-1.jpg new file mode 100644 index 0000000..554b894 Binary files /dev/null and b/images/autumn/backgrounds/MrsAverageMan-1.jpg differ diff --git a/images/autumn/backgrounds/MrsAverageMan-2.jpg b/images/autumn/backgrounds/MrsAverageMan-2.jpg new file mode 100644 index 0000000..7e9dfef Binary files /dev/null and b/images/autumn/backgrounds/MrsAverageMan-2.jpg differ diff --git a/images/autumn/backgrounds/OriginalForzaCoverArt-1.jpg b/images/autumn/backgrounds/OriginalForzaCoverArt-1.jpg new file mode 100644 index 0000000..bf5771a Binary files /dev/null and b/images/autumn/backgrounds/OriginalForzaCoverArt-1.jpg differ diff --git a/images/autumn/backgrounds/SkylineSonata-1.jpg b/images/autumn/backgrounds/SkylineSonata-1.jpg new file mode 100644 index 0000000..c186c76 Binary files /dev/null and b/images/autumn/backgrounds/SkylineSonata-1.jpg differ diff --git a/images/autumn/backgrounds/ThroughJaysLens-1.jpg b/images/autumn/backgrounds/ThroughJaysLens-1.jpg new file mode 100644 index 0000000..670178e Binary files /dev/null and b/images/autumn/backgrounds/ThroughJaysLens-1.jpg differ diff --git a/images/autumn/backgrounds/Vadeel-1.jpg b/images/autumn/backgrounds/Vadeel-1.jpg new file mode 100644 index 0000000..0098d76 Binary files /dev/null and b/images/autumn/backgrounds/Vadeel-1.jpg differ diff --git a/images/autumn/backgrounds/WallHaven-1.jpg b/images/autumn/backgrounds/WallHaven-1.jpg new file mode 100644 index 0000000..0098d76 Binary files /dev/null and b/images/autumn/backgrounds/WallHaven-1.jpg differ diff --git a/images/autumn/backgrounds/WallHaven-2.jpg b/images/autumn/backgrounds/WallHaven-2.jpg new file mode 100644 index 0000000..6f969cf Binary files /dev/null and b/images/autumn/backgrounds/WallHaven-2.jpg differ diff --git a/images/autumn/backgrounds/WallHaven-3.jpg b/images/autumn/backgrounds/WallHaven-3.jpg new file mode 100644 index 0000000..6d00291 Binary files /dev/null and b/images/autumn/backgrounds/WallHaven-3.jpg differ diff --git a/images/autumn/backgrounds/WallHaven-4.jpg b/images/autumn/backgrounds/WallHaven-4.jpg new file mode 100644 index 0000000..b649acc Binary files /dev/null and b/images/autumn/backgrounds/WallHaven-4.jpg differ diff --git a/images/autumn/backgrounds/WallHaven-5.jpg b/images/autumn/backgrounds/WallHaven-5.jpg new file mode 100644 index 0000000..585fd01 Binary files /dev/null and b/images/autumn/backgrounds/WallHaven-5.jpg differ diff --git a/images/autumn/backgrounds/WallHaven-6.jpg b/images/autumn/backgrounds/WallHaven-6.jpg new file mode 100644 index 0000000..d806986 Binary files /dev/null and b/images/autumn/backgrounds/WallHaven-6.jpg differ diff --git a/images/autumn/backgrounds/WallHaven-7.jpg b/images/autumn/backgrounds/WallHaven-7.jpg new file mode 100644 index 0000000..0db3951 Binary files /dev/null and b/images/autumn/backgrounds/WallHaven-7.jpg differ diff --git a/images/autumn/backgrounds/maikee_bery-1.jpg b/images/autumn/backgrounds/maikee_bery-1.jpg new file mode 100644 index 0000000..c57803c Binary files /dev/null and b/images/autumn/backgrounds/maikee_bery-1.jpg differ diff --git a/images/clock/clock-fullshadow.png b/images/clock/clock-fullshadow.png new file mode 100644 index 0000000..1bf94c1 Binary files /dev/null and b/images/clock/clock-fullshadow.png differ diff --git a/images/spring/backgrounds/And_Justice-1.jpg b/images/spring/backgrounds/And_Justice-1.jpg new file mode 100644 index 0000000..a5bf177 Binary files /dev/null and b/images/spring/backgrounds/And_Justice-1.jpg differ diff --git a/images/spring/backgrounds/AzudemK-1.jpg b/images/spring/backgrounds/AzudemK-1.jpg new file mode 100644 index 0000000..03c0b8f Binary files /dev/null and b/images/spring/backgrounds/AzudemK-1.jpg differ diff --git a/images/spring/backgrounds/Enzo03-1.jpg b/images/spring/backgrounds/Enzo03-1.jpg new file mode 100644 index 0000000..c9ac45e Binary files /dev/null and b/images/spring/backgrounds/Enzo03-1.jpg differ diff --git a/images/spring/backgrounds/OriginalForzaCoverArt-1.jpg b/images/spring/backgrounds/OriginalForzaCoverArt-1.jpg new file mode 100644 index 0000000..a68f271 Binary files /dev/null and b/images/spring/backgrounds/OriginalForzaCoverArt-1.jpg differ diff --git a/images/spring/backgrounds/Positivevibes845-1.jpg b/images/spring/backgrounds/Positivevibes845-1.jpg new file mode 100644 index 0000000..a3b2a63 Binary files /dev/null and b/images/spring/backgrounds/Positivevibes845-1.jpg differ diff --git a/images/spring/backgrounds/Semyonov-1.jpg b/images/spring/backgrounds/Semyonov-1.jpg new file mode 100644 index 0000000..282e81b Binary files /dev/null and b/images/spring/backgrounds/Semyonov-1.jpg differ diff --git a/images/spring/backgrounds/flakgunna-1.jpg b/images/spring/backgrounds/flakgunna-1.jpg new file mode 100644 index 0000000..bd3c4f5 Binary files /dev/null and b/images/spring/backgrounds/flakgunna-1.jpg differ diff --git a/images/spring/backgrounds/flakgunna-2.jpg b/images/spring/backgrounds/flakgunna-2.jpg new file mode 100644 index 0000000..12e6d24 Binary files /dev/null and b/images/spring/backgrounds/flakgunna-2.jpg differ diff --git a/images/spring/backgrounds/slamdunk_12-1.jpg b/images/spring/backgrounds/slamdunk_12-1.jpg new file mode 100644 index 0000000..7b71d43 Binary files /dev/null and b/images/spring/backgrounds/slamdunk_12-1.jpg differ diff --git a/images/spring/backgrounds/xXMetalFlakeXx-1.jpg b/images/spring/backgrounds/xXMetalFlakeXx-1.jpg new file mode 100644 index 0000000..10c033d Binary files /dev/null and b/images/spring/backgrounds/xXMetalFlakeXx-1.jpg differ diff --git a/images/spring/spring-splash.svg b/images/spring/spring-splash.svg new file mode 100644 index 0000000..6526b9c --- /dev/null +++ b/images/spring/spring-splash.svg @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/summer/backgrounds/MainlyGod-1.jpg b/images/summer/backgrounds/MainlyGod-1.jpg new file mode 100644 index 0000000..0f021f4 Binary files /dev/null and b/images/summer/backgrounds/MainlyGod-1.jpg differ diff --git a/images/summer/backgrounds/OfficialForzaCoverArt-1.jpg b/images/summer/backgrounds/OfficialForzaCoverArt-1.jpg new file mode 100644 index 0000000..5311842 Binary files /dev/null and b/images/summer/backgrounds/OfficialForzaCoverArt-1.jpg differ diff --git a/images/summer/backgrounds/Soovin-1.jpg b/images/summer/backgrounds/Soovin-1.jpg new file mode 100644 index 0000000..b206ac8 Binary files /dev/null and b/images/summer/backgrounds/Soovin-1.jpg differ diff --git a/images/summer/backgrounds/WallHaven-10.jpg b/images/summer/backgrounds/WallHaven-10.jpg new file mode 100644 index 0000000..478db5a Binary files /dev/null and b/images/summer/backgrounds/WallHaven-10.jpg differ diff --git a/images/summer/backgrounds/WallHaven-11.jpg b/images/summer/backgrounds/WallHaven-11.jpg new file mode 100644 index 0000000..e21d65f Binary files /dev/null and b/images/summer/backgrounds/WallHaven-11.jpg differ diff --git a/images/summer/backgrounds/WallHaven-12.jpg b/images/summer/backgrounds/WallHaven-12.jpg new file mode 100644 index 0000000..e6edfa6 Binary files /dev/null and b/images/summer/backgrounds/WallHaven-12.jpg differ diff --git a/images/summer/backgrounds/WallHaven-13.jpg b/images/summer/backgrounds/WallHaven-13.jpg new file mode 100644 index 0000000..09cc8a5 Binary files /dev/null and b/images/summer/backgrounds/WallHaven-13.jpg differ diff --git a/images/summer/backgrounds/WallHaven-14.jpg b/images/summer/backgrounds/WallHaven-14.jpg new file mode 100644 index 0000000..3556cda Binary files /dev/null and b/images/summer/backgrounds/WallHaven-14.jpg differ diff --git a/images/summer/backgrounds/WallHaven-15.jpg b/images/summer/backgrounds/WallHaven-15.jpg new file mode 100644 index 0000000..62ac663 Binary files /dev/null and b/images/summer/backgrounds/WallHaven-15.jpg differ diff --git a/images/summer/backgrounds/WallHaven-16.jpg b/images/summer/backgrounds/WallHaven-16.jpg new file mode 100644 index 0000000..c7bf563 Binary files /dev/null and b/images/summer/backgrounds/WallHaven-16.jpg differ diff --git a/images/summer/backgrounds/WallHaven-17.jpg b/images/summer/backgrounds/WallHaven-17.jpg new file mode 100644 index 0000000..c30ecd8 Binary files /dev/null and b/images/summer/backgrounds/WallHaven-17.jpg differ diff --git a/images/summer/backgrounds/WallHaven-18.jpg b/images/summer/backgrounds/WallHaven-18.jpg new file mode 100644 index 0000000..ab219f0 Binary files /dev/null and b/images/summer/backgrounds/WallHaven-18.jpg differ diff --git a/images/summer/backgrounds/WallHaven-19.jpg b/images/summer/backgrounds/WallHaven-19.jpg new file mode 100644 index 0000000..79b1ec2 Binary files /dev/null and b/images/summer/backgrounds/WallHaven-19.jpg differ diff --git a/images/summer/backgrounds/WillPill_-1.jpg b/images/summer/backgrounds/WillPill_-1.jpg new file mode 100644 index 0000000..c7e4d88 Binary files /dev/null and b/images/summer/backgrounds/WillPill_-1.jpg differ diff --git a/images/summer/summer-splash.svg b/images/summer/summer-splash.svg new file mode 100644 index 0000000..5aad449 --- /dev/null +++ b/images/summer/summer-splash.svg @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/winter/backgrounds/ARCLab-1.jpg b/images/winter/backgrounds/ARCLab-1.jpg new file mode 100644 index 0000000..39b0e44 Binary files /dev/null and b/images/winter/backgrounds/ARCLab-1.jpg differ diff --git a/images/winter/backgrounds/CCXGT-1.jpg b/images/winter/backgrounds/CCXGT-1.jpg new file mode 100644 index 0000000..b45250e Binary files /dev/null and b/images/winter/backgrounds/CCXGT-1.jpg differ diff --git a/images/winter/backgrounds/CraazyGamerz-1.jpg b/images/winter/backgrounds/CraazyGamerz-1.jpg new file mode 100644 index 0000000..05a39f8 Binary files /dev/null and b/images/winter/backgrounds/CraazyGamerz-1.jpg differ diff --git a/images/winter/backgrounds/DakarGelb-1.jpg b/images/winter/backgrounds/DakarGelb-1.jpg new file mode 100644 index 0000000..6202213 Binary files /dev/null and b/images/winter/backgrounds/DakarGelb-1.jpg differ diff --git a/images/winter/backgrounds/LooniLuna-1.jpg b/images/winter/backgrounds/LooniLuna-1.jpg new file mode 100644 index 0000000..4a0f9f1 Binary files /dev/null and b/images/winter/backgrounds/LooniLuna-1.jpg differ diff --git a/images/winter/backgrounds/OriginalForzaCoverArt-1.jpg b/images/winter/backgrounds/OriginalForzaCoverArt-1.jpg new file mode 100644 index 0000000..dd40b49 Binary files /dev/null and b/images/winter/backgrounds/OriginalForzaCoverArt-1.jpg differ diff --git a/images/winter/backgrounds/StickManTwit-1.jpg b/images/winter/backgrounds/StickManTwit-1.jpg new file mode 100644 index 0000000..294945a Binary files /dev/null and b/images/winter/backgrounds/StickManTwit-1.jpg differ diff --git a/images/winter/backgrounds/ThatsJustLogic-1.jpg b/images/winter/backgrounds/ThatsJustLogic-1.jpg new file mode 100644 index 0000000..b6d05a4 Binary files /dev/null and b/images/winter/backgrounds/ThatsJustLogic-1.jpg differ diff --git a/images/winter/backgrounds/TigerusTheReal-1.jpg b/images/winter/backgrounds/TigerusTheReal-1.jpg new file mode 100644 index 0000000..dfafeb1 Binary files /dev/null and b/images/winter/backgrounds/TigerusTheReal-1.jpg differ diff --git a/images/winter/backgrounds/flakgunna-1.jpg b/images/winter/backgrounds/flakgunna-1.jpg new file mode 100644 index 0000000..e02969c Binary files /dev/null and b/images/winter/backgrounds/flakgunna-1.jpg differ diff --git a/images/winter/backgrounds/kml--1.jpg b/images/winter/backgrounds/kml--1.jpg new file mode 100644 index 0000000..efa0282 Binary files /dev/null and b/images/winter/backgrounds/kml--1.jpg differ diff --git a/images/winter/backgrounds/maikee_bery-1.jpg b/images/winter/backgrounds/maikee_bery-1.jpg new file mode 100644 index 0000000..109ae0f Binary files /dev/null and b/images/winter/backgrounds/maikee_bery-1.jpg differ diff --git a/images/winter/backgrounds/naixu-1.jpg b/images/winter/backgrounds/naixu-1.jpg new file mode 100644 index 0000000..be0c9a3 Binary files /dev/null and b/images/winter/backgrounds/naixu-1.jpg differ diff --git a/images/winter/backgrounds/parkel42-1.jpg b/images/winter/backgrounds/parkel42-1.jpg new file mode 100644 index 0000000..1fd2453 Binary files /dev/null and b/images/winter/backgrounds/parkel42-1.jpg differ diff --git a/images/winter/backgrounds/parkel42-2.jpg b/images/winter/backgrounds/parkel42-2.jpg new file mode 100644 index 0000000..486b148 Binary files /dev/null and b/images/winter/backgrounds/parkel42-2.jpg differ diff --git a/images/winter/backgrounds/parkel42-3.jpg b/images/winter/backgrounds/parkel42-3.jpg new file mode 100644 index 0000000..b7d056d Binary files /dev/null and b/images/winter/backgrounds/parkel42-3.jpg differ diff --git a/images/winter/backgrounds/sjoel92-1.jpg b/images/winter/backgrounds/sjoel92-1.jpg new file mode 100644 index 0000000..c53fc7b Binary files /dev/null and b/images/winter/backgrounds/sjoel92-1.jpg differ diff --git a/images/winter/winter-splash.svg b/images/winter/winter-splash.svg new file mode 100644 index 0000000..58aec2b --- /dev/null +++ b/images/winter/winter-splash.svg @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/index.html b/index.html new file mode 100644 index 0000000..3ec429c --- /dev/null +++ b/index.html @@ -0,0 +1,57 @@ + + + + + + + + FH4 Season + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + D + + H + + M + + S +
+
+ + + + + + diff --git a/js/const.js b/js/const.js new file mode 100644 index 0000000..a4eb926 --- /dev/null +++ b/js/const.js @@ -0,0 +1,67 @@ +const seasons = ["winter", "spring", "summer", "autumn"]; +const winterStarts = new Date(Date.UTC(2018, 10, 8, 15, 00, 00)); +let lastCheckedSeason; +let minuteInterval = 0; +let secondInterval = 0; + +// List of the uploaded user's images +const userBackgrounds = { + "autumn": [ + "DANGERD33-1", + "InternetExplorer8-1", // 3837x2159 + "maikee_bery-1", + "MrsAverageMan-1", + "MrsAverageMan-2", + "OriginalForzaCoverArt-1", + "SkylineSonata-1", + "ThroughJaysLens-1", + "Vadeel-1", + ], + "spring": [ + // "-MattyMcFly-1", // Not 1080p; 1252x724 + "And_Justice-1", + "AzudemK-1", + "Enzo03-1", + "flakgunna-1", + "flakgunna-2", + "OriginalForzaCoverArt-1", + "Positivevibes845-1", + "Semyonov-1", // 1440p + "slamdunk_12-1", + "xXMetalFlakeXx-1", + ], + "summer": [ + "MainlyGod-1", + "OfficialForzaCoverArt-1", + "Soovin-1", + "WillPill_-1", + "WallHaven-10", + "WallHaven-11", + "WallHaven-12", + "WallHaven-13", + "WallHaven-14", + "WallHaven-15", + "WallHaven-16", + "WallHaven-17", + "WallHaven-18", + "WallHaven-19", + ], + "winter": [ + "ARCLab-1", // 4K + "CCXGT-1", + "CraazyGamerz-1", + "DakarGelb-1", + "flakgunna-1", // 2715x1121 + "kml--1", + "LooniLuna-1", + "maikee_bery-1", + "naixu-1", + "OriginalForzaCoverArt-1", + "parkel42-1", + "parkel42-2", + "sjoel92-1", + "StickManTwit-1", + "ThatsJustLogic-1", + "TigerusTheReal-1", + ], +}; diff --git a/js/const.js.backup b/js/const.js.backup new file mode 100644 index 0000000..be3e314 --- /dev/null +++ b/js/const.js.backup @@ -0,0 +1,59 @@ +const seasons = ["winter", "spring", "summer", "autumn"]; +const winterStarts = new Date(Date.UTC(2018, 10, 8, 15, 30, 00)); +let lastCheckedSeason; +let minuteInterval = 0; +let secondInterval = 0; + +// List of the uploaded user's images +const userBackgrounds = { + "autumn": [ + "DANGERD33-1", + "InternetExplorer8-1", // 3837x2159 + "maikee_bery-1", + "MrsAverageMan-1", + "MrsAverageMan-2", + "OriginalForzaCoverArt-1", + "SkylineSonata-1", + "ThroughJaysLens-1", + "Vadeel-1", + ], + "spring": [ + // "-MattyMcFly-1", // Not 1080p; 1252x724 + "And_Justice-1", + "AzudemK-1", + "Enzo03-1", + "flakgunna-1", + "flakgunna-2", + "OriginalForzaCoverArt-1", + "Positivevibes845-1", + "Semyonov-1", // 1440p + "slamdunk_12-1", + // "ur4ddiction-1", // Not 1080p; 1022x598 + "xXMetalFlakeXx-1", + ], + "summer": [ + "MainlyGod-1", + "OfficialForzaCoverArt-1", + "Soovin-1", + "WillPill_-1", + ], + "winter": [ + "ARCLab-1", // 4K + "CCXGT-1", + "CraazyGamerz-1", + "DakarGelb-1", + "flakgunna-1", // 2715x1121 + "kml--1", + "LooniLuna-1", + "maikee_bery-1", + "naixu-1", + "OriginalForzaCoverArt-1", + "parkel42-1", + "parkel42-2", + // "parkel42-3", // Not a fan + "sjoel92-1", + "StickManTwit-1", + "ThatsJustLogic-1", + "TigerusTheReal-1", + ], +}; diff --git a/js/content.js b/js/content.js new file mode 100644 index 0000000..3a5b9db --- /dev/null +++ b/js/content.js @@ -0,0 +1,69 @@ +function setBackgroundImage(currentSeason) { + // Randomly select a background appropriate for the season + let selectedBackground = userBackgrounds[currentSeason][Math.floor(Math.random() * userBackgrounds[currentSeason].length)]; + document.body.style.backgroundImage = `url(images/${currentSeason}/backgrounds/${selectedBackground}.jpg)`; + + // Art credit + document.body.alt = `Image courtesy of ${selectedBackground.slice(0, -2)}`; + console.log(`Background image courtesy of ${selectedBackground.slice(0, -2)}`); +} + +function setSeasonal(currentSeason, nextSeason) { + document.title = "It's " + currentSeason + " in Horizon"; + document.getElementById("season-splash").src = `images/${currentSeason}/${currentSeason}-splash.svg`; + document.getElementById("countdown-title").textContent = nextSeason + " starts in"; + + setBackgroundImage(currentSeason); +} + +function setCountdown(days, hours, minutes, seconds) { + // Set all the times + document.getElementById("days").textContent = days; + document.getElementById("hours").textContent = hours; + document.getElementById("minutes").textContent = minutes; + // Pad the seconds to two digits + document.getElementById("seconds").textContent = (seconds > 9) ? seconds : ("0" + seconds); + + // Hide the days if there are zero full days left + if (days === 0) { + document.getElementById("days").style.display = "none"; + document.getElementById("days-label").style.display = "none"; + } else { + document.getElementById("days").style.display = ""; + document.getElementById("days-label").style.display = ""; + } + + // Hide the hours if there are zero full hours AND days left + if (hours === 0 && days === 0) { + document.getElementById("hours").style.display = "none"; + document.getElementById("hours-label").style.display = "none"; + } else { + document.getElementById("hours").style.display = ""; + document.getElementById("hours-label").style.display = ""; + } + + // Hide the minutes if there are zero full minutes, hours, AND days left + if (minutes === 0 && hours === 0 && days === 0) { + document.getElementById("minutes").style.display = "none"; + document.getElementById("minutes-label").style.display = "none"; + } else { + document.getElementById("minutes").style.display = ""; + document.getElementById("minutes-label").style.display = ""; + } + + if (days === 0 && hours === 0) { + // If there are no full hours or days left, show the seconds + document.getElementById("seconds").style.display = ""; + document.getElementById("seconds-label").style.display = ""; + + // If there are also no minutes left, show the full "seconds" label + if (minutes === 0) { + document.getElementById("seconds-label").textContent = "SECONDS"; + } else { + document.getElementById("seconds-label").textContent = "S"; + } + } else { + document.getElementById("seconds").style.display = "none"; + document.getElementById("seconds-label").style.display = "none"; + } +} diff --git a/js/times.js b/js/times.js new file mode 100644 index 0000000..58e80aa --- /dev/null +++ b/js/times.js @@ -0,0 +1,31 @@ +function calculateTimes() { + let now = new Date(); + + // Calculate the number of seasons (weeks) since the seed time. + let numberOfSeasonsPassed = Math.floor(Math.abs( + (now - winterStarts) / (7 * 24 * 60 * 60 * 1000) + )); + + let currentSeason = seasons[numberOfSeasonsPassed % 4]; + + // Calculate the next season. + let nextSeason = seasons[(numberOfSeasonsPassed + 1) % 4]; + let nextSeasonStart = new Date(winterStarts); + nextSeasonStart.setDate(nextSeasonStart.getDate() + ((numberOfSeasonsPassed + 1) * 7)); + + // How much time until the next season. + let timeTilNextSeason = nextSeasonStart - now; + let days = Math.floor(timeTilNextSeason / (24 * 60 * 60 * 1000)); + let hours = Math.floor((timeTilNextSeason / (60 * 60 * 1000)) - (days * 24)); + let minutes = Math.floor((timeTilNextSeason / (60 * 1000)) - (hours * 60) - (days * 24 * 60)); + let seconds = Math.floor((timeTilNextSeason / 1000) - (minutes * 60) - (hours * 60 * 60) - (days * 24 * 60 * 60)); + + return { + currentSeason, + nextSeason, + days, + hours, + minutes, + seconds + } +} diff --git a/js/update.js b/js/update.js new file mode 100644 index 0000000..ebadb51 --- /dev/null +++ b/js/update.js @@ -0,0 +1,30 @@ +function update() { + let times = calculateTimes(); + + // Check if the season has changed or not + if (times.currentSeason !== lastCheckedSeason) { + setSeasonal(times.currentSeason, times.nextSeason); + lastCheckedSeason = times.currentSeason; + } + + // Configure the countdown timer + setCountdown(times.days, times.hours, times.minutes, times.seconds); + + // + if ((times.days === 0 && times.hours === 0) || (times.hours === 1 && times.minutes === 0)) { + // If there are just minutes (or just seconds) left, update every second. + if (!secondInterval) { + clearInterval(minuteInterval); + secondInterval = setInterval(() => update(), 1000); + } + } else { + // If there are just minutes (or just seconds) left, update every second. + if (!minuteInterval) { + clearInterval(secondInterval); + minuteInterval = setInterval(() => update(), 60000); + } + } +} + +// Sets the page going. +update(); diff --git a/styles/fonts.css b/styles/fonts.css new file mode 100644 index 0000000..c1bbe78 --- /dev/null +++ b/styles/fonts.css @@ -0,0 +1,20 @@ +@font-face { + font-family: 'PT Sans'; + font-style: normal; + font-weight: normal; + src: url('../fonts/PT-Sans-Regular.ttf'); +} + +@font-face { + font-family: 'PT Sans'; + font-style: normal; + font-weight: bold; + src: url('../fonts/PT-Sans-Bold.ttf'); +} + +@font-face { + font-family: 'PT Sans Narrow'; + font-style: normal; + font-weight: normal; + src: url('../fonts/PT-Sans-Narrow-Regular.ttf'); +} diff --git a/styles/global.css b/styles/global.css new file mode 100644 index 0000000..9a521b9 --- /dev/null +++ b/styles/global.css @@ -0,0 +1,118 @@ +* { + padding: 0; + margin: 0; + user-select: none; +} + +html { + width: 100%; + height: 100%; + overflow: hidden; +} + +body { + font-family: 'PT Sans'; + font-weight: normal; + + background: no-repeat center center fixed; + background-size: cover; + + display: grid; + grid-template-rows: min-content; +} + +#countdown-container { + background-color: #00b592; + background-image: url("../images/clock/clock-fullshadow.png"); + background-position: left; + background-size: contain; + background-repeat: no-repeat; + overflow: hidden; + + color: white; + text-transform: uppercase; + text-shadow: 0 0 10px #008168; +} + +@media screen and (orientation:landscape) { + body { + padding: 30px; + width: calc(100% - 2 * 30px); + height: calc(100% - 2 * 30px); + grid-template-columns: min-content; + justify-content: right; + } + + #season-splash { + align-self: flex-end; + width: 400px; + } + + #countdown-container { + padding: 20px; + padding-left: calc(70px + 20px); + border-radius: 20px; + justify-self: right; + font-size: 20px; + line-height: 15px; + } + + #countdown-title { + margin-bottom: 10px; + } + + .time-value { + font-size: 30px; + font-weight: bold; + line-height: 25px; + } + + .time-label { + font-family: "PT Sans Narrow"; + margin-left: -2px; + margin-right: 5px; + } +} + +@media screen and (orientation:portrait) { + body { + padding: 0 10%; + width: calc(100% - 2 * 10%); + height: 100%; + grid-template-columns: 1fr; + align-content: center; + justify-items: center; + row-gap: 100px; + backdrop-filter: blur(10px); + } + + #season-splash { + grid-row-start: 1; + width: 100%; + } + + #countdown-container { + justify-self: center; + border-radius: 20px; + padding: 40px; + padding-left: calc(170px + 40px); + font-size: 60px; + line-height: 50px; + } + + #countdown-title { + margin-bottom: 10px; + } + + .time-value { + font-size: 80px; + font-weight: bold; + line-height: 70px; + } + + .time-label { + font-family: "PT Sans Narrow"; + margin-left: -10px; + margin-right: 10px; + } +}