From 599c386086cb8d7adbc73690e2001a99c492fb9b Mon Sep 17 00:00:00 2001 From: sabin khatri Date: Sat, 1 Nov 2025 12:28:47 +0545 Subject: [PATCH 1/2] pomodoro timer with tasks, stats, dark mode --- web/PomoFlow/index.html | 87 +++++++++++++++++++++++ web/PomoFlow/script.js | 148 ++++++++++++++++++++++++++++++++++++++++ web/PomoFlow/style.css | 0 3 files changed, 235 insertions(+) create mode 100644 web/PomoFlow/index.html create mode 100644 web/PomoFlow/script.js create mode 100644 web/PomoFlow/style.css diff --git a/web/PomoFlow/index.html b/web/PomoFlow/index.html new file mode 100644 index 0000000..da46c5c --- /dev/null +++ b/web/PomoFlow/index.html @@ -0,0 +1,87 @@ + + + + + + PomoFlow + + + + + + + + + +
+
+ + +
+

PomoFlow

+ +
+ +
+ + +
+
+ + + + +
+

Focus Time

+

25:00

+
+
+ +
+ + +
+ +

Sessions today: 0

+
+ + +
+
+ + +
+ +
+
+ +
+ +
+
+ + + + \ No newline at end of file diff --git a/web/PomoFlow/script.js b/web/PomoFlow/script.js new file mode 100644 index 0000000..5f4ada5 --- /dev/null +++ b/web/PomoFlow/script.js @@ -0,0 +1,148 @@ +// Elements +const startBtn = document.getElementById('start-btn'); +const resetBtn = document.getElementById('reset-btn'); +const timerDisplay = document.getElementById('timer-display'); +const timerMode = document.getElementById('timer-mode'); +const progress = document.querySelector('.timer-progress'); +const taskInput = document.getElementById('task-input'); +const addTask = document.getElementById('add-task'); +const taskList = document.getElementById('task-list'); +const sessionCount = document.getElementById('session-count'); + +// State +let timeLeft = 25 * 60; +let totalTime = 25 * 60; +let isRunning = false; +let isFocus = true; +let timerId; +let sessions = parseInt(localStorage.getItem('pomoflow-sessions')) || 0; +let tasks = JSON.parse(localStorage.getItem('pomoflow-tasks')) || []; + +// Sound +const bell = new Audio('https://assets.mixkit.co/sfx/preview/mixkit-bell-notification-933.mp3'); + +// Update Timer +function updateTimer() { + const mins = Math.floor(timeLeft / 60).toString().padStart(2, '0'); + const secs = (timeLeft % 60).toString().padStart(2, '0'); + timerDisplay.textContent = `${mins}:${secs}`; + + const offset = ((totalTime - timeLeft) / totalTime) * 754; + progress.style.strokeDashoffset = 754 - offset; +} + +// Start Timer +function startTimer() { + if (isRunning) return; + isRunning = true; + startBtn.textContent = 'Pause'; + + timerId = setInterval(() => { + timeLeft--; + updateTimer(); + + if (timeLeft <= 0) { + clearInterval(timerId); + isRunning = false; + startBtn.textContent = 'Start'; + bell.play(); + + if (isFocus) { + sessions++; + sessionCount.textContent = sessions; + localStorage.setItem('pomoflow-sessions', sessions); + switchToBreak(); + } else { + switchToFocus(); + } + } + }, 1000); +} + +// Switch Modes +function switchToFocus() { + isFocus = true; + timeLeft = 25 * 60; + totalTime = 25 * 60; + timerMode.textContent = 'Focus Time'; + document.body.classList.remove('break-mode'); + updateTimer(); +} + +function switchToBreak() { + isFocus = false; + timeLeft = 5 * 60; + totalTime = 5 * 60; + timerMode.textContent = 'Break Time'; + document.body.classList.add('break-mode'); + updateTimer(); +} + +// Reset +resetBtn.addEventListener('click', () => { + clearInterval(timerId); + isRunning = false; + startBtn.textContent = 'Start'; + isFocus ? switchToFocus() : switchToBreak(); +}); + +// Start/Pause +startBtn.addEventListener('click', () => { + if (isRunning) { + clearInterval(timerId); + isRunning = false; + startBtn.textContent = 'Start'; + } else { + startTimer(); + } +}); + +// Tasks +function renderTasks() { + taskList.innerHTML = ''; + tasks.forEach((task, i) => { + const div = document.createElement('div'); + div.className = `flex items-center gap-3 p-3 rounded-xl bg-white/50 dark:bg-gray-700/50 backdrop-blur-sm transition-all ${task.done ? 'opacity-60 line-through' : ''}`; + div.innerHTML = ` + + ${task.text} + + `; + taskList.appendChild(div); + }); + localStorage.setItem('pomoflow-tasks', JSON.stringify(tasks)); +} + +function toggleTask(i) { + tasks[i].done = !tasks[i].done; + renderTasks(); +} + +window.deleteTask = function(i) { + tasks.splice(i, 1); + renderTasks(); +}; + +addTask.addEventListener('click', () => { + if (taskInput.value.trim()) { + tasks.push({ text: taskInput.value.trim(), done: false }); + taskInput.value = ''; + renderTasks(); + } +}); + +taskInput.addEventListener('keypress', e => { + if (e.key === 'Enter') addTask.click(); +}); + +// Dark Mode +document.getElementById('theme-toggle').addEventListener('click', () => { + document.body.classList.toggle('dark'); + const isDark = document.body.classList.contains('dark'); + document.getElementById('theme-toggle').textContent = isDark ? 'Light Mode' : 'Dark Mode'; +}); + +// Init +switchToFocus(); +renderTasks(); +sessionCount.textContent = sessions; \ No newline at end of file diff --git a/web/PomoFlow/style.css b/web/PomoFlow/style.css new file mode 100644 index 0000000..e69de29 From 3cf9f8449988ef8f60bddef353a862dfb3cf525b Mon Sep 17 00:00:00 2001 From: sabin khatri Date: Mon, 3 Nov 2025 09:42:06 +0545 Subject: [PATCH 2/2] added blogs page --- web/Neptechtribe/src/App.jsx | 2 + web/Neptechtribe/src/components/About.jsx | 2 +- web/Neptechtribe/src/components/Blogs.jsx | 313 ++++++++++++++++++++++ 3 files changed, 316 insertions(+), 1 deletion(-) create mode 100644 web/Neptechtribe/src/components/Blogs.jsx diff --git a/web/Neptechtribe/src/App.jsx b/web/Neptechtribe/src/App.jsx index 44f3cd9..f89d41f 100644 --- a/web/Neptechtribe/src/App.jsx +++ b/web/Neptechtribe/src/App.jsx @@ -6,6 +6,7 @@ import About from "./components/About"; import Footer from "./components/Footer"; import Events from "./components/Events"; import ContactUs from "./components/ContactUs"; +import Blogs from "./components/Blogs"; const App = () => { @@ -16,6 +17,7 @@ const App = () => {
+