diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2018-10-31 08:52:16 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2018-10-31 08:52:16 +0000 |
| commit | b99de1d4e79e6c4a548d9dddca730eaeeb63a1c9 (patch) | |
| tree | 1b34fd16a46d2567f7e767d9f260ad238bea0ef9 /app/mmmfs/gallery.moon | |
| parent | REHYDRATION (diff) | |
| download | mmm-b99de1d4e79e6c4a548d9dddca730eaeeb63a1c9.tar.gz mmm-b99de1d4e79e6c4a548d9dddca730eaeeb63a1c9.zip | |
almost there tbh
Diffstat (limited to 'app/mmmfs/gallery.moon')
| -rw-r--r-- | app/mmmfs/gallery.moon | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/app/mmmfs/gallery.moon b/app/mmmfs/gallery.moon deleted file mode 100644 index 98c9490..0000000 --- a/app/mmmfs/gallery.moon +++ /dev/null @@ -1,50 +0,0 @@ -import Fileder from require 'lib.mmmfs' -import div, h1, a, img, br from require 'lib.dom' - -children = for i=1,100 - id = math.floor math.random! * 200 - Fileder { - 'name: alpha': "image#{id}" - 'URL -> image/png': "https://picsum.photos/600/600/?image=#{id}" - 'preview: URL -> image/png': "https://picsum.photos/200/200/?image=#{id}" - } - -props = { - 'name: alpha': 'gallery', - 'title: text/plain': "A Gallery of 100 random pictures, come in!", - 'preview: moon -> mmm/dom': => div { - 'the first pic as a little taste:', - br!, - img src: @children[1]\get 'preview', 'URL -> image/png' - } - 'moon -> mmm/dom': => - link = (child) -> a { - href: '#', - onclick: -> BROWSER\navigate { 'gallery', (child\get 'name', 'alpha'), nil }, - img src: child\gett 'preview', 'URL -> image/png' - } - - content = [link child for child in *@children] - table.insert content, 1, h1 'gallery index' - div content - - 'slideshow: moon -> mmm/dom': => - import ReactiveVar, text, elements from require 'lib.component' - - index = ReactiveVar 1 - - prev = (i) -> math.max 1, i - 1 - next = (i) -> math.min #@children, i + 1 - - e = elements - e.div { - e.div { - e.a 'prev', href: '#', onclick: -> index\transform prev - index\map (i) -> text " image ##{i} " - e.a 'next', href: '#', onclick: -> index\transform next - }, - index\map (i) -> img src: @children[i]\gett nil, 'URL -> image/png' - } -} - -Fileder props, children |
