Fuzzies
How do I make an fuzzies?
What is a fuzzies? How do you make a fuzzies? This script and codes were developed by Pogany on 09 November 2022, Wednesday.
Fuzzies - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>fuzzies </title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <p>Draw something curvy.</p>
<canvas id="canvas"></canvas> <script src="js/index.js"></script>
</body>
</html>
Fuzzies - Script Codes CSS Codes
body { background-color: #222; overflow: hidden;
}
canvas { background-color: #000; display: block; margin: 0 auto; margin:calc(50vh - 250px - 5em) auto;
}
p { color: #777; font-family: Verdana, Geneva, sans-serif; font-size: 18px; text-align: center; margin: 3em 0 1em 0; font-weight: normal;
}
Fuzzies - Script Codes JS Codes
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
var cw = canvas.width = 500, cx = cw / 2;
var ch = canvas.height = 500, cy = ch / 2;
ctx.strokeStyle = "#fff";
var rad = Math.PI / 180;
var drawing = false;
var points = [];
var maxDist = 30;
canvas.addEventListener("mousedown", function(evt) { drawing = true; points.length = 0; m = oMousePos(this, evt); points.push(m);
});
canvas.addEventListener("mouseup", function(evt) { drawing = false;
});
canvas.addEventListener("mouseout", function(evt) { drawing = false;
});
canvas.addEventListener("mousemove", function(evt) { if (drawing == true) { m = oMousePos(this, evt); points.push(m); ctx.clearRect(0, 0, cw, ch); ctx.beginPath(); ctx.moveTo(points[0].x, points[0].y); for (var i = 0; i < points.length; i++) { ctx.lineTo(points[i].x, points[i].y); } ctx.stroke(); for (var i = 0; i < points.length; i++) { connect(i, points); } }
});
function connect(i, points) { for (var j = i; j < points.length; j++) { var partdist = dist(points[i], points[j]); if (partdist < maxDist) { ctx.beginPath(); ctx.moveTo(points[i].x, points[i].y); ctx.lineTo(points[j].x, points[j].y); var alp = Map(partdist, 0, maxDist, 1, 0); ctx.strokeStyle = "hsla(0,100%,100%," + alp + ")"; ctx.stroke(); } }
}
function Map(n, a, b, _a, _b) { var d = b - a; var _d = _b - _a; var u = _d / d; return _a + n * u;
}
function dist(p1, p2) { var dx = p2.x - p1.x; var dy = p2.y - p1.y; return Math.sqrt(dx * dx + dy * dy);
}
function oMousePos(canvas, evt) { var ClientRect = canvas.getBoundingClientRect(); return { //objeto x: Math.round(evt.clientX - ClientRect.left), y: Math.round(evt.clientY - ClientRect.top) }
}
Developer | Pogany |
Username | giaco |
Uploaded | November 09, 2022 |
Rating | 3 |
Size | 2,338 Kb |
Views | 12,144 |
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 |
Tiles | 2,018 Kb |
Basket | 2,297 Kb |
Swim Smooth | 2,897 Kb |
Out of the blue | 2,537 Kb |
Tiles nr.2 | 2,030 Kb |
Helianthus | 1,995 Kb |
Circles | 2,621 Kb |
Mountains | 2,389 Kb |
Matrix Falling Code | 52,476 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 |
A Pen by Anoop | Anoopjohn | 330,760 Kb |
Faces SVG animation | ScavengerFrontend | 2,957 Kb |
Realistic Buttons | Stoypenny | 2,248 Kb |
Haml Calendar | Katydecorah | 5,643 Kb |
CSS Chat Bubbles | Boylett | 2,094 Kb |
Foundation 5 Menu - Accessibility | Xporter | 1,999 Kb |
CSS Donut Charts | Seanstopnik | 2,908 Kb |
Colorful Sliders | Chanrith | 1,246 Kb |
CSS Infinite 360 | APinix | 5,564 Kb |
Hovers with popups | Zacharyolson | 2,380 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!