added games found/view counter on sidemenu

This commit is contained in:
IdleEndeavor 2021-08-28 14:02:37 +03:00
parent 38c76d2260
commit 2afc05eb10
3 changed files with 36 additions and 0 deletions

View File

@ -71,6 +71,25 @@ html, body {
position: fixed;
}
#foundcounter {
padding: 50px;
padding-left: 0;
color: white;
font-family: 'Roboto';
bottom: 10px;
width: 100%;
position: fixed;
}
#foundcounterno {
padding: 50px;
padding-left: 0;
color: white;
font-family: 'Roboto';
bottom: 30px;
width: 100%;
position: fixed;
}
.sidebar a:hover {
color: gray;

View File

@ -23,11 +23,25 @@
<img src="img/favicon.png" onclick="location.href='index.html';">
<li><a href="sites-indexed.html"> Sites Indexed </a></li>
<li><a href="terms.html"> Terms of Use </a></li>
<h4 id="foundcounterno" class="count">0</h4>
<h4 id="foundcounter">Games Found</h4>
<h4>Copyright <script type="text/javascript">document.write(new Date().getFullYear());</script><br>IdleEndeavor</h4>
</ul>
</nav>
</div>
<script type="text/javascript">
function updateCounter() {
fetch('https://api.countapi.xyz/update/ravegamesearch/ravesearch/?amount=1')
.then(res => res.json())
.then(data => counterElement.innerHTML = data.value)
}
updateCounter()
counterElement = document.getElementsByClassName('count')[0];
</script>
<!-- Search Box -->
<div id="search-box" class="search">
<img src="img/search-logo.png">

3
view-counter.txt Normal file
View File

@ -0,0 +1,3 @@
https://api.countapi.xyz/create?namespace=ravegamesearch&key=ravesearch&value=0
https://api.countapi.xyz/get/ravegamesearch/ravesearch
https://api.countapi.xyz/update/ravegamesearch/ravesearch/?amount=1