scrolly stuff
[mudsync.git] / mudsync / networking.scm
index 6f60ad971d8f15b7b2d351820a283168d4184f36..b938c8a9427bdf53936c44c1e9b7a045abdd4048 100644 (file)
                                       #:websocket-handler (wrap-apply websocket-handler)))))
 
 (define (view:main-display request body)
+  (define one-entry
+    '(div (@ (class "stream-entry"))
+          (p "This is an entry!")
+          (p "Let's try a few paragraphs")
+          (p "okay?")))
+
   (define body-tmpl
-    '(body
-      (@ (style "display: flex; flex-direction: column; align-content: stretch; align-items: stretch;"))
-      (div (@ (style "background: #555555; flex: 1;")
-              (id "stream-output"))
-           (p "nope"))
-      (div (@ (id "input-box")
-              (style "flex: 1; background: #000055;"))
+    `((div (@ (id "stream-metabox"))
+           (div (@ (id "stream"))
+                ,@(map (const one-entry) (iota 10))))
+      (div (@ (id "input-metabox"))
            (p "test test")
            (input (@ (id "input"))))))
 
   (define (main-tmpl)
-    `(html (@ (xmlns "http://www.w3.org/1999/xhtml")
-              (style "width: 100%; height: 100%;"))
-           (head
-            (title "Mudsync!")
-            (meta (@ (charset "UTF-8"))))
-           ,body-tmpl))
+    `(html (@ (xmlns "http://www.w3.org/1999/xhtml"))
+           (head (title "Mudsync!")
+                 (meta (@ (charset "UTF-8")))
+                 (link (@ (rel "stylesheet")
+                          (href "/static/css/main.css"))))
+           (body ,@body-tmpl)))
   (define (write-template-to-string)
     (with-fluids ((%default-port-encoding "UTF-8"))
-      (with-output-to-string
-        (lambda ()
-          (sxml->xml (main-tmpl))))))
+      (call-with-output-string
+        (lambda (p)
+          (sxml->xml (main-tmpl) p)))))
   (values (build-response #:code 200
                           #:headers '((content-type . (application/xhtml+xml))))
           (write-template-to-string)))