Add WORKLOG.md — continuation notes for any machine
Browse filesCaptures project overview, live URLs, deploy workflow, all features
added, visitor-counter details (counterapi.dev key/endpoints), and
next ideas so work can resume on another laptop via git clone.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- WORKLOG.md +55 -0
WORKLOG.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DesignForge Pro — Work Log
|
| 2 |
+
|
| 3 |
+
> Continuation notes so any machine (or a fresh Claude session) can pick up where we left off.
|
| 4 |
+
> This file lives in the repo on purpose — `git clone` it on the new laptop and read this first.
|
| 5 |
+
|
| 6 |
+
## What this is
|
| 7 |
+
- **DesignForge Pro** — a Canva-style design editor. Single static `index.html` (~2000 lines) built on **Fabric.js 5.3.0** (CDN). No backend, no build step.
|
| 8 |
+
- **Hugging Face static Space:** `mlmihjaz/LTM`
|
| 9 |
+
- Repo / page: https://huggingface.co/spaces/mlmihjaz/LTM
|
| 10 |
+
- Live app (static host): **https://mlmihjaz-ltm.static.hf.space** (note: `.static.hf.space`, not `.hf.space`)
|
| 11 |
+
- Owner: Mihjaz · mlmihjaz@gmail.com · FB https://www.facebook.com/mlmihjaz · WhatsApp +94 777 869 736
|
| 12 |
+
|
| 13 |
+
## How to deploy
|
| 14 |
+
Plain git over HTTPS to the HF remote (`origin` = the Space repo):
|
| 15 |
+
```
|
| 16 |
+
git add index.html
|
| 17 |
+
git commit -m "..."
|
| 18 |
+
git push origin main # pushes straight to the live Space; it rebuilds in seconds
|
| 19 |
+
```
|
| 20 |
+
Credentials were cached on the original laptop. **On a new laptop you'll need to auth** — `huggingface-cli login` (or a write token as the git password) before `git push` works.
|
| 21 |
+
|
| 22 |
+
Verify a deploy landed:
|
| 23 |
+
```
|
| 24 |
+
curl -sL https://mlmihjaz-ltm.static.hf.space/ | grep -c <some-unique-string-you-just-added>
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
## Features implemented (June 2026 session)
|
| 28 |
+
- **Bug fixes:** stroke-only shapes (checkmark/cross/plus) were filled blobs → fixed; horizontal lines landed off-center → fixed; undo/redo pushed duplicate history states (needed 2 presses) → added dedupe in `saveHist`.
|
| 29 |
+
- **Shape editing:** corner-radius slider, border style (solid/dashed/dotted), gradient fill/mix (two colors + direction) for shapes & lines.
|
| 30 |
+
- **Pen tool:** click points → polygon; double-click/Enter to finish, Esc to cancel.
|
| 31 |
+
- **More shapes:** added "More Shapes" category (semicircle, quarter, chevron, plus, chat, ribbon, flag, pac).
|
| 32 |
+
- **UX:** left panel auto-switches to Text/Shapes on selection; `Ctrl+A` select-all; delete works on multi-selection.
|
| 33 |
+
- **Photos tab (Pixabay):** image search next to Templates. API key in `index.html` (`PIXABAY_KEY`). Both API and image CDN send CORS `*`, so canvas export stays clean.
|
| 34 |
+
- **Templates:** intentionally "coming soon" banner — clicking one only resizes the canvas. **TODO: real templates (text + shapes + bg).**
|
| 35 |
+
- **Branding/contact:** welcome popup (once per browser via localStorage `df_welcomed`), scrolling promo marquee in top bar, WhatsApp + Facebook buttons top-right, credit + social links in status bar.
|
| 36 |
+
- **Visitor counter** (status bar) — see below.
|
| 37 |
+
- **Load glitch fix:** canvas now fit-zooms on first paint (was 100% then snap via `setTimeout`).
|
| 38 |
+
|
| 39 |
+
## Visitor counter details
|
| 40 |
+
- Service: **counterapi.dev v1** (free, no auth, CORS `*`). No backend needed.
|
| 41 |
+
- Namespace/key: `designforge-ltm-mlmihjaz` / `visits`
|
| 42 |
+
- Increment: `GET https://api.counterapi.dev/v1/designforge-ltm-mlmihjaz/visits/up`
|
| 43 |
+
- Read (CDN-cached! always add a cache-buster): `.../visits/?cb=<ts>`
|
| 44 |
+
- Set: `.../visits/set?count=N` (cannot set 0 — Go `required` rejects zero)
|
| 45 |
+
- App display = `BASE + count`, with **BASE = 0** (so it shows the true server count).
|
| 46 |
+
- Counts once per session (sessionStorage `df_visit_counted`); caches last value in localStorage `df_visits_cache` for instant paint + offline fallback.
|
| 47 |
+
- Server value was seeded to ~1990; it has since climbed naturally (~1996 at last check). To re-seed: hit the `set?count=N` endpoint.
|
| 48 |
+
|
| 49 |
+
## Known notes / next ideas
|
| 50 |
+
- Templates are placeholders — biggest remaining "real Canva" feature.
|
| 51 |
+
- Counter relies on a 3rd-party free service; if it dies, swap for a tiny Gradio/Docker Space hosting a JSON counter.
|
| 52 |
+
- Possible next: save/load projects (localStorage + JSON import/export), alignment/snap guides, grouping, multi-page.
|
| 53 |
+
|
| 54 |
+
## Git history (recent)
|
| 55 |
+
Run `git log --oneline` for the full list. Latest session commits: shape/undo fixes → welcome/promo → sidebar spacing → visitor counter (+ stale-read fix, seed 1990) → load-glitch fix.
|