You are browsing as a guest. Sign up (or log in) to start making projects!

WAIT-AN OCD MANAGER

  • 2 Devlogs
  • 2 Total hours

An OCD manager

Ship #1 Pending review

Hey everyone, welcome back! As I wrap things up for WAIT, I wanted to take a moment to look back at the entire journey. Bringing this project together from scratch has been quite a ride, so here is my final reflection on what was hard, what was fun, and what I am taking away from it all.

What Was Hard
Hands down, the hardest part was dealing with browser background throttling. When you are building something time-based, you naturally reach for setInterval and assume it will just work. Watching modern browsers completely freeze or slow down those timers the second a user switches tabs was super frustrating. Figuring out how to completely rethink my approach and switch to absolute timestamps took a lot of trial, error, and console logging before it finally clicked.

What Was Fun
The most fun part was definitely watching the raw logic come together and actually work. There is a very specific kind of satisfaction when you stare at a broken feature, completely rewrite the underlying JavaScript mechanism, and then watch the app snap into place and handle edge cases effortlessly. Seeing it go from a buggy concept to something smooth and reliable feels amazing.

What I Learned
This whole process taught me that you cannot always trust default tools or quick solutions, especially when dealing with browser environments. I learned how important it is to design state and timing logic to be resilient rather than fragile. It also gave me a much deeper appreciation for vanilla JavaScript and how much you can build without needing to rely on massive, heavy frameworks to do the heavy lifting for you.

As always, if you want to look at the code, break it, or suggest a cleaner way I could have written something, the repo is wide open over on GitHub.

Thanks for following along with the devlogs, and catch you on the next project!

  • 2 devlogs
  • 2h
Try project → See source code →
Open comments for this post

46m 5s logged

Devlog #2: Taming JavaScript Timers and Cleaning Up the CodeHey everyone, welcome back! If you have been following along with WAIT, I wanted to share a quick update on what I have been hacking away at recently, mostly focusing on the JavaScript side of things.If you want to see it live in action while you read, you can check it out on my GitHub Pages profile.The Plan for the JS
When I started writing the JS for this, I wanted to keep it pure vanilla, with no heavy frameworks, just clean code running directly in the browser. Right now, it is structured around a simple state object that handles what is going on, paired with a few helper files to keep my main script from turning into a massive wall of spaghetti code.The Biggest Headache: Browser Tab Throttling
I ran into a super annoying issue this week with JavaScript timers.If you have ever built anything with time or countdowns, you probably know that modern browsers like Chrome and Safari are notorious for throttling setInterval when you switch to a different tab or minimize your window. They do it to save battery, but for an app like this, it means your timer completely falls apart or freezes the second you look away.How I fixed it:
Instead of trusting setInterval to accurately count every single second, I switched over to using timestamps with Date.now and performance.now.
Instead of asking the code if a second passed every tick, it now checks what the exact math difference is between the start time and right now.
Even if the browser puts the tab to sleep for 30 seconds, the second you switch back, the script instantly calculates the real elapsed time and snaps the UI right where it needs to be. Total game changer.What Is Next
Now that the core timing logic is solid and does not break when you tab away, next on my JS checklist is hooking up localStorage so your settings and preferences actually save when you refresh the page.As always, if you want to look at the code, break it, or suggest a cleaner way I could have written something, the repo is wide open over on GitHub.

0
0
10
Open comments for this post

1h 19m 6s logged

so i was trying to make a little website for my fellow neurodivergents and i tried to make a website that might help to manage the OCD….i am trying my best to make the website more usefull i add a wall poster type style and ig i need to add more features to manage the intrusive thoughts overall i have made the HTML and CSS and now i have to work on the animations……….see you all in the next if anyone is reading ts

0
0
7

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…