Added some things

This commit is contained in:
Cametendo
2026-04-20 11:20:54 +02:00
parent 97a7c9f0fb
commit 372b892862
29 changed files with 406 additions and 92 deletions

21
Week-1/LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 Cametendo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

18
Week-1/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="rectangles.js"></script>
</body>
</html>

10
Week-1/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"
]
}

17
Week-1/labyrinth.js Normal file
View File

@@ -0,0 +1,17 @@
let x, y = 0;
function setup() {
createCanvas(800, 800);
strokeWeight(5);
background("gray");
}
function draw() {
for (let x = 0; x <= width; x += 40) {
for (let y = 0; y <= height; y += 40) {
square(x, y, 40);
}
}
line(width, height, -800, -800); // :3
}

25
Week-1/rectangles.js Normal file
View File

@@ -0,0 +1,25 @@
let r, g, b = 0;
function setup() {
createCanvas(800, 800);
strokeWeight(5);
}
function draw() {
frameRate()
background(100, 100, 100, 100);
for(i = 0; i < 1; i++) {
stroke(random(255), random(255), random(255))
noFill()
const rectWidthStatic = random(600);
const rectHeightStatic = random(600);
const rectWidthMouse = random(300);
const rectHeightMouse = random(300);
const rectMidX = (width/2) - (rectWidthStatic/2);
const rectMidY = (height/2) - (rectHeightStatic/2);
const offsetX = random(-40, 40);
const offsetY = random(-40, 40);
rect(rectMidX + offsetX, rectMidY + offsetY, rectWidthStatic, rectHeightStatic);
rect(mouseX + offsetX, mouseY + offsetY, rectWidthMouse, rectHeightMouse);
}
}

View File

@@ -0,0 +1,20 @@
<!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="labyrinth.js"></script>
<a href="script_rectangles.html">Rectangles Script</a>
<a href="script_labyrinth.html">Labyrinth Script</a>
</body>
</html>

View File

@@ -0,0 +1,20 @@
<!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="rectangles.js"></script>
<a href="script_rectangles.html">Rectangles Script</a>
<a href="script_labyrinth.html">Labyrinth Script</a>
</body>
</html>

8
Week-1/style.css Normal file
View File

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