Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

Halloween: the spider drops at every start and after half an hour away, Stats gets its own spooky corner, and the workout a quiet one (Also during workouts)

Duarte Santos925f117acee3
diff --git a/frontend/src/components/RestTimer.jsx b/frontend/src/components/RestTimer.jsx
index 88c72a8ea..3642db8b2 100644
--- a/frontend/src/components/RestTimer.jsx
+++ b/frontend/src/components/RestTimer.jsx
@@ -5,6 +5,7 @@ import { REST_MAX } from '../lib/duration.js'
import { durationSheet } from './DurationWheel.jsx'
import { Button } from './ui.jsx'
import Icon from './Icon.jsx'
+import { SeasonDeco } from './Seasonal.jsx'
const clock = sec => Math.floor(sec / 60) + ':' + String(sec % 60).padStart(2, '0')
@@ -117,6 +118,7 @@ export default function RestTimer() {
return (
<div id="timer" className={'rest' + (timer.paused ? ' paused' : '') + (timer.kind === 'switch' ? ' switch' : '') + (timer.ready ? ' ready' : '')}>
<div className="bar" aria-hidden="true"><i style={{ transform: `scaleX(${pct / 100})` }} /></div>
+ <SeasonDeco spot="rest-timer" workout />
<button type="button" className="tclock" onClick={adjustRestSheet}
aria-label={(timer.ready ? t('Ready') : clock(timer.left)) + '. ' + t('Change the time left')}>
<span className="t" role={timer.ready ? 'status' : undefined} data-alt={timer.ready ? '0:00' : t('Ready')}>{timer.ready ? t('Ready') : clock(timer.left)}</span>
diff --git a/frontend/src/components/Seasonal.jsx b/frontend/src/components/Seasonal.jsx
index fe4ff74a2..20c124e28 100644
--- a/frontend/src/components/Seasonal.jsx
+++ b/frontend/src/components/Seasonal.jsx
@@ -1,6 +1,6 @@
import { Suspense, lazy, useEffect } from 'react'
import { useStore } from '../store/useStore.js'
-import { activeSeason } from '../lib/seasonal.js'
+import { activeSeason, seasonInWorkout } from '../lib/seasonal.js'
/* The main bundle's side of the seasonal themes (lib/seasonal.js): two tiny components that render
nothing at all unless a theme is showing, and only then fetch its module (seasonal/<id>.jsx,
@@ -38,9 +38,13 @@ export function SeasonalLayer({ hidden = false }) {
return <Suspense fallback={null}><Layer hidden={hidden} fresh={firstVisible} /></Suspense>
}
-/** One piece of decoration in a view: `spot` names where ('home-hero', 'home-streak', ...). */
-export function SeasonDeco({ spot }) {
- const id = useSeason()
+/** One piece of decoration in a view: `spot` names where ('home-hero', 'home-streak', ...).
+ `workout` marks a spot on the workout screen or its sheets: those follow the theme's own
+ "Also during workouts" switch as well. */
+export function SeasonDeco({ spot, workout = false }) {
+ const season = useSeason()
+ const inWorkout = useStore(s => seasonInWorkout(s.S))
+ const id = workout && !inWorkout ? null : season
if (!id || !LOADERS[id]) return null
const { Deco } = modOf(id)
return <Suspense fallback={null}><Deco spot={spot} /></Suspense>
diff --git a/frontend/src/components/Seasonal.lazy.test.jsx b/frontend/src/components/Seasonal.lazy.test.jsx
index 63ed681b2..c4faf651d 100644
--- a/frontend/src/components/Seasonal.lazy.test.jsx
+++ b/frontend/src/components/Seasonal.lazy.test.jsx
@@ -57,6 +57,14 @@ describe('fetched only while a theme shows', () => {
expect(document.documentElement.dataset.season).toBeUndefined()
})
+ it('a workout spot stays empty with Also during workouts switched off, and nothing is fetched for it', async () => {
+ st.S = { seasonal: { halloweenWorkout: false } }
+ const { SeasonDeco } = await import('./Seasonal.jsx')
+ await act(async () => root.render(<SeasonDeco spot="workout-hdr" workout />))
+ expect(host.innerHTML).toBe('')
+ expect(st.loaded).toBe(0)
+ })
+
it('out of season on Auto: the same', async () => {
vi.setSystemTime(new Date(2026, 11, 3, 12))
st.S = {}
diff --git a/frontend/src/lib/pt-br-locale.test.js b/frontend/src/lib/pt-br-locale.test.js
index 8198be913..fcbbe27ca 100644
--- a/frontend/src/lib/pt-br-locale.test.js
+++ b/frontend/src/lib/pt-br-locale.test.js
@@ -41,7 +41,7 @@ describe('Brazilian Portuguese locale', () => {
// has to be taught is a number nobody reads. What the numbers stood for is asserted above.
// If the hash fails, review the changed keys and wording before accepting a new one. From
// frontend/: node scripts/pt-br-inheritance-fingerprint.mjs --list
- expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('b62744aa1d45b0a964771ac133d6329819a6a54e58d963e97e1e5a00631c0551')
+ expect(fingerprint, 'pt-PT inheritance changed; review the inherited pt-BR wording').toBe('f18b915a058ef3d5bed71edb043b1726f61c082b0174c52dbcbe61bd45fc812d')
})
// pt-PT labelled Unpair 'Desfazer': Undo, in Portuguese (it is pt-BR's Undo), on the button that
diff --git a/frontend/src/lib/seasonal.js b/frontend/src/lib/seasonal.js
index c85049301..3847a637a 100644
--- a/frontend/src/lib/seasonal.js
+++ b/frontend/src/lib/seasonal.js
@@ -5,8 +5,9 @@
// (components/Seasonal.jsx), so a profile with themes off, or a day out of season, pays nothing.
//
// The choice is a Look setting like Theme and Accent color, so it syncs with the profile:
-// S.seasonal = { halloween: 'auto' | 'on' | 'off', halloweenColors: true }. Absent reads as Auto.
-// What happens once a day (the spider, the pumpkin) is per device, in localStorage below.
+// S.seasonal = { halloween: 'auto' | 'on' | 'off', halloweenColors: true, halloweenWorkout: false }.
+// Absent reads as Auto, without the colours, and with the workout screen decorated.
+// What happens once a day (the pumpkin's surprise) is per device, in localStorage below.
/* One entry per theme. `from` and `to` are [month, day], 1-based and inclusive, in local time:
Halloween is on from 1 October to the end of 31 October and gone on 1 November. The strings
@@ -17,6 +18,7 @@ export const THEMES = [
id: 'halloween', title: 'Halloween', icon: 'pumpkin', tint: 'var(--orange)',
from: [10, 1], to: [10, 31],
colors: 'orange', colorsTitle: 'Spooky colors', colorsNote: 'A pumpkin orange accent while Halloween shows. Your own color comes back after.',
+ workoutTitle: 'Also during workouts', workoutNote: 'A cobweb in the header, bats behind the rest timer, pumpkins on the finish screen. Never on your sets.',
during: 'Spiders, bats and one shy pumpkin until the end of October. Never during a workout.',
back: 'Back next October. The spiders are on holiday.',
},
@@ -59,6 +61,12 @@ export function seasonAccent(S, now = new Date()) {
return th?.colors && S?.seasonal?.[id + 'Colors'] === true ? th.colors : null
}
+/** Whether the showing theme also decorates the workout screen: on unless switched off. */
+export function seasonInWorkout(S, now = new Date()) {
+ const id = activeSeason(S, now)
+ return !!id && S?.seasonal?.[id + 'Workout'] !== false
+}
+
/* Once a day per device: true the first time it is asked on a local date, false after. Storage
that is not there (a private window, blocked site data) answers false, so nothing repeats. */
const pad = n => String(n).padStart(2, '0')
diff --git a/frontend/src/lib/seasonal.test.js b/frontend/src/lib/seasonal.test.js
index fc7d64593..8f1a35040 100644
--- a/frontend/src/lib/seasonal.test.js
+++ b/frontend/src/lib/seasonal.test.js
@@ -1,7 +1,7 @@
// @vitest-environment happy-dom
// Seasonal themes (lib/seasonal.js): the date window, the choice, the opt-in colours, once a day.
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
-import { THEMES, inSeason, seasonChoice, themeOn, activeSeason, seasonAccent, onceToday, doneToday } from './seasonal.js'
+import { THEMES, inSeason, seasonChoice, themeOn, activeSeason, seasonAccent, seasonInWorkout, onceToday, doneToday } from './seasonal.js'
const local = (y, m, d, h = 12, min = 0) => new Date(y, m - 1, d, h, min)
@@ -66,6 +66,16 @@ describe('the choice', () => {
})
})
+describe('during workouts', () => {
+ const oct = local(2026, 10, 25), may = local(2026, 5, 3)
+ it('on by default while the theme shows, off when switched off, never out of season', () => {
+ expect(seasonInWorkout({}, oct)).toBe(true)
+ expect(seasonInWorkout({ seasonal: { halloweenWorkout: false } }, oct)).toBe(false)
+ expect(seasonInWorkout({}, may)).toBe(false)
+ expect(seasonInWorkout({ seasonal: { halloween: 'off' } }, oct)).toBe(false)
+ })
+})
+
describe('once a day', () => {
beforeEach(() => localStorage.clear())
afterEach(() => localStorage.clear())
diff --git a/frontend/src/locales/ar.js b/frontend/src/locales/ar.js
index d56061211..9a38e2746 100644
--- a/frontend/src/locales/ar.js
+++ b/frontend/src/locales/ar.js
@@ -2619,6 +2619,8 @@ export default {
'None, so dumbbell lifts stay hidden.': 'لا شيء، لذا تبقى تمارين الدمبل مخفية.',
'openGym reads only while it is open: heart rate for workouts of the last day, weigh-ins of the last year. Older workouts stay as they are.': 'يقرأ openGym فقط وهو مفتوح: نبض القلب لتمارين آخر يوم، وقياسات الوزن لآخر سنة. تبقى التمارين الأقدم كما هي.',
// --- seasonal themes (lib/seasonal.js) ---
+ 'Also during workouts': 'أثناء التمرين أيضًا',
+ 'A cobweb in the header, bats behind the rest timer, pumpkins on the finish screen. Never on your sets.': 'شبكة عنكبوت في الترويسة، وخفافيش خلف مؤقت الراحة، ويقطين في شاشة الإنهاء. أبدًا فوق مجموعاتك.',
'Seasonal themes': 'سمات المواسم',
'Little extras for the time of year.': 'لمسات صغيرة تناسب الوقت من السنة.',
'Halloween': 'الهالوين',
diff --git a/frontend/src/locales/bn.js b/frontend/src/locales/bn.js
index 5e5b58382..1079c97db 100644
--- a/frontend/src/locales/bn.js
+++ b/frontend/src/locales/bn.js
@@ -2643,6 +2643,8 @@ export default {
'None, so dumbbell lifts stay hidden.': 'একটাও নেই, তাই ডাম্বেলের ব্যায়াম লুকানো থাকবে।',
'openGym reads only while it is open: heart rate for workouts of the last day, weigh-ins of the last year. Older workouts stay as they are.': 'openGym শুধু খোলা থাকলেই পড়ে: শেষ এক দিনের ওয়ার্কআউটের হার্ট রেট, শেষ এক বছরের ওজন। পুরোনো ওয়ার্কআউট যেমন আছে তেমনই থাকে।',
// --- seasonal themes (lib/seasonal.js) ---
+ 'Also during workouts': 'ওয়ার্কআউটের সময়ও',
+ 'A cobweb in the header, bats behind the rest timer, pumpkins on the finish screen. Never on your sets.': 'হেডারে মাকড়সার জাল, বিশ্রামের টাইমারের পেছনে বাদুড়, শেষে কুমড়ো। আপনার সেটের ওপর কখনো নয়।',
'Seasonal themes': 'মৌসুমি থিম',
'Little extras for the time of year.': 'বছরের এই সময়ের জন্য ছোট্ট কিছু বাড়তি সাজ।',
'Halloween': 'হ্যালোইন',
diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.js
index 39b7aefe8..0ff043d2a 100644
--- a/frontend/src/locales/de.js
+++ b/frontend/src/locales/de.js
@@ -2584,6 +2584,8 @@ export default {
'None, so dumbbell lifts stay hidden.': 'Keine, also bleiben Kurzhantelübungen ausgeblendet.',
'openGym reads only while it is open: heart rate for workouts of the last day, weigh-ins of the last year. Older workouts stay as they are.': 'openGym liest nur, solange es offen ist: Puls für Trainings vom letzten Tag, Wiegungen des letzten Jahres. Ältere Trainings bleiben, wie sie sind.',
// --- seasonal themes (lib/seasonal.js) ---
+ 'Also during workouts': 'Auch im Training',
+ 'A cobweb in the header, bats behind the rest timer, pumpkins on the finish screen. Never on your sets.': 'Ein Spinnennetz im Kopfbereich, Fledermäuse hinter dem Pausentimer, Kürbisse beim Abschluss. Nie auf deinen Sätzen.',
'Seasonal themes': 'Saison-Themen',
'Little extras for the time of year.': 'Kleine Extras passend zur Jahreszeit.',
'Halloween': 'Halloween',
diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.js
index 89fa509d9..2e84d8723 100644
--- a/frontend/src/locales/es.js
+++ b/frontend/src/locales/es.js
@@ -2564,6 +2564,8 @@ export default {
'None, so dumbbell lifts stay hidden.': 'Ninguna, así que los ejercicios con mancuernas quedan ocultos.',
'openGym reads only while it is open: heart rate for workouts of the last day, weigh-ins of the last year. Older workouts stay as they are.': 'openGym solo lee mientras está abierto: pulso de los entrenos del último día, pesajes del último año. Los entrenos anteriores se quedan como están.',
// --- seasonal themes (lib/seasonal.js) ---
+ 'Also during workouts': 'También al entrenar',
+ 'A cobweb in the header, bats behind the rest timer, pumpkins on the finish screen. Never on your sets.': 'Una telaraña en la cabecera, murciélagos detrás del temporizador de descanso, calabazas al terminar. Nunca encima de tus series.',
'Seasonal themes': 'Temas de temporada',
'Little extras for the time of year.': 'Pequeños extras según la época del año.',
'Halloween': 'Halloween',
diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.js
index 79a9d9ae3..a6e10eba2 100644
--- a/frontend/src/locales/fr.js
+++ b/frontend/src/locales/fr.js
@@ -2564,6 +2564,8 @@ export default {
'None, so dumbbell lifts stay hidden.': 'Aucun, donc les exercices aux haltères restent cachés.',
'openGym reads only while it is open: heart rate for workouts of the last day, weigh-ins of the last year. Older workouts stay as they are.': 'openGym ne lit que lorsqu’il est ouvert : fréquence cardiaque des séances du dernier jour, pesées de la dernière année. Les séances plus anciennes restent telles quelles.',
// --- seasonal themes (lib/seasonal.js) ---
+ 'Also during workouts': 'Aussi pendant les séances',
+ 'A cobweb in the header, bats behind the rest timer, pumpkins on the finish screen. Never on your sets.': 'Une toile d\'araignée dans l\'en-tête, des chauves-souris derrière le minuteur de repos, des citrouilles à la fin. Jamais sur tes séries.',
'Seasonal themes': 'Thèmes de saison',
'Little extras for the time of year.': 'Petits bonus selon la saison.',
'Halloween': 'Halloween',
diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.js
index ff25624f6..8d300abd8 100644
--- a/frontend/src/locales/hi.js
+++ b/frontend/src/locales/hi.js
@@ -2564,6 +2564,8 @@ export default {
'None, so dumbbell lifts stay hidden.': 'कोई नहीं, इसलिए डंबल वाली एक्सरसाइज़ छिपी रहेंगी।',
'openGym reads only while it is open: heart rate for workouts of the last day, weigh-ins of the last year. Older workouts stay as they are.': 'openGym सिर्फ़ तब पढ़ता है जब वह खुला हो: पिछले एक दिन के वर्कआउट की धड़कन, पिछले एक साल का वज़न। पुराने वर्कआउट जैसे हैं वैसे ही रहते हैं।',
// --- seasonal themes (lib/seasonal.js) ---
+ 'Also during workouts': 'वर्कआउट के दौरान भी',
+ 'A cobweb in the header, bats behind the rest timer, pumpkins on the finish screen. Never on your sets.': 'हेडर में मकड़ी का जाला, आराम टाइमर के पीछे चमगादड़, आख़िर में कद्दू। आपके सेट पर कभी नहीं।',
'Seasonal themes': 'मौसमी थीम',
'Little extras for the time of year.': 'साल के इस समय के लिए छोटी-छोटी सजावट।',
'Halloween': 'हैलोवीन',
diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.js
index afa3b9dea..d643bca0b 100644
--- a/frontend/src/locales/hu.js
+++ b/frontend/src/locales/hu.js
@@ -2567,6 +2567,8 @@ export default {
'None, so dumbbell lifts stay hidden.': 'Nincs, így a kézisúlyzós gyakorlatok rejtve maradnak.',
'openGym reads only while it is open: heart rate for workouts of the last day, weigh-ins of the last year. Older workouts stay as they are.': 'Az openGym csak nyitott állapotban olvas: az utolsó nap edzéseinek pulzusát és az utolsó egy év mérlegeléseit. A régebbi edzések maradnak, ahogy vannak.',
// --- seasonal themes (lib/seasonal.js) ---
+ 'Also during workouts': 'Edzés közben is',
+ 'A cobweb in the header, bats behind the rest timer, pumpkins on the finish screen. Never on your sets.': 'Pókháló a fejlécben, denevérek a pihenőidőzítő mögött, tökök a végén. Soha nem a sorozataidon.',
'Seasonal themes': 'Szezonális témák',
'Little extras for the time of year.': 'Apró extrák az évszakhoz.',
'Halloween': 'Halloween',
diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.js
index baa3db1fc..457ab333a 100644
--- a/frontend/src/locales/it.js
+++ b/frontend/src/locales/it.js
@@ -2564,6 +2564,8 @@ export default {
'None, so dumbbell lifts stay hidden.': 'Nessuno, quindi gli esercizi con manubri restano nascosti.',
'openGym reads only while it is open: heart rate for workouts of the last day, weigh-ins of the last year. Older workouts stay as they are.': 'openGym legge solo mentre è aperto: battito degli allenamenti dell’ultimo giorno, pesate dell’ultimo anno. Gli allenamenti più vecchi restano come sono.',
// --- seasonal themes (lib/seasonal.js) ---
+ 'Also during workouts': 'Anche durante gli allenamenti',
+ 'A cobweb in the header, bats behind the rest timer, pumpkins on the finish screen. Never on your sets.': 'Una ragnatela nell\'intestazione, pipistrelli dietro il timer di recupero, zucche alla fine. Mai sopra le tue serie.',
'Seasonal themes': 'Temi stagionali',
'Little extras for the time of year.': 'Piccoli extra per il periodo dell\'anno.',
'Halloween': 'Halloween',
diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.js
index 0c130299f..ab1e31f92 100644
--- a/frontend/src/locales/ko.js
+++ b/frontend/src/locales/ko.js
@@ -2564,6 +2564,8 @@ export default {
'None, so dumbbell lifts stay hidden.': '없음, 그래서 덤벨 운동은 숨겨져요.',
'openGym reads only while it is open: heart rate for workouts of the last day, weigh-ins of the last year. Older workouts stay as they are.': 'openGym은 열려 있을 때만 읽어요: 최근 하루 동안의 운동 심박수와 최근 1년의 체중 기록. 그보다 오래된 운동은 그대로 둬요.',
// --- seasonal themes (lib/seasonal.js) ---
+ 'Also during workouts': '운동 중에도',
+ 'A cobweb in the header, bats behind the rest timer, pumpkins on the finish screen. Never on your sets.': '헤더에 거미줄, 휴식 타이머 뒤에 박쥐, 마무리 화면에 호박. 세트 위에는 절대 안 나와요.',
'Seasonal themes': '시즌 테마',
'Little extras for the time of year.': '계절에 맞춘 작은 장식이에요.',
'Halloween': '핼러윈',
diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.js
index 5d760a1ba..08c0eac1a 100644
--- a/frontend/src/locales/pl.js
+++ b/frontend/src/locales/pl.js
@@ -2564,6 +2564,8 @@ export default {
'None, so dumbbell lifts stay hidden.': 'Brak, więc ćwiczenia z hantlami są ukryte.',
'openGym reads only while it is open: heart rate for workouts of the last day, weigh-ins of the last year. Older workouts stay as they are.': 'openGym czyta tylko, gdy jest otwarty: tętno z treningów z ostatniej doby, pomiary wagi z ostatniego roku. Starsze treningi zostają bez zmian.',
// --- seasonal themes (lib/seasonal.js) ---
+ 'Also during workouts': 'Także podczas treningu',
+ 'A cobweb in the header, bats behind the rest timer, pumpkins on the finish screen. Never on your sets.': 'Pajęczyna w nagłówku, nietoperze za minutnikiem przerwy, dynie na podsumowaniu. Nigdy na Twoich seriach.',
'Seasonal themes': 'Motywy sezonowe',
'Little extras for the time of year.': 'Drobne dodatki na tę porę roku.',
'Halloween': 'Halloween',
diff --git a/frontend/src/locales/pt-BR.js b/frontend/src/locales/pt-BR.js
index c343c7e5f..e19b048b3 100644
--- a/frontend/src/locales/pt-BR.js
+++ b/frontend/src/locales/pt-BR.js
@@ -1657,6 +1657,7 @@ export const PT_BR_OVERRIDES = {
'None, so dumbbell lifts stay hidden.': 'Nenhum, então os exercícios com halteres ficam escondidos.',
'openGym reads only while it is open: heart rate for workouts of the last day, weigh-ins of the last year. Older workouts stay as they are.': 'O openGym só lê enquanto está aberto: frequência cardíaca dos treinos do último dia, pesagens do último ano. Os treinos mais antigos ficam como estão.',
// --- seasonal themes (lib/seasonal.js) ---
+ 'A cobweb in the header, bats behind the rest timer, pumpkins on the finish screen. Never on your sets.': 'Uma teia de aranha no cabeçalho, morcegos atrás do cronômetro de descanso, abóboras no fim. Nunca em cima das suas séries.',
'A pumpkin orange accent while Halloween shows. Your own color comes back after.': 'Um destaque laranja abóbora enquanto durar o Halloween. Depois sua cor volta.',
'Spiders, bats and one shy pumpkin until the end of October. Never during a workout.': 'Aranhas, morcegos e uma abóbora tímida até o fim de outubro. Nunca durante um treino.',
'Little extras for the time of year.': 'Pequenos extras de acordo com a época do ano.',
diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.js
index f35e6f365..779f65a50 100644
--- a/frontend/src/locales/pt.js
+++ b/frontend/src/locales/pt.js
@@ -2564,6 +2564,8 @@ export default {
'None, so dumbbell lifts stay hidden.': 'Nenhum, por isso os exercícios com halteres ficam escondidos.',
'openGym reads only while it is open: heart rate for workouts of the last day, weigh-ins of the last year. Older workouts stay as they are.': 'O openGym só lê enquanto está aberto: frequência cardíaca dos treinos do último dia, pesagens do último ano. Os treinos mais antigos ficam como estão.',
// --- seasonal themes (lib/seasonal.js) ---
+ 'Also during workouts': 'Também durante os treinos',
+ 'A cobweb in the header, bats behind the rest timer, pumpkins on the finish screen. Never on your sets.': 'Uma teia de aranha no cabeçalho, morcegos atrás do temporizador de descanso, abóboras no fim. Nunca em cima das tuas séries.',
'Seasonal themes': 'Temas da época',
'Little extras for the time of year.': 'Pequenos extras conforme a altura do ano.',
'Halloween': 'Halloween',
diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.js
index 010af101b..12d74ea25 100644
--- a/frontend/src/locales/ru.js
+++ b/frontend/src/locales/ru.js
@@ -2568,6 +2568,8 @@ export default {
'None, so dumbbell lifts stay hidden.': 'Нет, поэтому упражнения с гантелями скрыты.',
'openGym reads only while it is open: heart rate for workouts of the last day, weigh-ins of the last year. Older workouts stay as they are.': 'openGym читает данные, только пока открыт: пульс тренировок за последние сутки, взвешивания за последний год. Старые тренировки остаются как есть.',
// --- seasonal themes (lib/seasonal.js) ---
+ 'Also during workouts': 'И во время тренировки',
+ 'A cobweb in the header, bats behind the rest timer, pumpkins on the finish screen. Never on your sets.': 'Паутина в шапке, летучие мыши за таймером отдыха, тыквы на итогах. Никогда поверх твоих подходов.',
'Seasonal themes': 'Сезонные темы',
'Little extras for the time of year.': 'Маленькие сюрпризы по сезону.',
'Halloween': 'Хеллоуин',
diff --git a/frontend/src/locales/sv.js b/frontend/src/locales/sv.js
index 5af7ec4e8..86d33fd0f 100644
--- a/frontend/src/locales/sv.js
+++ b/frontend/src/locales/sv.js
@@ -2611,6 +2611,8 @@ export default {
'None, so dumbbell lifts stay hidden.': 'Inga, så hantelövningar förblir dolda.',
'openGym reads only while it is open: heart rate for workouts of the last day, weigh-ins of the last year. Older workouts stay as they are.': 'openGym läser bara medan appen är öppen: puls för pass från det senaste dygnet, vägningar från det senaste året. Äldre pass förblir som de är.',
// --- seasonal themes (lib/seasonal.js) ---
+ 'Also during workouts': 'Även under passen',
+ 'A cobweb in the header, bats behind the rest timer, pumpkins on the finish screen. Never on your sets.': 'Ett spindelnät i sidhuvudet, fladdermöss bakom vilotimern, pumpor när passet är klart. Aldrig på dina set.',
'Seasonal themes': 'Säsongsteman',
'Little extras for the time of year.': 'Små extragrejer efter årstiden.',
'Halloween': 'Halloween',
diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.js
index d113f56cc..50c0bd1c8 100644
--- a/frontend/src/locales/th.js
+++ b/frontend/src/locales/th.js
@@ -2575,6 +2575,8 @@ export default {
'None, so dumbbell lifts stay hidden.': 'ไม่มี ท่าที่ใช้ดัมเบลจึงถูกซ่อนไว้',
'openGym reads only while it is open: heart rate for workouts of the last day, weigh-ins of the last year. Older workouts stay as they are.': 'openGym อ่านเฉพาะตอนที่เปิดอยู่: อัตราการเต้นของหัวใจของการฝึกในวันล่าสุด และน้ำหนักในหนึ่งปีล่าสุด การฝึกที่เก่ากว่านั้นจะเหมือนเดิม',
// --- seasonal themes (lib/seasonal.js) ---
+ 'Also during workouts': 'ระหว่างออกกำลังกายด้วย',
+ 'A cobweb in the header, bats behind the rest timer, pumpkins on the finish screen. Never on your sets.': 'ใยแมงมุมที่ส่วนหัว ค้างคาวหลังตัวจับเวลาพัก ฟักทองตอนจบ ไม่บังเซ็ตของคุณเด็ดขาด',
'Seasonal themes': 'ธีมตามฤดูกาล',
'Little extras for the time of year.': 'ของตกแต่งเล็กๆ ตามช่วงเวลาของปี',
'Halloween': 'ฮาโลวีน',
diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.js
index 10a496dce..72affc211 100644
--- a/frontend/src/locales/tr.js
+++ b/frontend/src/locales/tr.js
@@ -2564,6 +2564,8 @@ export default {
'None, so dumbbell lifts stay hidden.': 'Yok, bu yüzden dambıl hareketleri gizli kalır.',
'openGym reads only while it is open: heart rate for workouts of the last day, weigh-ins of the last year. Older workouts stay as they are.': 'openGym yalnızca açıkken okur: son bir günün antrenmanları için nabız, son bir yılın tartılmaları. Daha eski antrenmanlar olduğu gibi kalır.',
// --- seasonal themes (lib/seasonal.js) ---
+ 'Also during workouts': 'Antrenman sırasında da',
+ 'A cobweb in the header, bats behind the rest timer, pumpkins on the finish screen. Never on your sets.': 'Başlıkta bir örümcek ağı, dinlenme sayacının arkasında yarasalar, bitişte balkabakları. Setlerinin üstünde asla.',
'Seasonal themes': 'Sezon temaları',
'Little extras for the time of year.': 'Mevsime göre küçük sürprizler.',
'Halloween': 'Cadılar Bayramı',
diff --git a/frontend/src/locales/uk.js b/frontend/src/locales/uk.js
index ad4818978..bea8f0072 100644
--- a/frontend/src/locales/uk.js
+++ b/frontend/src/locales/uk.js
@@ -2561,6 +2561,8 @@ export default {
'None, so dumbbell lifts stay hidden.': 'Немає, тож вправи з гантелями приховані.',
'openGym reads only while it is open: heart rate for workouts of the last day, weigh-ins of the last year. Older workouts stay as they are.': 'openGym читає дані, лише поки відкритий: пульс тренувань за останню добу, зважування за останній рік. Старіші тренування лишаються як є.',
// --- seasonal themes (lib/seasonal.js) ---
+ 'Also during workouts': 'І під час тренування',
+ 'A cobweb in the header, bats behind the rest timer, pumpkins on the finish screen. Never on your sets.': 'Павутина в шапці, кажани за таймером відпочинку, гарбузи на підсумках. Ніколи поверх твоїх підходів.',
'Seasonal themes': 'Сезонні теми',
'Little extras for the time of year.': 'Маленькі сюрпризи до пори року.',
'Halloween': 'Гелловін',
diff --git a/frontend/src/locales/zh-TW.js b/frontend/src/locales/zh-TW.js
index 2c6f1ee37..a9e7a28e2 100644
--- a/frontend/src/locales/zh-TW.js
+++ b/frontend/src/locales/zh-TW.js
@@ -2557,6 +2557,8 @@ export default {
'None, so dumbbell lifts stay hidden.': '沒有,所以啞鈴動作會隱藏。',
'openGym reads only while it is open: heart rate for workouts of the last day, weigh-ins of the last year. Older workouts stay as they are.': 'openGym 只在開啟時讀取:最近一天訓練的心率,最近一年的體重紀錄。更早的訓練維持不變。',
// --- seasonal themes (lib/seasonal.js) ---
+ 'Also during workouts': '訓練時也顯示',
+ 'A cobweb in the header, bats behind the rest timer, pumpkins on the finish screen. Never on your sets.': '頁首一張蜘蛛網,休息計時器後面幾隻蝙蝠,完成畫面上幾顆南瓜。絕不擋住你的組。',
'Seasonal themes': '季節主題',
'Little extras for the time of year.': '應景的小彩蛋。',
'Halloween': '萬聖節',
diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.js
index b7126ebb5..bf2b4e51a 100644
--- a/frontend/src/locales/zh.js
+++ b/frontend/src/locales/zh.js
@@ -2564,6 +2564,8 @@ export default {
'None, so dumbbell lifts stay hidden.': '没有,所以哑铃动作会隐藏。',
'openGym reads only while it is open: heart rate for workouts of the last day, weigh-ins of the last year. Older workouts stay as they are.': 'openGym 只在打开时读取:最近一天训练的心率,最近一年的称重。更早的训练保持不变。',
// --- seasonal themes (lib/seasonal.js) ---
+ 'Also during workouts': '训练时也显示',
+ 'A cobweb in the header, bats behind the rest timer, pumpkins on the finish screen. Never on your sets.': '页眉里一张蛛网,休息计时器后面几只蝙蝠,完成页上几个南瓜。绝不挡住你的组。',
'Seasonal themes': '季节主题',
'Little extras for the time of year.': '应季的小彩蛋。',
'Halloween': '万圣节',
diff --git a/frontend/src/seasonal/halloween.css b/frontend/src/seasonal/halloween.css
index ea0f8a233..4ea19e4fb 100644
--- a/frontend/src/seasonal/halloween.css
+++ b/frontend/src/seasonal/halloween.css
@@ -3,6 +3,8 @@
Transforms and opacity only; every animation runs a fixed number of times and stops. */
:root[data-season="halloween"]{
+ --hw-bone:#e6dfd1;
+ --hw-moon:#f2e3a2;
--hw-ink:#b49ae6; /* spider, bats, witch on a dark screen: moonlit lavender */
--hw-ink-2:#7b5cc0;
--hw-thread:rgba(235,235,245,.42);
@@ -10,6 +12,8 @@
--hw-face:#ffd04a;
}
:root[data-season="halloween"][data-theme="light"]{
+ --hw-bone:#7b7262;
+ --hw-moon:#e3b948;
--hw-ink:#33244a;
--hw-ink-2:#5b3f8c;
--hw-thread:rgba(60,60,67,.38);
@@ -19,7 +23,7 @@
/* ------------------------------------------------------------ cobwebs -- */
/* In a card's corner, under its content and never in a tap's way. */
-[data-season="halloween"] :has(> .hw-web){position:relative}
+[data-season="halloween"] :is(.card, .sect-b):has(> .hw-web){position:relative}
[data-season="halloween"] .hw-web{
position:absolute;width:52px;height:52px;pointer-events:none;
fill:none;stroke:var(--hw-web);stroke-width:.8;stroke-linecap:round;
@@ -31,7 +35,7 @@
/* --------------------------------------------------------- header bats -- */
[data-season="halloween"] .hdr:has(> .hw-bats){position:relative}
-[data-season="halloween"] .hdr:has(> .hw-bats) > :not(.hw-bats){position:relative;z-index:1}
+[data-season="halloween"] .hdr:has(> .hw-bats) > :not(.hw-bats):not(.hw-moon){position:relative;z-index:1}
[data-season="halloween"] .hw-bats{position:absolute;inset:-6px 0 -4px;overflow:hidden;pointer-events:none;z-index:0}
.hw-batsvg{display:block;width:100%;height:100%;fill:var(--hw-ink)}
[data-season="halloween"] .hw-batlane{
@@ -158,6 +162,82 @@
100%{transform:translate3d(calc(100vw + 30px),-6px,0) rotate(-6deg)}
}
+/* ---------------------------------------------------------------- Stats -- */
+/* The moon sits in the header's quiet middle, left of its buttons, behind the title's text. */
+[data-season="halloween"] .hw-moon{
+ position:absolute;top:2px;inset-inline-end:112px;width:30px;height:30px;z-index:0;pointer-events:none;
+ animation:hw-float 3s ease-in-out 6 alternate;
+}
+.hw-moonsvg{display:block;width:100%;height:100%;fill:var(--hw-moon);opacity:.85}
+.hw-moonwitch{position:absolute;left:-6px;top:11px;width:22px;height:13px;transform:rotate(-8deg)}
+@keyframes hw-float{from{transform:translateY(0)}to{transform:translateY(-3px)}}
+
+/* Spiders hanging into the empty end of a tile, from its top edge. */
+[data-season="halloween"] .tile:has(> .hw-tilespiders){position:relative}
+.hw-tilespiders{position:absolute;top:0;inset-inline-end:20px;width:44px;height:0;pointer-events:none}
+.hw-hang{position:absolute;top:0;right:0;width:14px;animation:hw-bob 2.6s ease-in-out 6 alternate}
+.hw-hang.hw-hang-b{right:26px;animation-duration:3.1s;animation-delay:.8s}
+.hw-hangthread{position:absolute;left:6.5px;top:0;width:1px;height:var(--len);background:var(--hw-thread)}
+.hw-hang .hw-spidersvg{position:absolute;left:0;top:calc(var(--len) - 3px);width:14px;height:14px}
+.hw-hang .hw-legs{animation:none}
+@keyframes hw-bob{from{transform:translateY(0)}to{transform:translateY(3px)}}
+
+/* A skeleton hanging by its hands off the activity card's top edge, beside the title. */
+[data-season="halloween"] .card:has(> .hw-skel){position:relative}
+.hw-skel{
+ position:absolute;top:-3px;inset-inline-end:20px;width:22px;height:38px;pointer-events:none;
+ transform-origin:50% 0;animation:hw-sway 3.2s ease-in-out 4 alternate;
+}
+.hw-skelsvg{display:block;width:100%;height:100%}
+.hw-skelsvg .hw-bones{fill:none;stroke:var(--hw-bone);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
+.hw-skelsvg .hw-skull{fill:var(--hw-bone)}
+.hw-skelsvg .hw-socket{fill:var(--surface)}
+@keyframes hw-sway{from{transform:rotate(-4deg)}to{transform:rotate(4deg)}}
+
+[data-season="halloween"] .hw-web-bl{left:0;bottom:0;width:46px;height:46px;transform:scaleY(-1)}
+[dir="rtl"][data-season="halloween"] .hw-web-bl{left:auto;right:0;transform:scale(-1,-1)}
+
+/* Two pumpkins peeking over a card's top edge, just to look. */
+[data-season="halloween"] .hw-peek.hw-peek-two{width:64px;inset-inline-end:40px}
+.hw-peek-two .hw-pk{position:absolute;left:4px;top:1px;width:30px;animation:hw-peek .9s cubic-bezier(.3,1.5,.5,1) .6s both}
+.hw-peek-two .hw-pk-s{left:36px;top:5px;width:22px;animation-delay:.85s}
+
+/* --------------------------------------------------------- the workout -- */
+/* Nothing here takes a tap, and nothing moves anything: the web and its spider are drawn under
+ the header's own content (isolation, z-index -1), from the screen's top corner, and the spider
+ hangs in the side gutter, outside every button. */
+[data-season="halloween"] .whdr:has(> .hw-wcorner){isolation:isolate}
+[data-season="halloween"] .whdr:not(.stick):has(> .hw-wcorner){position:relative}
+.hw-wcorner{
+ position:absolute;z-index:-1;pointer-events:none;width:0;height:0;
+ top:calc(-1 * (var(--sat) + var(--conn, 0px) + 8px));inset-inline-start:calc(-1 * var(--pad));
+}
+/* the pinned header (List, Compact) carries the page's top padding itself, and its children are positioned */
+[data-season="halloween"] .whdr.stick > .hw-wcorner{position:absolute;top:0;inset-inline-start:0}
+[data-season="halloween"] .hw-wcorner .hw-web-tl{left:0;top:0;width:48px;height:48px;opacity:.85}
+[dir="rtl"][data-season="halloween"] .hw-wcorner .hw-web-tl{left:auto;right:0;transform:scaleX(-1)}
+.hw-hang.hw-hang-w{right:auto;left:1px;top:calc(var(--sat) + var(--conn, 0px) + 8px);width:12px}
+[dir="rtl"] .hw-hang.hw-hang-w{left:auto;right:1px}
+.hw-hang-w .hw-hangthread{left:5.5px}
+.hw-hang-w .hw-spidersvg{width:12px;height:12px}
+
+/* The rest bar: two bats along its top edge, under its clock and buttons. */
+#timer > .hw-restbats{position:absolute;left:0;right:0;top:4px;height:9px;z-index:-1;pointer-events:none;overflow:hidden}
+.hw-restlane{position:absolute;inset:0;opacity:0;animation:hw-restcross 4.6s cubic-bezier(.45,.05,.55,.95) .4s 1 both}
+.hw-restlane.hw-rl1{animation-delay:1.5s;animation-duration:5.4s}
+.hw-restlane .hw-flap{position:absolute;left:0;top:0;width:16px;height:8px;animation:hw-flap .18s ease-in-out 32 alternate}
+.hw-rl1 .hw-flap{width:12px;height:6px;top:1px}
+@keyframes hw-restcross{
+ 0%{transform:translate3d(-8%,0,0);opacity:0}
+ 8%,85%{opacity:.55}
+ 100%{transform:translate3d(104%,0,0);opacity:0}
+}
+
+/* The finish screen: a pumpkin on each side of the trophy. */
+.hw-finish{position:absolute;inset:0;pointer-events:none}
+.hw-finish .hw-pk{position:absolute;bottom:0;right:calc(50% + 34px);width:28px;animation:hw-hop .6s cubic-bezier(.3,1.6,.5,1) .5s 2}
+.hw-finish .hw-pk-r{right:auto;left:calc(50% + 34px);width:22px;animation-delay:.75s}
+
@media (prefers-reduced-motion: reduce){
.hw-spider:not(.hw-still),.hw-witch,.hw-burst{display:none}
}
diff --git a/frontend/src/seasonal/halloween.jsx b/frontend/src/seasonal/halloween.jsx
index 29ef4958c..0cce75bbe 100644
--- a/frontend/src/seasonal/halloween.jsx
+++ b/frontend/src/seasonal/halloween.jsx
@@ -107,26 +107,77 @@ const Witch = () => (
</svg>
)
+// A skeleton hanging by its hands from an edge, for the Stats page.
+const Skeleton = () => (
+ <svg className="hw-skelsvg" viewBox="0 0 24 42" aria-hidden="true" focusable="false">
+ <path className="hw-bones" d="M7.6 1.4 8.8 13M16.4 1.4 15.2 13M8.8 13h6.4M12 13v13M9 16.4c2 .8 4 .8 6 0M9.2 19.2c1.9.7 3.7.7 5.6 0M9.6 22c1.6.6 3.2.6 4.8 0M9.4 26.4h5.2M10.4 26.6l-.8 11.6-2 1.4M13.6 26.6l.8 11.6 2 1.4" />
+ <path className="hw-skull" d="M12 3.6c2.4 0 4 1.7 4 3.9 0 1.4-.7 2.4-1.6 2.9v1.4h-4.8v-1.4C8.7 9.9 8 8.9 8 7.5c0-2.2 1.6-3.9 4-3.9Z" />
+ <circle className="hw-socket" cx="10.5" cy="7.6" r="1" /><circle className="hw-socket" cx="13.5" cy="7.6" r="1" />
+ <path className="hw-socket" d="M11.4 9.6h1.2l-.6-1Z" />
+ </svg>
+)
+
+// A crescent moon with a very small witch crossing it, for a header's quiet corner.
+const MoonWitch = () => (
+ <span className="hw-moon" aria-hidden="true">
+ <svg className="hw-moonsvg" viewBox="0 0 32 32" aria-hidden="true" focusable="false"><path d="M20.6 3.2A13 13 0 1 0 28.8 22 10.4 10.4 0 0 1 20.6 3.2Z" /></svg>
+ <span className="hw-moonwitch"><Witch /></span>
+ </span>
+)
+
+// A spider hanging still from a thread of `len` px, bobbing a little now and then.
+const HangingSpider = ({ len = 28, className = '' }) => (
+ <span className={'hw-hang ' + className} style={{ '--len': len + 'px' }} aria-hidden="true">
+ <span className="hw-hangthread" /><Spider />
+ </span>
+)
+
/* -------------------------------------------------------- the layer -- */
// Once per session at most, decided once: the witch is rare on purpose.
let witchPlan = null
let witchFlown = false
-let spiderTried = false
-/** The spider at the day's first start, and now and then the witch. Nothing while `hidden`. */
+/* The spider drops at every start of the app, and again whenever it comes back to the front after
+ AWAY_MS or more in the background (closed and opened again, as far as anyone can tell). Time away
+ is counted here, at module level, so it is right however long the layer itself was mounted. */
+export const AWAY_MS = 30 * 60 * 1000
+let startTried = false
+let hiddenAt = null
+const onReturn = new Set()
+if (typeof document !== 'undefined') {
+ document.addEventListener('visibilitychange', () => {
+ if (document.hidden) { hiddenAt = Date.now(); return }
+ const away = hiddenAt !== null && Date.now() - hiddenAt >= AWAY_MS
+ hiddenAt = null
+ if (away) onReturn.forEach(fn => fn())
+ })
+}
+
+/** The spider at every start, and now and then the witch. Nothing while `hidden` (the workout). */
export function Layer({ hidden, fresh }) {
const [spider, setSpider] = useState(null) // null | 'drop' | 'still'
const [witch, setWitch] = useState(false)
+ const hiddenNow = useRef(hidden)
+ hiddenNow.current = hidden
useEffect(() => {
- if (spiderTried || hidden) return
- spiderTried = true
- // A start straight into a workout, or a day it already dropped on this device: no spider.
- if (!fresh || !onceToday('spider')) return
- const still = reducedMotion()
- setSpider(still ? 'still' : 'drop')
+ if (!spider || spider === 'drop') return
// Reduced motion: a tiny spider sits in the corner for a few seconds, and that is all.
- if (still) { const tm = setTimeout(() => setSpider(null), 4000); return () => clearTimeout(tm) }
+ const tm = setTimeout(() => setSpider(null), 4000)
+ return () => clearTimeout(tm)
+ }, [spider])
+ useEffect(() => {
+ if (hidden) setSpider(null)
+ const drop = () => setSpider(cur => cur || (reducedMotion() ? 'still' : 'drop'))
+ // The start: once per session, and not over a start straight into a running workout.
+ if (!startTried && !hidden) {
+ startTried = true
+ if (fresh) drop()
+ }
+ // Back after a while away: again, unless it came back to the workout screen.
+ const back = () => { if (!hiddenNow.current) drop() }
+ onReturn.add(back)
+ return () => { onReturn.delete(back) }
}, [hidden, fresh])
useEffect(() => {
if (hidden || witchFlown || reducedMotion()) return
@@ -160,11 +211,35 @@ function SpiderDrop({ still, onGone }) {
/** Decoration for one place in a view. Unknown spots draw nothing. */
export function Deco({ spot }) {
- if (spot === 'header-bats') return <HeaderBats />
- if (spot === 'home-hero') return <Web className="hw-web-br" />
- if (spot === 'plan-card') return <Web className="hw-web-tr" />
- if (spot === 'home-streak') return <PeekPumpkin />
- return null
+ switch (spot) {
+ case 'header-bats': return <HeaderBats />
+ case 'home-hero': return <Web className="hw-web-br" />
+ case 'plan-card': return <Web className="hw-web-tr" />
+ case 'home-streak': return <PeekPumpkin />
+ // Stats: bats and the moon in the header, two spiders in the empty end of the lifetime tile,
+ // a skeleton hanging off the activity card, cobwebs in two bottom corners, pumpkins peeking.
+ case 'stats-hdr': return <><HeaderBats /><MoonWitch /></>
+ case 'stats-tile': return <span className="hw-tilespiders" aria-hidden="true"><HangingSpider len={30} /><HangingSpider len={14} className="hw-hang-b" /></span>
+ case 'stats-heatmap': return <span className="hw-skel" aria-hidden="true"><Skeleton /></span>
+ case 'stats-web': return <Web className="hw-web-bl" />
+ case 'stats-peek': return <span className="hw-peek hw-peek-two" aria-hidden="true"><span className="hw-pk"><Pumpkin /></span><span className="hw-pk hw-pk-s"><Pumpkin /></span></span>
+ // The workout screen: nothing there can be tapped, and nothing sits on a set, a button,
+ // a timer, the chip row or an exercise picture. The header's corner web and its spider sit
+ // in the page's side gutter, the bats fly along the rest bar's top edge, and the pumpkins
+ // flank the finish screen's trophy.
+ case 'workout-hdr': return <span className="hw-wcorner" aria-hidden="true"><Web className="hw-web-tl" /><HangingSpider len={22} className="hw-hang-w" /></span>
+ case 'rest-timer': return <RestBats />
+ case 'finish': return <span className="hw-finish" aria-hidden="true"><span className="hw-pk"><Pumpkin /></span><span className="hw-pk hw-pk-r"><Pumpkin /></span></span>
+ default: return null
+ }
+}
+
+// Two small bats along the rest bar's top edge, once each time the bar appears.
+function RestBats() {
+ if (reducedMotion()) return null
+ return <span className="hw-restbats" aria-hidden="true">
+ {[0, 1].map(i => <span key={i} className={'hw-restlane hw-rl' + i}><span className="hw-flap"><Bat /></span></span>)}
+ </span>
}
// Three bats cross behind the title a few times, then the sky stays quiet until the next visit.
diff --git a/frontend/src/seasonal/halloween.test.jsx b/frontend/src/seasonal/halloween.test.jsx
index 77c6cc62e..791ca4ee3 100644
--- a/frontend/src/seasonal/halloween.test.jsx
+++ b/frontend/src/seasonal/halloween.test.jsx
@@ -26,22 +26,65 @@ afterEach(() => { act(() => root.unmount()); host.remove(); vi.useRealTimers() }
const render = el => act(() => root.render(el))
describe('the spider', () => {
- it('drops at the first start of the day, and not at the next one', async () => {
+ it('drops at every start, today\'s second one too', async () => {
let { Layer } = await load()
render(<Layer hidden={false} fresh />)
expect(host.querySelector('.hw-spider .hw-drop')).not.toBeNull()
expect(host.querySelector('.hw-spider').getAttribute('aria-hidden')).toBe('true')
act(() => root.unmount()); root = createRoot(host)
- ;({ Layer } = await load()) // a second start, same day
+ ;({ Layer } = await load()) // closed and started again, same day
+ render(<Layer hidden={false} fresh />)
+ expect(host.querySelector('.hw-spider .hw-drop')).not.toBeNull()
+ })
+
+ it('once per start: the layer mounting again (a theme switch) does not drop it twice', async () => {
+ const { Layer } = await load()
+ render(<Layer hidden={false} fresh />)
+ act(() => {
+ const e = new Event('animationend', { bubbles: true })
+ host.querySelector('.hw-drop').dispatchEvent(e)
+ })
+ expect(host.querySelector('.hw-spider')).toBeNull()
+ act(() => root.unmount()); root = createRoot(host)
render(<Layer hidden={false} fresh />)
expect(host.querySelector('.hw-spider')).toBeNull()
})
- it('does not drop over a start straight into a workout, and keeps the day for later', async () => {
+ it('drops again when the app comes back after half an hour or more, not after a quick look away', async () => {
+ let now = Date.parse('2026-10-25T10:00:00')
+ const clock = vi.spyOn(Date, 'now').mockImplementation(() => now)
+ let hiddenDoc = false
+ Object.defineProperty(document, 'hidden', { configurable: true, get: () => hiddenDoc })
+ const away = ms => act(() => {
+ hiddenDoc = true; document.dispatchEvent(new Event('visibilitychange'))
+ now += ms
+ hiddenDoc = false; document.dispatchEvent(new Event('visibilitychange'))
+ })
+ try {
+ const { Layer, AWAY_MS } = await load()
+ render(<Layer hidden={false} fresh={false} />) // a start into the workout, then out of it
+ expect(host.querySelector('.hw-spider')).toBeNull()
+ away(5 * 60 * 1000)
+ expect(host.querySelector('.hw-spider')).toBeNull()
+ away(AWAY_MS)
+ expect(host.querySelector('.hw-spider .hw-drop')).not.toBeNull()
+ // Back on the workout screen after a long while: no spider there.
+ render(<Layer hidden fresh={false} />)
+ away(AWAY_MS + 1)
+ render(<Layer hidden fresh={false} />)
+ expect(host.querySelector('.hw-spider')).toBeNull()
+ } finally {
+ clock.mockRestore()
+ delete document.hidden
+ }
+ })
+
+ it('does not drop over a start straight into a workout', async () => {
const { Layer } = await load()
render(<Layer hidden fresh={false} />)
expect(host.innerHTML).toBe('')
- expect(localStorage.getItem('og_season_spider')).toBeNull()
+ render(<Layer hidden={false} fresh={false} />)
+ expect(host.querySelector('.hw-spider')).toBeNull()
})
it('one tap and it scurries off, and is gone when it is out of sight', async () => {
@@ -117,6 +160,35 @@ describe('the pumpkin', () => {
})
describe('the spots', () => {
+ it('Stats: bats, the moon, hanging spiders, a skeleton, a cobweb and peeking pumpkins, none of them in the way', async () => {
+ const { Deco } = await load()
+ render(<>{['stats-hdr', 'stats-tile', 'stats-heatmap', 'stats-web', 'stats-peek'].map(s => <Deco key={s} spot={s} />)}</>)
+ expect(host.querySelector('.hw-moon .hw-witchsvg')).not.toBeNull()
+ expect(host.querySelectorAll('.hw-tilespiders .hw-hang')).toHaveLength(2)
+ expect(host.querySelector('.hw-skel .hw-skelsvg')).not.toBeNull()
+ expect(host.querySelectorAll('.hw-peek-two .hw-pumpkinsvg')).toHaveLength(2)
+ for (const el of host.children) expect(el.getAttribute('aria-hidden'), el.className).toBe('true')
+ expect(host.querySelectorAll('button')).toHaveLength(0)
+ })
+
+ it('the workout screen gets nothing that can be tapped or focused', async () => {
+ const { Deco } = await load()
+ render(<>{['workout-hdr', 'rest-timer', 'finish'].map(s => <Deco key={s} spot={s} />)}</>)
+ expect(host.querySelector('.hw-wcorner .hw-web')).not.toBeNull()
+ expect(host.querySelector('.hw-wcorner .hw-hang')).not.toBeNull()
+ expect(host.querySelectorAll('.hw-restbats .hw-batsvg')).toHaveLength(2)
+ expect(host.querySelectorAll('.hw-finish .hw-pumpkinsvg')).toHaveLength(2)
+ for (const el of host.children) expect(el.getAttribute('aria-hidden'), el.className).toBe('true')
+ expect(host.querySelectorAll('button, a, input, [tabindex]')).toHaveLength(0)
+ })
+
+ it('with reduced motion the rest bar has no bats at all', async () => {
+ reduce = true
+ const { Deco } = await load()
+ render(<Deco spot="rest-timer" />)
+ expect(host.innerHTML).toBe('')
+ })
+
it('cobwebs and bats are decoration: hidden from assistive tech, never in a tap\'s way', async () => {
const { Deco } = await load()
render(<><Deco spot="home-hero" /><Deco spot="plan-card" /><Deco spot="header-bats" /><Deco spot="workout" /></>)
diff --git a/frontend/src/sheets.jsx b/frontend/src/sheets.jsx
index 7a3d480a7..e8d27c512 100644
--- a/frontend/src/sheets.jsx
+++ b/frontend/src/sheets.jsx
@@ -26,6 +26,7 @@ import ExerciseAliasesEditor, { ExerciseAliasesField, ExerciseAliasesLink } from
import { SG_NAME_MAX } from './lib/superset-meta.js'
import { REST_MAX, fmtRest, restWheelValue } from './lib/duration.js'
import Icon from './components/Icon.jsx'
+import { SeasonDeco } from './components/Seasonal.jsx'
import { Button, Slider, Switch, Segmented, SelectRow, Row, TextField, NumberField, MultiSelectRow } from './components/ui.jsx'
import { glyphOf, GLYPH_GROUPS, DEFAULT_GLYPH } from './lib/glyphs.js'
import BodyMap from './components/BodyMap.jsx'
@@ -3676,7 +3677,7 @@ function FinishSummary({ w, prs, e1prs = [], additions = [], close }) {
return <div style={{ textAlign: 'center', padding: '8px 0' }}>
{/* Sticky, so the summary can be left from the top however far it has been scrolled. */}
<div className="fin-x"><button type="button" className="iconbtn" aria-label={t('Close')} onClick={() => closeThenNav(close, '/home')}><Icon name="xmark" /></button></div>
- <div style={{ fontSize: 44, display: 'flex', justifyContent: 'center', color: 'var(--acc)' }}><Icon name="trophy" /></div>
+ <div style={{ fontSize: 44, display: 'flex', justifyContent: 'center', color: 'var(--acc)', position: 'relative' }}><Icon name="trophy" /><SeasonDeco spot="finish" workout /></div>
<h3 style={{ margin: '8px 0' }}>{t('Workout complete!')}</h3>
<div className="tiles fin" style={{ textAlign: 'start' }}>
<div className="tile"><div className="l">{t('Duration')}</div><div className="v" style={{ fontSize: '1.1rem' }}>{fmtDur(w.end - w.start)}</div></div>
diff --git a/frontend/src/views/Settings.jsx b/frontend/src/views/Settings.jsx
index 4f77823b0..17314fb3d 100644
--- a/frontend/src/views/Settings.jsx
+++ b/frontend/src/views/Settings.jsx
@@ -894,6 +894,11 @@ export default function Settings({ page = null, find = null, via = null, entryKe
<Switch aria-label={t(th.colorsTitle)} checked={S.seasonal?.[th.id + 'Colors'] === true}
onChange={v => set(th.id + 'Colors', v)} />
</Row>}
+ {/* On by default while the theme shows; nothing there is ever in the way of a set. */}
+ {th.workoutTitle && <Row icon="play" iconTint="var(--green)" title={t(th.workoutTitle)} subtitle={t(th.workoutNote)}>
+ <Switch aria-label={t(th.workoutTitle)} checked={S.seasonal?.[th.id + 'Workout'] !== false}
+ onChange={v => set(th.id + 'Workout', v)} />
+ </Row>}
</Section>
})}
</>,
diff --git a/frontend/src/views/Settings.themes.test.jsx b/frontend/src/views/Settings.themes.test.jsx
index 4a1a31c1f..e2db24ddd 100644
--- a/frontend/src/views/Settings.themes.test.jsx
+++ b/frontend/src/views/Settings.themes.test.jsx
@@ -125,4 +125,12 @@ describe('Seasonal themes', () => {
act(() => sw.click())
expect(mocks.S.seasonal).toEqual({ halloweenColors: true })
})
+
+ it('Also during workouts is on until switched off, and then stored', () => {
+ mount()
+ const sw = rowOf('Also during workouts').querySelector('[role="switch"]')
+ expect(sw.getAttribute('aria-checked')).toBe('true')
+ act(() => sw.click())
+ expect(mocks.S.seasonal).toEqual({ halloweenWorkout: false })
+ })
})
diff --git a/frontend/src/views/Stats.jsx b/frontend/src/views/Stats.jsx
index f41d28659..6f8806f8d 100644
--- a/frontend/src/views/Stats.jsx
+++ b/frontend/src/views/Stats.jsx
@@ -11,6 +11,7 @@ import { bwSheet, goalSheet, calendarSheet, dayOverrideSheet, workoutDetailSheet
import LineChart from '../components/LineChart.jsx'
import WeightRate from '../components/WeightRate.jsx'
import Heatmap from '../components/Heatmap.jsx'
+import { SeasonDeco } from '../components/Seasonal.jsx'
import Icon from '../components/Icon.jsx'
import { reportSheet } from '../components/ReportSheet.jsx'
import BodyMap, { BodyMapLegend } from '../components/BodyMap.jsx'
@@ -720,7 +721,7 @@ export default function Stats() {
if (showRel) exOpts.push({ value: 'bodyweight', label: t('Bodyweight') })
return <>
- <div className="hdr"><div><h1>{t('Stats')}</h1><div className="sub">{t('Progress & history')}</div></div>
+ <div className="hdr"><SeasonDeco spot="stats-hdr" /><div><h1>{t('Stats')}</h1><div className="sub">{t('Progress & history')}</div></div>
<div className="row" style={{ gap: 8 }}>
<button className="iconbtn" onClick={reportSheet} aria-label={t('Performance report')} title={t('Performance report')}><Icon name="note" /></button>
<button className="iconbtn" onClick={() => nav('/history')} aria-label={t('History')}><Icon name="history" /></button>
@@ -733,10 +734,11 @@ export default function Stats() {
<div className="tile"><div className="l"><Icon name="scale" />{t('Weight 30d')}</div><div className="v" style={{ fontSize: 22, color: bwDelta30 === null ? 'inherit' : bwDeltaColor(bwDelta30, (lastBW(S) || {}).w || 0) }}>{bwDelta30 === null ? '–' : (bwDelta30 > 0 ? '+' : '') + fmtNum(bwDelta30) + ' ' + S.unit}</div></div>
{/* Everything ever lifted (Discord): imports included, warm-ups only when the profile
counts them (#719). Full width, since a few hundred sessions make a long number. */}
- {lifetime > 0 && <div className="tile" style={{ gridColumn: '1 / -1' }} data-lifetime-volume><div className="l"><Icon name="plate" />{t('Lifted in total')}</div><div className="v">{fmtVol(Math.round(lifetime), S.unit)}</div></div>}
+ {lifetime > 0 && <div className="tile" style={{ gridColumn: '1 / -1' }} data-lifetime-volume><SeasonDeco spot="stats-tile" /><div className="l"><Icon name="plate" />{t('Lifted in total')}</div><div className="v">{fmtVol(Math.round(lifetime), S.unit)}</div></div>}
</div>
<div className="card">
+ <SeasonDeco spot="stats-heatmap" />
<h2>{t('Activity (last 12 months)')}</h2>
<Heatmap
S={S}
@@ -759,6 +761,7 @@ export default function Stats() {
<Button size="sm" variant="tinted" trailingIcon="chevronRight" style={{ flexShrink: 0 }} onClick={() => nav('/progress-photos')}>{t('Open')}</Button>
</div>}
<div className="card row between" style={{ alignItems: 'center', gap: 12 }}>
+ <SeasonDeco spot="stats-peek" />
<div style={{ minWidth: 0 }}><h2 style={{ margin: 0 }}>{t('Body measurements')}</h2>
<div className="muted small" style={{ marginTop: 4 }}>{(S.measurements || []).length
? t('Last check-in {0}', fmtDate(S.measurements[S.measurements.length - 1].d, true))
@@ -785,6 +788,7 @@ export default function Stats() {
{S.bodyweight.length > 0 && <div className="row" style={{ justifyContent: 'flex-end', marginTop: 4 }}>
<Button size="sm" variant="ghost" trailingIcon="chevronRight" onClick={weighInsSheet}>{t('All weigh-ins')}</Button>
</div>}
+ <SeasonDeco spot="stats-web" />
</div>
<div className="card">
diff --git a/frontend/src/views/Workout.jsx b/frontend/src/views/Workout.jsx
index 909f87d55..c8ced51e2 100644
--- a/frontend/src/views/Workout.jsx
+++ b/frontend/src/views/Workout.jsx
@@ -48,6 +48,7 @@ import { canMoveActiveWorkoutUnit, moveActiveWorkoutUnit, canMoveActiveWorkoutEn
import { nextOpenSet, workoutKeyAction } from '../lib/workout-keys.js'
import { MUSCLE_NAME } from '../lib/muscles.js'
import FocusView from './FocusView.jsx'
+import { SeasonDeco } from '../components/Seasonal.jsx'
import { entryDbLoad, bellsIn, ownedWeightsFor, stepOwned } from '../lib/dumbbells.js'
// How long after a key starts a hold the same key is not yet its "Done" (#133). A USB button
@@ -2149,6 +2150,8 @@ function ActiveWorkout() {
set counter, discard/finish, progress) stays pinned — the one thing you want in view
while you are somewhere in the middle of a long stack. Cards mode never scrolls far. */}
<div className={'whdr' + (listMode ? ' stick' : '')} ref={hdrRef}>
+ {/* In season, a corner web under the header's own buttons (components/Seasonal.jsx). */}
+ <SeasonDeco spot="workout-hdr" workout />
{/* ⌄ leaves the screen and keeps the session running (the tab bar's Resume brings it back);
in the editor of a saved workout it is the ✕ that closes the editor. Finish is a labelled pill
rather than a check that looked like a set tick: it opens the Finish sheet (Finish and save,
diff --git a/frontend/src/views/settings-pages.js b/frontend/src/views/settings-pages.js
index c73cdfdca..9142d889b 100644
--- a/frontend/src/views/settings-pages.js
+++ b/frontend/src/views/settings-pages.js
@@ -129,6 +129,7 @@ export const SEARCH = [
{ page: 'look', title: 'Seasonal themes', icon: 'pumpkin', tint: 'var(--orange)', kw: 'seasonal season holiday halloween theme decoration' },
// Seasonal themes
{ page: 'themes', title: 'Halloween', icon: 'pumpkin', tint: 'var(--orange)', kw: 'halloween seasonal theme spooky spider pumpkin bats witch october decoration', opts: ['Auto', 'On', 'Off'] },
+ { page: 'themes', title: 'Also during workouts', icon: 'play', tint: 'var(--green)', kw: 'halloween seasonal workout training decoration' },
{ page: 'themes', title: 'Spooky colors', icon: 'palette', tint: 'var(--purple)', kw: 'halloween orange purple accent color colour seasonal' },
{ page: 'look', title: 'Show connection status', icon: 'cloud', tint: 'var(--blue)', kw: 'sync offline banner bar connection', when: c => !c.demo },
// Data & backup