summaryrefslogtreecommitdiff
path: root/pages.lisp
diff options
context:
space:
mode:
authorGrant Shoshin Shangreaux <shoshin@cicadas.surf>2023-01-07 11:12:15 -0600
committerGrant Shoshin Shangreaux <shoshin@cicadas.surf>2023-01-07 11:12:15 -0600
commitaee7f487f97c10c15b6c7b48156cc95db19d9137 (patch)
tree9ccdb9b7a3e356ed39f2ed71b2d04b7e2718df20 /pages.lisp
parent9a040d4e78ab07eb9c482a40042f2ba92d2a8e3b (diff)
First Draft of hero creation and login
Diffstat (limited to 'pages.lisp')
-rw-r--r--pages.lisp30
1 files changed, 30 insertions, 0 deletions
diff --git a/pages.lisp b/pages.lisp
new file mode 100644
index 0000000..7bbf48b
--- /dev/null
+++ b/pages.lisp
@@ -0,0 +1,30 @@
+;;;; pages.lisp -- html generation functions for dnd
+
+(defmacro with-page ((&key title) &body body)
+ `(with-html-string
+ (:doctype)
+ (:html
+ (:head
+ (:title ,title))
+ (:body ,@body))))
+
+(defun a-hero-is-born ()
+ (with-page (:title "A Hero Is Born!")
+ (:header
+ (:h1 "A Hero Is Materializing From the Void..."))
+ (:form :method "POST" :action "/a-hero-is-born"
+ (:label :for "NAME" "Thy Hero's Appelation")
+ (:input :name "NAME")
+ (:button :type "submit"))))
+
+(defun doorkeeper ()
+ (with-page (:title "Tavern Door")
+ (:h1 "Wot's yer name 'ero?")
+ (:form :method "POST" :action "/tavern-door"
+ (:label :for "NAME" "Thy Hero's Appelation")
+ (:input :name "NAME")
+ (:button :type "submit"))))
+
+(defun tavern (hero)
+ (with-page (:title "A Bustling Tavern")
+ (:h1 "Aye! Welcome " (hero-name hero))))