var thestring = "DRACULA";
thetext = loadStrings('dracula.txt');
thefont[0] = loadFont('dracula.otf');
thefont[1] = loadFont('go around the books.ttf');
thefont[2] = loadFont('iknowaghost.ttf');
thefont[3] = loadFont('go around the books.ttf');
efont[0] = loadFont('go around the books.ttf');
efont[1] = loadFont('go around the books.ttf');
createCanvas(windowWidth, windowHeight);
textFont(random(thefont));
for(let i = 0;i<thetext.length;i++)
thebigstring+=thetext[i]+' ';
thebigstring = thebigstring.replace(/[^a-zA-Z0-9’ ]/g, ' ');
thebigstring = thebigstring.replace(/ ’/g, ' ');
thebigstring = thebigstring.replace(/’ /g, ' ');
thebigstring = thebigstring.toLowerCase();
thebigstring = thebigstring.replace(/ +/g, ' ');
thebigstring = thebigstring.trim();
console.log(thebigstring);
thewords = thebigstring.split(' ');
stroke(random(128,255),random(128,255),random(128,255),random(60,90));
text(thestring, width/2, height/2);
stroke(random(128,255),random(128,255),random(128,255),random(60,90));
text(thestring, width/2, height/2);
stroke(random(128,255),random(128,255),random(128,255),random(60,90));
text(thestring, width/2, height/2);
stroke(random(128,255),random(128,255),random(128,255),random(60,90));
text(thestring, width/2, height/2);
textAlign(CENTER, CENTER);
stroke(random(128,255),random(128,255),random(128,255),random(60,90));
text(thestring, width/2, height/2);
textAlign(CENTER, BOTTOM);
stroke(random(128,255),random(128,255),random(128,255),random(60,90));
text(thestring, width/2, height/2);
stroke(random(128,255),random(128,255),random(128,255),random(60,90));
text(thestring, width/2, height/2);
textAlign(RIGHT, CENTER);
stroke(random(128,255),random(128,255),random(128,255),random(60,90));
text(thestring, width/2, height/2);
textAlign(RIGHT, BOTTOM);
stroke(random(128,255),random(128,255),random(128,255),random(60,70));
if(thewords[whichword]=='dracula')
stroke(0,0,random(0,255));
for (let i = 0; i < 100; i++) {
textFont(random(thefont));
fill(random(0,255), 0, 0);
stroke(0, 0, random(0,255));
let wlen = textWidth(thewords[whichword]+' ');
stroke(random(128,255),random(128,255),random(128,255),random(60,90));
text(thestring, width/2, height/2);
stroke(random(128,255),random(128,255),random(128,255),random(60,90));
text(thestring, width/2, height/2);
stroke(random(128,255),random(128,255),random(128,255),random(60,90));
text(thestring, width/2, height/2);
stroke(random(128,255),random(128,255),random(128,255),random(60,90));
text(thestring, width/2, height/2);
textAlign(CENTER, CENTER);
stroke(random(128,255),random(128,255),random(128,255),random(60,90));
text(thestring, width/2, height/2);
textAlign(CENTER, BOTTOM);
stroke(random(128,255),random(128,255),random(128,255),random(60,90));
text(thestring, width/2, height/2);
stroke(random(128,255),random(128,255),random(128,255),random(60,90));
text(thestring, width/2, height/2);
textAlign(RIGHT, CENTER);
stroke(random(128,255),random(128,255),random(128,255),random(60,90));
text(thestring, width/2, height/2);
textAlign(RIGHT, BOTTOM);
stroke(random(128,255),random(128,255),random(128,255),random(60,70));
text(thewords[whichword], x, y);
whichword = (whichword+1)%thewords.length;