aboutsummaryrefslogtreecommitdiffstats
path: root/app/mmmfs/gallery.moon
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2018-10-29 08:35:53 +0000
committers-ol <s-ol@users.noreply.github.com>2018-10-29 08:35:53 +0000
commit27d1cf641ce3bbfe96e6fe18f24dd46f95efbe5e (patch)
treeac703b9f84c1c8e4666d039a880a2af91c450c4a /app/mmmfs/gallery.moon
parentmove duct_tape to lib (diff)
downloadmmm-27d1cf641ce3bbfe96e6fe18f24dd46f95efbe5e.tar.gz
mmm-27d1cf641ce3bbfe96e6fe18f24dd46f95efbe5e.zip
better conversion inverence for mmmfs
Diffstat (limited to 'app/mmmfs/gallery.moon')
-rw-r--r--app/mmmfs/gallery.moon51
1 files changed, 0 insertions, 51 deletions
diff --git a/app/mmmfs/gallery.moon b/app/mmmfs/gallery.moon
deleted file mode 100644
index e1868d1..0000000
--- a/app/mmmfs/gallery.moon
+++ /dev/null
@@ -1,51 +0,0 @@
-import div, h1, a, img, br from require 'lib.html'
-
-URL = (url) => url
-
-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', 'image/png', :URL
- }
- 'moon -> mmm/dom': =>
- link = (child) -> a {
- href: '#',
- onclick: -> BROWSER\navigate { 'gallery', (child\get 'name', 'alpha'), nil },
- img src: child\gett 'preview', 'image/png', :URL
- }
-
- 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, 'image/png', :URL
- }
-}
-
-Fileder props, children