recipes: replace placeholder images with OKLAB dominant color backgrounds
Instead of generating/serving 20px placeholder images with blur CSS, extract a perceptually accurate dominant color (Gaussian-weighted OKLAB average) and use it as a solid background-color while the full image loads. Removes placeholder image generation, blur CSS/JS, and placeholder directory references across upload flows, API routes, service worker, and all card/hero components. Adds admin bulk tool to backfill colors for existing recipes.
This commit is contained in:
@@ -12,6 +12,7 @@ const RecipeSchema = new mongoose.Schema(
|
||||
mediapath: {type: String, required: true}, // filename with hash for cache busting: e.g., "maccaroni.a1b2c3d4.webp"
|
||||
alt: String,
|
||||
caption: String,
|
||||
color: String, // dominant color hex e.g. "#a1b2c3", used as loading placeholder
|
||||
}],
|
||||
description: {type: String, required: true},
|
||||
note: {type: String},
|
||||
|
||||
Reference in New Issue
Block a user