-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.html
178 lines (166 loc) · 8.26 KB
/
main.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Happy Valentine's Day My Love 💗💗💗</title>
<link rel="stylesheet" href="quotes.css">
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
</head>
<body>
<div class="main">
<h2>* Choose the day *</h2>
<div class="container">
<a href="rose.html" class="day-link" data-date="2025-02-07">
<div class="rose-day day">
<div class="icon">
<lord-icon src="https://cdn.lordicon.com/jmeofbeb.json" trigger="hover"></lord-icon>
</div>
<div class="info">
<h1 class="day-name">Rose Day</h1>
<p class="date">Feb 07</p>
<div class="countdown" id="countdown-rose"></div>
</div>
</div>
</a>
<a href="propose.html" class="day-link" data-date="2025-02-08">
<div class="propose-day day">
<div class="icon">
<lord-icon src="https://cdn.lordicon.com/etgnxeer.json" trigger="hover"></lord-icon>
</div>
<div class="info">
<h1 class="day-name">Propose Day</h1>
<p class="date">Feb 08</p>
<div class="countdown" id="countdown-propose"></div>
</div>
</div>
</a>
<a href="chocolate.html" class="day-link" data-date="2025-02-09">
<div class="chocolate-day day">
<div class="icon">
<lord-icon src="https://cdn.lordicon.com/mlxonlmo.json" trigger="hover"></lord-icon>
</div>
<div class="info">
<h1 class="day-name">Chocolate Day</h1>
<p class="date">Feb 09</p>
<div class="countdown" id="countdown-chocolate"></div>
</div>
</div>
</a>
<a href="teddy.html" class="day-link" data-date="2025-02-10">
<div class="teddy-day day">
<div class="icon">
<lord-icon src="https://cdn.lordicon.com/mlxonlmo.json" trigger="hover"></lord-icon>
</div>
<div class="info">
<h1 class="day-name">Teddy Day</h1>
<p class="date">Feb 10</p>
<div class="countdown" id="countdown-teddy"></div>
</div>
</div>
</a>
<a href="promise.html" class="day-link" data-date="2025-02-11">
<div class="promise-day day">
<div class="icon">
<lord-icon src="https://cdn.lordicon.com/ibufipbp.json" trigger="hover"></lord-icon>
</div>
<div class="info">
<h1 class="day-name">Promise Day</h1>
<p class="date">Feb 11</p>
<div class="countdown" id="countdown-promise"></div>
</div>
</div>
</a>
<a href="hug.html" class="day-link" data-date="2025-02-12">
<div class="hug-day day">
<div class="icon">
<lord-icon src="https://cdn.lordicon.com/etgnxeer.json" trigger="hover"></lord-icon>
</div>
<div class="info">
<h1 class="day-name">Hug Day</h1>
<p class="date">Feb 12</p>
<div class="countdown" id="countdown-hug"></div>
</div>
</div>
</a>
<a href="kiss.html" class="day-link" data-date="2025-02-13">
<div class="kis-day day">
<div class="icon">
<lord-icon src="https://cdn.lordicon.com/etgnxeer.json" trigger="hover"></lord-icon>
</div>
<div class="info">
<h1 class="day-name">Kiss Day</h1>
<p class="date">Feb 13</p>
<div class="countdown" id="countdown-kiss"></div>
</div>
</div>
</a>
<a href="valentine.html" class="day-link" data-date="2025-02-14">
<div class="valentine-day day">
<div class="icon">
<lord-icon src="https://cdn.lordicon.com/etgnxeer.json" trigger="hover"></lord-icon>
</div>
<div class="info">
<h1 class="day-name">Valentine Day</h1>
<p class="date">Feb 14</p>
<div class="countdown" id="countdown-valentine"></div>
</div>
</div>
</a>
</div>
<div class="copyright-container">
<h3 class="copyright">Created with ❤️ by <a id="instagramProfileLink" href="#" target="_blank"><span id="instagramProfileName"></span></a></h3>
</div>
</div>
<script src="https://cdn.lordicon.com/lordicon.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
// Fetch config.json and update Instagram profile link
fetch('config.json')
.then(response => response.json())
.then(data => {
const instagramProfileLink = document.getElementById('instagramProfileLink');
const instagramProfileNameElement = document.getElementById('instagramProfileName');
instagramProfileLink.href = `https://instagram.com/${data.instagramUsername}`;
instagramProfileNameElement.textContent = data.instagramProfileName;
})
.catch(error => console.error('Error fetching config.json:', error));
// Countdown logic
const dayLinks = document.querySelectorAll('.day-link');
const currentDate = new Date();
dayLinks.forEach(link => {
const dayDate = new Date(link.getAttribute('data-date') + 'T00:00:00+05:30'); // Adjust for IST
const countdownElement = link.querySelector('.countdown');
function updateCountdown() {
const timeDiff = dayDate - new Date(); // Use current time dynamically
if (timeDiff <= 0) {
countdownElement.textContent = 'This day is now available!';
clearInterval(interval);
return;
}
const days = Math.floor(timeDiff / (1000 * 60 * 60 * 24));
const hours = Math.floor((timeDiff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((timeDiff % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((timeDiff % (1000 * 60)) / 1000);
countdownElement.textContent = `Time left: ${days}d ${hours}h ${minutes}m ${seconds}s`;
}
const interval = setInterval(updateCountdown, 1000);
updateCountdown(); // Initial call
link.addEventListener('click', function (event) {
if (new Date() < dayDate) {
event.preventDefault();
countdownElement.textContent = 'This day is not yet available. Please wait...';
}
});
});
// Music playback logic
document.querySelectorAll('.day-link').forEach(link => {
link.addEventListener('click', function (event) {
window.parent.postMessage('startMusic', '*');
});
});
});
</script>
</body>
</html>