Upload files to 'example-p5'

This commit is contained in:
JoanaChicau 2023-08-31 11:46:07 +02:00
parent 3c924f39c4
commit 04c57d5c26
4 changed files with 44 additions and 0 deletions

15
example-p5/index.html Normal file
View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/p5.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/addons/p5.sound.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<meta charset="utf-8" />
</head>
<body>
<main>
</main>
<script src="sketch.js"></script>
</body>
</html>

3
example-p5/p5.sound.min.js vendored Normal file

File diff suppressed because one or more lines are too long

19
example-p5/sketch.js Normal file
View File

@ -0,0 +1,19 @@
function setup() {
resizeCanvas(windowWidth,windowHeight)
}
function draw() {
noStroke()
fill (25, 25, 255, 100) // RGB + opacity
myCircle()
textSize(40)
text('hello ٩(˘◡˘)۶ world', 10, height/2) // x y
}
// RANDOM
function myCircle(){
circle(random(width), random(height), random(50))
fr = 6;
frameRate(fr);
describe('A blue circle moving randomly on a white canvas');
}

7
example-p5/style.css Normal file
View File

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