From 1d7696c5b8364c00528eacea263334e84553358b Mon Sep 17 00:00:00 2001 From: Sam Sneed <163201376+sam-sneed@users.noreply.github.com> Date: Sat, 10 Aug 2024 10:54:50 -0500 Subject: [PATCH] Add files via upload --- countdown.js | 30 ++++++++++++++++++++++++++++++ index.html | 32 ++++++++++++++++++++++++++++++++ styles.css | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 countdown.js create mode 100644 index.html create mode 100644 styles.css diff --git a/countdown.js b/countdown.js new file mode 100644 index 0000000..48e211e --- /dev/null +++ b/countdown.js @@ -0,0 +1,30 @@ +document.addEventListener('DOMContentLoaded', function () { + // Set the date for January 1st of the following year + const targetDate = new Date(); + targetDate.setFullYear(targetDate.getFullYear() + 1); + targetDate.setMonth(0); + targetDate.setDate(1); + targetDate.setHours(0, 0, 0, 0); + + // Update the countdown every second + setInterval(updateCountdown, 1000); + + function updateCountdown() { + const currentDate = new Date(); + const timeDifference = targetDate - currentDate; + + const days = Math.floor(timeDifference / (1000 * 60 * 60 * 24)); + const hours = Math.floor((timeDifference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); + const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60)); + const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000); + + document.getElementById('days').textContent = formatTime(days); + document.getElementById('hours').textContent = formatTime(hours); + document.getElementById('minutes').textContent = formatTime(minutes); + document.getElementById('seconds').textContent = formatTime(seconds); + } + + function formatTime(time) { + return time < 10 ? `0${time}` : time; + } +}); diff --git a/index.html b/index.html new file mode 100644 index 0000000..4bf1fef --- /dev/null +++ b/index.html @@ -0,0 +1,32 @@ + + + + + + + Year of the Linux Desktop Countdown + + +
+

The year of the Linux desktop is coming soon!

+
+ +
+
+
00
+
Days
+ +
00
+
Hours
+ +
00
+
Minutes
+ +
00
+
Seconds
+
+
+ + + + diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..2aeb082 --- /dev/null +++ b/styles.css @@ -0,0 +1,43 @@ +body { + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + margin: 0; + padding: 0; + background-color: #282c35; + color: white; +} + +header { + text-align: center; + padding: 2rem; + background-color: #1e222b; +} + +h1 { + font-size: 1.5em; +} + +main { + display: flex; + justify-content: center; + align-items: center; + height: 80vh; +} + +#countdown { + display: flex; + justify-content: space-around; + align-items: center; + font-size: 2em; +} + +.countdown-item { + background-color: #1e222b; + color: white; + padding: 0.5em; + border-radius: 5px; + margin: 0 0.3em; +} + +.countdown-label { + text-align: center; +}