grid-flag.js

total 0
used 0
limit 0
/* title: Grid Flag categories: minimal grid files: ../point_src/unpack.js head point pointlist stage stroke dragging mouse --- The minimal requirements include the _head_, _stage_, and the _point_. */ addSliderControlSet({ color: { min: 0, max: 361, value: 190 , onchange(ev, unit) { stage.baseColor = Number(ev.currentTarget.value) unit.value = ev.currentTarget.value } } , growth: { min: 0, max: 40, value: 6 , onchange(ev, unit) { stage.growth = Number(ev.currentTarget.value) unit.value = ev.currentTarget.value } } , min: { min: .5, max: 40, value: 5, step: .5 , onchange(ev, unit) { stage.min = Number(ev.currentTarget.value) unit.value = ev.currentTarget.value } } }) class MainStage extends Stage { canvas = 'playspace' mounted() { this.point = this.center.copy().update({ radius: 30}) // this.points = PointList.generate.grid(500, 20, 15, point(100, 100)) this.points = PointList.generate.grid({ count:500 , rowCount:20 , spread:15 , position:point(100, 100) }) this.tick = 0 this.speed = .02 this.phase = this.point.radians = .3 this.growth = 6 this.min = 3 this.baseColor = 190 this.dragging.add(this.point) } draw(ctx){ this.clear(ctx) this.tick += 1 this.phase = this.point.radians this.speed = this.point.radius * .001 this.points.pen.fill(ctx) this.point.pen.indicator(ctx) let baseColor = this.baseColor this.points.each.radius = (p, i) => { return this.min + ( Math.cos(i * this.phase + this.tick * this.speed ) * this.growth ) } this.points.each.color = (p,i)=>{ return `hsl(${baseColor+Math.sin(i * this.speed * this.phase) * 40} 80% 50%)` } } } stage = MainStage.go(/*{ loop: true }*/)
Run
Meta Data
title Grid Flag
imports ()
files ('../point_src/unpack.js', 'head', 'point', 'pointlist', 'stage', 'stroke', 'dragging', 'mouse')
unused_keys ()
unknown_keys ('categories',)
categories ['minimal', 'grid']
filepath_exists True
path grid-flag.js
filepath grid-flag.js
clean_files ('../point_src/unpack.js', '../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/pointlist.js', '../point_src/pointlistpen.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/events.js', '../point_src/automouse.js')
markdown {'html': '<p>The minimal requirements include the <em>head</em>, <em>stage</em>, and the <em>point</em>.</p>', 'content': 'title: Grid Flag\ncategories: minimal\n grid\nfiles:\n ../point_src/unpack.js\n head\n point\n pointlist\n stage\n stroke\n dragging\n mouse\n---\n\nThe minimal requirements include the _head_, _stage_, and the _point_.'}