snapshot-upload.js

total 0
used 0
limit 0
/* title: Upload Snapshots categories: gif files: head pointlist point stage mouse stroke ../point_src/random.js ../point_src/easing.js ../point_src/iter/lerp.js ../theatre/utils/snapshots.js --- Save many images on the server to generate an animated gif using the backend. */ addButton('Start Recording', { onclick() { stage.startRecord() } }) addButton('Stop Recording', { onclick() { stage.stopRecord() } }) class MainStage extends Stage { canvas='playspace' mounted(){ let count = 50 this.a = PointList.generate.random(count, [200,350, 20, 200], [60, 150, 1, 1]) this.b = PointList.generate.radius({count, offset: {radius:3}}, 140, new Point(300, 300)) this.c = PointList.generate.random(count) this.isRecording = false } onMousedown(e) { console.log('mousedown') this.update() this.draw(this.ctx) sendImage(this.canvas) } startRecord() { this.isRecording = true this.stepRecord() } stopRecord() { this.isRecording = false } stepRecord() { if(this.isRecording) { this.update() this.draw(this.ctx) sendImage(this.canvas).then(this.stepRecord.bind(this)) } } draw(ctx) { this.clear(ctx, '#010101') this.a.pen.indicator(ctx, 'green') this.b.pen.indicator(ctx, {color:'#333'}) this.c.lerper.through(this.a, this.b, {seconds: 5, easing: linearInOut, fps: 30}) this.c.pen.indicator(ctx, {color:'purple'}) } } ;stage = MainStage.go({ loop: false });
Run
Meta Data
title Upload Snapshots
imports ()
files ('head', 'pointlist', 'point', 'stage', 'mouse', 'stroke', '../point_src/random.js', '../point_src/easing.js', '../point_src/iter/lerp.js', '../theatre/utils/snapshots.js')
unused_keys ()
unknown_keys ('categories',)
categories ['gif']
filepath_exists True
path snapshot-upload.js
filepath snapshot-upload.js
clean_files ('../point_src/core/head.js', '../point_src/pointlistdraw.js', '../point_src/pointlistgradient.js', '../point_src/pointlistshape.js', '../point_src/pointlistgenerator.js', '../point_src/unpack.js', '../point_src/pointlist.js', '../point_src/pointlistpen.js', '../point_src/pointpen.js', '../point_src/compass.js', '../point_src/center.js', '../point_src/point-content.js', '../point_src/pointdraw.js', '../point_src/relative-xy.js', '../point_src/pointcast.js', '../point_src/point.js', '../point_src/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/events.js', '../point_src/automouse.js', '../point_src/setunset.js', '../point_src/stroke.js', '../point_src/random.js', '../point_src/easing.js', '../point_src/iter/lerp.js', '../theatre/utils/snapshots.js')
markdown {'html': '<p>Save many images on the server to generate an animated gif using the backend.</p>', 'content': 'title: Upload Snapshots\ncategories: gif\nfiles:\n head\n pointlist\n point\n stage\n mouse\n stroke\n ../point_src/random.js\n ../point_src/easing.js\n ../point_src/iter/lerp.js\n ../theatre/utils/snapshots.js\n---\n\nSave many images on the server to generate an animated gif using the backend.'}