Skip to content

Commit

Permalink
Merge pull request #103 from yamini1183/main
Browse files Browse the repository at this point in the history
feat: global visitors counter
  • Loading branch information
AdityaSinha2305 authored Oct 28, 2024
2 parents 41908e2 + c285d06 commit ab8c576
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 18 deletions.
7 changes: 5 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,17 @@
<img src="assets/img1.jpg" class="bg" alt="Background Image" />
<div class="container-fluid">
<div id="visitor-count" class="visitor-count">
<p>Total Visits: <span id="count">0</span></p>
<p>Total Visits: <div id="sfc8fakp1k27d64t5yc1x4p4xmjtczfjrqb"></div>
<script type="text/javascript" src="https://counter6.optistats.ovh/private/counter.js?c=8fakp1k27d64t5yc1x4p4xmjtczfjrqb&down=async" async></script>
<noscript><a href="https://www.freecounterstat.com" title="free hit counter"><img src="https://counter6.optistats.ovh/private/freecounterstat.php?c=8fakp1k27d64t5yc1x4p4xmjtczfjrqb" border="0" title="free hit counter" alt="free hit counter"></a></noscript>
</p>
</div>
<!-- Toggle Captcha Menu -->
<div class="toggleMenu">
<button class="toggleCaptchaBtn" id="textCaptchaBtn">Text</button>
<button class="toggleCaptchaBtn" id="mathCaptchaBtn">Math</button>
</div>

<!-- Text Captcha -->
<div class="captcha-container" id="textCaptcha" style="display: block">
<div class="header" style="font-size: 40px"><b>TEXT CAPTCHA</b></div>
Expand Down
14 changes: 0 additions & 14 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,6 @@ const readMathBtn = document.querySelector("#readMath");
const submitMathBtn = document.querySelector("#submitMathBtn");
const changeMathBtn = document.querySelector("#changeMathBtn");

function updateVisitorCount() {
const countElement = document.getElementById('count');
let visitCount = localStorage.getItem('visitCount');

if (visitCount) {
visitCount = parseInt(visitCount) + 1;
localStorage.setItem('visitCount', visitCount);
} else {
visitCount = 1;
localStorage.setItem('visitCount', visitCount);
}
countElement.textContent = visitCount;
}
document.addEventListener("DOMContentLoaded", updateVisitorCount);

let captchaType = "text";

Expand Down
4 changes: 2 additions & 2 deletions styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ body {
}

.visitor-count {
background: linear-gradient(45deg, #4CAF50, #2196F3);
background: linear-gradient(45deg, #013103, #02223c);
color: #fff;
text-align: center;
padding: 8px 16px;
padding: 2px 16px;
border-radius: 8px;
font-size: 1.2rem;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
Expand Down

0 comments on commit ab8c576

Please sign in to comment.