Browse Source

Upload files to 'example-p5'

master
JoanaChicau 1 year ago
parent
commit
04c57d5c26
  1. 15
      example-p5/index.html
  2. 3
      example-p5/p5.sound.min.js
  3. 19
      example-p5/sketch.js
  4. 7
      example-p5/style.css

15
example-p5/index.html

@ -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

File diff suppressed because one or more lines are too long

19
example-p5/sketch.js

@ -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

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