diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2018-10-27 12:56:46 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2018-10-27 12:56:46 +0000 |
| commit | 29a3ad9c26017b1578062706b6da9282977b6ad2 (patch) | |
| tree | 8e7b51e9564a0ccd0b83e0cf3607c0b2501a9517 /app | |
| parent | mmmfs browser etc (diff) | |
| download | mmm-29a3ad9c26017b1578062706b6da9282977b6ad2.tar.gz mmm-29a3ad9c26017b1578062706b6da9282977b6ad2.zip | |
pause twisted preview
Diffstat (limited to 'app')
| -rw-r--r-- | app/mmmfs/tree.moon | 6 | ||||
| -rw-r--r-- | app/mmmfs/twisted.moon | 15 |
2 files changed, 14 insertions, 7 deletions
diff --git a/app/mmmfs/tree.moon b/app/mmmfs/tree.moon index b90d8cd..e058b85 100644 --- a/app/mmmfs/tree.moon +++ b/app/mmmfs/tree.moon @@ -242,9 +242,5 @@ and some bold **text** and `code tags` with me.", } -- if we are on client (mmm.s-ol.nu/?client=mmmfs), throw in twisted as a child - if MODE == 'CLIENT' then Fileder { - 'name: alpha': 'twisted', - 'title: text/plain': "canvas animation that doesn't quite fit", - 'preview: moon -> mmm/component': => require '.twisted' - } + if MODE == 'CLIENT' then require '.twisted' } diff --git a/app/mmmfs/twisted.moon b/app/mmmfs/twisted.moon index c2f805b..ec3fa83 100644 --- a/app/mmmfs/twisted.moon +++ b/app/mmmfs/twisted.moon @@ -7,8 +7,12 @@ class TwistedDemo extends CanvasApp width: 500 height: 400 length: math.pi * 4 - new: => - super true + new: (preview) => + if preview + @width, @height = 120, 120 + super false, true + else + super true @background = {Math.random!, Math.random!/3+.2, Math.random!/4} hue = Math.random! @shades = setmetatable {}, __index: (key) => @@ -35,3 +39,10 @@ class TwistedDemo extends CanvasApp draw 1 TwistedDemo! + +Fileder { + 'name: alpha': 'twisted', + 'title: text/plain': "canvas animation with static preview", + 'preview: moon -> mmm/component': => TwistedDemo true + 'moon -> mmm/component': => TwistedDemo! +} |
