/
sketch.js
51 lines (43 loc) · 1.34 KB
/
sketch.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
var audio;
var header = 'justinharrison000@gmail.com';
var repository = 'https://soundcloud.com/harrisonjustin';
function preload() {
audio = createAudio(['huh_2.mp3']);
}
function setup() {
createCanvas(windowWidth, windowHeight);
background(0);
textSize(20);
fill(255);
textFont("Courier New");
text("loop?", ((windowWidth/2.0) - (windowWidth * 0.05)), (windowHeight/2.0));
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
background(0);
text("loop?", ((windowWidth/2.0) - (windowWidth * 0.05)), (windowHeight/2.0));
}
function mousePressed(){
var d = dist(mouseX, mouseY, (windowWidth/2.0) - (windowWidth * 0.05), (windowHeight/2.0));
if (d< (windowWidth * 0.2)) {
clear();
createCanvas(windowWidth, windowHeight);
background(0);
audio.loop();
email = createP(header);
email.style("color", "white");
email.style("font-family", "monospace");
email.style("font-variant", "small-caps");
email.style("font-size", "medium");
email.style("padding", "5px");
email.position(5,0);
url = createA(repository, repository);
url.style("color", "white");
url.style("font-family", "monospace");
url.style("font-variant", "small-caps");
url.style("font-size", "medium");
url.style("padding", "5px");
url.position(5,50);
return(false);
}
}