From e86946428223bbcaae089bb92066988c3af129a0 Mon Sep 17 00:00:00 2001 From: s-ol Date: Fri, 23 Nov 2018 13:56:23 +1100 Subject: clean-ish header --- build/render_fileder.moon | 67 +++++++++++++++++++++++++++++++++++++++++++---- mmm/mmmfs/init.moon | 22 ---------------- scss/browser.scss | 2 +- scss/main.scss | 36 ++++++++++++++++++++++++- 4 files changed, 98 insertions(+), 29 deletions(-) diff --git a/build/render_fileder.moon b/build/render_fileder.moon index d76d162..f8958aa 100644 --- a/build/render_fileder.moon +++ b/build/render_fileder.moon @@ -1,20 +1,47 @@ require 'mmm' -import render from require 'mmm.mmmfs' import get_path from require 'build.util' +import tohtml from require 'mmm.component' +import Browser from require 'mmm.mmmfs.browser' + +export BROWSER -- usage: -- moon render.moon { path_to_root } = arg +seed = (str) -> + len = #str + rnd = -> math.ceil math.random! * len + + math.randomseed len + + return if len == 0 + + upper, lower = 0, 0 + for i=1,4 + upper += str\byte rnd! + upper *= 0x100 + + lower += str\byte rnd! + lower *= 0x100 + + math.randomseed upper, lower + +pick = (...) -> + num = select '#', ... + i = math.ceil math.random! * num + select i, ... + assert path_to_root, "please specify the relative root path" path = get_path path_to_root +seed path + root = dofile '$bundle.lua' assert root, "couldn't load $bundle.lua" root\mount path, true -content, rehydrate = render root, path -assert content, "no content" +BROWSER = Browser root, path with io.open 'index.html', 'w' \write " @@ -30,9 +57,29 @@ with io.open 'index.html', 'w' --> + + - #{content} +
+

+ + + mmm + .s-ol.nu +

+ + fun stuff with code and wires + + +
+ + #{assert (tohtml BROWSER), "couldn't render BROWSER"} @@ -41,7 +88,17 @@ with io.open 'index.html', 'w' - #{rehydrate} + " \close! diff --git a/mmm/mmmfs/init.moon b/mmm/mmmfs/init.moon index 4dd5c32..8aba86a 100644 --- a/mmm/mmmfs/init.moon +++ b/mmm/mmmfs/init.moon @@ -1,31 +1,9 @@ require = relative ... import Key, Fileder from require '.fileder' import Browser from require '.browser' -import tohtml from require 'mmm.component' - -render = (root, path) -> - export BROWSER - BROWSER = Browser root, path - - content = tohtml BROWSER - - rehydrate = " -" - content, rehydrate { :Key :Fileder :Browser - :render } diff --git a/scss/browser.scss b/scss/browser.scss index ab03d59..1117da7 100644 --- a/scss/browser.scss +++ b/scss/browser.scss @@ -46,7 +46,7 @@ display: flex; flex: 0 0 3.2em; justify-content: space-between; - background: #eeeeee; + background: $gray-bright; /* > * { diff --git a/scss/main.scss b/scss/main.scss index 070eac0..adbb65d 100644 --- a/scss/main.scss +++ b/scss/main.scss @@ -36,6 +36,40 @@ a { color: inherit; } +header { + font-family: 'Source Sans Pro', sans-serif; + padding: 1rem 2rem; + text-align: right; + + color: $gray-bright; + background: $gray-dark; + + h1 { + display: flex; + justify-content: space-around; + align-items: baseline; + margin: 0; + + font-size: 4rem; + font-weight: 200; + + > b { + flex: 1; + } + + .bold { + font-weight: 400; + } + } + + i.sun { + font-style: normal; + font-weight: 800; + font-size: 0.7em; + vertical-align: -0.04em; + } +} + .canvas_app { position: relative; @@ -67,7 +101,7 @@ a { a { display: block; - color: #eee; + color: $gray-bright; font-family: inherit; } } -- cgit v1.2.3