diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/html.moon | 2 | ||||
| -rw-r--r-- | app/index.moon | 38 |
2 files changed, 39 insertions, 1 deletions
diff --git a/app/html.moon b/app/html.moon index b89344c..cf4a6e6 100644 --- a/app/html.moon +++ b/app/html.moon @@ -16,7 +16,7 @@ element = (element) -> (attrs = {}, ...) -> elements = {} add = (e) -> elements[e] = element e -for e in *{'div', 'span', 'a', 'p', 'button', 'ul', 'li'} do add e +for e in *{'div', 'span', 'a', 'p', 'button', 'ul', 'li', 'i', 'b', 'u', 'tt'} do add e for e in *{'br', 'img', 'input', 'p'} do add e for i=1,8 do add "h" .. i diff --git a/app/index.moon b/app/index.moon new file mode 100644 index 0000000..b501d57 --- /dev/null +++ b/app/index.moon @@ -0,0 +1,38 @@ +window = js.global +document = window.document + +import h1, p, a, br, ul, tt, li from require './html.moon' + +moon = '\xe2\x98\xbd' +back_button = -> + document.body\appendChild p a { '< back', href: '/' } + +switch window.location.search + when "?twisted" + back_button! + require './twisted.moon' + when "?center-of-mass" then + back_button! + require './centerofmass.moon' + else + document.body\appendChild h1 'mmm' + document.body\appendChild p { + tt 'mmm' + ' is not the ' + tt 'www' + ', because it runs on ' + a { 'MoonScript', href: 'https://moonscript.org' } + '.' + br! + 'You can find the source code of everything ' + a { 'here', href: 'https://github.com/s-ol/mmm' } + '.' + } + document.body\appendChild p 'current demos:' + document.body\appendChild ul for name in *{'twisted', 'center-of-mass'} + li a { name, href: "/?#{name}" } + +document.body\appendChild p { + "made with #{moon} by " + a { 's-ol', href: 'https://twitter.com/S0lll0s' } +} |
