diff options
| author | unwox <me@unwox.com> | 2025-10-03 11:56:37 +0600 |
|---|---|---|
| committer | unwox <me@unwox.com> | 2025-10-13 23:11:01 +0600 |
| commit | 3f5ade2e7a139bb4405437e8fc5546aafc7b05ef (patch) | |
| tree | 77c437958d74b591f11ec207d16749cf207a51e3 /test.fnl | |
| parent | f5a70e6a446e00969adb866ef2e2d10bf33bc4a8 (diff) | |
WIP shop
Diffstat (limited to 'test.fnl')
| -rw-r--r-- | test.fnl | 112 |
1 files changed, 0 insertions, 112 deletions
diff --git a/test.fnl b/test.fnl deleted file mode 100644 index ec8812c..0000000 --- a/test.fnl +++ /dev/null @@ -1,112 +0,0 @@ -(import-macros {:compile-html HTML} :macros) - -(fn improve-typography [text] - (var result - (-> text - (string.gsub "(\n|\r)" " ") - (string.gsub "%s+" " "))) - (let [nbsp-replaces ["на" "На" "и" "И" "в" "В" "о" "О" "с" "С" "со" "Со" "до" - "До" "для" "Для" "а" "А" "но" "Но" "на" "На" "я" "Я" "мы" - "Мы" "над" "Над" "под" "Под" "г." "Г." "ул." "Ул." - "д." "Д." "%d+"]] - (each [_ v (ipairs nbsp-replaces)] - (set result - (-> result - (string.gsub (.. "( " v ") ") "%1 ") - (string.gsub (.. "(%s" v ") ") " %1 ") - (string.gsub (.. "^(" v ") ") "%1 "))))) - result) - -(fn header [current-path] - (local logo - (HTML [:img {:class "logo" :src "/static/logo.svg" - :alt "Белая жаба в мультяшном стиле с чайником на голове"}])) - - (HTML [:article {:class "article"} - (if (~= current-path "") (HTML [:a {:href "/"} logo]) logo) - [:h1 {} "Чайная комната «Белая жаба»"] - [:nav {} - [:a {:href "/shop" :class "active"} - "магазин"] - [:span {} "~"] - [:a {:href "https://t.me/whitetoadtea"} - "телеграм"] - [:span {} "~"] - [:a {:href "https://vk.com/whitetoadtea"} - "вконтакте"]]])) - -(local texts { - :address - (improve-typography - "г. Омск, ул. Пушкина, д. 133/9, этаж 2. Вход с крыльца Магнита, дверь - слева, домофон 4") - - :individual-ceremony - (improve-typography - "Индивидуальная чайная церемония: мастер готовит для вас чай на ваш выбор. - О времени встречи договариваемся. Стоимость 1000 рублей с человека, - до 5 человек.") - - :weekly-meetings - (improve-typography - "Еженедельное мероприятие: каждую субботу в 15:00 мы собираемся и пьем - чай из нашей коллекции. Для посещения необходима запись в комментариях - под соответствующим постом в нашей группе в телеграме. Стоимость 500 - рублей с человека.")}) - -(print - (HTML [:div (fn [] {:huemoe nil :hello "world" :required true}) "whatever"])) - -; (macrodebug -; (HTML [:div (fn [] {:hello "world" :required true}) "whatever"])) - -; (macrodebug -; (HTML -; [:div {:class "side"} -; (unpack [])])) - -; (macrodebug -; (HTML -; [:div {:class "side"} -; [:article {:class "article"} -; (header "") -; [:h2 {} "Адрес"] -; [:p {} "test!"]]])) - -; (print (HTML -; [:img {:class "side"}])) - -; (local hello {:world "test"}) - -; (print -; (fennel.view -; [(HTML [:div {:class "first"} "11111"]) -; (HTML [:div {:class "second"} "22222"])])) - -; (print (HTML -; [:div {:class "side"} -; [:article {:class "article"} -; (header "") -; [(if true :h2 :h3) {(if true "hello" "world") "test"} "Адрес"] -; [:else {:test hello.world} "Адрес"] -; [:NO-ESCAPE "<script>works!</script>"] -; [:p {} "<script>doesnt work!</script>"]]])) - -; (macrodebug -; (HTML -; [:div {:class "side"} -; (header "") -; [:article {:class "article"} -; [:h2 {} "Адрес"] -; [:p {} [:NO-ESCAPE texts.address]]] -; [:article {:class "article"} -; [:h2 {} "Форматы участия"] -; [:ol {} -; [:li {} -; [:NO-ESCAPE texts.individual-ceremony] -; [:div {:class "button-wrapper"} -; [:a {:href "https://t.me/whitetoadvlad" :class "button"} "Записаться"]]] -; [:li {} -; [:NO-ESCAPE texts.weekly-meetings] -; [:div {:class "button-wrapper"} -; [:a {:href "https://t.me/whitetoadtea" :class "button"} "Подписаться"]]]]]])) |
