-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
97 lines (72 loc) · 1.97 KB
/
index.html
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script src="./p5.min.js"></script>
<!-- <script>
var img
function preload() {
img = loadImage('../download.png');
}
function setup() {
createCanvas(windowWidth - 10, windowHeight - 20)
image(img, 0, 0);
}
let arr = []
let loc = 0
let i = 0
function draw() {
background(255)
let mx = mouseX
let my = mouseY
i += 0.1
let x = Math.sin(i) * 40 + mx
let y = Math.cos(i) * 40 + my
let xz = Math.sin(i) * 10 + mx
let yz = Math.cos(i) * 10 + my
arr.push(ellipse(xz, yz, 20))
arr.push(rect(x, y, 10, 10))
loc += 5
text("sheqmnili obieqtebis odenoba: " + arr.length, 100, 10)
if (loc >= windowWidth) {
loc = !loc
}
if (arr.length >= 1) {
arr.splice(0, 1)
arr.splice(0, 1)
}
}
function Circle() {
fill(random(0, 255))
}
</script> -->
<script>
var img;
let c;
let mytext = prompt()
function preload() {
img = loadImage('./Abstract_Square_Art.png');
}
function setup() {
c = createCanvas(windowWidth, windowHeight)
image(img, 0, 0, windowWidth, windowHeight)
}
function draw() {
}
function mousePressed() {
let x = mouseX
let y = mouseY
textSize(44)
text(mytext, x, y)
}
function doubleClicked() {
saveCanvas(c, 'myCanvas', 'jpg');
}
</script>
</body>
</html>