Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time
50 lines (44 sloc) 1.34 KB
(ns thank-you-nhs.core
(:require [hiccup.core :as h]))
(def head
[:link {:rel :stylesheet
:href "styles/main.css"}]
[:link {:href "" :rel "stylesheet"}]
[:link {:rel :icon
:href "favicon.ico"}]
[:title "Thank you NHS!"]
[:meta {:name "viewport"
:content "width=device-width, initial-scale=1"}]])
(def rainbow
(let [colours ["red" "orange" "yellow" "green" "blue" "indigo" "violet"]
rainbow-height 15
r-step (int (/ (- 50 rainbow-height) (inc (count colours))))]
{:viewBox "0 0 100 50"
:preserveAspectRatio "xMidYMax slice"
:width "auto"}
[:mask {:id "hole"}
[:rect {:width "100%" :height "100%" :fill "white"}]
[:circle {:cx 50 :cy 50 :r (* 1.5 rainbow-height) :fill "black"}]]]
(->> (concat
[:g {:mask "url(#hole)"}]
(->> colours
(fn [idx colour]
[:circle {:cx 50 :cy 50 :r (- 50 (* r-step idx)) :fill colour}]))))
(into []))]]))
(def page
[:h1 "Thank you NHS!"]
(defn main [& args]
(println "Building...")
(spit "public/index.html" (h/html page)))