-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage.html
51 lines (51 loc) · 2.11 KB
/
page.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
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Panel de dibujo </title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;700&display=swap" rel="stylesheet">
<link href="style.css" rel="stylesheet" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap" rel="stylesheet">
</head>
<body>
<header><h1>Dibuja </h1></header>
<footer>
<a href="index.html">Pa atras</a>
<div id="controles"></div>
<a href="#" id="descarga">Guarda tu dibujito</a>
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.min.js"></script>
<script>
var que = new URLSearchParams(window.location.search).get("dibuja");
document.querySelector("h1").textContent += que;
/*
document.querySelector("a").textContent += que;
*/
function setup() {
var d = select("#descarga");
d.mousePressed(artemania);
createCanvas(windowWidth, windowHeight).position(0, 0).style("z-index", -1);
background(255);
elColor = createColorPicker("#777777").parent("controles");
elSlider = createSlider(1, 5, 3).parent("controles");
}
function draw() {
stroke(elColor.color());
strokeWeight(elSlider.value());
if (mouseIsPressed) {
line(pmouseX, pmouseY, mouseX, mouseY);
}
}
function artemania() {
saveCanvas("mi_atacazo_artistico", "jpg");
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}
</script>
</body>
</html>