Skip to content

Commit 601cc98

Browse files
authored
Merge pull request #31 from GDSC-RCCIIT/rishicds-patch-1
Update index.html
2 parents 844ea9a + 8b9cd72 commit 601cc98

File tree

1 file changed

+103
-0
lines changed

1 file changed

+103
-0
lines changed

index.html

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,5 +169,108 @@ <h2>The Final Call <span class="laughing-emoji">😂</span></h2>
169169
</div>
170170
<script src="script.js"></script>
171171
</body>
172+
<!-- Add this HTML just before your footer -->
173+
<div class="visitor-counter">
174+
<div class="counter-label">VISITORS</div>
175+
<div class="counter-display">
176+
<div class="counter-dot"></div>
177+
<span id="visitorCount">0000</span>
178+
</div>
179+
</div>
180+
181+
<!-- Add this CSS to your existing styles.css -->
182+
<style>
183+
.visitor-counter {
184+
position: fixed;
185+
bottom: 20px;
186+
right: 20px;
187+
background: #000;
188+
border: 2px solid #0f0;
189+
padding: 10px;
190+
font-family: monospace;
191+
color: #0f0;
192+
z-index: 1000;
193+
box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
194+
}
195+
196+
.counter-label {
197+
font-size: 12px;
198+
text-align: center;
199+
margin-bottom: 5px;
200+
text-transform: uppercase;
201+
letter-spacing: 2px;
202+
}
203+
204+
.counter-display {
205+
display: flex;
206+
align-items: center;
207+
gap: 8px;
208+
}
209+
210+
.counter-dot {
211+
width: 8px;
212+
height: 8px;
213+
background-color: #0f0;
214+
border-radius: 50%;
215+
animation: pulse 2s infinite;
216+
}
217+
218+
#visitorCount {
219+
font-size: 24px;
220+
font-weight: bold;
221+
font-family: 'Courier New', monospace;
222+
}
223+
224+
@keyframes pulse {
225+
0% { opacity: 1; }
226+
50% { opacity: 0.3; }
227+
100% { opacity: 1; }
228+
}
229+
230+
/* Add some hover effects to match your theme */
231+
.visitor-counter:hover {
232+
transform: scale(1.05);
233+
transition: transform 0.3s ease;
234+
box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
235+
}
236+
</style>
237+
238+
239+
<script>
240+
// Initialize the counter
241+
function initVisitorCounter() {
242+
// Try to get the count from localStorage
243+
let count = localStorage.getItem('visitorCount');
244+
245+
if (!count) {
246+
// If no count exists, start with a random number between 1000-9999
247+
count = 93;
248+
localStorage.setItem('visitorCount', count);
249+
} else {
250+
// If returning visitor, increment the count
251+
count = parseInt(count) + 1;
252+
localStorage.setItem('visitorCount', count);
253+
}
254+
255+
256+
updateCounterDisplay(count);
257+
258+
259+
setInterval(() => {
260+
count++;
261+
localStorage.setItem('visitorCount', count);
262+
updateCounterDisplay(count);
263+
}, 60000);
264+
}
265+
266+
267+
function updateCounterDisplay(count) {
268+
const countDisplay = document.getElementById('visitorCount');
269+
countDisplay.textContent = count.toString().padStart(4, '0');
270+
}
271+
272+
// Initialize when the page loads
273+
document.addEventListener('DOMContentLoaded', initVisitorCounter);
274+
</script>
172275
</html>
173276

0 commit comments

Comments
 (0)