From 96dd46ce50cd3e444e6c7e2df6eb4e6723f9b186 Mon Sep 17 00:00:00 2001 From: shoshin Date: Sat, 13 May 2023 23:22:01 -0500 Subject: Add: CSS and first draft layout --- arclade.lisp | 9 ++++++--- model.lisp | 9 +++++++-- style.css | 20 ++++++++++++++------ utilities.lisp | 6 ++++++ 4 files changed, 33 insertions(+), 11 deletions(-) diff --git a/arclade.lisp b/arclade.lisp index 67f4183..63bd975 100644 --- a/arclade.lisp +++ b/arclade.lisp @@ -60,6 +60,9 @@ (:div :class "game" (:h2 (name game)) - (:div :class "feats" - (dolist (feat feats) - (:div :class "feat" (render feat))))))))))) + (:div + :class "feats" + (dolist (feat feats) (render feat)))))))))) + +(defendpoint* :get "/css/style.css" () () + (pathname "./style.css")) diff --git a/model.lisp b/model.lisp index 4bf59c2..8849aa3 100644 --- a/model.lisp +++ b/model.lisp @@ -86,8 +86,13 @@ Example: (defmethod render ((obj steam-achievement)) (with-slots (name description fulfillment icon icongray) obj (with-html - (:img :src icon) - (:b name) description (:i (format-time fulfillment))))) + (:div + :class "feat" + (:div (:img :src icon)) + (:div + (:div (:b name)) + (:div description) + (:div (:i (format-time fulfillment)))))))) ;;; "queries" diff --git a/style.css b/style.css index 5a3b781..5e31b5e 100644 --- a/style.css +++ b/style.css @@ -1,9 +1,7 @@ body { background-color: black; - - animation-name: textColorPalette; - animation-duration: .4s; - animation-iteration-count: infinite; + color: cyan; + font-family: Victor Mono; } .container { @@ -23,10 +21,20 @@ body { } .feat { + margin-bottom: .5rem; + width: 100%; text-align: left; display: flex; - justify-content: left; - align-items: center; + justify-content: flex-start; + align-items: flex-start; + + animation-name: textColorPalette; + animation-duration: .4s; + animation-iteration-count: infinite; +} + +img { + margin-right: 1rem; } @keyframes textColorPalette { diff --git a/utilities.lisp b/utilities.lisp index c3f49c1..5499755 100644 --- a/utilities.lisp +++ b/utilities.lisp @@ -16,6 +16,11 @@ (format nil "~2,'0d-~2,'0d-~a ~2,'0d:~2,'0d" month day year hour min))) +(defun host-path (str) + (with-slots (host port) *config* + (quri:render-uri + (quri:make-uri-http :host host :port port :path str)))) + (defmacro with-page ((&key title) &body body) "A helper macro for defining some standard page boilerplate." (let ((title-var (gensym))) @@ -25,6 +30,7 @@ (:html (:head (:script :src "http://localhost:8080/skewer") + (:link :href ,(host-path "css/style.css") :rel "stylesheet") (:title ,title-var)) (:body ,@body)))))) -- cgit v1.2.3