xxxxxxxxxx
115
let grungetxt;
let pad = 50
let fsize = 76
let fsize2 = fsize
let sizeVar = 80
let start;
let mid;
let wrap;
let bigdecay = 5
let bigframe = 0
let picdecay = 5
let picframe = 0
let picx = 0
let picy = 0
let picw = 0
let pich = 0
let words = "YOU WOULDN'T STEAL A CAR" //customize this text
let wordL = words.split(" ")
let run;
let cop;
let smudge;
let pic;
function preload() {
grungetxt = loadFont('DIRTYEGO.TTF')
cop = loadImage('https://images.unsplash.com/photo-1608095476825-d4e0f916372f?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1740&q=80')
smudge = loadImage('https://images.unsplash.com/photo-1606162415247-2d1ecf5c7906?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1740&q=80')
}
function setup() {
createCanvas(400, 400);
start = createVector(pad, height/2-fsize/2)
mid = createVector(width/2, height/2)
wrap = width-2*pad
frameRate(20)
cop.filter(POSTERIZE, 4)
smudge.filter(POSTERIZE, 8)
}
function draw() {
background(0)
if (random() < 0.1) {
if (random()>0.5) {
pic = cop
} else {
pic = smudge
}
picx = random(pic.width)
picy = random(pic.height)
picw = pic.width-picx
pich = pic.height-picy
picframe = picdecay
}
if (picframe) {
translate(0, 0)
image(pic, 0, 0, width, height, picx, picy, picw, pich)
picframe--
}
push();
strokeWeight(3)
stroke(255,0,0, 120)
let r = random()
r = floor(r*r*r*5)
for (let i=0;i<r;i++) {
let l = random(height)
line(0, l, width, l+random()*20-10)
}
stroke(0, 0, 255, 120)
let b = random()
b = floor(b*b*5)
for (let i=0;i<b;i++) {
let l = random(height)
line(0, l, width, l+random()*20-10)
}
pop();
textFont(grungetxt)
if (random() < 0.02) {
bigframe = bigdecay
}
if (bigframe) {
fsize=fsize2*1.2
start.x = pad/2
wrap = (width-3*pad)*1.2
bigframe--
} else {
fsize=fsize2
start.x=pad
wrap = width-3*pad
}
textSize(fsize)
for (let word of wordL) {
stroke(0)
strokeWeight(8)
fill(255)
let posX = start.x + run%wrap
let posY = start.y + floor(run/wrap)*fsize
run += (word.length + 1) * fsize / 3
textSize(fsize + (noise(word.length*1000)-0.5)*sizeVar)
posY += (noise(word.length*500)-0.5)*sizeVar/2
text(word, posX, posY)
}
run = 0
}