Let the queue page pin the frame animation
Waiting for the shuffle bag to land on the animation you are working on makes testing one of them tedious. The queue page now carries an Animation row next to Background: Auto keeps the per-track cycle, any other button pins the player to that animation until the mode changes again. The animation names live in config.js alongside their labels, so the server can validate them and the queue page can label its buttons; motion.js keys its registry by the same names. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tg15tLAuT6NrCE1ZxKVgDB
This commit is contained in:
+11
-1
@@ -16,6 +16,8 @@ import {
|
||||
CORNER_INTERVAL_SECONDS,
|
||||
CORNER_MARGIN,
|
||||
BACKGROUNDS,
|
||||
ANIMATIONS,
|
||||
AUTO_ANIMATION,
|
||||
} from '../config.js';
|
||||
import { parseVideoId, fetchTitle } from './youtube.js';
|
||||
import * as store from './state.js';
|
||||
@@ -43,7 +45,9 @@ app.get('/config.js', (_req, res) => {
|
||||
`export const BOUNCE_SPEED = ${BOUNCE_SPEED};\n` +
|
||||
`export const CORNER_INTERVAL_SECONDS = ${CORNER_INTERVAL_SECONDS};\n` +
|
||||
`export const CORNER_MARGIN = ${CORNER_MARGIN};\n` +
|
||||
`export const BACKGROUNDS = ${JSON.stringify(BACKGROUNDS)};\n`,
|
||||
`export const BACKGROUNDS = ${JSON.stringify(BACKGROUNDS)};\n` +
|
||||
`export const ANIMATIONS = ${JSON.stringify(ANIMATIONS)};\n` +
|
||||
`export const AUTO_ANIMATION = ${JSON.stringify(AUTO_ANIMATION)};\n`,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -112,6 +116,12 @@ const handlers = {
|
||||
commit();
|
||||
},
|
||||
|
||||
setAnimation(_ws, msg) {
|
||||
if (!store.isAnimation(msg.key)) return;
|
||||
store.getState().animation = msg.key;
|
||||
commit();
|
||||
},
|
||||
|
||||
// Relayed straight through: this arrives once a second and must never
|
||||
// touch the disk.
|
||||
progress(_ws, msg) {
|
||||
|
||||
Reference in New Issue
Block a user