Canvas Coloured Spirals

Developer
Size
2,052 Kb
Views
26,312

How do I make an canvas coloured spirals?

This was inspired by Seb Lee-Delisle's quick demo during his CodeKen presentation.. What is a canvas coloured spirals? How do you make a canvas coloured spirals? This script and codes were developed by Adrian Parr on 08 November 2022, Tuesday.

Canvas Coloured Spirals Previews

Canvas Coloured Spirals - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Canvas Coloured Spirals</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <canvas id="canvas" width="550" height="310"> Your browser does not support the HTML5 Canvas element.
</canvas> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Canvas Coloured Spirals - Script Codes CSS Codes

html, body { background-color: #272727; padding: 0px; margin: 0px; overflow: hidden;
}
canvas { border: black solid 1px;
}

Canvas Coloured Spirals - Script Codes JS Codes

$(function() { var canvas = document.getElementById('canvas'); var c = canvas.getContext('2d'); var width = canvas.width = window.innerWidth; var height = canvas.height = window.innerHeight; var angle = 3; var maxRectSize = width*2; setInterval(loop, 1000/30); function loop() { c.save(); c.translate(width/2, height/2); c.lineWidth = 2; for (var i=0; i<1000; i++) { c.strokeStyle = 'hsla('+(i*6)+',100%, 50%, 0.3)'; c.strokeRect(maxRectSize/2, maxRectSize/2, maxRectSize, maxRectSize); c.rotate(angle * Math.PI/180); c.scale(0.993, 0.993); } c.restore(); angle += 0.005; }
});
Canvas Coloured Spirals - Script Codes
Canvas Coloured Spirals - Script Codes
Home Page Home
Developer Adrian Parr
Username adrianparr
Uploaded November 08, 2022
Rating 4
Size 2,052 Kb
Views 26,312
Do you need developer help for Canvas Coloured Spirals?

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!

Adrian Parr (adrianparr) Script Codes
Create amazing marketing copy 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!