mirror of
https://github.com/Cametendo/EMVs-Creative-coding.git
synced 2026-06-20 17:45:02 +02:00
Push after two months, oops
This commit is contained in:
18
Week-2/Pictures/image-filter.html
Normal file
18
Week-2/Pictures/image-filter.html
Normal 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="image-filter.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
18
Week-2/Pictures/image.html
Normal file
18
Week-2/Pictures/image.html
Normal 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="image.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,10 +1,57 @@
|
||||
let img;
|
||||
let img_Joyboy;
|
||||
let img_Gears;
|
||||
let img_Git;
|
||||
let img_Mai;
|
||||
let img_Mai2;
|
||||
let img_Miku;
|
||||
let img_Monitoring;
|
||||
let img_Picture;
|
||||
let img_Juerg;
|
||||
let img_Strawhat;
|
||||
let img_Tux;
|
||||
let img_Waifu;
|
||||
const imageArray = [];
|
||||
let randomImageIndex = 0;
|
||||
|
||||
function mouseClicked() {
|
||||
randomImageIndex = Math.random() * imageArray.length;
|
||||
randomImageIndex = parseInt(randomImageIndex);
|
||||
console.log(randomImageIndex);
|
||||
clear();
|
||||
const { img, width, height } = imageArray[randomImageIndex];
|
||||
image(img, 0, 0, width, height);
|
||||
}
|
||||
|
||||
function preload() {
|
||||
img = loadImage("/Images/monitoring-miku.png");
|
||||
img_Gears = loadImage("/Images/Gears.png");
|
||||
img_Git = loadImage("/Images/Git-Icon-1788C.png");
|
||||
img_Joyboy = loadImage("/Images/joyboy.png");
|
||||
img_Mai = loadImage("/Images/Mai.png");
|
||||
img_Mai2 = loadImage("/Images/Mai2.jpg");
|
||||
img_Miku = loadImage("/Images/Miku1.jpg");
|
||||
img_Monitoring = loadImage("/Images/monitoring-miku.png");
|
||||
img_Picture = loadImage("/Images/pictureV2.jpg");
|
||||
img_Juerg = loadImage("/Images/Profilbild_juerg.png");
|
||||
img_Strawhat = loadImage("/Images/Strawhat.png");
|
||||
img_Tux = loadImage("/Images/Tux-svg.png");
|
||||
img_Waifu = loadImage("/Images/waifu1.png");
|
||||
|
||||
imageArray.push({ img: img_Gears, width: 800, height: 800 });
|
||||
imageArray.push({ img: img_Joyboy, width: 681, height: 800 });
|
||||
imageArray.push({ img: img_Git, width: 800, height: 800 });
|
||||
imageArray.push({ img: img_Mai, width: 835, height: 800 });
|
||||
imageArray.push({ img: img_Mai2, width: 800, height: 800 });
|
||||
imageArray.push({ img: img_Miku, width: 800, height: 800 });
|
||||
imageArray.push({ img: img_Monitoring, width: 800, height: 800 });
|
||||
imageArray.push({ img: img_Picture, width: 800, height: 800 });
|
||||
imageArray.push({ img: img_Juerg, width: 800, height: 800 });
|
||||
imageArray.push({ img: img_Strawhat, width: 800, height: 800 });
|
||||
imageArray.push({ img: img_Tux, width: 675, height: 800 });
|
||||
imageArray.push({ img: img_Waifu, width: 1049, height: 800 });
|
||||
}
|
||||
|
||||
function setup() {
|
||||
createCanvas(720, 400);
|
||||
image(img, 0, 0, 300, 300);
|
||||
createCanvas(1400, 1400);
|
||||
const { img, width, height } = imageArray[randomImageIndex];
|
||||
image(img, 0, 0, width, height);
|
||||
}
|
||||
|
||||
18
Week-2/Pictures/transformations.html
Normal file
18
Week-2/Pictures/transformations.html
Normal 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="transformations.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,13 +1,13 @@
|
||||
function setup() {
|
||||
createCanvas(800, 800);
|
||||
background(200);
|
||||
fill(150, 0, 0);
|
||||
rect(0, 0, 60, 150);
|
||||
createCanvas(800, 800);
|
||||
background(200);
|
||||
fill(150, 0, 0);
|
||||
rect(0, 0, 60, 150);
|
||||
|
||||
translate(200, 120);
|
||||
rotate(0.5);
|
||||
scale(1.5);
|
||||
translate(200, 120);
|
||||
rotate(0.5);
|
||||
scale(1.5);
|
||||
|
||||
fill(0, 150, 0);
|
||||
rect(0, 0, 60, 150);
|
||||
}
|
||||
fill(0, 150, 0);
|
||||
rect(0, 0, 60, 150);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user