Only.games.github -

.game-grid display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.8rem; max-width: 1200px; margin: 0 auto;

async function loadGames() const res = await fetch('games.json'); const data = await res.json(); const grid = document.getElementById('gameGrid'); grid.innerHTML = data.games.map(game => ` <a href="$game.path" class="game-card" target="_top"> <div class="game-thumb">$game.thumb</div> <div class="game-title">$game.title</div> <div class="game-desc">$game.desc</div> </a> `).join(''); only.games.github

.game-card:hover transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0,0,0,0.4); border-color: #5b6e8c; ├── assets/ │ ├── favicon

footer text-align: center; margin-top: 4rem; font-size: 0.8rem; color: #4a5568; just games

only.games.github Enable GitHub Pages in Settings > Pages > Source = main (root) .

Your live URL will be: https://<your-username>.github.io/only.games.github only.games.github/ ├── index.html ├── style.css ├── games/ │ ├── snake/ │ │ ├── index.html │ │ ├── script.js │ │ └── style.css │ ├── tetris/ │ │ └── ... │ └── platformer/ │ └── ... ├── assets/ │ ├── favicon.ico │ └── placeholder.png └── README.md 4. Core HTML (index.html) <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> <title>only.games — classic arcade</title> <link rel="stylesheet" href="style.css"> <link rel="icon" type="image/x-icon" href="assets/favicon.ico"> </head> <body> <header> <h1>🎮 only.games</h1> <p>no launchers. no logins. just games.</p> </header> <main class="game-grid" id="gameGrid"> <!-- dynamically loaded from games.json --> </main> <footer> <span>⚡ hosted on GitHub Pages</span> </footer> <script src="script.js"></script> </body> </html> 5. Style (style.css) * margin: 0; padding: 0; box-sizing: border-box;

Leave a Reply