The Logged drinks section at the bottom of the WaterTrack page is a live, scrollable history of every drink you have recorded in the current day. Each entry shows the fluid ounce amount and the exact time it was logged. Because the entire list is serialised toDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/mr-sunset/watertracker/llms.txt
Use this file to discover all available pages before exploring further.
localStorage on every update, your history survives page refreshes, browser restarts, and device sleeps — it will be right there the next time you open the app.
Log structure
Each entry in the list is a<li> element with the class drink-entry, containing two <span> children:
- The first
<span>displays the logged amount followed byoz. - The
.drink-time<span>shows the timestamp formatted as locale-awareHH:MM AM/PM, produced by:
drinks.prepend(li), so the most recent drink is always visible without scrolling.
Empty state
The list always displays a placeholder message when no drinks have been logged yet. The exact message depends on the context:Initial load / no history
When the page loads and
localStorage contains no drink data, the list renders:“No logged drinks”After a reset
When you confirm a reset via the Settings panel, the list is replaced with:“No drinks logged yet today!”
.empty-state CSS class, which centres and italicises the text in a muted grey:
Persistence
Every timelogDrink() is called, the full drinks array is immediately written to localStorage under the key water_logged_drinks as a JSON-serialised array of { amount, time } objects:
localStorage looks like this:
DOMContentLoaded fires and the saved array is read back:
renderDrinkUI() — which always prepends — reconstructs the list in the correct newest-first order.
The running total is stored separately under the key
water_total_intake as a plain number. Both keys are cleared together when you use the Reset button.Scrolling
The#drinks list has a capped height with vertical scrolling enabled, so the rest of the page layout stays clean no matter how many drinks you log in a day: