splatout.js

total 0
used 0
limit 0
/* --- title: Splatout files: head point pointlist mouse stage stroke dragging ../point_src/random.js ../point_src/stage-clock.js ../point_src/easing.js ../point_src/iter/lerp.js --- */ class MainStage extends Stage { canvas='playspace' // live=false mounted(){ this.p = this.center.copy() this.p.color = this.randomColor() this.microValue = this.clock.frameStepValue(1) // seconds this.backgroundColor = undefined; //this.randomColor() } onMousedown(e){ /* Grab Point Animate To size. Then the new background color, */ let p = Point.from(e).update({ radius: 5 }) this.p = p p.color = this.randomColor() let width = this.dimensions.width * 1.5 let easing = easingFunctions.get('sine', 'in') let st = this; let v = this.v = new Value(this.p.radius, width, easing) v.doneHandler = ()=>{ // st.switchOut() this.nextTick(this.switchOut.bind(this)) } this.microStep = 0 } randomColor(){ let deg = random.int(360) let sat = random.int(100) let lig = random.int(100) return `hsl(${deg}deg ${sat}% ${lig}%)` } switchOut() { console.log('doneHandler') let p = this.p this.v = undefined; this.backgroundColor = p.color // this.nextTick( setTimeout(()=>{ // p.color = this.randomColor() // p.radius = 5 // this.p.radius = 50 }, 400) } step(){ if(this.v) { let t = this.v.get(this.microStep) this.p.radius = t } else { // this.p.radius -= this.microValue * 30 } this.microStep += this.microValue } draw(ctx){ this.clear(ctx, this.backgroundColor) this.p.pen.fill(ctx) this.step() // this.p.pen.indicator(ctx) } } ;stage = MainStage.go();
Run
Meta Data
title Splatout
imports ()
files ('head', 'point', 'pointlist', 'mouse', 'stage', 'stroke', 'dragging', '../point_src/random.js', '../point_src/stage-clock.js', '../point_src/easing.js', '../point_src/iter/lerp.js')
unused_keys ()
unknown_keys ()
filepath_exists True
path splatout.js
filepath splatout.js
clean_files ('../point_src/core/head.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/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/events.js', '../point_src/automouse.js', '../point_src/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/setunset.js', '../point_src/stroke.js', '../point_src/functions/clamp.js', '../point_src/distances.js', '../point_src/protractor.js', '../point_src/text/beta.js', '../point_src/dragging.js', '../point_src/random.js', '../point_src/stage-clock.js', '../point_src/easing.js', '../point_src/iter/lerp.js')
markdown {'html': '', 'content': '---\ntitle: Splatout\nfiles:\n head\n point\n pointlist\n mouse\n stage\n stroke\n dragging\n ../point_src/random.js\n ../point_src/stage-clock.js\n ../point_src/easing.js\n ../point_src/iter/lerp.js\n---'}