Spaces:
Running
Running
File size: 777 Bytes
1d5ed21 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
// 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
}); |