-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpollen.rkt
72 lines (61 loc) · 2.87 KB
/
pollen.rkt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#lang racket/base
(require pollen/core
racket/function
racket/string)
(provide (all-defined-out))
(define (link url . body)
`(a ([class "text-engineering hover:underline hover:decoration-2 hover:underline-offset-2 hover:decoration-engineering transition duration-300"] [rel "noreferrer noopener"] [target "_blank"] [href ,url])
,@body))
(define (par . body)
`(p ([class "my-4 sm:text-lg leading-relaxed"]) ,@body))
(define (id-ify text)
(string-replace (string-downcase text) " " "-"))
(define (heading text)
`(h1 ([id ,(id-ify text)] [class ,"text-3xl font-mono text-engineering tracking-tighter leading-snug"])
,text))
(define (orga . body)
`(div ([class "flex items-center gap-2 -mx-2 my-4"])
(span ([class "border-solid border-b border-zinc-300 flex-1"]))
(p ([class "italic text-zinc-500"]) ,@body)
(span ([class "border-solid border-b border-zinc-300 flex-1"]))))
(define (abstract . body)
`(div ([class "abstract-wrapper relative flex flex-col italic text-base md:mx-8 mt-2 mb-4"])
(div ([class "abstract-content transition-all duration-300 ease-in-out mb-2"])
,@body)))
(define (projekt #:title title #:img [img ""] . body)
`(div ([class "overflow-hidden my-4 snap-center flex w-[90%] shrink-0 mx-8 sm:mx-16 shadow-lg rounded-lg"])
,(if (string=? img "")
""
`(img ([class "w-full"] [src ,img])))
(div ([class "py-4 grow w-full"])
,(heading title)
,@body)))
(define (projekte . body)
`(div ([id "projekt-container"][class "scroll-container mb-4 -mx-6 md:-mx-12 lg:-mx-24 md:gap-4 lg:gap-8 relative"])
(div ([class "flex justify-between"])
(button ([id "projekte-scroll-left"] [class "
sticky -mr-6 sm:-mr-2 md:mr-0 left-0 top-0 transform
text-zinc-500 bg-white/0 h-auto
hover:cursor-pointer hover:scale-125
duration-200 ease-out transition
z-10"])
(svg ([xmlns "http://www.w3.org/2000/svg"] [fill "none"] [viewBox "0 0 24 24"] [stroke-width "1.5"] [stroke "currentColor"] [class "size-10"])
(path ([stroke-linecap "round"] [stroke-linejoin "round"] [d "M15.75 19.5 8.25 12l7.5-7.5"]))
)
)
(div ([id "projekte-container"] [class "relative flex flex-row-reverse items-center flex-grow snap-x overflow-x-auto"])
,@body
)
(button ([id "projekte-scroll-right"] [class "
sticky -ml-6 sm:-ml-2 md:ml-0 right-0 top-0 transform
text-zinc-500 bg-white/0 h-auto
hover:cursor-pointer hover:scale-125
duration-200 ease-out transition
z-10"])
(svg ([xmlns "http://www.w3.org/2000/svg"] [fill "none"] [viewBox "0 0 24 24"] [stroke-width "1.5"] [stroke "currentColor"] [class "size-10"])
(path ([stroke-linecap "round"] [stroke-linejoin "round"] [d "m8.25 4.5 7.5 7.5-7.5 7.5"]))
)
)
)
)
)