Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>TodoFlow - Modern Todo App</title> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css"> | |
| <style> | |
| :root { | |
| --bg-primary: #f8fafc; | |
| --bg-secondary: #ffffff; | |
| --bg-tertiary: #f1f5f9; | |
| --text-primary: #0f172a; | |
| --text-secondary: #64748b; | |
| --accent: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); | |
| --accent-hover: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%); | |
| --success: linear-gradient(135deg, #10b981 0%, #059669 100%); | |
| --danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); | |
| --warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); | |
| --border: #e2e8f0; | |
| --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05); | |
| --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); | |
| --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); | |
| --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); | |
| --glass-bg: rgba(255, 255, 255, 0.25); | |
| --glass-border: rgba(255, 255, 255, 0.18); | |
| --radius: 16px; | |
| --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); | |
| } | |
| [data-theme="dark"] { | |
| --bg-primary: #0f0f23; | |
| --bg-secondary: #1a1a2e; | |
| --bg-tertiary: #16213e; | |
| --text-primary: #f8fafc; | |
| --text-secondary: #cbd5e1; | |
| --border: #334155; | |
| --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3); | |
| --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3); | |
| --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4); | |
| --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5); | |
| --glass-bg: rgba(26, 26, 46, 0.4); | |
| --glass-border: rgba(99, 102, 241, 0.2); | |
| } | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| } | |
| body { | |
| font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; | |
| background: linear-gradient(-45deg, var(--bg-primary), var(--bg-secondary), var(--bg-tertiary), var(--bg-primary)); | |
| background-size: 400% 400%; | |
| animation: gradientShift 15s ease infinite; | |
| color: var(--text-primary); | |
| min-height: 100vh; | |
| padding: 1rem; | |
| line-height: 1.6; | |
| transition: var(--transition); | |
| } | |
| @keyframes gradientShift { | |
| 0% { background-position: 0% 50%; } | |
| 50% { background-position: 100% 50%; } | |
| 100% { background-position: 0% 50%; } | |
| } | |
| .container { | |
| max-width: 600px; | |
| margin: 0 auto; | |
| min-height: 100vh; | |
| display: flex; | |
| flex-direction: column; | |
| gap: 2rem; | |
| padding: 2rem 0; | |
| } | |
| header { | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| background: var(--glass-bg); | |
| backdrop-filter: blur(20px); | |
| -webkit-backdrop-filter: blur(20px); | |
| border: 1px solid var(--glass-border); | |
| border-radius: var(--radius); | |
| padding: 1.5rem 2rem; | |
| box-shadow: var(--shadow-lg); | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| header::before { | |
| content: ''; | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| right: 0; | |
| bottom: 0; | |
| background: var(--accent); | |
| opacity: 0.1; | |
| border-radius: var(--radius); | |
| } | |
| h1 { | |
| font-size: clamp(1.75rem, 4vw, 2.5rem); | |
| font-weight: 800; | |
| background: var(--accent); | |
| -webkit-background-clip: text; | |
| -webkit-text-fill-color: transparent; | |
| background-clip: text; | |
| position: relative; | |
| z-index: 1; | |
| } | |
| .header-actions { | |
| display: flex; | |
| align-items: center; | |
| gap: 1rem; | |
| } | |
| .theme-toggle { | |
| background: none; | |
| border: none; | |
| font-size: 1.25rem; | |
| color: var(--text-primary); | |
| cursor: pointer; | |
| padding: 0.5rem; | |
| border-radius: 50%; | |
| transition: var(--transition); | |
| width: 44px; | |
| height: 44px; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| } | |
| .theme-toggle:hover { | |
| background: var(--glass-bg); | |
| transform: scale(1.05); | |
| } | |
| .built-with { | |
| font-size: 0.875rem; | |
| color: var(--text-secondary); | |
| text-decoration: none; | |
| position: relative; | |
| z-index: 1; | |
| } | |
| .built-with:hover { | |
| color: var(--text-primary); | |
| } | |
| .input-section { | |
| background: var(--glass-bg); | |
| backdrop-filter: blur(20px); | |
| -webkit-backdrop-filter: blur(20px); | |
| border: 1px solid var(--glass-border); | |
| border-radius: var(--radius); | |
| padding: 1.5rem; | |
| box-shadow: var(--shadow-xl); | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| .input-section::before { | |
| content: ''; | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| right: 0; | |
| height: 4px; | |
| background: var(--accent); | |
| } | |
| .input-wrapper { | |
| display: flex; | |
| gap: 1rem; | |
| align-items: center; | |
| } | |
| #todoInput { | |
| flex: 1; | |
| padding: 1rem 1.5rem; | |
| border: 2px solid transparent; | |
| border-radius: 12px; | |
| font-size: 1rem; | |
| background: rgba(255, 255, 255, 0.5); | |
| color: var(--text-primary); | |
| outline: none; | |
| transition: var(--transition); | |
| backdrop-filter: blur(10px); | |
| } | |
| #todoInput::placeholder { | |
| color: var(--text-secondary); | |
| } | |
| #todoInput:focus { | |
| border-color: hsl(217, 91%, 60%); | |
| box-shadow: 0 0 0 3px hsl(217, 91%, 80% / 0.5); | |
| background: rgba(255, 255, 255, 0.8); | |
| } | |
| #addBtn { | |
| background: var(--accent); | |
| color: white; | |
| border: none; | |
| padding: 1rem 1.5rem; | |
| border-radius: 12px; | |
| font-size: 1rem; | |
| font-weight: 600; | |
| cursor: pointer; | |
| transition: var(--transition); | |
| box-shadow: var(--shadow-md); | |
| white-space: nowrap; | |
| display: flex; | |
| align-items: center; | |
| gap: 0.5rem; | |
| } | |
| #addBtn:hover { | |
| background: var(--accent-hover); | |
| transform: translateY(-2px); | |
| box-shadow: var(--shadow-lg); | |
| } | |
| #addBtn:active { | |
| transform: translateY(0); | |
| } | |
| .todo-list { | |
| flex: 1; | |
| display: flex; | |
| flex-direction: column; | |
| gap: 1rem; | |
| } | |
| .todo-item { | |
| background: var(--glass-bg); | |
| backdrop-filter: blur(20px); | |
| -webkit-backdrop-filter: blur(20px); | |
| border: 1px solid var(--glass-border); | |
| border-radius: var(--radius); | |
| padding: 1.25rem; | |
| box-shadow: var(--shadow-lg); | |
| opacity: 0; | |
| transform: translateX(-20px); | |
| animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards; | |
| transition: var(--transition); | |
| display: grid; | |
| grid-template-columns: auto 1fr auto; | |
| gap: 1rem; | |
| align-items: center; | |
| } | |
| .todo-item.show { | |
| opacity: 1; | |
| transform: translateX(0); | |
| } | |
| .todo-item:hover { | |
| transform: translateY(-4px); | |
| box-shadow: var(--shadow-xl); | |
| } | |
| .todo-item.done { | |
| opacity: 0.7; | |
| background: rgba(16, 185, 129, 0.1); | |
| border-color: rgba(16, 185, 129, 0.3); | |
| } | |
| .todo-item.done .todo-text { | |
| text-decoration: line-through; | |
| color: var(--text-secondary); | |
| } | |
| @keyframes slideIn { | |
| to { | |
| opacity: 1; | |
| transform: translateX(0); | |
| } | |
| } | |
| .checkbox { | |
| width: 24px; | |
| height: 24px; | |
| border-radius: 50%; | |
| border: 2px solid var(--border); | |
| background: transparent; | |
| cursor: pointer; | |
| transition: var(--transition); | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| font-size: 0.75rem; | |
| position: relative; | |
| } | |
| .checkbox:hover { | |
| background: var(--glass-bg); | |
| } | |
| .checkbox.checked { | |
| background: var(--success); | |
| border-color: var(--success); | |
| color: white; | |
| } | |
| .todo-text { | |
| font-size: 1.1rem; | |
| cursor: pointer; | |
| transition: var(--transition); | |
| padding: 0.5rem 0; | |
| word-break: break-word; | |
| } | |
| .todo-text.editing { | |
| padding: 0.5rem; | |
| border-radius: 8px; | |
| background: rgba(255, 255, 255, 0.6); | |
| border: 2px solid transparent; | |
| } | |
| .actions { | |
| display: flex; | |
| gap: 0.5rem; | |
| opacity: 0; | |
| transition: var(--transition); | |
| } | |
| .todo-item:hover .actions { | |
| opacity: 1; | |
| } | |
| .action-btn { | |
| width: 40px; | |
| height: 40px; | |
| border: none; | |
| border-radius: 50%; | |
| cursor: pointer; | |
| font-size: 0.875rem; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| transition: var(--transition); | |
| color: var(--text-secondary); | |
| } | |
| .action-btn:hover { | |
| color: white; | |
| transform: scale(1.1); | |
| } | |
| .edit-btn { | |
| background: var(--warning); | |
| } | |
| .edit-btn:hover { | |
| background: #f59e0b; | |
| } | |
| .delete-btn { | |
| background: var(--danger); | |
| } | |
| .delete-btn:hover { | |
| background: #ef4444; | |
| } | |
| .filters { | |
| display: flex; | |
| gap: 0.5rem; | |
| justify-content: center; | |
| flex-wrap: wrap; | |
| } | |
| .filter-btn { | |
| padding: 0.75rem 1.5rem; | |
| border: 2px solid transparent; | |
| background: var(--glass-bg); | |
| color: var(--text-secondary); | |
| border-radius: 50px; | |
| cursor: pointer; | |
| font-weight: 500; | |
| transition: var(--transition); | |
| backdrop-filter: blur(10px); | |
| white-space: nowrap; | |
| } | |
| .filter-btn.active, | |
| .filter-btn:hover { | |
| background: var(--glass-bg); | |
| color: var(--text-primary); | |
| border-color: hsl(217, 91%, 60%); | |
| box-shadow: 0 0 0 3px hsl(217, 91%, 80% / 0.3); | |
| } | |
| .footer { | |
| background: var(--glass-bg); | |
| backdrop-filter: blur(20px); | |
| -webkit-backdrop-filter: blur(20px); | |
| border: 1px solid var(--glass-border); | |
| border-radius: var(--radius); | |
| padding: 1.5rem; | |
| box-shadow: var(--shadow-lg); | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| flex-wrap: wrap; | |
| gap: 1rem; | |
| } | |
| .stats { | |
| color: var(--text-secondary); | |
| font-weight: 500; | |
| } | |
| .clear-btn { | |
| background: var(--danger); | |
| color: white; | |
| border: none; | |
| padding: 0.75rem 1.5rem; | |
| border-radius: 50px; | |
| cursor: pointer; | |
| font-weight: 500; | |
| transition: var(--transition); | |
| opacity: 0.8; | |
| } | |
| .clear-btn:hover:not(:disabled) { | |
| opacity: 1; | |
| transform: translateY(-2px); | |
| box-shadow: var(--shadow-md); | |
| } | |
| .clear-btn:disabled { | |
| opacity: 0.5; | |
| cursor: not-allowed; | |
| } | |
| .empty-state { | |
| text-align: center; | |
| padding: 3rem 1rem; | |
| color: var(--text-secondary); | |
| } | |
| .empty-state i { | |
| font-size: 4rem; | |
| margin-bottom: 1rem; | |
| opacity: 0.5; | |
| } | |
| /* Responsive */ | |
| @media (max-width: 768px) { | |
| .container { | |
| padding: 1rem 0; | |
| gap: 1.5rem; | |
| } | |
| header, | |
| .input-section, | |
| .footer { | |
| padding: 1.25rem; | |
| } | |
| .input-wrapper { | |
| flex-direction: column; | |
| } | |
| #addBtn { | |
| width: 100%; | |
| justify-content: center; | |
| } | |
| .todo-item { | |
| grid-template-columns: 1fr; | |
| gap: 1rem; | |
| text-align: center; | |
| } | |
| .actions { | |
| opacity: 1; | |
| justify-content: center; | |
| } | |
| .footer { | |
| flex-direction: column; | |
| text-align: center; | |
| } | |
| } | |
| @media (max-width: 480px) { | |
| body { | |
| padding: 0.5rem; | |
| } | |
| h1 { | |
| font-size: 1.75rem; | |
| } | |
| } | |
| /* Hide scrollbar for webkit */ | |
| ::-webkit-scrollbar { | |
| width: 6px; | |
| } | |
| ::-webkit-scrollbar-track { | |
| background: transparent; | |
| } | |
| ::-webkit-scrollbar-thumb { | |
| background: var(--text-secondary); | |
| border-radius: 3px; | |
| } | |
| ::-webkit-scrollbar-thumb:hover { | |
| background: var(--text-primary); | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="container"> | |
| <header> | |
| <h1><i class="fas fa-tasks"></i> TodoFlow</h1> | |
| <div class="header-actions"> | |
| <button class="theme-toggle" id="themeToggle" title="Toggle Theme"> | |
| <i class="fas fa-moon"></i> | |
| </button> | |
| <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="built-with" title="Built with anycoder"> | |
| Built with <i class="fab fa-hugging-face"></i> anycoder | |
| </a> | |
| </div> | |
| </header> | |
| <section class="input-section" role="search"> | |
| <div class="input-wrapper"> | |
| <input type="text" id="todoInput" placeholder="What needs to be done today? ✨" maxlength="200"> | |
| <button id="addBtn" aria-label="Add Todo"> | |
| <i class="fas fa-plus"></i> Add | |
| </button> | |
| </div> | |
| </section> | |
| <main class="todo-list" id="todoList"> | |
| <!-- Todos will be dynamically inserted here --> | |
| </main> | |
| <nav class="filters" id="filters"> | |
| <button class="filter-btn active" data-filter="all">All</button> | |
| <button class="filter-btn" data-filter="active">Active</button> | |
| <button class="filter-btn" data-filter="completed">Completed</button> | |
| </nav> | |
| <footer class="footer" id="footer" style="display: none;"> | |
| <span class="stats" id="stats"></span> | |
| <button class="clear-btn" id="clearBtn" disabled>Clear Completed</button> | |
| </footer> | |
| </div> | |
| <script> | |
| class TodoApp { | |
| constructor() { | |
| this.todos = []; | |
| this.currentFilter = 'all'; | |
| this.editingId = null; | |
| this.init(); | |
| } | |
| init() { | |
| this.load(); | |
| this.bindEvents(); | |
| this.render(); | |
| } | |
| bindEvents() { | |
| const addBtn = document.getElementById('addBtn'); | |
| const todoInput = document.getElementById('todoInput'); | |
| const filters = document.getElementById('filters'); | |
| const themeToggle = document.getElementById('themeToggle'); | |
| const clearBtn = document.getElementById('clearBtn'); | |
| addBtn.addEventListener('click', () => this.addTodo()); | |
| todoInput.addEventListener('keypress', (e) => { | |
| if (e.key === 'Enter') this.addTodo(); | |
| }); | |
| filters.addEventListener('click', (e) => { | |
| if (e.target.dataset.filter) { | |
| this.setFilter(e.target.dataset.filter); | |
| } | |
| }); | |
| themeToggle.addEventListener('click', () => this.toggleTheme()); | |
| clearBtn.addEventListener('click', () => this.clearCompleted()); | |
| document.addEventListener('click', (e) => { | |
| if (e.target.closest('.checkbox')) this.toggleTodo(e.target.closest('.todo-item').dataset.id); | |
| if (e.target.closest('.edit-btn')) this.startEdit(e.target.closest('.todo-item').dataset.id); | |
| if (e.target.closest('.delete-btn')) this.deleteTodo(e.target.closest('.todo-item').dataset.id); | |
| }); | |
| todoInput.addEventListener('input', () => { | |
| todoInput.style.height = 'auto'; | |
| todoInput.style.height = todoInput.scrollHeight + 'px'; | |
| }); | |
| } | |
| addTodo() { | |
| const input = document.getElementById('todoInput'); | |
| const text = input.value.trim(); | |
| if (!text) return; | |
| const todo = { | |
| id: Date.now().toString(), | |
| text, | |
| done: false | |
| }; | |
| this.todos.unshift(todo); | |
| input.value = ''; | |
| this.save(); | |
| this.render(); | |
| } | |
| toggleTodo(id) { | |
| const todo = this.todos.find(t => t.id === id); | |
| if (todo) { | |
| todo.done = !todo.done; | |
| this.save(); | |
| this.render(); | |
| } | |
| } | |
| deleteTodo(id) { | |
| this.todos = this.todos.filter(t => t.id !== id); | |
| this.save(); | |
| this.render(); | |
| } | |
| startEdit(id) { | |
| if (this.editingId) return; | |
| this.editingId = id; | |
| this.render(); | |
| const input = document.querySelector(`[data-id="${id}"] .todo-text`); | |
| if (input) { | |
| input.focus(); | |
| const range = document.createRange(); | |
| range.selectNodeContents(input); | |
| range.collapse(false); | |
| const sel = window.getSelection(); | |
| sel.removeAllRanges(); | |
| sel.addRange(range); | |
| } | |
| } | |
| handleEdit(e) { | |
| if (e.key === 'Enter' && !e.shiftKey) { | |
| e.preventDefault(); | |
| this.finishEdit(e.target); | |
| } else if (e.key === 'Escape') { | |
| this.finishEdit(e.target); | |
| } | |
| } | |
| finishEdit(target) { | |
| const id = target.closest('.todo-item').dataset.id; | |
| const newText = target.textContent.trim(); | |
| if (newText) { | |
| const todo = this.todos.find(t => t.id === id); | |
| if (todo) todo.text = newText; | |
| } | |
| this.editingId = null; | |
| this.save(); | |
| this.render(); | |
| } | |
| setFilter(filter) { | |
| this.currentFilter = filter; | |
| document.querySelectorAll('.filter-btn').forEach(btn => btn.classList.remove('active')); | |
| document.querySelector(`[data-filter="${filter}"]`).classList.add('active'); | |
| this.render(); | |
| } | |
| clearCompleted() { | |
| this.todos = this.todos.filter(t => !t.done); | |
| this.save(); | |
| this.render(); | |
| } | |
| getFilteredTodos() { | |
| switch (this.currentFilter) { | |
| case 'active': return this.todos.filter(t => !t.done); | |
| case 'completed': return this.todos.filter(t => t.done); | |
| default: return this.todos; | |
| } | |
| } | |
| updateStats() { | |
| const activeCount = this.todos.filter(t => !t.done).length; | |
| document.getElementById('stats').textContent = `${activeCount} ${activeCount === 1 ? 'item' : 'items'} left`; | |
| } | |
| render() { | |
| const list = document.getElementById('todoList'); | |
| const filtered = this.getFilteredTodos(); | |
| const footer = document.getElementById('footer'); | |
| const clearBtn = document.getElementById('clearBtn'); | |
| if (this.todos.length === 0) { | |
| list.innerHTML = ` | |
| <div class="empty-state"> | |
| <i class="fas fa-clipboard-list"></i> | |
| <h2>No todos yet</h2> | |
| <p>Add one above to get started! 🚀</p> | |
| </div> | |
| `; | |
| footer.style.display = 'none'; | |
| return; | |
| } | |
| list.innerHTML = filtered.map((todo, index) => { | |
| const editing = this.editingId === todo.id; | |
| return ` | |
| <article class="todo-item ${todo.done ? 'done' : ''}" data-id="${todo.id}"> | |
| <button class="checkbox ${todo.done ? 'checked' : ''}" aria-label="${todo.done ? 'Mark incomplete' : 'Mark complete'}"> | |
| ${todo.done ? '<i class="fas fa-check"></i>' : ''} | |
| </button> | |
| <div class="todo-text ${editing ? 'editing' : ''} ${todo.done ? 'done' : ''}" | |
| contenteditable="${editing}" | |
| ${editing ? `onkeydown="app.handleEdit(event)"` : ''}> | |
| ${todo.text} | |
| </div> | |
| <div class="actions"> | |
| <button class="action-btn edit-btn" aria-label="Edit" ${editing ? 'disabled' : ''}> | |
| <i class="fas fa-edit"></i> | |
| </button> | |
| <button class="action-btn delete-btn" aria-label="Delete"> | |
| <i class="fas fa-trash"></i> | |
| </button> | |
| </div> | |
| </article> | |
| `; | |
| }).join(''); | |
| // Animate new items | |
| filtered.slice(-3).forEach((_, i) => { | |
| setTimeout(() => { | |
| const item = list.querySelectorAll('.todo-item')[filtered.length - 1 - i]; | |
| if (item) item.classList.add('show'); | |
| }, i * 100); | |
| }); | |
| footer.style.display = 'flex'; | |
| clearBtn.disabled = this.todos.every(t => !t.done); | |
| this.updateStats(); | |
| } | |
| save() { | |
| localStorage.setItem('todoflow', JSON.stringify(this.todos)); | |
| localStorage.setItem('todoflow-filter', this.currentFilter); | |
| } | |
| load() { | |
| const saved = localStorage.getItem('todoflow'); | |
| if (saved) { | |
| this.todos = JSON.parse(saved); | |
| } | |
| const savedFilter = localStorage.getItem('todoflow-filter'); | |
| if (savedFilter) { | |
| this.currentFilter = savedFilter; | |
| document.querySelector(`[data-filter="${this.currentFilter}"]`).classList.add('active'); | |
| document.querySelector(`[data-filter="all"]`).classList.remove('active'); | |
| } | |
| } | |
| toggleTheme() { | |
| const body = document.body; | |
| const isDark = body.dataset.theme === 'dark'; | |
| const icon = document.getElementById('themeToggle').querySelector('i'); | |
| if (isDark) { | |
| body.removeAttribute('data-theme'); | |
| icon.className = 'fas fa-moon'; | |
| localStorage.removeItem('todoflow-theme'); | |
| } else { | |
| body.dataset.theme = 'dark'; | |
| icon.className = 'fas fa-sun'; | |
| localStorage.setItem('todoflow-theme', 'dark'); | |
| } | |
| } | |
| } | |
| // Global app for event handlers | |
| const app = new TodoApp(); | |
| // Load theme | |
| const savedTheme = localStorage.getItem('todoflow-theme'); | |
| if (savedTheme === 'dark') { | |
| document.body.dataset.theme = 'dark'; | |
| document.getElementById('themeToggle').querySelector('i').className = 'fas fa-sun'; | |
| } | |
| </script> | |
| </body> | |
| </html> |