forked from GSSoC24/Postman-Challenge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
4,438 additions
and
760 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = { | ||
root: true, | ||
env: { browser: true, es2020: true }, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:react/recommended', | ||
'plugin:react/jsx-runtime', | ||
'plugin:react-hooks/recommended', | ||
], | ||
ignorePatterns: ['dist', '.eslintrc.cjs'], | ||
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, | ||
settings: { react: { version: '18.2' } }, | ||
plugins: ['react-refresh'], | ||
rules: { | ||
'react/jsx-no-target-blank': 'off', | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# React + Vite | ||
|
||
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. | ||
|
||
Currently, two official plugins are available: | ||
|
||
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh | ||
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,95 +1,13 @@ | ||
<!DOCTYPE html> | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Leaderboard</title> | ||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
margin: 20px; | ||
text-align: center; | ||
} | ||
img { | ||
max-width: 100%; | ||
height: auto; | ||
} | ||
table { | ||
width: 100%; | ||
border-collapse: collapse; | ||
margin-top: 20px; | ||
} | ||
th, td { | ||
padding: 8px; | ||
text-align: left; | ||
border-bottom: 1px solid #ddd; | ||
} | ||
th { | ||
background-color: #ff6600; | ||
} | ||
.highlight { | ||
color: orange; | ||
font-weight: bold; | ||
} | ||
.description { | ||
margin: 20px 0; | ||
font-size: 1.2em; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<img src="logo.png" alt="GirlScript Summer Of Code Logo"> | ||
<h1>Campus ambassador Leaderboard</h1> | ||
<div class="description"> | ||
Get ready to climb the ranks and win big! As a | ||
<span class="highlight">GirlScript Summer of Code</span> campus ambassador, | ||
your influence is invaluable. We're excited to introduce the leaderboard, | ||
your gateway to exclusive rewards. For every successful referral who completes | ||
certification and contributes a merged PR to the designated Postman Challenge | ||
GitHub repo, you earn a whopping 50 points. The campus ambassador with the highest | ||
score will be showered with amazing goodies and surprises. | ||
</div> | ||
<table id="leaderboardTable"> | ||
<thead> | ||
<tr> | ||
<th>Rank</th> | ||
<th>Name</th> | ||
<th>Referral Code</th> | ||
<th>Number of Certifications</th> | ||
<th>Score</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
</tbody> | ||
</table> | ||
<footer> | ||
<img src="footer.png" alt="GirlScript Summer Of Code Logo"> | ||
</footer> | ||
<script> | ||
function updateLeaderboard() { | ||
fetch('/api/leaderboard') | ||
.then(response => response.json()) | ||
.then(leaderboard => { | ||
const tableBody = document.getElementById('leaderboardTable').getElementsByTagName('tbody')[0]; | ||
tableBody.innerHTML = ''; | ||
|
||
leaderboard.forEach((item, index) => { | ||
const row = tableBody.insertRow(); | ||
row.insertCell(0).textContent = index + 1; // Rank | ||
row.insertCell(1).textContent = item['Name']; | ||
row.insertCell(2).textContent = item['Referral Code']; | ||
row.insertCell(3).textContent = item['Number of Certifications']; | ||
row.insertCell(4).textContent = item['Number of Certifications'] * 50; // Score | ||
}); | ||
}) | ||
.catch(error => console.error('Error loading the leaderboard data:', error)); | ||
} | ||
|
||
// Update the leaderboard every 3 seconds | ||
setInterval(updateLeaderboard, 3000); | ||
|
||
// Initial load | ||
updateLeaderboard(); | ||
</script> | ||
</body> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>GSSOC'24 | CA Leaderboard</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.jsx"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.