changed up the ui

master
Clyne 1 year ago
parent 1ec46b5407
commit 5e95b04c13
Signed by: clyne
GPG Key ID: 3267C8EBF3F9AFC7

@ -1,4 +1,4 @@
(defproject bitgloo-web "0.5"
(defproject bitgloo-web "0.7"
:description "bitgloo website framework"
:url "https://bitgloo.com"
:license {:name "GPL-3.0-or-later" :url "https://www.gnu.org/licenses/gpl-3.0.en.html"}

@ -1,93 +1,80 @@
@font-face {
/* https://indestructibletype.com/Jost.html */
/*@font-face
{
font-family: Jost;
src: url('/Jost-400-Book.otf');
}
html, body {
}*/
html {
background: #d8f0ff;
font-family: Jost;
}
body {
padding: 0em 1.5em;
font-family: sans-serif;
}
#title-container {
padding-top: 4em;
padding-bottom: 0.5em;
#container {
background: white;
margin: 2em auto;
box-shadow: 0px 0px 12px 4px lightgray;
width: 1024px;
max-width: 97%;
}
#posts {
min-height: 400px;
#header {
padding: 1.2em;
}
#logo {
height: 90px;
}
.block {
padding-bottom: 20px;
border-top: 1px solid #888;
float: right;
height: inherit;
}
#menu {
background: #555;
border-bottom: 3px solid #0066cc;
}
.menu-item {
display: inline-block;
color: white;
border-left: 1px solid gray;
padding: 0.5em 1em;
font-weight: bold;
text-decoration: none;
}
.block img {
max-width: 40em;
border: 1px solid #888;
.menu-item:first {
border-left: 0;
}
h1 {
font-size: 4em;
display: inline;
padding-left: 0.1em;
color: black;
.menu-item:hover {
background: #0066cc;
}
h1:hover {
color: #ff3300;
.content {
padding: 0.75em 1.5em;
font-size: 1.2em;
}
h2 {
font-size: 2.2em;
#footer {
font-size: 6px;
color: lightgray;
text-align: right;
}
h3 {
font-size: 1.7em;
#title {
border-bottom: 1px solid lightgray;
height: 60px;
position: relative;
margin-bottom: 0.2em;
}
h4, h5 {
font-size: 1.6em;
#subtitle {
color: gray;
}
p, li {
font-size: 1.5em;
max-width: 50em;
h1 {
margin-bottom: 0.2em;
position: absolute;
bottom: 0;
font-size: 2.5em;
color: black;
}
a, a code {
text-decoration: none;
color: #ff3300;
img {
max-width: 100%;
}
#footer {
color: #666;
text-align: right;
table {
width: 100%;
}
code {
padding: 2px;
font-family: monospace, monospace;
font-size: 0.8em;
td {
vertical-align: top;
min-width: 240px;
}
pre {
padding: 4px;
background: #333;
color: #ccc;
font-family: fixed;
td:first-child {
padding-right: 2em;
}
.codecolor0 { color: #2c6; }
.codecolor1 { color: yellow; }
.codecolor2 { color: pink; }
.codecolor3 { color: #c44; }

@ -6,12 +6,19 @@
(:require [markdown.core :refer [md-to-html-string]]))
(def page-header
[:div#title-container
[:a {:href "/"}
[:div#header
[:div#title
[:img#logo {:src "/logo.jpg" :alt "bitgloo logo"}]
[:h1 "bitgloo"]]])
[:a {:href "/"}
[:h1 "bitgloo"]]]])
;[:div#subtitle "Electronics design services"]])
(def page-menu
[:div#menu
[:a.menu-item {:href "/"} "Home"]
[:a.menu-item {:href "/projects"} "Projects"]])
(def page-footer [:div#footer [:span "© Clyne Sullivan 2023"]])
(def page-footer [:div#footer "© Clyne Sullivan 2023"])
(defn md-file? [path] (str/ends-with? path ".md"))
@ -19,12 +26,12 @@
(defn parse-md-file [file] (-> file slurp md-to-html-string))
(defn render-md-files [file-list] (for [f file-list] [:div.block (parse-md-file f)]))
(defn render-md-files [file-list] (for [f file-list] [:div.content (parse-md-file f)]))
(defn load-page [path]
(let [file-list (filter md-file? (get-file-list path))]
(when-not (empty? file-list)
(page/html5
[:head [:title "bitgloo"] (page/include-css "/main.css")]
[:body page-header [:div#posts (render-md-files file-list)] page-footer]))))
[:body [:div#container page-header page-menu (render-md-files file-list) page-footer]]))))

@ -15,7 +15,8 @@
(defn image? [path] (some (partial str/ends-with? path) image-extensions))
(defn home-redirect [uri] (if (= "/" uri) "/home" uri))
;(defn home-redirect [uri] (if (= "/" uri) "/home" uri))
(defn home-redirect [uri] uri)
(defn request-handler [content-path request]
(let [path (str content-path (home-redirect (:uri request)))]
@ -31,6 +32,10 @@
(when (.exists (io/file path)) (resp/file-response path))
(handler request)))))
(defn wrap-no-params [handler]
(fn [request]
(when (nil? (:query-string request)) (handler request))))
(defn wrap-only-gets [handler]
(fn [request]
(when (= :get (:request-method request)) (handler request))))
@ -61,6 +66,7 @@
(wrap-resource "public")
(wrap-content-type)
(wrap-not-modified)
(wrap-no-params)
(wrap-only-gets)
(wrap-not-found)
(wrap-log-transactions)

Loading…
Cancel
Save