diff --git a/55-productivity-dashboard/index.html b/55-productivity-dashboard/index.html new file mode 100644 index 0000000..a37dffa --- /dev/null +++ b/55-productivity-dashboard/index.html @@ -0,0 +1,62 @@ + + + + + + Productivity Dashboard + + + + + + +
+ +
+ +
+
Focus Timer
+
25:00
+
+ + +
+
+ + +
+
Quick Notes
+ +
+
+ + +
+
Today's Tasks
+ + +
+ + +
+ + + + +
+ Maximum 4 active tasks allowed to fit the screen. +
+
+
+ + + + \ No newline at end of file diff --git a/55-productivity-dashboard/script.js b/55-productivity-dashboard/script.js new file mode 100644 index 0000000..154ea8a --- /dev/null +++ b/55-productivity-dashboard/script.js @@ -0,0 +1,98 @@ +// --- TIMER LOGIC --- +let timeLeft = 25 * 60; +let timerId = null; +const timerDisplay = document.getElementById('timer'); +const startBtn = document.getElementById('startBtn'); +const resetBtn = document.getElementById('resetBtn'); + +function updateTimerDisplay() { + let minutes = Math.floor(timeLeft / 60); + let seconds = timeLeft % 60; + timerDisplay.textContent = `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`; +} + +startBtn.addEventListener('click', () => { + if (timerId === null) { + timerId = setInterval(() => { + if (timeLeft > 0) { + timeLeft--; + updateTimerDisplay(); + } else { + clearInterval(timerId); + timerId = null; + startBtn.innerHTML = ' Start'; + alert('Focus time is up! Take a short break.'); + timeLeft = 25 * 60; + updateTimerDisplay(); + } + }, 1000); + startBtn.innerHTML = ' Pause'; + } else { + clearInterval(timerId); + timerId = null; + startBtn.innerHTML = ' Resume'; + } +}); + +resetBtn.addEventListener('click', () => { + clearInterval(timerId); + timerId = null; + timeLeft = 25 * 60; + updateTimerDisplay(); + startBtn.innerHTML = ' Start'; +}); + + +// --- TASK LIST LOGIC --- +const taskInput = document.getElementById('taskInput'); +const addTaskBtn = document.getElementById('addTaskBtn'); +const taskList = document.getElementById('taskList'); + +addTaskBtn.addEventListener('click', () => { + const taskText = taskInput.value.trim(); + + // Prevent scrolling by limiting to 4 items max + if (taskList.children.length >= 4) { + alert("Maximum 4 tasks allowed to keep the interface compact!"); + return; + } + + if (taskText !== "") { + const li = document.createElement('li'); + li.className = 'task-item'; + + li.innerHTML = ` + ${taskText} + + `; + + // Toggle completed status on click + li.querySelector('span').addEventListener('click', function() { + li.classList.toggle('completed'); + }); + + // Delete button logic + li.querySelector('.delete-task-btn').addEventListener('click', function() { + li.remove(); + }); + + taskList.appendChild(li); + taskInput.value = ""; + } +}); + +taskInput.addEventListener('keypress', (e) => { + if (e.key === 'Enter') addTaskBtn.click(); +}); + + +// --- LOCALSTORAGE (Saves notes automatically) --- +const quickNote = document.getElementById('quickNote'); + +if(localStorage.getItem('quick_dashboard_note')) { + quickNote.value = localStorage.getItem('quick_dashboard_note'); +} + +quickNote.addEventListener('input', () => { + localStorage.setItem('quick_dashboard_note', quickNote.value); +}); \ No newline at end of file diff --git a/55-productivity-dashboard/style.css b/55-productivity-dashboard/style.css new file mode 100644 index 0000000..6ded098 --- /dev/null +++ b/55-productivity-dashboard/style.css @@ -0,0 +1,201 @@ +/* Bootstrap-style minimalist Reset & Variables */ +:root { + --bs-primary: #0d6efd; + --bs-primary-hover: #0b5ed7; + --bs-body-bg: #f8f9fa; + --bs-card-bg: #ffffff; + --bs-border-color: #dee2e6; + --bs-text-dark: #212529; + --bs-text-muted: #6c757d; +} + +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +body { + background-color: var(--bs-body-bg); + color: var(--bs-text-dark); + font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + height: 100vh; + display: flex; + justify-content: center; + align-items: center; + overflow: hidden; /* Strictly no scroll */ + padding: 20px; +} + +/* Dashboard Grid */ +.dashboard-container { + display: flex; + gap: 20px; + width: 680px; + height: 380px; /* Fixed height to fit everything in one view */ +} + +.panel-left { + flex: 1; + display: flex; + flex-direction: column; + height: 100%; +} + +.panel-right { + flex: 1.2; + height: 100%; +} + +/* Card Styling */ +.card { + background-color: var(--bs-card-bg); + border: 1px solid var(--bs-border-color); + border-radius: 0.375rem; + box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); +} + +.p-3 { padding: 1rem; } +.mb-2 { margin-bottom: 0.5rem; } +.mb-3 { margin-bottom: 1rem; } +.mt-auto { margin-top: auto; } +.text-center { text-align: center; } +.text-muted { color: var(--bs-text-muted) !important; } +.text-uppercase { text-transform: uppercase; } +.small { font-size: 0.875rem; } +.font-weight-bold { font-weight: 700; } +.d-flex { display: flex; } +.flex-column { flex-direction: column; } +.flex-grow-1 { flex-grow: 1; } +.gap-2 { gap: 0.5rem; } + +/* Timer Display */ +.timer-display { + font-size: 2.5rem; + font-weight: 700; + margin-bottom: 0.5rem; + color: var(--bs-text-dark); + font-variant-numeric: tabular-nums; +} + +/* Buttons */ +.btn { + display: inline-block; + font-weight: 400; + line-height: 1.5; + text-align: center; + text-decoration: none; + vertical-align: middle; + cursor: pointer; + user-select: none; + border: 1px solid transparent; + padding: 0.375rem 0.75rem; + font-size: 1rem; + border-radius: 0.375rem; + transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out; +} + +.btn-sm { + padding: 0.25rem 0.5rem; + font-size: 0.875rem; + border-radius: 0.25rem; +} + +.btn-primary { + color: #fff; + background-color: var(--bs-primary); + border-color: var(--bs-primary); +} + +.btn-primary:hover { + background-color: var(--bs-primary-hover); + border-color: var(--bs-primary-hover); +} + +.btn-outline-secondary { + color: var(--bs-text-muted); + border-color: var(--bs-border-color); + background-color: transparent; +} + +.btn-outline-secondary:hover { + background-color: #e9ecef; +} + +/* Inputs */ +.input-group { + display: flex; + width: 100%; +} + +.input-group .form-control { + flex: 1; + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} + +.input-group .btn { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +.form-control { + display: block; + width: 100%; + padding: 0.375rem 0.75rem; + font-size: 1rem; + font-weight: 400; + line-height: 1.5; + color: var(--bs-text-dark); + background-color: #fff; + background-clip: padding-box; + border: 1px solid var(--bs-border-color); + border-radius: 0.375rem; + outline: none; +} + +.form-control:focus { + border-color: #86b7fe; + box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, .25); +} + +.text-textarea { + resize: none; + flex-grow: 1; + font-size: 0.9rem; +} + +/* Task List */ +.task-list { + list-style: none; + display: flex; + flex-direction: column; + gap: 8px; +} + +.task-item { + display: flex; + justify-content: space-between; + align-items: center; + padding: 8px 12px; + background-color: #f8f9fa; + border: 1px solid var(--bs-border-color); + border-radius: 0.25rem; + font-size: 0.9rem; +} + +.task-item.completed span { + text-decoration: line-through; + color: var(--bs-text-muted); +} + +.delete-task-btn { + color: #dc3545; + cursor: pointer; + background: transparent; + border: none; +} + +.delete-task-btn:hover { + color: #a71d2a; +} \ No newline at end of file