This user has been banned.

Trixie Timer - (It's a working title)

Trixie Timer - (It's a working title)

43 devlogs
25h 49m
•  Ship certified
Created by Sapphire

An alternative to "Time Out" the macOS app. However Trixie Timer is web based and therefore cross platform, furthermore there are no features locked behind paywalls.

Timeline

Ship 1

1 payout of shell 165.0 shells

Sapphire

over 1 year ago

Sapphire • Covers 43 devlogs and 25h 49m

Made label next to progress bar show the name of the break.
Uploaded to GitHub and set up GitHub Pages.
Finalised README.md
Now time to ship

Update attachment

Update it to make audio work and also to finalise the read me, wow this project was harder and took way longer than I expected but now I will upload it to GitHub and GitHub Pages and then ship it and also add the break name at the start of the label.

Update attachment

Updated readme.md and moved all JS and CSS into the HTML file so that the whole program is one file that can easily be shared or modified, and ran however you like. Also updated the code to show the break timer (about to test it) and also play audio on break start and break end (about to test that too).

Update attachment

Top bar shows a break in progress with 1 minutes left and then when the minute passes it changes to break starts in 50 minutes which is the expected value. So now break label and work timers and work label are correctly displayed, however the progress bar for break isn't updated.

It seems the logic is incorrect, when the break started it switched to break completed for 250ms and it then updates the time to the correct next break time which is good

Added logic to tell the difference between whether the break is in progress or it was already comlpeted (meaning nextBreak needs to be updated).

Update attachment

Updated some logic and also added the logic to tell if the break has started, need to add the ability to tell the progress of the break, and if the break has already passed and therefore requiring to update the next break value

Update attachment

Fixed how date is concatenated to fix it not working before 10am

Update attachment

Finished logic for showing break count down progress bar. However logic for setting labels seems to be incorrect, also label for showing amount of time in break logic is uncomplete

Update attachment

It now shows how many minutes left until the break starts (and updates to a placeholder when a break is in progress) I just need to update the logic for calculating and updating the value of next break in local storage and also to make the progress bar show break time and the label show how many minutes of break time is left (and also make it play audio at the start and end of a break)

Note for admins: this devlog says 50m 14s (so subtract 28m 37s for real time (I think))

It works!!!! Progress bar updates as time passes! I just need to update the label to show useful information, to add logic for when the work interval is complete to start the break timer and to update the next break time ,hmm sounds familiar ;( and also play a sound when break time starts and when it ends.

fixed logic for saving the timestamp to local storage, for real this time it was actually saving the time on page load instead of the time the user input in the box, this took way too long to fix but now I can correctly save the next break for each break saved by the user. As you can see in the picture they are rounded to the lower 60,000 which is the minute not including seconds and milliseconds unlike before where I thought they were saved like that but weren't

Update attachment

Fixed logic for saving the timestamp to local storage

Update attachment

Time is now saved as UNIX timestamp (rounded down to the current minute)

Update attachment

Changed next break input to date and time, there is no way the way I did it is the best way in JS but it does work so that's fine.

Update attachment

commented a lot of code and slowly copy and pasting and modifying it and modifying and refactoring other code to fix everything, so far I have managed to create placeholder bars and labels on initial load of the website, I need to then update the updateTimers function to update these progress bars and labels, and in the future also add a delete button. do it right or do it twice hopefully I can still finish by the end of today

Update attachment

Whole code needs to be refactored to use UNIX timestamps instead of the noob way I'm doing now. Here's how break timer looks and the work timers need to look more like this instead they count all previous time instead of only the time for the work period which means the percentage of time left until the break is very small compared to what it should be.

Update attachment

nextBreak is now updated in localStorage however, audio isn't played when a break starts or ends and also the value and maxes while correct needs to be changed to show progress of the current break instead of the whole day until the next break (the middle break won't change since the time span is the whole day but the other two are clearly wrong)

Update attachment

Now it correctly shows when the break ends if the break is in progress and the progress bar shows the progress of the break instead of work interval. Finally I need to add logic to update localStorage when the nextBreak is passed and completed to update the time of the next break and refresh the page unless the new value is updated to a time that is in the future (in case the user closed the page and missed a few breaks, also make sure to not play the alarms in this case since it will play multiple alerts possibly). Also to play an alert when a break starts and when it ends.

Update attachment

It's all coming together, I need to add audio for when a break starts and also update the next break values and refactor when the add form is submitted store the minute instead of converting it later, also I need to add the if break is in progress or complete logic.

Update attachment

Set the value and max for each of the timer , however now I need to update the logic for calculating next break since the user only sets the initial next break the program needs to update it for each new break and also update the label to display this information

Update attachment

Added CSS to pin a transparent image to the bottom right of the background and make the page width 500px might change that in the future but the image in the background is here to stay. Also renamed the program to Trixie Timer, ITS A WORKING TITLE

Update attachment

Converted the next break time to the Nth minute of the day same thing for time and the way time updates, now everything is stored as the Nth minute of the day , next I will make the progress bar value and max set to current minute of the day and break minute, then if break minute >= current minute change the sample text to show Break until (time) and play an alert to notify the user that it is a break time Else make the label show Work

Update attachment

Refactored a bit and also added better comments and made it so that when the user submits a form it refreshes the page and clears the form, this is so that the progress bar and label for it then appear under the Timers heading. Also switched to chromium to test it and everything seems to save to local storage correctly.

Update attachment

Added some comments and made a label appear next to the progress bar and then a new line so that each timer appears on a different line.

Update attachment

Managed to make it have one progress bar for each break saved to localStorage, felt tired today didn't do much

Update attachment

Added value and max to the bar and managed to make a loop to print to console all of the details of each break the user has saved to local storage.

Update attachment

Added a progress bar from javascript, i need to set it to have values based on the timers stored in local storage, and then update it so that it creates one progress bar for each timer saved

Update attachment

Changed the heading for the div which will contain the timers, and managed to get the if statement to work properly, that took way too long. Now if any inputs are missing the values don't save to local storage, meaning you have to input all values to add a new timer. This would be so much easier for a client server application

Changed colour, trying to make a conditional that if the inputs are empty it doesn't do the rest of the function but it doesn't work (video shows it outputting the values and they are all there so it should print the same thing with B at the start instead but it doesn't it prints the 0 which means the if statement didn't work)

Sapphire Sapphire over 1 year ago
Also made it append the H1 that says test into the div using JS. It’s where I plan to put the timers and when the timers reach the end they should alert the user with audio.

I fixed saving data to the local storage. I tried to implement something to make the user input into the 'break for' and 'every' interval boxes remove any letters they input and only keep the numbers, however to due to how firefox and safari work (likely related to the Bugzilla link from the previous devlog) my method doesn't work on those browsers whereas chromium doesn't even need my method it just works. I just removed all of the code and added a text label to tell the user to only enter the number. The bug won't affect client server browser applications so I believe thats why it's marked as wontfix but for what I was trying to do implementing what I wanted seems impossible, I think Mozilla is trying to kill local only websites (running html css and js locally only not from a server or from static servers that only serve the files like GitHub pages) but I don't have the expertise to prove it but I am starting to believe that Chromium are actually the good guys. If it wasn't for them you would be able to make way more better programs that work without internet or from github pages and you wouldn't have to pay for server costs since github pages hosts the files for free. Reminder: Google pays Mozilla and owns a cloud server platform. My conspiracy theory is coming together... I hereby recommend Ungoogled-Chromium to anyone reading this

Update attachment

Now my program uses addEventListener instead of onchange but it didn't fix having to exit the textbox to update so I also made it constantly re run the script every 360ms as well which is indeed called debouncing. I tried some things to make it so they can only enter numbers in the minutes input boxes one of the worked. Well actually it works in chromium but not safari and firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1398528 status: wontfix ??? opened 8 years ago ???

Added error checking so it shows a comment if the break interval is longer than the every input, added type casting to the two inputs and added text to signify it should be in minutes, added some comments and todos and refactored code a bit, added a space between minutes and the text after it which shows the work amount.

Next i want to try the JS way to call the function that calculates the work interval, instead of using onchange in html since right now it only updates text after you exit the text box (shown in video) but I want it to be like password boxes on other websites, it updates live as you are still typing (with a small delay so it doesn't flicker as you are still making changes I think it's called debounce), also users can enter letters even though in the html I put type=number (which would work if I was using a server since it won't submit the form but this thats not how it works for how i'm doing it which is local js only and no backend code). Also I changed the live server extension settings to refresh the page when I save the files instead of on every change.

Made it so that when break length and every (how often the break should be) are entered or changes, it calculates and shows how long you will be working for to make it clear that the every input is the length including the break so for example every 60 minutes you will have a break for 10 minutes therefore you will be working for 50 minutes.

The goal right now is to get to a point where you can add that break and a 1 hour break every four hours at the same time so during the 3 hours of work you work in 3 50/10minutes sections but then take a long break for 1 hour which overrides the 50/10 timer (assuming0-8=sleep this leads to 10 hours of work and 6 hours of break spread out through the day for example to eat 3 meals and take a shower before bed during the 1 hour breaks and to stretch/exercise during the shorter breaks)

Also hopefully I will implement a feature to do a case opening for which stretch/exercise/activity you will be doing during your break (optional)

Update attachment

Made it so that the inputs from the add break form save to localStorage and they have ids based on the number of breaks that exist so they can be individually referenced but now I have to create logic to tell if a previous break has been delete

Update attachment

Removed some stuff because I realised I need to learn the JS basics so I can do what I want in my other project The White Room, but I was skipping ahead to the Canvas API and Trigonometry.

Update attachment

Added a canvas and white border to the canvas 500x500px to try draw an analogue clock using JS. Also removed the progress bars and just stored the time in variables instead

Update attachment

Can access submitted form data from JS (this example just prints them in console)

Now the progress bars update automatically. Shown: minute hand and second hand incrementing

Updated main.js so that the three progress parts are set to the current value on page refresh. Video shows me refreshing the page and the seconds hand progress bar updating

Set up live server, and split it into index.html, main.js and, styles.css.

Clicking the progress bars adds text to the end

Initial HTML file started, also made <body2> with a horizontal rule (<hr>) above it to test things out but it will be removed later

Update attachment