Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
178 lines (159 loc) · 5.83 KB
/
Copy pathindex.html
File metadata and controls
178 lines (159 loc) · 5.83 KB
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">
<title>WhatsApp Link Countdown</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f0f0f0;
}
.container {
max-width: 400px;
margin: auto;
padding: 20px;
border: 1px solid #ddd;
border-radius: 8px;
background-color: white;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.countdown-title {
text-align: center;
margin-bottom: 20px;
color: #333;
}
.countdown-box {
margin-bottom: 20px;
padding: 10px;
background-color: #f0f8ff;
border-radius: 8px;
}
.countdown-title-inner {
margin-bottom: 10px;
color: #007bff;
text-align: center;
}
.countdown-units {
display: flex;
justify-content: space-around;
}
.countdown-unit {
text-align: center;
}
.countdown-unit-value {
font-size: 18px;
font-weight: bold;
color: #007bff;
}
.countdown-unit-label {
font-size: 12px;
color: #555;
text-transform: capitalize;
}
.status {
margin-bottom: 20px;
}
#openLinkBtn {
width: 100%;
padding: 10px;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s ease;
}
</style>
</head>
<body>
<div class="container">
<h2 class="countdown-title">WhatsApp Link Countdown</h2>
<div class="countdown-box">
<h4 class="countdown-title-inner">Time Remaining</h4>
<div class="countdown-units">
<div class="countdown-unit">
<div id="days" class="countdown-unit-value">0</div>
<div class="countdown-unit-label">days</div>
</div>
<div class="countdown-unit">
<div id="hours" class="countdown-unit-value">0</div>
<div class="countdown-unit-label">hours</div>
</div>
<div class="countdown-unit">
<div id="minutes" class="countdown-unit-value">0</div>
<div class="countdown-unit-label">minutes</div>
</div>
<div class="countdown-unit">
<div id="seconds" class="countdown-unit-value">0</div>
<div class="countdown-unit-label">seconds</div>
</div>
</div>
</div>
<div class="status">
<strong>Current Status:</strong>
<p id="statusText">Link Not Yet Accessible</p>
</div>
<button id="openLinkBtn">Link Locked</button>
</div>
<script>
// Configuration
const WHATSAPP_LINK = "https://aassanhai.github.io/Aboli-Birthday/";
const TARGET_DATE = "2024-12-14";
// DOM Elements
const daysEl = document.getElementById('days');
const hoursEl = document.getElementById('hours');
const minutesEl = document.getElementById('minutes');
const secondsEl = document.getElementById('seconds');
const statusTextEl = document.getElementById('statusText');
const openLinkBtn = document.getElementById('openLinkBtn');
// Calculate Time Remaining
function calculateTimeRemaining() {
const now = new Date();
const target = new Date(TARGET_DATE);
const diff = target.getTime() - now.getTime();
if (diff > 0) {
const days = Math.floor(diff / (1000 * 60 * 60 * 24));
const hours = Math.floor((diff / (1000 * 60 * 60)) % 24);
const minutes = Math.floor((diff / (1000 * 60)) % 60);
const seconds = Math.floor((diff / 1000) % 60);
return { days, hours, minutes, seconds };
}
return { days: 0, hours: 0, minutes: 0, seconds: 0 };
}
// Update Countdown
function updateCountdown() {
const timeRemaining = calculateTimeRemaining();
daysEl.textContent = timeRemaining.days;
hoursEl.textContent = timeRemaining.hours;
minutesEl.textContent = timeRemaining.minutes;
secondsEl.textContent = timeRemaining.seconds;
const currentDate = new Date();
const target = new Date(TARGET_DATE);
const isLinkAccessible = currentDate >= target;
statusTextEl.textContent = isLinkAccessible ? "Link Available" : "Link Not Yet Accessible";
statusTextEl.style.color = isLinkAccessible ? "green" : "red";
openLinkBtn.textContent = isLinkAccessible ? "Open WhatsApp Link" : "Link Locked";
openLinkBtn.style.backgroundColor = isLinkAccessible ? "green" : "gray";
}
// Handle Link Opening
function handleOpenLink() {
const currentDate = new Date();
const target = new Date(TARGET_DATE);
if (currentDate < target) {
alert("I know u want click this link BUT Have patience, Good things always come with time.");
return;
}
window.open(WHATSAPP_LINK, "_blank");
}
// Event Listener
openLinkBtn.addEventListener('click', handleOpenLink);
// Initial Update and Timer
updateCountdown();
setInterval(updateCountdown, 1000);
</script>
</body>
</html>