feat: show recipe image alongside description when metadata has one
Build and Deploy / build-and-deploy (push) Successful in 1m30s
Build and Deploy / build-and-deploy (push) Successful in 1m30s
Adds a .roux-desc-row flex container that places the recipe description text on the left and the image (from metaImage) on the right, using what was previously empty horizontal space. Image is capped at 280px, with a subtle shadow and rounded corners. Responsively stacks on mobile.
This commit is contained in:
+12
-4
@@ -219,7 +219,11 @@ page title content =
|
||||
, ".roux-step:has(input:checked) .step-text { opacity: 0.4; }"
|
||||
, ""
|
||||
, ".roux-course { font-size: 0.6rem; color: var(--roux-accent); opacity: 0.65; margin: 0 0 0.15rem; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 500; }"
|
||||
, ".roux-desc { font-size: 0.85rem; line-height: 1.6; color: var(--roux-text); margin: 0 0 1.5rem; max-width: 640px; opacity: 0.85; }"
|
||||
, ".roux-desc { font-size: 0.85rem; line-height: 1.6; color: var(--roux-text); margin: 0; max-width: 640px; opacity: 0.85; }"
|
||||
, ".roux-desc-row { display: flex; gap: 2rem; align-items: flex-start; margin-bottom: 1.5rem; }"
|
||||
, ".roux-desc-row .roux-desc { flex: 1; }"
|
||||
, ".roux-desc-row img { max-width: 280px; height: auto; border-radius: 6px; box-shadow: 0 2px 8px rgba(61, 44, 30, 0.1); }"
|
||||
, "@media (max-width: 768px) { .roux-desc-row { flex-direction: column; } .roux-desc-row img { max-width: 100%; } }"
|
||||
, ""
|
||||
, ".roux-ingredient-tag { border-bottom: 1.5px solid rgba(191, 148, 40, 0.35); }"
|
||||
, ".roux-cookware-tag, .roux-timer-tag { opacity: 0.85; }"
|
||||
@@ -535,9 +539,13 @@ renderRecipe recipe = do
|
||||
Just url -> H.a ! A.class_ "roux-source-link" ! A.href (H.toValue url) ! A.target "_blank" ! A.rel "noopener noreferrer" $ do
|
||||
"↗ Original"
|
||||
Nothing -> pure ()
|
||||
case desc of
|
||||
Just d -> H.p ! A.class_ "roux-desc" $ H.toHtml d
|
||||
Nothing -> pure ()
|
||||
H.div ! A.class_ "roux-desc-row" $ do
|
||||
case desc of
|
||||
Just d -> H.p ! A.class_ "roux-desc" $ H.toHtml d
|
||||
Nothing -> pure ()
|
||||
case metaImage meta of
|
||||
Just img -> H.img ! A.src (H.toValue img) ! A.alt (H.toValue (titleText recipe))
|
||||
Nothing -> pure ()
|
||||
renderMetaBar meta
|
||||
let sections = NE.toList (recipeSections recipe)
|
||||
notes = collectNotes recipe
|
||||
|
||||
Reference in New Issue
Block a user