Add 10 random squares

This commit is contained in:
Cametendo
2026-03-30 11:20:29 +02:00
parent f04899575d
commit 01d60e00b2
6 changed files with 58 additions and 0 deletions

18
index.html Normal file
View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sketch</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script src="libraries/p5.min.js"></script>
<script src="libraries/p5.sound.min.js"></script>
</head>
<body>
<script src="sketch.js"></script>
</body>
</html>

10
jsconfig.json Normal file
View File

@@ -0,0 +1,10 @@
{
"compilerOptions": {
"target": "es6"
},
"include": [
"*.js",
"**/*.js",
"/home/came/.vscode/extensions/samplavigne.p5-vscode-1.2.16/p5types/global.d.ts"
]
}

2
libraries/p5.min.js vendored Normal file

File diff suppressed because one or more lines are too long

3
libraries/p5.sound.min.js vendored Normal file

File diff suppressed because one or more lines are too long

17
sketch.js Normal file
View File

@@ -0,0 +1,17 @@
let r, g, b = 0;
function setup() {
createCanvas(800, 800);
strokeWeight(5);
frameRate(5)
background(100, 100, 100, 1);
for(i = 0; i < 10; i++) {
stroke(random(255), random(255), random(255))
noFill()
square(random(width), random(height), random(300));
}
}
function draw() {
frameRate(5);
}

8
style.css Normal file
View File

@@ -0,0 +1,8 @@
html, body {
margin: 0;
padding: 0;
}
canvas {
display: block;
}