Golden ratio
How do I make an golden ratio?
Just a golden ratio creator. What is a golden ratio? How do you make a golden ratio? This script and codes were developed by Darby Rathbone on 13 October 2022, Thursday.
Golden ratio - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>golden ratio</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <script src="js/index.js"></script>
</body>
</html>
Golden ratio - Script Codes JS Codes
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
canvas.height = 350;canvas.width=600;
canvas.style.zoom = "1";
canvas.style.border = "solid black 1px";
document.body.appendChild(canvas);
var square = function(size,x,y){ this.width = size; this.height = size; this.top = y; this.left = x; this.bottom = y+size; this.right = x+size; this.center ={x:(x+x+size)/2.0,y:(y+y+size)/2.0}; this.color = "rgba("+((Math.random()*255)|0)+","+((Math.random()*255)|0)+","+((Math.random()*255)|0)+","+1.0+")"; this.draw = function(c){ c.fillStyle = this.color; c.fillRect(this.left,this.top,this.width,this.height); c.strokeRect(this.left,this.top,this.width,this.height); c.fill(); c.stroke(); }; return this;
};
ctx.lineWidth = 1;
var sq = [];
sq.push(new square(1,canvas.width/2,canvas.height/2));
sq.push(new square(1,canvas.width/2+1,canvas.height/2));
for (var i = 0;i<200;i++){ var f =sq[sq.length-1], s = sq[sq.length-2]; if (f.height+s.height == Math.abs(f.right-s.left)) sq.push(new square(f.height+s.height,s.left,f.bottom)); if (f.height+s.height == Math.abs(f.bottom-s.top)) sq.push(new square(f.height+s.height,f.left-(f.height+s.height),s.top)); if (f.height+s.height == Math.abs(f.left-s.right)) sq.push(new square(f.height+s.height,f.left,f.top-(f.height+s.height))); if (f.height+s.height == Math.abs(f.top-s.bottom)) sq.push(new square(f.height+s.height,f.right,f.top));
}
sq.forEach(function(e,i,a){ e.draw(ctx);
});
Developer | Darby Rathbone |
Username | blackkbot |
Uploaded | October 13, 2022 |
Rating | 3 |
Size | 1,893 Kb |
Views | 40,480 |
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!
Name | Size |
JQuery Number Counter Plugin | 3,195 Kb |
A Pen by Darby Rathbone | 3,190 Kb |
Graphing equations | 3,529 Kb |
Balls | 3,920 Kb |
Drag, drop and snap | 2,542 Kb |
Jigsaw puzzle | 5,193 Kb |
A linearly interpolated spline | 2,328 Kb |
3d css transformations | 2,652 Kb |
Sudoku grid | 2,042 Kb |
Perlin noise on worker | 2,989 Kb |
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!
Name | Username | Size |
Comment Jquery | SquishyAndroid | 2,421 Kb |
Hamburger Menu Animation | Salmanraza | 2,580 Kb |
Material design buttons | Fischaela | 4,381 Kb |
SVG email test v2.0 | M_J_Robbins | 2,090 Kb |
A Pen by Bryan Rojas | Bryanrojas | 1,873 Kb |
Zip Button test | Lje7462 | 1,932 Kb |
Airbnb Homepage | SindhujaD | 2,480 Kb |
Javascript Welcome | Peterlewicki | 1,573 Kb |
Simple checkbox style | Vncnz | 2,628 Kb |
Twitch API | Coderpilot | 3,412 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!