Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ // Mobile menu toggle
+ const menuToggle = document.querySelector('.menu-toggle');
+ const navLinks = document.querySelector('.nav-links');
+
+ menuToggle.addEventListener('click', () => {
+ navLinks.classList.toggle('active');
+ });
+
+ // Demo buttons functionality
+ const demoButtons = document.querySelectorAll('.demo-btn');
+ demoButtons.forEach(btn => {
+ btn.addEventListener('click', () => {
+ const technique = btn.parentElement.querySelector('.sudoku-mini-grid');
+ demonstrateTechnique(technique.dataset.technique);
+ });
+ });
+
+ // Initialize practice grid
+ initializePracticeGrid();
+ });
+
+ function demonstrateTechnique(technique) {
+ // Example demonstrations for each technique
+ const demonstrations = {
+ hiddenpairs: () => {
+ // Animation logic for hidden pairs technique
+ console.log('Demonstrating hidden pairs technique');
+ },
+ xwing: () => {
+ // Animation logic for x-wing technique
+ console.log('Demonstrating x-wing technique');
+ }
+ };
+
+ if (demonstrations[technique]) {
+ demonstrations[technique]();
+ }
+ }
+
+ function initializePracticeGrid() {
+ const grid = document.getElementById('practiceGrid');
+ // Initialize 9x9 grid
+ for (let i = 0; i < 81; i++) {
+ const cell = document.createElement('input');
+ cell.type = 'number';
+ cell.min = 1;
+ cell.max = 9;
+ cell.classList.add('grid-cell');
+ grid.appendChild(cell);
+ }
+
+ // Add event listeners for control buttons
+ document.getElementById('newPuzzle').addEventListener('click', generateNewPuzzle);
+ document.getElementById('showHint').addEventListener('click', showHint);
+ document.getElementById('checkSolution').addEventListener('click', checkSolution);
+ }
+
+ function generateNewPuzzle() {
+ // Generate new Sudoku puzzle
+ console.log('Generating new puzzle');
+ }
+
+ function showHint() {
+ // Show next best move
+ console.log('Showing hint');
+ }
+
+ function checkSolution() {
+ // Validate current grid state
+ console.log('Checking solution');
+ }