-
Notifications
You must be signed in to change notification settings - Fork 0
/
mat.min.js
1 lines (1 loc) · 2.87 KB
/
mat.min.js
1
let customFont,wordsToDisplay;function preload(){customFont=loadFont("/MonumentExtended-Bold.otf"),wordsToDisplay=window.innerWidth<780?["careCo\xf1o","Hijueputa","Marica","Pendejo","Gorr\xf3n","Malparido","careCo\xf1o","Hijueputa","Marica","Pendejo","Gorr\xf3n","Malparido","Sapoperro","Perrojijipueta","SetentaHijupueta","tripleHpta","Hijueputa","Hijodelasmilputas","pirobo","guevon","Guevetas","lameCulos","Carechimba","ga\xf1apo","PerroJijijueputa","CHupaPitos","Apelotardado","AbortoEmico","Caremierda","Marrana","Cerdo","Desgraciado","Careloco",]:["careCo\xf1o","Hijueputa","Marica","Pendejo","Gorr\xf3n","Malparido","Sapoperro","Perrojijipueta","SetentaHijupueta","tripleHpta","CatreHpta","DobleHpta","CareePuto","Zunga","Mierdero","Arrastrado","Atolondrado","Atulampado","Baboso","Balurdo","Bazofia","Bobalic\xf3n","Bobo","Cacorro","Calientahuevos","Caraemonda","CareChimba","Cochino","Corroncho","Coscorria","Culipronta","Flojo","careFufa","Fufurufa","Garbimba","Garnupia","Gonorrea","Gonorrienta","Guache","Guaricha","Guisa","Gurrupleta","Hijueputa","Hijodelasmilputas","pirobo","guevon","Guevetas","Pelmazo","Petardo","Tarado","Tarupido","Tarilas","Sopenco","lameCulos","Carechimba","ga\xf1apo","PerroJijijueputa","CHupaPitos","Apelotardado","AbortoEmico","Caremierda","Marrana","Cerdo","Desgraciado","Careloco",]}const Engine=Matter.Engine,World=Matter.World,Bodies=Matter.Bodies,Body=Matter.Body;let engine,words=[],ground,wallLeft,wallRight;function setup(){createCanvas(windowWidth,windowHeight-10),engine=Engine.create(),ground=Bodies.rectangle(width/2,height-1,width,10,{isStatic:!0}),wallLeft=Bodies.rectangle(0,height/2,10,height,{isStatic:!0}),wallRight=Bodies.rectangle(width,height/2,10,height,{isStatic:!0}),World.add(engine.world,[ground,wallLeft,wallRight]);for(let o=0;o<wordsToDisplay.length;o++)words.push(new Word(random(width),-200,wordsToDisplay[o]))}function draw(){for(let o of(background("#ffffff"),Engine.update(engine),words))o.show()}class Word{constructor(o,a,e){this.body=Bodies.rectangle(o,a,10*e.length,40),this.word=e,World.add(engine.world,this.body)}show(){let o=this.body.position,a=this.body.angle;push(),translate(o.x,o.y),rotate(a),rectMode(CENTER),fill(0),stroke("#ffffff"),strokeWeight(3),rect(0,0,15*this.word.length+10,50,60),noStroke(),textFont(customFont),fill("#fffff"),textSize(14),textAlign(CENTER,CENTER),text(this.word.toLowerCase(),1,0),pop()}}function mouseMoved(){for(let o of words)50>dist(mouseX,mouseY,o.body.position.x,o.body.position.y)&&Body.applyForce(o.body,{x:o.body.position.x,y:o.body.position.y},{x:random(-.2,.2),y:random(-.2,.2)})}function updateWords(){for(let o of words)World.remove(engine.world,o.body);words=[];for(let a=0;a<wordsToDisplay.length;a++)words.push(new Word(random(width),-200,wordsToDisplay[a]))}function updateWindowSize(){resizeCanvas(windowWidth,windowHeight-10)}window.addEventListener("resize",function(){updateWindowSize(),updateWords()});