Web Spiral - p5.js

Size
2,183 Kb
Views
78,936

How do I make an web spiral - p5.js?

What is a web spiral - p5.js? How do you make a web spiral - p5.js? This script and codes were developed by Tina Anastopoulos on 31 August 2022, Wednesday.

Web Spiral - p5.js Previews

Web Spiral - p5.js - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Web Spiral - p5.js</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <script src='https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.7/p5.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Web Spiral - p5.js - Script Codes CSS Codes

body { margin: 0; background: #000;
}
canvas { display: block; margin: auto;
}

Web Spiral - p5.js - Script Codes JS Codes

/* ¯\_₍⸍⸌̣ʷ̣̫⸍̣⸌₎_/¯ */
var x, y, size, theta = 0, num=1000;
function setup() { createCanvas(window.innerWidth, window.innerHeight);	stroke(255,150); fill(0);
}
function draw() { background(0); var x=width/2, y=height/2; var angle=0; var radius=30; for (var i=0; i<num; i++) { x = width/2 + sin(angle)*radius; y = height/2 + cos(angle)*radius; var size = map(sin(theta+TWO_PI/num*i*20), -1, 1, 0, 50); var scal = .5+1.0/num*2*i;	if(i%9===0){	strokeWeight(3);	stroke(255,0,0);	} else {	strokeWeight(2);	//stroke(10,100,100);	stroke(255);	//stroke(255,200);	} ellipse(x, y, size*scal, size*scal); angle += radians(5); radius += .5; } theta -= 0.025;
}
function windowResized() { resizeCanvas(windowWidth, windowHeight);
}
Web Spiral - p5.js - Script Codes
Web Spiral - p5.js - Script Codes
Home Page Home
Developer Tina Anastopoulos
Username TWAIN
Uploaded August 31, 2022
Rating 4.5
Size 2,183 Kb
Views 78,936
Do you need developer help for Web Spiral - p5.js?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Tina Anastopoulos (TWAIN) Script Codes
Create amazing web content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!