Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ // Add smooth scroll behavior
+ document.querySelectorAll('a[href^="#"]').forEach(anchor => {
+ anchor.addEventListener('click', function (e) {
+ e.preventDefault();
+ document.querySelector(this.getAttribute('href')).scrollIntoView({
+ behavior: 'smooth'
+ });
+ });
+ });
+
+ // Add dynamic theme toggle
+ const themeToggle = document.createElement('button');
+ themeToggle.innerHTML = '🌙';
+ themeToggle.className = 'theme-toggle';
+ themeToggle.style.position = 'fixed';
+ themeToggle.style.right = '20px';
+ themeToggle.style.top = '20px';
+ themeToggle.style.padding = '10px';
+ themeToggle.style.borderRadius = '50%';
+ themeToggle.style.border = 'none';
+ themeToggle.style.cursor = 'pointer';
+
+ document.body.appendChild(themeToggle);
+
+ themeToggle.addEventListener('click', () => {
+ document.body.classList.toggle('dark-theme');
+ themeToggle.innerHTML = document.body.classList.contains('dark-theme') ? '☀️' : '🌙';
+ });
+ });