2025-05-02 01:31:26 +09:00
|
|
|
(defpackage #:hp/components/header
|
|
|
|
(:use #:cl
|
|
|
|
#:hsx)
|
|
|
|
(:import-from #:jingle
|
|
|
|
#:request-uri)
|
|
|
|
(:export #:~header))
|
|
|
|
(in-package #:hp/components/header)
|
|
|
|
|
|
|
|
(defparameter *nav-menu*
|
|
|
|
'(("/bio" "bio")
|
|
|
|
("/work" "work")
|
|
|
|
("/blog" "blog")))
|
|
|
|
|
|
|
|
(defcomp ~header ()
|
|
|
|
(hsx
|
2025-05-02 09:16:21 +09:00
|
|
|
(header :class "flex justify-between py-2 md:py-4 border-b-1 sticky top-0 bg-white"
|
2025-05-02 01:31:26 +09:00
|
|
|
(h1 :class "text-2xl md:text-3xl font-bold"
|
|
|
|
(a :href "/"
|
|
|
|
"skyizwhite"))
|
|
|
|
(nav :class "flex items-end"
|
2025-05-02 09:16:21 +09:00
|
|
|
(ul :preload "mouseover" :class "flex gap-4 text-xl"
|
2025-05-02 01:31:26 +09:00
|
|
|
(loop
|
|
|
|
:for (href label) :in *nav-menu* :collect
|
|
|
|
(if (search href (request-uri jingle:*request*))
|
|
|
|
(hsx (li :class "text-pink-500"
|
|
|
|
label))
|
|
|
|
(hsx (li (a :href href :class "underline hover:text-pink-500"
|
|
|
|
label))))))))))
|