Skip to content

Commit

Permalink
Added website counter
Browse files Browse the repository at this point in the history
  • Loading branch information
ygowthamr committed Nov 1, 2024
1 parent d5a7451 commit 73fc9dc
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 6 deletions.
6 changes: 5 additions & 1 deletion blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,11 @@ <h2 class="footer-title secondary-title" >About Us</h2>
</div>

<div>
<img src="https://hits.sh/anshika-26.github.io/WordWise.svg?label=Website%20Views&extraCount=1515&color=30322f&labelColor=F5B3B5" alt="Web views" style="height: 20px;width: 150px;margin-top: 40px;">
<!-- <img src="https://hits.sh/anshika-26.github.io/WordWise.svg?label=Website%20Views&extraCount=1515&color=30322f&labelColor=F5B3B5" alt="Web views" style="height: 20px;width: 150px;margin-top: 40px;"> -->
<div class="containerWebsiteViews">
<div class="containerText"><p>Website Views</p></div>
<div class="containerNumbers"><p id="visitorCount">0</p></div>
</div>
</div>
</div>

Expand Down
6 changes: 5 additions & 1 deletion category.html
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,11 @@ <h2 class="footer-title secondary-title" >About Us</h2>
</div>

<div>
<img src="https://hits.sh/anshika-26.github.io/WordWise.svg?label=Website%20Views&extraCount=1515&color=30322f&labelColor=F5B3B5" alt="Web views" style="height: 20px;width: 150px;margin-top: 40px;">
<!-- <img src="https://hits.sh/anshika-26.github.io/WordWise.svg?label=Website%20Views&extraCount=1515&color=30322f&labelColor=F5B3B5" alt="Web views" style="height: 20px;width: 150px;margin-top: 40px;"> -->
<div class="containerWebsiteViews">
<div class="containerText"><p>Website Views</p></div>
<div class="containerNumbers"><p id="visitorCount">0</p></div>
</div>
</div>
</div>

Expand Down
6 changes: 5 additions & 1 deletion contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,11 @@ <h2 class="footer-title secondary-title">About Us</h2>
<div> <a href="privacy.html" style="color: #520be1e7;">Privacy Policy</a> </div>

<div>
<img src="https://hits.sh/anshika-26.github.io/WordWise.svg?label=Website%20Views&extraCount=1515&color=30322f&labelColor=F5B3B5" alt="Web views" style="height: 20px;width: 150px;margin-top: 40px;">
<!-- <img src="https://hits.sh/anshika-26.github.io/WordWise.svg?label=Website%20Views&extraCount=1515&color=30322f&labelColor=F5B3B5" alt="Web views" style="height: 20px;width: 150px;margin-top: 40px;"> -->
<div class="containerWebsiteViews">
<div class="containerText"><p>Website Views</p></div>
<div class="containerNumbers"><p id="visitorCount">0</p></div>
</div>
</div>
</div>

Expand Down
7 changes: 6 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,11 @@ <h2 class="footer-title secondary-title">About Us</h2>
</div>

<div>
<img src="https://hits.sh/anshika-26.github.io/WordWise.svg?label=Website%20Views&extraCount=1515&color=30322f&labelColor=F5B3B5" alt="Web views" style="height: 20px;width: 150px;margin-top: 40px;">
<!-- <img src="https://hits.sh/anshika-26.github.io/WordWise.svg?label=Website%20Views&extraCount=1515&color=30322f&labelColor=F5B3B5" alt="Web views" style="height: 20px;width: 150px;margin-top: 40px;"> -->
<div class="containerWebsiteViews">
<div class="containerText"><p>Website Views</p></div>
<div class="containerNumbers"><p id="visitorCount">0</p></div>
</div>
</div>
</div>

Expand Down Expand Up @@ -1586,6 +1590,7 @@ <h2 class="footer-title secondary-title mt-5">Connect with us</h2>
const preloader = document.querySelector("#loader");

function Finish_Loader() {
updateVisitorCount();
preloader.style.display = "none";
}
</script>
Expand Down
6 changes: 5 additions & 1 deletion privacy.html
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,11 @@ <h2 class="footer-title secondary-title">About Us</h2>
</div>
<div> <a href="privacy.html" style="color: #520be1e7;">Privacy Policy</a> </div>
<div>
<img src="https://hits.sh/anshika-26.github.io/WordWise.svg?label=Website%20Views&extraCount=1515&color=30322f&labelColor=F5B3B5" alt="Web views" style="height: 20px;width: 150px;margin-top: 40px;">
<!-- <img src="https://hits.sh/anshika-26.github.io/WordWise.svg?label=Website%20Views&extraCount=1515&color=30322f&labelColor=F5B3B5" alt="Web views" style="height: 20px;width: 150px;margin-top: 40px;"> -->
<div class="containerWebsiteViews">
<div class="containerText"><p>Website Views</p></div>
<div class="containerNumbers"><p id="visitorCount">0</p></div>
</div>
</div>
</div>

Expand Down
11 changes: 11 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,14 @@ function closeOnOutsideClick(event) {
document.removeEventListener("click", closeOnOutsideClick); // Remove the listener
}
}

function updateVisitorCount() {

let visitorCount = localStorage.getItem('visitorCount') ? parseInt(localStorage.getItem('visitorCount')) : 0;

visitorCount++;

localStorage.setItem('visitorCount', visitorCount);

document.getElementById('visitorCount').innerText = visitorCount;
}
6 changes: 5 additions & 1 deletion start_writing.html
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,11 @@ <h2 class="footer-title secondary-title" >About Us</h2>
</div>

<div>
<img src="https://hits.sh/anshika-26.github.io/WordWise.svg?label=Website%20Views&extraCount=1515&color=30322f&labelColor=F5B3B5" alt="Web views" style="height: 20px;width: 150px;margin-top: 40px;">
<!-- <img src="https://hits.sh/anshika-26.github.io/WordWise.svg?label=Website%20Views&extraCount=1515&color=30322f&labelColor=F5B3B5" alt="Web views" style="height: 20px;width: 150px;margin-top: 40px;"> -->
<div class="containerWebsiteViews">
<div class="containerText"><p>Website Views</p></div>
<div class="containerNumbers"><p id="visitorCount">0</p></div>
</div>
</div>
</div>

Expand Down
23 changes: 23 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3835,4 +3835,27 @@ h1 + p, p + p {
.comment-icon{
font-size: 14px;
color: var(--text-color);
}

.containerWebsiteViews {
display: flex;
justify-content: space-between;
border-radius: 10px;
margin-top: 1vh;
background-color: #f8b5b5;
width: 10vw;
}
.containerText p,
.containerNumbers p {
margin-left: 10px;
font-weight: 600;
}
.containerNumbers {
width: 2.5vw;
background-color: #403c3c;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
}
.containerNumbers p {
color: white;
}

0 comments on commit 73fc9dc

Please sign in to comment.