43 lines
1.3 KiB
Markdown
43 lines
1.3 KiB
Markdown
|
||
# Countdown Generator (Flask + Jinja)
|
||
|
||
A tiny two-page app:
|
||
- `/` – a setup form to pick the target date/time and styles.
|
||
- `/countdown?…` – the shareable countdown page, configured entirely from query params.
|
||
|
||
## Quick start
|
||
|
||
```bash
|
||
python3 -m venv .venv
|
||
source .venv/bin/activate
|
||
pip install flask
|
||
python app.py
|
||
# open http://127.0.0.1:5000/
|
||
```
|
||
|
||
## URL Parameters
|
||
|
||
- `target` — ISO-8601 local datetime (e.g. `2025-09-06T12:00`)
|
||
- `title` — heading text
|
||
- `scheme` — `dark` or `light`
|
||
- `accent` — CSS color (e.g. `#ff6b6b` or `hsl(260 90% 60%)`)
|
||
- `fg` / `bg` — text/background colors
|
||
- `radius` — number (px) for rounded corners
|
||
- `shadow` — `none|sm|md|lg`
|
||
- `font` — CSS font-family string
|
||
- `millis` — `1` to show milliseconds
|
||
- `rounded_unit` — `none|minutes|hours|days` (rounds to nearest)
|
||
|
||
## Example
|
||
|
||
```
|
||
/countdown?title=Ignacio%27s%20Trip&target=2025-09-06T12:00&scheme=dark&accent=%238b5cf6&radius=20&shadow=lg&font=system-ui&millis=1
|
||
```
|
||
|
||
## Notes
|
||
|
||
- The generator reflects any params back into the form, so you can tweak and re-generate links.
|
||
- No external assets required. Everything is pure HTML/CSS/JS with Flask+Jinja.
|
||
- The countdown runs with `requestAnimationFrame` and updates at ~60Hz (with ms on if enabled).
|
||
- If no `target` is provided, `/countdown` redirects to `/`.
|