Pastel dots net
How do I make an pastel dots net?
What is a pastel dots net? How do you make a pastel dots net? This script and codes were developed by Gabi on 23 December 2022, Friday.
Pastel dots net - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Pastel dots net</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h1>Please hover over the canvas</h1>
<canvas id = 'c' width="500" height="500"></canvas> <script src="js/index.js"></script>
</body>
</html>
Pastel dots net - Script Codes CSS Codes
@import url(https://fonts.googleapis.com/css?family=Gabriela:400normal);
body { margin: 0; overflow: hidden; background: black;
}
h1 { text-align: center; color: white; font-family: 'Gabriela' !important; font-style: normal; font-weight: 400; font-size:30px; margin:1em;
}
canvas { display: block; margin: 0 auto;
}
Pastel dots net - Script Codes JS Codes
var c = document.getElementById("c");
var ctx = c.getContext("2d");
var cw = c.width;
var ch = c.height;
var step = 30;
var dotR = 1;
var T = .01;
var grd = ctx.createLinearGradient(0, 0, c.width, 0);
grd.addColorStop(0, "hsl(300,100%,75%)");
grd.addColorStop("0.3", "hsl(203,100%,75%)");
grd.addColorStop("0.6", "hsl(84,100%,75%)");
grd.addColorStop("0.8", "hsl(60,100%,75%)");
grd.addColorStop(1, "hsl(0,100%,75%)");
ctx.fillStyle = grd;
function DrawCurves() { ctx.beginPath(); for (var l = -cw; l <= 2 * cw; l += step) { /*ctx.moveTo(l,0);// aquí empieza la curva ctx.quadraticCurveTo(cX,cY,l,ch); ctx.stroke();*/ for (var t = 0; t <= 1; t += T) { var x = (1 - t) * (1 - t) * l + 2 * (1 - t) * t * cX + t * t * l; var y = (1 - t) * (1 - t) * 0 + 2 * (1 - t) * t * cY + t * t * ch; ctx.moveTo(x + dotR, y); ctx.arc(x, y, dotR, 0, 2 * Math.PI); } } for (var b = -ch; b <= 2 * ch; b += step) { /*ctx.moveTo(0,b);// aquí empieza la curva ctx.quadraticCurveTo(cX,cY,cw,0); ctx.stroke();*/ for (var t1 = 0; t1 <= 1; t1 += T) { var x = (1 - t1) * (1 - t1) * 0 + 2 * (1 - t1) * t1 * cX + t1 * t1 * cw; var y = (1 - t1) * (1 - t1) * b + 2 * (1 - t1) * t1 * cY + t1 * t1 * b; ctx.moveTo(x + dotR, y); ctx.arc(x, y, dotR, 0, 2 * Math.PI); } } ctx.fill();
}
function oMousePos(canvas, evt) { var ClientRect = canvas.getBoundingClientRect(); return { //objeto x: Math.round(evt.clientX - ClientRect.left), y: Math.round(evt.clientY - ClientRect.top) }
}
c.addEventListener("mousemove", function(evt) { ctx.clearRect(0, 0, cw, ch); var mousePos = oMousePos(c, evt); cX = mousePos.x; cY = mousePos.y; DrawCurves();
}, false);
window.addEventListener("load", function(evt) { cX = cw / 2; cY = ch / 2; DrawCurves();
}, false);
c.addEventListener("mouseleave", function(evt) { ctx.clearRect(0, 0, cw, ch); cX = cw / 2; cY = ch / 2; DrawCurves();
}, false);
Developer | Gabi |
Username | enxaneta |
Uploaded | December 23, 2022 |
Rating | 4 |
Size | 2,415 Kb |
Views | 6,072 |
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 |
CSS only star rating | 1,860 Kb |
Rift | 2,213 Kb |
Broken English | 4,877 Kb |
Squiggly lines | 4,753 Kb |
Holy Cow Mandala | 2,764 Kb |
Sine wave ice cream | 2,127 Kb |
Sakura | 3,605 Kb |
Animated SVG Turbulence Filter | 2,330 Kb |
Sphere Within Sphere | 4,769 Kb |
Fat worm | 2,695 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 |
SCSS Simple Animated Drop-In | Danwarfel | 2,175 Kb |
Velocity.js custom stagger | Tommiehansen | 4,805 Kb |
Owl Carousel - jumpTo | OwlFonk | 2,553 Kb |
Modular Flip Card | Bbodine1 | 4,009 Kb |
BlueBox Fork | Huskynation | 12,675 Kb |
Google Fonts Sass Mixin | HugoGiraudel | 4,237 Kb |
JavaScript constructors | Simboonlong | 2,415 Kb |
TweenMax transformOrigin Bubble | Nicolund | 2,209 Kb |
A Pen by Tosh | Panev | 2,586 Kb |
Sony Xperia Z3 Flat MockUp | Dapinitial | 4,379 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!