├── LICENSE ├── README.md ├── arcs └── arcs.gif ├── dancing ├── dancing.js ├── part.js ├── particle.js ├── skeleton.js ├── toxichelper.js └── toxiclibs.js ├── data ├── 0head.png ├── 1head.png ├── 2head.png ├── 3head.png ├── 4head.png ├── Nunito-Black.ttf ├── Nunito-Bold.ttf └── auld.mp3 ├── favicon.ico ├── fireworks ├── Firework.pde ├── Fireworks.pde └── processing.min.js └── index.html /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Coding Train 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Happy-2019 2 | 3 | Happy New Year from The Coding Train! 4 | 5 | https://codingtrain.github.io/Happy-2019/ 6 | -------------------------------------------------------------------------------- /arcs/arcs.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingTrain/Happy-2019/d6b44be28b7cb81d0edd1a8df3907ecc9723e039/arcs/arcs.gif -------------------------------------------------------------------------------- /dancing/dancing.js: -------------------------------------------------------------------------------- 1 | // The Nature of Code 2 | // Daniel Shiffman 3 | // http://natureofcode.com 4 | 5 | // Simple Toxiclibs Spring 6 | var VerletPhysics2D = toxi.physics2d.VerletPhysics2D, 7 | GravityBehavior = toxi.physics2d.behaviors.GravityBehavior, 8 | AttractionBehavior = toxi.physics2d.behaviors.AttractionBehavior, 9 | VerletParticle2D = toxi.physics2d.VerletParticle2D, 10 | VerletSpring2D = toxi.physics2d.VerletSpring2D, 11 | VerletMinDistanceSpring2D = toxi.physics2d.VerletMinDistanceSpring2D, 12 | Vec2D = toxi.geom.Vec2D, 13 | Rect = toxi.geom.Rect; 14 | 15 | // Reference to physics world 16 | var physics; 17 | 18 | var s1; 19 | var s2; 20 | 21 | // make a new HTML5 audio object named audio 22 | // Audio audio = new Audio(); 23 | // make string that will house the audio extension 24 | var fileExt; 25 | 26 | var showHidden = false; 27 | 28 | var mouseAttractor; 29 | 30 | var mousePos; 31 | 32 | var dance = false; 33 | 34 | var audio; 35 | 36 | var started = false; 37 | 38 | function setup() { 39 | var parent = document.getElementById('dancing'); 40 | var canvas = createCanvas(parent.offsetWidth, parent.offsetHeight); 41 | canvas.parent('dancing'); 42 | 43 | // Initialize the physics 44 | physics = new VerletPhysics2D(); 45 | physics.addBehavior(new GravityBehavior(new Vec2D(0, 0.5))); 46 | 47 | // Set the world's bounding box 48 | physics.setWorldBounds(new Rect(0, 0, width, height)); 49 | 50 | s1 = new Skeleton((3 * width) / 4, height/2, height/600, '0'); 51 | s2 = new Skeleton(width / 4, height/2, height/550, str(round(random(1, 4)))); 52 | dance = true; 53 | 54 | mousePos = new Vec2D(); 55 | } 56 | 57 | var counter = 0; 58 | 59 | function draw() { 60 | // Update the physics world 61 | //if (dance || frameCount < 2) { 62 | physics.update(); 63 | counter++; 64 | //} 65 | 66 | background(255); 67 | 68 | push(); 69 | translate(width / 2, height / 2); 70 | rotate(counter * 0.001); 71 | var delta = TWO_PI / 20; 72 | var r = width; 73 | colorMode(HSB, 255); 74 | for (var a = 0; a < TWO_PI; a += delta) { 75 | var c = color(map(a + counter / 20.0, 0, TWO_PI, 0, 255) % 255, 255, 255); 76 | fill(c); 77 | stroke(c); 78 | 79 | beginShape(); 80 | vertex(0, 0); 81 | vertex(r * cos(a), r * sin(a)); 82 | vertex(r * cos(a + delta), r * sin(a + delta)); 83 | endShape(CLOSE); 84 | } 85 | fill(255); 86 | stroke(255); 87 | ellipse(0, 0, abs(sin(frameCount/60.0))*15, abs(sin(frameCount/60.0))*15); 88 | pop(); 89 | colorMode(RGB); 90 | 91 | s1.display(); 92 | s1.control(); 93 | s2.display(); 94 | s2.control(); 95 | 96 | s1.hdance(); 97 | s2.vdance(); 98 | } 99 | 100 | function mousePressed() { 101 | if (!started) { 102 | started = true; 103 | audio = loadSound('data/auld.mp3', function(){audio.play();}); 104 | } else { 105 | //s1.click(mouseX, mouseY); 106 | //s2.click(mouseX, mouseY); 107 | 108 | mousePos = new Vec2D(mouseX, mouseY); 109 | // create a new positive attraction force field around the mouse position (radius=250px) 110 | mouseAttractor = new AttractionBehavior(mousePos, width, -5); 111 | physics.addBehavior(mouseAttractor); 112 | } 113 | } 114 | 115 | function mouseDragged() { 116 | // update mouse attraction focal point 117 | mousePos.set(mouseX, mouseY); 118 | } 119 | 120 | function mouseReleased() { 121 | // remove the mouse attraction when button has been released 122 | physics.removeBehavior(mouseAttractor); 123 | //s1.release(); 124 | //s2.release(); 125 | } 126 | 127 | function keyPressed() { 128 | if (key == ' ') { 129 | //showHidden = !showHidden; 130 | } 131 | } 132 | 133 | function windowResized() { 134 | setup(); 135 | } 136 | -------------------------------------------------------------------------------- /dancing/part.js: -------------------------------------------------------------------------------- 1 | class Part { 2 | constructor(a_, b_, s, w) { 3 | this.a = a_; 4 | this.b = b_; 5 | if (s !== null) { 6 | this.img = loadImage(s); 7 | } else { 8 | this.img = null; 9 | } 10 | this.dir = createVector(); 11 | this.what = w || 'nothing'; 12 | } 13 | 14 | display() { 15 | this.dir.x = this.b.p.x - this.a.p.x; 16 | this.dir.y = this.b.p.y - this.a.p.y; 17 | var angle = this.dir.heading(); 18 | push(); 19 | if (this.what === 'head') { 20 | translate(this.a.p.x, this.a.p.y); 21 | imageMode(CENTER); 22 | rotate(angle - PI / 2); 23 | image(this.img, 0, 0, this.img.width*(height/5/this.img.height), height/5); 24 | } else if (this.what === 'sign') { 25 | translate(this.b.p.x, this.b.p.y); 26 | stroke(0); 27 | rotate(angle); 28 | strokeWeight(8); 29 | line(0, 0, 0, -50); 30 | rectMode(CENTER); 31 | fill(255); 32 | strokeWeight(1); 33 | rect(0, -50, 100, 50); 34 | fill(0); 35 | textAlign(CENTER); 36 | textSize(24); 37 | text('2019', 0, -50); 38 | } 39 | pop(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /dancing/particle.js: -------------------------------------------------------------------------------- 1 | // The Nature of Code 2 | // Daniel Shiffman 3 | // http://natureofcode.com 4 | // Notice how we are using inheritance here! 5 | // We could have just stored a reference to a VerletParticle object 6 | class Particle { 7 | constructor(loc, r_, s) { 8 | this.p = new VerletParticle2D(loc); 9 | this.r = r_; 10 | if (s) { 11 | this.img = loadImage(s); 12 | } 13 | this.drag = false; 14 | //physics.addBehavior(new AttractionBehavior(p, r*2, -r)); 15 | } 16 | // All we're doing really is adding a display() function to a VerletParticle 17 | display() { 18 | fill(127); 19 | stroke(0); 20 | strokeWeight(2); 21 | if (this.img) { 22 | imageMode(CENTER); 23 | image(this.img, this.p.x, this.p.y); 24 | } 25 | else { 26 | ellipse(this.p.x, this.p.y, this.r * 2, this.r * 2); 27 | } 28 | } 29 | control() { 30 | if (this.drag) { 31 | //lock(); 32 | //p.x = mouseX; 33 | //p.y = mouseY; 34 | //unlock(); 35 | } 36 | } 37 | grab() { 38 | this.drag = true; 39 | } 40 | lock() { 41 | this.p.lock(); 42 | } 43 | unlock() { 44 | this.p.unlock(); 45 | } 46 | release() { 47 | this.drag = false; 48 | } 49 | over(px, py) { 50 | if (dist(this.p.x, this.p.y, px, py) < r * 2) { 51 | return true; 52 | } 53 | else { 54 | return false; 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /dancing/skeleton.js: -------------------------------------------------------------------------------- 1 | class Skeleton { 2 | constructor(x, y, scl_, who) { 3 | this.parts = []; 4 | this.dparts = []; 5 | this.springs = []; 6 | this.hsprings = []; 7 | this.origin = new Vec2D(x, y); 8 | this.scl = scl_; 9 | // Make two particles 10 | this.head = new Particle(new Vec2D(x, y), 16); 11 | this.neck = new Particle(new Vec2D(x, y + 0 * this.scl), 4); 12 | this.dhead = new Part(this.head, this.neck, `data/${who}head.png`, 'head'); 13 | this.lShoulder = new Particle(new Vec2D(x + width/30 * this.scl, y + height/5 * this.scl), 4 * this.scl); 14 | this.rShoulder = new Particle(new Vec2D(x - width/30 * this.scl, y + height/5 * this.scl), 4 * this.scl); 15 | this.lElbow = new Particle(new Vec2D(x + width/6 * this.scl, y + height/5 * this.scl), 8 * this.scl); 16 | this.rElbow = new Particle(new Vec2D(x - width/6 * this.scl, y + height/5 * this.scl), 8 * this.scl); 17 | this.lHand = new Particle(new Vec2D(x + height/2 * this.scl, y + height/5 * this.scl), 16 * this.scl); 18 | this.rHand = new Particle(new Vec2D(x - height/2 * this.scl, y + height/5 * this.scl), 16 * this.scl); 19 | this.belly = new Particle(new Vec2D(x, y+height/4), 4 * this.scl); 20 | //dbody = new Part(neck,belly,who+"body.png"); 21 | //dlarm1 = new Part(lShoulder,lElbow,who+"larm1.png"); 22 | //dlarm2 = new Part(lElbow,lHand,who+"larm2.png"); 23 | if (who == 0) { 24 | this.sign = new Part(this.lElbow, this.lHand, null, 'sign'); 25 | } 26 | this.lKnee = new Particle(new Vec2D(x + width/12 * this.scl, y + height/1.5 * this.scl), 4 * this.scl); 27 | this.rKnee = new Particle(new Vec2D(x + width/12 * this.scl, y + height/1.5 * this.scl), 4 * this.scl); 28 | this.lFoot = new Particle(new Vec2D(x + width/12 * this.scl, y + height/1.5 * this.scl), 16 * this.scl); 29 | this.rFoot = new Particle(new Vec2D(x + width/12 * this.scl, y + height/1.5 * this.scl), 16 * this.scl); 30 | this.head.lock(); 31 | //rHand.lock(); 32 | //lHand.lock(); 33 | //lShoulder.lock(); 34 | //rShoulder.lock(); 35 | // Make a spring connecting both Particles 36 | var headneck = new VerletSpring2D(this.head.p, this.neck.p, 5 * this.scl, 0.01); 37 | var spring2 = new VerletSpring2D(this.neck.p, this.lShoulder.p, 20 * this.scl, 0.01); 38 | var spring3 = new VerletSpring2D(this.neck.p, this.rShoulder.p, 20 * this.scl, 0.01); 39 | var spring4 = new VerletSpring2D(this.rShoulder.p, this.rElbow.p, 40 * this.scl, 0.01); 40 | var spring5 = new VerletSpring2D(this.lShoulder.p, this.lElbow.p, 40 * this.scl, 0.01); 41 | var shoulders = new VerletMinDistanceSpring2D(this.lShoulder.p, this.rShoulder.p, 100 * this.scl, 0.01); 42 | var spring6 = new VerletSpring2D(this.rHand.p, this.rElbow.p, 40 * this.scl, 0.01); 43 | var spring7 = new VerletSpring2D(this.lHand.p, this.lElbow.p, 40 * this.scl, 0.01); 44 | var spring8 = new VerletSpring2D(this.neck.p, this.belly.p, 50, 0.01); 45 | var belly1 = new VerletMinDistanceSpring2D(this.belly.p, this.rShoulder.p, 10 * this.scl, 0.01); 46 | var belly2 = new VerletMinDistanceSpring2D(this.belly.p, this.lShoulder.p, 10 * this.scl, 0.01); 47 | var head1 = new VerletMinDistanceSpring2D(this.head.p, this.rShoulder.p, 100 * this.scl, 0.01); 48 | var head2 = new VerletMinDistanceSpring2D(this.head.p, this.lShoulder.p, 100 * this.scl, 0.01); 49 | var spring9 = new VerletSpring2D(this.belly.p, this.lKnee.p, 80 * this.scl, 0.01); 50 | var spring10 = new VerletSpring2D(this.belly.p, this.rKnee.p, 80 * this.scl, 0.01); 51 | var knees = new VerletMinDistanceSpring2D(this.lKnee.p, this.rKnee.p, 50 * this.scl, 0.01); 52 | var spring11 = new VerletSpring2D(this.lFoot.p, this.lKnee.p, 80 * this.scl, 0.01); 53 | var spring12 = new VerletSpring2D(this.rFoot.p, this.rKnee.p, 80 * this.scl, 0.01); 54 | this.parts.push(this.head); 55 | this.parts.push(this.neck); 56 | this.parts.push(this.lShoulder); 57 | this.parts.push(this.rShoulder); 58 | this.parts.push(this.lElbow); 59 | this.parts.push(this.rElbow); 60 | this.parts.push(this.lHand); 61 | this.parts.push(this.rHand); 62 | this.parts.push(this.belly); 63 | this.parts.push(this.lKnee); 64 | this.parts.push(this.rKnee); 65 | this.parts.push(this.lFoot); 66 | this.parts.push(this.rFoot); 67 | //dparts.push(dbody); 68 | this.dparts.push(this.dhead); 69 | //dparts.push(dlarm1); 70 | //dparts.push(dlarm2); 71 | this.dparts.push(this.sign); 72 | this.springs.push(headneck); 73 | this.springs.push(spring2); 74 | this.springs.push(spring3); 75 | this.springs.push(spring4); 76 | this.springs.push(spring5); 77 | this.springs.push(spring6); 78 | this.springs.push(spring7); 79 | this.springs.push(spring8); 80 | this.springs.push(shoulders); 81 | this.springs.push(belly1); 82 | this.springs.push(belly2); 83 | this.springs.push(spring9); 84 | this.springs.push(spring10); 85 | this.springs.push(spring11); 86 | this.springs.push(spring12); 87 | this.hsprings.push(head1); 88 | this.hsprings.push(head2); 89 | this.hsprings.push(knees); 90 | for (var i = 0; i < this.parts.length; i++) { 91 | var p = this.parts[i]; 92 | physics.addParticle(p.p); 93 | } 94 | for (var i = 0; i < this.springs.length; i++) { 95 | var s = this.springs[i]; 96 | physics.addSpring(s); 97 | } 98 | for (var i = 0; i < this.hsprings.length; i++) { 99 | var s = this.hsprings[i]; 100 | physics.addSpring(s); 101 | } 102 | this.hangle = 0; 103 | this.vangle = 0; 104 | } 105 | click(mx, my) { 106 | for (var i = 0; i < this.parts.length; i++) { 107 | var p = this.parts[i]; 108 | if (p.over(mx, my)) { 109 | p.grab(); 110 | } 111 | } 112 | } 113 | hdance() { 114 | if (!this.head.drag) { 115 | this.head.p.x = this.origin.x + sin(this.hangle) * 20; 116 | //head.y = origin.y + cos(angle)*20; 117 | this.hangle += 0.3; 118 | } 119 | } 120 | vdance() { 121 | //head.x = origin.x + sin(hangle)*20; 122 | if (!this.head.drag) { 123 | this.head.p.x = this.origin.y + cos(this.vangle) * 20; 124 | this.vangle += 0.3; 125 | } 126 | } 127 | release() { 128 | for (var i = 0; i < this.parts.length; i++) { 129 | var p = this.parts[i]; 130 | p.release(); 131 | } 132 | } 133 | control() { 134 | for (var i = 0; i < this.parts.length; i++) { 135 | var p = this.parts[i]; 136 | p.control(); 137 | } 138 | } 139 | display() { 140 | for (var i = 0; i < this.springs.length; i++) { 141 | var s = this.springs[i]; 142 | stroke(0); 143 | line(s.a.x, s.a.y, s.b.x, s.b.y); 144 | } 145 | if (showHidden) { 146 | for (var i = 0; i < this.hsprings.length; i++) { 147 | var s = this.hsprings[i]; 148 | stroke(0); 149 | line(s.a.x, s.a.y, s.b.x, s.b.y); 150 | } 151 | } 152 | for (var i = 0; i < this.parts.length; i++) { 153 | //var p = this.parts[i]; 154 | //p.display(); 155 | } 156 | for (var i = 0; i < this.dparts.length; i++) { 157 | var p = this.dparts[i]; 158 | if (p) p.display(); 159 | } 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /dancing/toxichelper.js: -------------------------------------------------------------------------------- 1 | // The Nature of Code 2 | // Daniel Shiffman 3 | // http://natureofcode.com 4 | 5 | // Making it easier to use all these classes 6 | // Maybe this is a bad idea? 7 | var VerletPhysics2D = toxi.physics2d.VerletPhysics2D; 8 | var GravityBehavior = toxi.physics2d.behaviors.GravityBehavior; 9 | var AttractionBehavior = toxi.physics2d.behaviors.AttractionBehavior; 10 | var VerletParticle2D = toxi.physics2d.VerletParticle2D; 11 | var VerletSpring2D = toxi.physics2d.VerletSpring2D; 12 | var VerletMinDistanceSpring2D = toxi.physics2d.VerletMinDistanceSpring2D; 13 | var Vec2D = toxi.geom.Vec2D; 14 | var Rect =toxi.geom.Rect; 15 | -------------------------------------------------------------------------------- /data/0head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingTrain/Happy-2019/d6b44be28b7cb81d0edd1a8df3907ecc9723e039/data/0head.png -------------------------------------------------------------------------------- /data/1head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingTrain/Happy-2019/d6b44be28b7cb81d0edd1a8df3907ecc9723e039/data/1head.png -------------------------------------------------------------------------------- /data/2head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingTrain/Happy-2019/d6b44be28b7cb81d0edd1a8df3907ecc9723e039/data/2head.png -------------------------------------------------------------------------------- /data/3head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingTrain/Happy-2019/d6b44be28b7cb81d0edd1a8df3907ecc9723e039/data/3head.png -------------------------------------------------------------------------------- /data/4head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingTrain/Happy-2019/d6b44be28b7cb81d0edd1a8df3907ecc9723e039/data/4head.png -------------------------------------------------------------------------------- /data/Nunito-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingTrain/Happy-2019/d6b44be28b7cb81d0edd1a8df3907ecc9723e039/data/Nunito-Black.ttf -------------------------------------------------------------------------------- /data/Nunito-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingTrain/Happy-2019/d6b44be28b7cb81d0edd1a8df3907ecc9723e039/data/Nunito-Bold.ttf -------------------------------------------------------------------------------- /data/auld.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingTrain/Happy-2019/d6b44be28b7cb81d0edd1a8df3907ecc9723e039/data/auld.mp3 -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingTrain/Happy-2019/d6b44be28b7cb81d0edd1a8df3907ecc9723e039/favicon.ico -------------------------------------------------------------------------------- /fireworks/Firework.pde: -------------------------------------------------------------------------------- 1 | class Firework { 2 | PVector pos; 3 | PVector vel; 4 | 5 | float size; 6 | 7 | float hue; 8 | float alpha; 9 | 10 | int level; 11 | 12 | Firework(PVector p, PVector v, float h, int l) { 13 | pos = p; 14 | vel = v; 15 | 16 | size = random(3, 10); 17 | 18 | hue = h; 19 | alpha = 255; 20 | 21 | level = l; 22 | } 23 | 24 | void display() { 25 | strokeWeight(size); 26 | stroke(hue, 255, 255, alpha); 27 | 28 | point(pos.x, pos.y); 29 | } 30 | 31 | void update(int i) { 32 | pos.add(vel); 33 | vel.mult(0.975); 34 | 35 | alpha = lerp(alpha, 0, 0.025); 36 | hue+= 0.1; 37 | 38 | if (alpha < 10) { 39 | if (level > 0) 40 | recreate(); 41 | 42 | fireworks.remove(i); 43 | } 44 | } 45 | 46 | void recreate() { 47 | int children = round(random(10, 50)); 48 | float childrenHue = random(255); 49 | 50 | for (int i = 0; i < children; i++) 51 | fireworks.add(new Firework(new PVector(pos.x, pos.y), new PVector(cos(TWO_PI*i/float(children))*size*1.5, sin(TWO_PI*i/float(children))*size*1.5), childrenHue, random(2) < 0.5 ? level-1 : 0)); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /fireworks/Fireworks.pde: -------------------------------------------------------------------------------- 1 | /* @pjs font="data/Nunito-Black.ttf"; */ 2 | 3 | ArrayList fireworks; 4 | PFont font; 5 | 6 | void setup() { 7 | var parent = document.getElementById('fireworks'); 8 | size(parent.offsetWidth, parent.offsetHeight); 9 | 10 | colorMode(HSB); 11 | 12 | fireworks = new ArrayList(); 13 | font = createFont("data/Nunito-Black.ttf", 12); 14 | } 15 | 16 | void draw() { 17 | background(0); 18 | textFont(font); 19 | textAlign(CENTER, CENTER); 20 | 21 | autoTextSize("Happy "+year()+"!", width*5/8.0, height/2.0, 1); 22 | text("Happy "+year()+"!", width/2.0, height/2.0); 23 | 24 | for (int i = 0; i < fireworks.size(); i++) { 25 | if (fireworks.get(i) != null) { 26 | fireworks.get(i).display(); 27 | fireworks.get(i).update(i); 28 | } 29 | } 30 | 31 | if (frameCount%30 == 0 || random(1) < 0.01) 32 | fireworks.add(new Firework(new PVector(random(width), height), new PVector(0, random(-height/120.0, -height/30.0)), random(255), round(random(1, 2.5)))); 33 | } 34 | 35 | float autoTextSize(String str, float w, float h, int l) { 36 | textSize(1); 37 | float minW = w/textWidth(str); 38 | float minH = h/float(l); 39 | textSize(min(minW, minH)); 40 | 41 | return min(minW, minH); 42 | } 43 | 44 | window.onresize = setup; -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 153 | 154 | Happy 2019! 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 |
Happy 2019!
170 | 171 |
172 |
173 |
174 | 175 |
176 |

Sketch made by @shiffman using p5.js and toxiclibs.js - view source code

177 | 178 |
179 | 180 |

Auld Lang Syne (Bossa)
By unreal_dm 2010 - Licensed under Creative Commons Attribution (3.0)

181 |
182 | 183 |
184 | 185 |
186 | 187 |
188 |

Sketch made by @joogps using Processing and Processing.js - view source code

189 |
190 | 191 |
192 | 193 |
194 | 195 |
196 |

Gif made by @villares using Processing.py - view source code

197 | 198 |

"Feliz 2019" means "Happy 2019" in Portuguese.

199 |
200 |
201 | 202 | 203 | --------------------------------------------------------------------------------