Snapshot viewer: auto-advancing slideshow with pause and open-in-tab #98
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When browsing snapshots for a clip, there is no way to auto-play through them — every frame requires a manual click and a full page reload. There is also no way to view a snapshot at full scale without inspecting the image URL manually.
Two improvements are needed:
Explored the current snapshot viewer. Key findings:
snapshots.htmluses full-page navigation (?n=Nlinks) for Prev/Next — every frame loads the whole page.base.html._album_responseinsnapshots.pyonly computes the label for the current framen.Plan of attack:
_album_response: add alabelslist (all labels computed upfront) to the template context alongside the existing fields. The per-framelabelkey is dropped; the template useslabels[n]for the initial render.snapshots.html: add a<script>block that embedstotal,imgBaseUrl,baseUrl,labelsfrom Jinja as JS constants. A singleSLIDE_INTERVAL_MSconstant (top of the script block) is the single place to change the delay. AgoTo(n)function handles all frame transitions — wraps the index for looping, updates the<img src>, counter, label, Prev/Next hrefs, and open-in-tab href, then resets the interval. Prev/Next become onclick JS calls instead of full-page links. Pause/Un-Pause button togglesclearInterval/setInterval.Files changed:
src/cang/web/routes/snapshots.py,src/cang/web/templates/snapshots.html.