Improve timeline UX and add catalog restore scripts for paintings and portraits.
Load the home-page catalog once with a lightweight artists API, batch pan/zoom updates per frame, use dynamic year labels, and speed up movement-flow zoom. Add sync-image-paths and fetch-artist-images plus docs for the post-seed pipeline.
This commit is contained in:
+11
-2
@@ -175,8 +175,17 @@ app.get('/api/movements/:id/artists', async (req, res) => {
|
||||
// All artists in a year range (for timeline portrait placement)
|
||||
app.get('/api/artists', async (req, res) => {
|
||||
try {
|
||||
const { start, end, movement_id } = req.query;
|
||||
let query = `
|
||||
const { start, end, movement_id, timeline } = req.query;
|
||||
const timelineOnly = timeline === '1' || timeline === 'true';
|
||||
let query = timelineOnly
|
||||
? `
|
||||
SELECT a.id, a.name, a.birth_year, a.death_year, a.movement_id, a.portrait_path,
|
||||
a.bio_short, a.wikipedia_title, a.century,
|
||||
m.name as movement_name, m.color as movement_color
|
||||
FROM artists a
|
||||
LEFT JOIN art_movements m ON a.movement_id = m.id
|
||||
WHERE 1=1`
|
||||
: `
|
||||
SELECT a.*, m.name as movement_name, m.color as movement_color
|
||||
FROM artists a
|
||||
LEFT JOIN art_movements m ON a.movement_id = m.id
|
||||
|
||||
Reference in New Issue
Block a user