From 09d21984a753649d47b977fa563bd5ebd37cc5ef Mon Sep 17 00:00:00 2001 From: Tim Date: Sat, 21 Jun 2025 12:42:03 +0200 Subject: Make changes to visitor ui --- src/chef/frontend/visitor/recipe.clj | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'src/chef/frontend/visitor/recipe.clj') diff --git a/src/chef/frontend/visitor/recipe.clj b/src/chef/frontend/visitor/recipe.clj index e3dbf97..f76b58a 100644 --- a/src/chef/frontend/visitor/recipe.clj +++ b/src/chef/frontend/visitor/recipe.clj @@ -9,8 +9,10 @@ (defn- render [portions recipe] (cutils/gen-page (str "chef - " (:recipes/title recipe)) - [:div {:style {:margin-left "1em"}} - [:div + [:div {:style {:margin "2em auto" + :width :fit-content} + :class "card"} + [:div {:style {:width :inherit}} [:h1 {:style {:display :inline-block :margin-right "0.5em"}} (:recipes/title recipe)] @@ -19,8 +21,9 @@ clcategories/generate-path) ")")]] (when (some? (clrecipes/get-recipe-thumbnail (:recipes/id recipe))) [:img {:src (str "/recipes/" (:recipes/id recipe) "/thumbnail") - :width "50%"}]) - [:h2 + :width "50%" + :style {:border-radius "10px"}}]) + [:h2 {:style {:width :inherit}} "Zutaten pro " [:input {:type :number :value portions @@ -32,19 +35,20 @@ 1 " Person(en)" "") ":"] - [:ul (for [ingredient (-> recipe - :recipes/ingredients - cutils/parse-ingredients)] - [:li - [:b (:description ingredient)] ": " - (* (:amount ingredient) portions) - (:unit ingredient)])] - [:h2 "Zubereitung"] + [:ul {:style {:width :inherit}} + (for [ingredient (-> recipe + :recipes/ingredients + cutils/parse-ingredients)] + [:li + [:b (:description ingredient)] ": " + (* (:amount ingredient) portions) + (:unit ingredient)])] + [:h2 {:style {:width :inherit}} "Zubereitung"] (->> (:recipes/preparation recipe) cstr/split-lines (map #(if (cstr/blank? %) [:br] - [:p %])))])) + [:p {:style {:width :inherit}} %])))])) (defn handler [req] (->> (clrecipes/get-recipe (get-in req [:path-params :id])) -- cgit v1.2.3