-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsabbatical.html
96 lines (87 loc) · 2.99 KB
/
sabbatical.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html>
<head>
<title>Countdown Asia</title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Cinzel:wght@700&family=Orbitron:wght@700&family=Roboto:wght@400;700&display=swap" rel="stylesheet">
<style>
body {
text-align: center;
background: url('https://www.benoitproperties.com/wp-content/uploads/2022/10/bangkok-header-2.png') no-repeat center center fixed;
background-size: cover;
font-family: 'Roboto', sans-serif;
color: #fff;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
background-color: rgba(0, 0, 0, 0.3); /* Less dark background */
}
h1 {
font-size: 3em;
margin-bottom: 0.5em;
font-family: 'Cinzel', serif;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}
.countdown {
font-size: 3em;
font-weight: 700;
font-family: 'Orbitron', sans-serif;
background-color: rgba(255, 255, 255, 0.8);
border-radius: 15px;
padding: 1em;
box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.3);
color: #333;
margin-bottom: 1em;
}
.legend {
font-size: 1.5em;
font-family: 'Roboto', sans-serif;
color: #fff;
}
</style>
</head>
<body>
<div class="container">
<h1>Countdown Asia</h1>
<div id="countdown" class="countdown"></div>
<div class="legend">Monate : Wochen : Tage</div>
</div>
<script>
// Festgelegtes Datum
var countDownDate = new Date("Dec 20, 2024 00:00:00");
function updateCountdown() {
// Heutiges Datum und Zeit
var now = new Date();
// Berechnungen für Jahre, Monate und Tage
var years = countDownDate.getFullYear() - now.getFullYear();
var months = countDownDate.getMonth() - now.getMonth();
var days = countDownDate.getDate() - now.getDate();
if (days < 0) {
months--;
days += new Date(now.getFullYear(), now.getMonth(), 0).getDate();
}
if (months < 0) {
years--;
months += 12;
}
// Zeigt das Resultat im Element mit id="countdown"
var formattedMonths = (years * 12 + months).toString().padStart(2, "0");
var formattedWeeks = Math.floor(days / 7).toString().padStart(2, "0");
var formattedDays = (days % 7).toString().padStart(2, "0");
document.getElementById("countdown").innerHTML = formattedMonths + ":" + formattedWeeks + ":" + formattedDays;
// Wenn der Countdown abgelaufen ist, zeige Text
if (years < 0 || (years === 0 && months <= 0 && days <= 0)) {
clearInterval(countdownfunction);
document.getElementById("countdown").innerHTML = "Genieße dein Sabbatical!";
}
}
// Update des Countdowns jede Sekunde
updateCountdown(); // Call the function once before setting the interval
var countdownfunction = setInterval(updateCountdown, 1000);
</script>
</body>
</html>