chessfusion-royale / script.js
johnreaver's picture
онлайн шахматы челеове против человека, ии проитив человека и ии против ии
1d5ed21 verified
raw
history blame contribute delete
777 Bytes
// 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
});