Skip to content

Commit

Permalink
Merge pull request #404 from Ayush-may/issue_386
Browse files Browse the repository at this point in the history
Issue 386
  • Loading branch information
Durgesh4993 authored Jul 26, 2024
2 parents 1b383b7 + a9d0f2d commit cfff055
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 22 deletions.
72 changes: 72 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 25 additions & 3 deletions public/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ let data = [];
window.onload = async function () {
data = await getAllContributors("GameSphere-MultiPlayer/Community-Page");

console.log(data.length);
if(document.getElementById('rankingTableBody') == null)
return;

var i = 0;
const top3Fragment = document.createDocumentFragment();
const rankingFragment = document.createDocumentFragment();
Expand Down Expand Up @@ -144,7 +146,7 @@ window.onload = async function () {
console.log("RUNNED");
};

const nav = document.querySelector(".nav"),
let nav = document.querySelector(".nav"),
searchIcon = document.querySelector("#searchIcon"),
navOpenBtn = document.querySelector(".navOpenBtn"),
navCloseBtn = document.querySelector(".navCloseBtn"),
Expand Down Expand Up @@ -227,15 +229,35 @@ document.addEventListener("DOMContentLoaded", function () {
const discordPopup = document.getElementById("discord-popup");
const closeBtn = document.getElementById("close-btn");

if(discordButton == null)
return;

discordButton.addEventListener("click", function () {
discordPopup.style.display = "block";
});

closeBtn.addEventListener("click", function () {
discordPopup.style.display = "none";
discordPopup.remove();
});
});

// document.addEventListener("DOMContentLoaded", function () {
// const discordPopup = document.getElementById("discord-popup");
// const closeBtn = document.getElementById("close-btn");
// const discordButton = document.getElementById("discord-button");
//
// if(discordButton == null)
// return;
//
// discordButton.addEventListener("click", function () {
// discordPopup.style.display = "block";
// });
//
// closeBtn.addEventListener("click", function () {
// discordPopup.style.display = "none";
// });
// });

const success = () => {
showAlert("You have successfully subscribed!", "success");
};
Expand Down
2 changes: 1 addition & 1 deletion server/views/about.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
</nav>

<%- include('partials/rateus') %>
<script src="/js/script.js"></script>
<!-- <script src="/js/script.js"></script>-->

<div class="social-icons">
<button class="toggler"><img src="/images/social1.webp" alt=""></button>
Expand Down
14 changes: 9 additions & 5 deletions server/views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!-- Title of the webpage displayed on the browser tab. -->
<link rel="stylesheet" href="/css/styles.css" />
<!-- Link to an external CSS file for styling. -->
<script src="/public/js/script.js" defer></script>
<!-- <script src="/public/js/script.jsz" defer></script>-->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
Expand Down Expand Up @@ -532,7 +532,7 @@
/* background-color: black; */
}
</style>
<script src="/js/script.js" defer></script>
<!-- <script src="/js/script.js" defer></script>-->
</head>

<body class="page-leaderboard">
Expand Down Expand Up @@ -596,7 +596,7 @@
<li><a href="/about" class="links-hover">About Us</a></li>
<li><a href="https://chromegaming.github.io/Chrome-Gaming-Certification/" class="links-hover">Certificate</a></li>
<li><a class="links-hover" onclick="openRateUs()">Rate Us</a></li>
<script src="/js/script.js" defer></script>
<!-- <script src="/js/script.js" defer></script>-->
<li>
<div class="small-screen-social">
<a href="https://www.youtube.com/@ChromeGamingOn" target="_blank" class="social-icon youtube"></a>
Expand All @@ -622,7 +622,7 @@
</div>
</nav>
<%- include('partials/rateus') %>
<script src="/js/script.js"></script>
<!-- <script src="/js/script.js"></script>-->
<!--==================== SEARCH ====================-->
<div class="search" id="search">
<form action="" class="search__form">
Expand Down Expand Up @@ -1057,6 +1057,10 @@
// { place: 50, name: "Sana" },
// ];
/*
I commented this becoz this script is already being called in script.js (line 39) - Ayush-may
function compare(a, b) {
if (a.contributions < b.contributions) {
return 1;
Expand Down Expand Up @@ -1316,7 +1320,7 @@ subscriptionForm.addEventListener("submit", function (event) {
success();
}
});
*/
</script>

Expand Down
10 changes: 5 additions & 5 deletions server/views/play.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
</nav>

<%- include('partials/rateus') %>
<script src="/js/script.js"></script>
<!-- <script src="/js/script.js"></script>-->

<div class="social-icons">
<button class="toggler"><img src="/images/social1.webp" alt=""></button>
Expand Down Expand Up @@ -450,10 +450,10 @@ const coords = { x: 0, y: 0 };
};
shareButton.addEventListener("click", toggleSocials);
document.querySelector('.toggler').addEventListener('click', function() {
document.querySelector('.social-icons').classList.toggle('show-icons');
});
// no toggler class
// document.querySelector('.toggler').addEventListener('click', function() {
// document.querySelector('.social-icons').classList.toggle('show-icons');
// });
const updateProgress = () =>{
const {scrollTop,scrollHeight} = document.documentElement;
const scrollPercent = `${(scrollTop/(scrollHeight-window.innerHeight)) * 100}%`;
Expand Down
18 changes: 10 additions & 8 deletions server/views/products.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
</nav>

<%- include('partials/rateus') %>
<script src="/js/script.js"></script>
<!-- <script src="/js/script.js"></script>-->

<style>
.border-hover::after {
Expand Down Expand Up @@ -542,9 +542,10 @@
shareButton.addEventListener("click", toggleSocials);
document.querySelector('.toggler').addEventListener('click', function () {
document.querySelector('.social-icons').classList.toggle('show-icons');
});
// no .toggler class
// document.querySelector('.toggler').addEventListener('click', function () {
// document.querySelector('.social-icons').classList.toggle('show-icons');
// });
</script>

Expand Down Expand Up @@ -612,10 +613,11 @@
}
animateCircles();
document.querySelector('.toggler').addEventListener('click', function () {
document.querySelector('.social-icons').classList.toggle('show-icons');
});
// no .toggler class
// document.querySelector('.toggler').addEventListener('click', function () {
// document.querySelector('.social-icons').classList.toggle('show-icons');
// });
</script>
</body>
Expand Down

0 comments on commit cfff055

Please sign in to comment.