Spaces:
Running
Running
| // Shared utility functions | |
| function showToast(message, type = 'info') { | |
| const toast = document.createElement('div'); | |
| toast.className = `fixed bottom-4 right-4 px-4 py-2 rounded-md shadow-lg text-white ${ | |
| type === 'error' ? 'bg-red-500' : | |
| type === 'success' ? 'bg-green-500' : 'bg-blue-500' | |
| }`; | |
| toast.textContent = message; | |
| document.body.appendChild(toast); | |
| setTimeout(() => { | |
| toast.remove(); | |
| }, 3000); | |
| } | |
| // Initialize chess game (will be extended in specific pages) | |
| function initChessGame(mode) { | |
| console.log(`Initializing chess game in ${mode} mode`); | |
| // Common initialization logic here | |
| } | |
| // Navigation helper | |
| document.addEventListener('DOMContentLoaded', () => { | |
| // Any shared initialization logic | |
| }); |