jiggle-pointlist.js

total 0
used 0
limit 0
/* --- title: Jiggle categories: iteration files: ../point_src/core/head.js ../point_src/pointpen.js ../point_src/pointdraw.js ../point_src/extras.js ../point_src/math.js ../point_src/point-content.js ../point_src/stage.js ../point_src/point.js ../point_src/distances.js ../point_src/pointlist.js ../point_src/events.js ../point_src/functions/clamp.js ../point_src/relative.js ../point_src/keyboard.js ../point_src/automouse.js ../point_src/dragging.js ../point_src/iter/alpha.js ../point_src/text/alpha.js ../point_src/text/label.js ../point_src/text/beta.js ../point_src/jiggle.js --- Speedy motion at a singular position. https://youtube.com/clip/UgkxbshWOsMf_ukuMO-Zq9Mimj1UYlFDIQ9Q?si=RgotghYr0We685BC */ class MainStage extends Stage { canvas='playspace' mounted(){ let pl = new PointList() this.origin = this.center.copy().update({radius: 9}) this.jiggler = new Jiggler(undefined, this.origin) this.jiggler2 = new Jiggler() this.pl = pl pl.push(new Jiggler()) pl.push(new Jiggler()) pl.push(new Jiggler()) pl.push(new Jiggler()) this.dragging.addPoints(this.origin) } draw(ctx){ this.clear(ctx) this.pl.each.step() this.pl.forEach(p=>{ p.point.pen.fill(ctx, '#22BB55') }) let jPoint = this.jiggler.point let updates = this.calcDistanceChanges(jPoint) this.jiggler.step(updates) this.jiggler2.step() let j2 = this.jiggler2.point.add(this.center.copy()) jPoint.pen.fill(ctx, '#22BB55') j2.pen.fill(ctx, '#000') } calcDistanceChanges(jPoint) { let reducer = (20 / this.mouse.point.distanceTo(jPoint)) reducer = clamp(reducer, .1, 1) return { width: clamp(reducer * 10, 1, 3) , height: clamp(reducer * 10, 1, 3) , reducer } } } ;stage = MainStage.go();
Run
Meta Data
title Jiggle
imports ()
files ('../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.js', '../point_src/extras.js', '../point_src/math.js', '../point_src/point-content.js', '../point_src/stage.js', '../point_src/point.js', '../point_src/distances.js', '../point_src/pointlist.js', '../point_src/events.js', '../point_src/functions/clamp.js', '../point_src/relative.js', '../point_src/keyboard.js', '../point_src/automouse.js', '../point_src/dragging.js', '../point_src/iter/alpha.js', '../point_src/text/alpha.js', '../point_src/text/label.js', '../point_src/text/beta.js', '../point_src/jiggle.js')
unused_keys ()
unknown_keys ('categories',)
categories ['iteration']
filepath_exists True
path jiggle-pointlist.js
filepath jiggle-pointlist.js
clean_files ('../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.js', '../point_src/extras.js', '../point_src/math.js', '../point_src/compass.js', '../point_src/center.js', '../point_src/point-content.js', '../point_src/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/relative-xy.js', '../point_src/pointcast.js', '../point_src/point.js', '../point_src/distances.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/events.js', '../point_src/functions/clamp.js', '../point_src/relative.js', '../point_src/keyboard.js', '../point_src/automouse.js', '../point_src/protractor.js', '../point_src/text/beta.js', '../point_src/dragging.js', '../point_src/iter/alpha.js', '../point_src/text/alpha.js', '../point_src/text/label.js', '../point_src/jiggle.js')
markdown {'html': '<hr />\n<p>Speedy motion at a singular position.\nhttps://youtube.com/clip/UgkxbshWOsMf_ukuMO-Zq9Mimj1UYlFDIQ9Q?si=RgotghYr0We685BC</p>', 'content': '---\ntitle: Jiggle\ncategories: iteration\nfiles:\n ../point_src/core/head.js\n ../point_src/pointpen.js\n ../point_src/pointdraw.js\n ../point_src/extras.js\n ../point_src/math.js\n ../point_src/point-content.js\n ../point_src/stage.js\n ../point_src/point.js\n ../point_src/distances.js\n ../point_src/pointlist.js\n ../point_src/events.js\n ../point_src/functions/clamp.js\n ../point_src/relative.js\n ../point_src/keyboard.js\n ../point_src/automouse.js\n ../point_src/dragging.js\n ../point_src/iter/alpha.js\n ../point_src/text/alpha.js\n ../point_src/text/label.js\n ../point_src/text/beta.js\n ../point_src/jiggle.js\n\n---\n\nSpeedy motion at a singular position.\nhttps://youtube.com/clip/UgkxbshWOsMf_ukuMO-Zq9Mimj1UYlFDIQ9Q?si=RgotghYr0We685BC'}