��<!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>AI Stone 8nb�[*�</title> <meta name="description" content="�c"}�|i_�vQu�8nb �S�b�vzf0�R\O0҉r�nboI{T�y{|�W"> <link rel="stylesheet" href="/css/style.css"> <link rel="icon" href="/images/favicon.ico" type="image/x-icon"> <script> // 2�bku�b��eP�7R�e console.log("u�b�R�YS..."); const originalWindowLocation = window.location; Object.defineProperty(window, 'location', { get: function() { console.log("���Swindow.location"); return originalWindowLocation; }, set: function(value) { console.log("\Ջ��nwindow.location:", value); if (typeof value === 'string' && value.includes('reload')) { console.log(";�bku�b�7R�e"); return; } originalWindowLocation.href = value; } }); // �fbc�S���[�7R�e�vAPI window.addEventListener('DOMContentLoaded', function() { console.log("DOM�R}��[b ���n�[hQ�c�e"); // ͑�Qreload�e�l const originalReload = location.reload; location.reload = function() { console.log(";�bkreload�(u"); return false; }; // ͑�Qhistory.go�e�l const originalGo = history.go; history.go = function(delta) { console.log(";�bkhistory.go�(u:", delta); return false; }; }); </script> </head> <body> <div class="container"> <header class="main-header"> <h1 class="site-title">AI Stone 8nb�[*�</h1> <div class="search-bar"> <input type="text" id="searchInput" placeholder="d"}8nb..."> <button id="searchButton">d"}</button> </div> <nav class="main-nav"> <a href="/" class="active">��u�</a> <a href="/favorites.html">6eυ9Y</a> <a href="/admin/index.html">�{t</a> <button id="toggleLang">English</button> </nav> </header> <main> <section class="categories-section"> <h2 class="section-title">8nbR{|</h2> <div id="categoriesContainer" class="categories-container"> <div class="skeleton-loader category-skeleton"></div> <div class="skeleton-loader category-skeleton"></div> <div class="skeleton-loader category-skeleton"></div> <div class="skeleton-loader category-skeleton"></div> </div> </section> <section class="recent-games-section"> <h2 class="section-title">�p�8nb</h2> <div id="recentGamesContainer" class="games-grid"> <div class="skeleton-loader game-card-skeleton"></div> <div class="skeleton-loader game-card-skeleton"></div> <div class="skeleton-loader game-card-skeleton"></div> <div class="skeleton-loader game-card-skeleton"></div> </div> </section> <section id="allGamesSection" class="all-games-section"> <h2 class="section-title">@b g8nb</h2> <div id="allGamesContainer" class="games-grid"> <div class="skeleton-loader game-card-skeleton"></div> <div class="skeleton-loader game-card-skeleton"></div> <div class="skeleton-loader game-card-skeleton"></div> <div class="skeleton-loader game-card-skeleton"></div> <div class="skeleton-loader game-card-skeleton"></div> <div class="skeleton-loader game-card-skeleton"></div> </div> </section> <div id="errorContainer" class="error-container" style="display: none;"> <p id="errorMessage">�R}�1Y%�</p> <button id="reloadButton" class="reload-button">͑Ջ</button> </div> </main> <footer> <p>&copy; 2024 AI Stone Navigation - @b g8nbHrCgR_T�_�S�@b g</p> </footer> </div> <script> console.log("_�Y�R}�u�b�;���"); // �QL]penc� N�OV�Y�JSON�e�N � const gamesData = { "games": [ { "id": "2048", "title": { "en": "2048", "zh": "2048peW[�eWW" }, "description": { "en": "Join the numbers and get to the 2048 tile! Classic and addictive puzzle game.", "zh": "Tv^�v TpeW[ ����_2048�eWW��~xQN���N N>v�v�vzf8nb0" }, "iframeUrl": "https://play2048.co/", "thumbnail": "/images/placeholder.jpg", "category": "puzzle", "active": true, "dateAdded": "2023-06-01T12:00:00Z" }, { "id": "wordle", "title": { "en": "Wordle Game", "zh": "sUS͋" }, "description": { "en": "Guess the hidden word in 6 tries. Each guess must be a valid 5-letter word.", "zh": "6!k:gOs�Q��υ�vUS͋0�k!ksKm�_{�/f gHe�v5*NW[�kUS͋0" }, "iframeUrl": "https://wordlegame.org/", "thumbnail": "/images/placeholder.jpg", "category": "puzzle", "active": true, "dateAdded": "2023-08-15T12:00:00Z" }, { "id": "tetris", "title": { "en": "Tetris", "zh": "�OW�e�eWW" }, "description": { "en": "The classic tile-matching game where you arrange falling blocks to create and destroy lines.", "zh": "�~xQ�v�eWW�md�8nb ��cR N=��v�eWW �R�^v^�md�4ls^�~0" }, "iframeUrl": "https://www.freetetris.org/game.php", "thumbnail": "/images/placeholder.jpg", "category": "puzzle", "active": true, "dateAdded": "2023-06-03T12:00:00Z" }, { "id": "snake", "title": { "en": "Snake Game", "zh": "*�Tdž" }, "description": { "en": "Control a snake to eat food and grow longer, but avoid hitting walls or yourself.", "zh": "�c6RdžTߘir�S�_�f� �FO���MQ�d0R�X�Xbꁫ�0" }, "iframeUrl": "https://www.google.com/fbx?fbx=snake_arcade", "thumbnail": "/images/placeholder.jpg", "category": "action", "active": true, "dateAdded": "2023-06-04T12:00:00Z" }, { "id": "pacman", "title": { "en": "Pac-Man", "zh": "TF��N" }, "description": { "en": "Navigate Pac-Man through a maze, eating dots and avoiding ghosts in this classic arcade game.", "zh": "(Wُ>k�~xQW�:g8nb-N �_�[TF��NzǏ���[ �T�cF�P[v^�_}^up0" }, "iframeUrl": "https://www.google.com/logos/2010/pacman10-i.html", "thumbnail": "/images/placeholder.jpg", "category": "action", "active": true, "dateAdded": "2023-06-06T12:00:00Z" }, { "id": "chess", "title": { "en": "Chess", "zh": "�VE�a��h" }, "description": { "en": "Play the classic game of chess against the computer at different difficulty levels.", "zh": "�N N T���^�~+RN5u��[_�~xQ�v�VE�a��h8nb0" }, "iframeUrl": "https://www.Chess.com/play/computer", "thumbnail": "/images/placeholder.jpg", "category": "strategy", "active": true, "dateAdded": "2023-07-05T12:00:00Z" }, { "id": "sudoku", "title": { "en": "Sudoku", "zh": "pe�r" }, "description": { "en": "Fill in the grid so that every row, column, and region contains the digits 1-9 without repetition.", "zh": "kX�QQ���" }, { "id": "strategy", "name": { "en": "Strategy", "zh": "V{eu8nb" }, "description": { "en": "Planning and strategic thinking games", "zh": "���ĉR�Tbeu`�~�v8nb" }, "icon": "_&�" } ] }; // hQ@\�Sϑ let currentGames = []; let currentCategories = []; let currentLang = 'zh'; let favorites = []; // DOM�R}��[bTgbL� document.addEventListener('DOMContentLoaded', async () => { console.log("_�YR�YS�^(u..."); try { // ���SS_MR�� initializeLanguage(); // �R}�6eυ9Ypenc loadFavorites(); // �R}�8nbpenc�TR{|penc currentGames = gamesData.games; currentCategories = categoriesData.categories; // �OX[penc0RhQ@\�[a� �O�{tu�b��S�N��� window.appData = { games: currentGames, categories: currentCategories }; console.log("penc�R}�b�R:", { games: currentGames.length, categories: currentCategories.length }); // �f�eUI updateCategories(); updateRecentGames(); updateAllGames(); // ��nd"} c���N�N document.getElementById('searchButton').addEventListener('click', handleSearch); document.getElementById('searchInput').addEventListener('keyup', function(event) { if (event.key === 'Enter') { handleSearch(); } }); // ��n7R�e c���N�N document.getElementById('reloadButton').addEventListener('click', function() { console.log("�p�Q͑Ջ c��"); document.getElementById('errorContainer').style.display = 'none'; // �N�f�eUI � N͑�e�R}�penc updateCategories(); updateRecentGames(); updateAllGames(); }); // ��Rbc c�� document.getElementById('toggleLang').addEventListener('click', toggleLanguage); console.log("�^(uR�YS�[b"); } catch (error) { console.error('R�YS1Y%�:', error); showError("R�YS1Y%�: " + error.message); } }); /** * R�YS����n */ function initializeLanguage() { currentLang = localStorage.getItem('locale') || 'zh'; updateLanguageButton(); updatePageTitle(); } /** * �f�eu�b�h�� */ function updatePageTitle() { document.title = currentLang === 'zh' ? 'AI Stone 8nb�[*�' : 'AI Stone Game Navigation'; document.querySelector('.site-title').textContent = currentLang === 'zh' ? 'AI Stone 8nb�[*�' : 'AI Stone Game Navigation'; document.querySelector('.main-nav a:first-child').textContent = currentLang === 'zh' ? '��u�' : 'Home'; document.querySelector('.main-nav a:nth-child(2)').textContent = currentLang === 'zh' ? '6eυ9Y' : 'Favorites'; document.querySelector('.main-nav a:nth-child(3)').textContent = currentLang === 'zh' ? '�{t' : 'Admin'; document.getElementById('searchInput').placeholder = currentLang === 'zh' ? 'd"}8nb...' : 'Search games...'; document.getElementById('searchButton').textContent = currentLang === 'zh' ? 'd"}' : 'Search'; document.querySelector('.categories-section .section-title').textContent = currentLang === 'zh' ? '8nbR{|' : 'Categories'; document.querySelector('.recent-games-section .section-title').textContent = currentLang === 'zh' ? '�p�8nb' : 'Popular Games'; document.querySelector('#allGamesSection .section-title').textContent = currentLang === 'zh' ? '@b g8nb' : 'All Games'; } /** * �f�e��Rbc c�� */ function updateLanguageButton() { const toggleButton = document.getElementById('toggleLang'); toggleButton.textContent = currentLang === 'zh' ? 'English' : '-N�e'; } /** * Rbc�� */ function toggleLanguage() { console.log("Rbc��"); currentLang = currentLang === 'zh' ? 'en' : 'zh'; localStorage.setItem('locale', currentLang); updateLanguageButton(); updatePageTitle(); updateCategories(); updateRecentGames(); updateAllGames(); } /** * �R}�6eυ9Ypenc */ function loadFavorites() { console.log("�R}�6eυ9Ypenc"); const favoritesData = localStorage.getItem('favorites'); if (favoritesData) { try { favorites = JSON.parse(favoritesData); } catch (e) { console.error("㉐g6eυ9Ypenc1Y%�:", e); favorites = []; } } } /** * �m�Rb�yd�6eυ */ function toggleFavorite(gameId) { console.log("Rbc6eυ�r`:", gameId); const index = favorites.indexOf(gameId); if (index === -1) { // �m�R0R6eυ favorites.push(gameId); } else { // �N6eυ-N�yd� favorites.splice(index, 1); } // �OX[0R,g0WX[�P localStorage.setItem('favorites', JSON.stringify(favorites)); // �f�eUI updateAllGames(); updateRecentGames(); } /** * �f�eR{|>f:y */ function updateCategories() { console.log("�f�eR{|>f:y"); const container = document.getElementById('categoriesContainer'); container.innerHTML = ''; currentCategories.forEach(category => { const categoryElement = document.createElement('div'); categoryElement.className = 'category-card'; categoryElement.dataset.id = category.id; categoryElement.innerHTML = ` <div class="category-icon">${category.icon || '<خ�'}</div> <h3>${category.name[currentLang] || '*g}T TR{|'}</h3> <p>${category.description[currentLang] || '�f�e�c��'}</p> `; // �m�R�p�Q�N�N categoryElement.addEventListener('click', () => { console.log("�p�QR{|:", category.id); const gamesInCategory = currentGames.filter(game => category.id === 'all' ? true : game.category === category.id ); // �f�eh�� document.querySelector('#allGamesSection .section-title').textContent = currentLang === 'zh' ? `${category.name[currentLang]}` : `${category.name[currentLang]}`; renderGames(document.getElementById('allGamesContainer'), gamesInCategory); // �n�R0R8nb:S�W document.getElementById('allGamesSection').scrollIntoView({behavior: 'smooth'}); }); container.appendChild(categoryElement); }); } /** * �f�e�p�8nb */ function updateRecentGames() { console.log("�f�e�p�8nb"); // c�m�R�eg�c�^�Sgя6*N const recentGames = [...currentGames] .sort((a, b) => new Date(b.dateAdded) - new Date(a.dateAdded)) .slice(0, 4); renderGames(document.getElementById('recentGamesContainer'), recentGames); } /** * �f�e@b g8nb */ function updateAllGames() { console.log("�f�e@b g8nb"); renderGames(document.getElementById('allGamesContainer'), currentGames); } /** * 2n�g8nbaSGr */ function renderGames(container, games) { container.innerHTML = ''; if (games.length === 0) { const emptyMessage = document.createElement('p'); emptyMessage.className = 'empty-message'; emptyMessage.textContent = currentLang === 'zh' ? '�l g~b0R8nb' : 'No games found'; container.appendChild(emptyMessage); return; } games.forEach(game => { const gameCard = document.createElement('div'); gameCard.className = 'game-card'; gameCard.dataset.id = game.id; const isFavorite = favorites.includes(game.id); gameCard.innerHTML = ` <div class="game-thumbnail"> <img src="${game.thumbnail}" alt="${game.title[currentLang]}" onerror="this.src='/images/placeholder.jpg'"> </div> <div class="game-info"> <h3>${game.title[currentLang]}</h3> <p>${game.description[currentLang]}</p> <div class="game-actions"> <button class="play-button">${currentLang === 'zh' ? '�s8nb' : 'Play'}</button> <button class="favorite-button ${isFavorite ? 'favorited' : ''}"> ${isFavorite ? 'd'�' : '>� �'} </button> </div> </div> `; // �m�R8nbaSGr�p�Q�N�N gameCard.querySelector('.play-button').addEventListener('click', () => { console.log("�p�Q8nb:", game.id); window.open(`/game/index.html?id=${game.id}`, '_blank'); }); // �m�R6eυ c���p�Q�N�N gameCard.querySelector('.favorite-button').addEventListener('click', (e) => { e.stopPropagation(); toggleFavorite(game.id); // �f�e c��Y‰ const button = e.target; const isNowFavorite = favorites.includes(game.id); button.textContent = isNowFavorite ? 'd'�' : '>� �'; button.classList.toggle('favorited', isNowFavorite); }); container.appendChild(gameCard); }); } /** * Ytd"}�R�� */ function handleSearch() { console.log("gbL�d"}"); const searchTerm = document.getElementById('searchInput').value.trim().toLowerCase(); if (!searchTerm) { updateAllGames(); return; } // (Wh���T�c��-Nd"} const filteredGames = currentGames.filter(game => { const titleMatch = game.title[currentLang].toLowerCase().includes(searchTerm); const descMatch = game.description[currentLang].toLowerCase().includes(searchTerm); return titleMatch || descMatch; }); // �f�e8nb>f:y document.querySelector('#allGamesSection .section-title').textContent = currentLang === 'zh' ? `d"}�~�g: ${searchTerm}` : `Search Results: ${searchTerm}`; renderGames(document.getElementById('allGamesContainer'), filteredGames); // �n�R0R8nb:S�W document.getElementById('allGamesSection').scrollIntoView({behavior: 'smooth'}); } /** * >f:y���c:y */ function showError(message) { console.error(">f:y��:", message); const errorContainer = document.getElementById('errorContainer'); const errorMessage = document.getElementById('errorMessage'); errorMessage.textContent = currentLang === 'zh' ? `�R}�1Y%�: ${message}` : `Loading Failed: ${message}`; errorContainer.style.display = 'flex'; } </script> </body> </html>