mirror of
https://github.com/tmdinosaurcenter/kiosk-guestbook.git
synced 2026-06-04 00:10:16 -06:00
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)
This commit is contained in:
+1
-2
@@ -4,5 +4,4 @@
|
|||||||
envsubst < /app/templates/index.html.template > /app/templates/index.html
|
envsubst < /app/templates/index.html.template > /app/templates/index.html
|
||||||
|
|
||||||
# Start Gunicorn; using an environment variable for workers (default is 3)
|
# 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 ${GUNICORN_WORKERS:-3}
|
||||||
exec gunicorn --bind 0.0.0.0:8000 app:app --workers ${WORKERS:-3}
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import csv
|
import csv
|
||||||
|
import os
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
|
||||||
# TODO: Hardcoded relative path — breaks if script is run from a different directory.
|
DATABASE = os.environ.get('DATABASE_PATH', 'guestbook.db')
|
||||||
# Replace with: DATABASE = os.environ.get('DATABASE_PATH', 'guestbook.db') and import os.
|
|
||||||
DATABASE = 'guestbook.db'
|
|
||||||
EXPORT_FILE = 'mailchimp_export.csv'
|
EXPORT_FILE = 'mailchimp_export.csv'
|
||||||
|
|
||||||
def export_guestbook_to_csv():
|
def export_guestbook_to_csv():
|
||||||
|
|||||||
@@ -23,16 +23,17 @@
|
|||||||
.scrolling-content {
|
.scrolling-content {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
font-size: 1.25rem;
|
||||||
animation: scroll-left linear infinite;
|
animation: scroll-left linear infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes scroll-left {
|
@keyframes scroll-left {
|
||||||
0% {
|
0% {
|
||||||
transform: translateX(100vw);
|
transform: translateX(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
100% {
|
||||||
transform: translateX(-100%);
|
transform: translateX(-50%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -97,10 +98,16 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Scrolling Guest Entries at the Bottom -->
|
<!-- Scrolling Guest Entries at the Bottom -->
|
||||||
|
<!-- Content is duplicated so the loop is seamless: animate 0 → -50% -->
|
||||||
<div class="scrolling-wrapper">
|
<div class="scrolling-wrapper">
|
||||||
<div class="scrolling-content">
|
<div class="scrolling-content">
|
||||||
{% for guest in guests %}
|
{% for guest in guests %}
|
||||||
<span class="me-4">
|
<span class="me-5">
|
||||||
|
<strong>{{ guest[0] }}</strong> from {{ guest[1] }}
|
||||||
|
</span>
|
||||||
|
{% endfor %}
|
||||||
|
{% for guest in guests %}
|
||||||
|
<span class="me-5">
|
||||||
<strong>{{ guest[0] }}</strong> from {{ guest[1] }}
|
<strong>{{ guest[0] }}</strong> from {{ guest[1] }}
|
||||||
</span>
|
</span>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -114,8 +121,9 @@
|
|||||||
const content = document.querySelector(".scrolling-content");
|
const content = document.querySelector(".scrolling-content");
|
||||||
|
|
||||||
function updateScrollSpeed() {
|
function updateScrollSpeed() {
|
||||||
const totalDistance = window.innerWidth + content.offsetWidth;
|
// Travel distance is half the total width (one copy of the list)
|
||||||
content.style.animationDuration = (totalDistance / pixelsPerSecond) + "s";
|
const oneCopyWidth = content.offsetWidth / 2;
|
||||||
|
content.style.animationDuration = (oneCopyWidth / pixelsPerSecond) + "s";
|
||||||
}
|
}
|
||||||
|
|
||||||
updateScrollSpeed();
|
updateScrollSpeed();
|
||||||
|
|||||||
Reference in New Issue
Block a user