Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
GithubMaster212 authored Dec 1, 2024
1 parent 6b8249e commit 643bc5d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
z-index: 1000;
}
.category-container {
margin: 20px 0;
margin: 20px 0; /* Space between categories */
}
.category-title {
margin-left: 60px; /* Space for category title */
margin-left: 100px; /* Increased space for category title */
font-size: 24px; /* Font size for category title */
}
.game-row {
Expand Down Expand Up @@ -88,7 +88,8 @@
<script>
const categories = {
'1': 'Featured',
'2': '2 Player'
'2': '2 Player',
'3': 'Online Multiplayer' // New category added
};

async function loadGames() {
Expand All @@ -98,7 +99,7 @@
const response = await fetch('https://api.github.com/repos/githubmaster212/game/contents/games');
const files = await response.json();

const gamesByCategory = { '1': [], '2': [] }; // Initialize arrays for Featured and 2 Player
const gamesByCategory = { '1': [], '2': [], '3': [] }; // Initialize arrays for Featured, Two Player, and Online Multiplayer

// Categorize games based on filename
for (const file of files) {
Expand All @@ -107,7 +108,7 @@
const row = rowPriority[0];
const priority = rowPriority[1];

// Only add games to Featured (row '1') or Two Player (row '2')
// Only add games to the respective categories based on their row number
if (gamesByCategory[row]) {
const gameData = await fetch(file.download_url).then(res => res.text());
const [title, description, imageUrl, gameUrl] = gameData.split('\n');
Expand Down

0 comments on commit 643bc5d

Please sign in to comment.