From 46dca45e047788ff36bed9247de7d6d570aa3424 Mon Sep 17 00:00:00 2001 From: Steve Dogiakos Date: Mon, 9 Mar 2026 20:52:00 -0600 Subject: [PATCH] fix: correct WORKERS var, export path, and seamless marquee loop - entrypoint.sh: use GUNICORN_WORKERS to match example.env (#17) - guestbook_export.py: read DATABASE_PATH from env instead of hardcoded relative path (#18) - Scrolling marquee: duplicate guest list for seamless loop, animate translateX(0) to translateX(-50%), increase font to 1.25rem, fix JS speed calc to use half content width (#20) --- entrypoint.sh | 3 +-- scripts/guestbook_export.py | 5 ++--- templates/index.html.template | 18 +++++++++++++----- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 4ac9629..23dbe32 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,5 +4,4 @@ envsubst < /app/templates/index.html.template > /app/templates/index.html # Start Gunicorn; using an environment variable for workers (default is 3) -# TODO: Variable mismatch — example.env sets GUNICORN_WORKERS but this reads WORKERS. Change to ${GUNICORN_WORKERS:-3}. -exec gunicorn --bind 0.0.0.0:8000 app:app --workers ${WORKERS:-3} +exec gunicorn --bind 0.0.0.0:8000 app:app --workers ${GUNICORN_WORKERS:-3} diff --git a/scripts/guestbook_export.py b/scripts/guestbook_export.py index 310d024..fe85294 100644 --- a/scripts/guestbook_export.py +++ b/scripts/guestbook_export.py @@ -1,9 +1,8 @@ import csv +import os import sqlite3 -# TODO: Hardcoded relative path — breaks if script is run from a different directory. -# Replace with: DATABASE = os.environ.get('DATABASE_PATH', 'guestbook.db') and import os. -DATABASE = 'guestbook.db' +DATABASE = os.environ.get('DATABASE_PATH', 'guestbook.db') EXPORT_FILE = 'mailchimp_export.csv' def export_guestbook_to_csv(): diff --git a/templates/index.html.template b/templates/index.html.template index dcdbdce..1cfee32 100644 --- a/templates/index.html.template +++ b/templates/index.html.template @@ -23,16 +23,17 @@ .scrolling-content { display: inline-block; padding: 10px; + font-size: 1.25rem; animation: scroll-left linear infinite; } @keyframes scroll-left { 0% { - transform: translateX(100vw); + transform: translateX(0); } 100% { - transform: translateX(-100%); + transform: translateX(-50%); } } @@ -97,10 +98,16 @@ +
{% for guest in guests %} - + + {{ guest[0] }} from {{ guest[1] }} + + {% endfor %} + {% for guest in guests %} + {{ guest[0] }} from {{ guest[1] }} {% endfor %} @@ -114,8 +121,9 @@ const content = document.querySelector(".scrolling-content"); function updateScrollSpeed() { - const totalDistance = window.innerWidth + content.offsetWidth; - content.style.animationDuration = (totalDistance / pixelsPerSecond) + "s"; + // Travel distance is half the total width (one copy of the list) + const oneCopyWidth = content.offsetWidth / 2; + content.style.animationDuration = (oneCopyWidth / pixelsPerSecond) + "s"; } updateScrollSpeed();