summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--index.html40
1 files changed, 22 insertions, 18 deletions
diff --git a/index.html b/index.html
index 9622bff..e51e31c 100644
--- a/index.html
+++ b/index.html
@@ -301,26 +301,30 @@
});
</script>
- <script>
- function updateClockAndCalendar() {
- const now = new Date();
- const hours = now.getHours();
- const minutes = now.getMinutes();
+ <script>
+ let colonVisible = true;
- const displayHours = hours < 10 ? `0${hours}` : hours;
- const displayMinutes = minutes < 10 ? `0${minutes}` : minutes;
- document.getElementById('time').textContent = `${displayHours}:${displayMinutes}`;
-
- const days = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'];
- const months = ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'];
- document.getElementById('day').textContent = days[now.getDay()];
- document.getElementById('date').textContent = now.getDate();
- document.getElementById('month').textContent = months[now.getMonth()];
- }
+ function updateClockAndCalendar() {
+ const now = new Date();
+ const hours = now.getHours();
+ const minutes = now.getMinutes();
+ const displayHours = hours < 10 ? `0${hours}` : hours;
+ const displayMinutes = minutes < 10 ? `0${minutes}` : minutes;
- updateClockAndCalendar();
- setInterval(updateClockAndCalendar, 1000);
- </script>
+ const colon = colonVisible ? ':' : ' ';
+ document.getElementById('time').textContent = `${displayHours}${colon}${displayMinutes}`;
+ colonVisible = !colonVisible;
+
+ const days = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'];
+ const months = ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'];
+ document.getElementById('day').textContent = days[now.getDay()];
+ document.getElementById('date').textContent = now.getDate();
+ document.getElementById('month').textContent = months[now.getMonth()];
+ }
+
+ updateClockAndCalendar();
+ setInterval(updateClockAndCalendar, 1000);
+ </script>
</body>
</html>