Medium Loader Canvas Example
How do I make an medium loader canvas example?
What is a medium loader canvas example? How do you make a medium loader canvas example? This script and codes were developed by Luca De Blasio on 04 September 2022, Sunday.
Medium Loader Canvas Example - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Medium Loader Canvas Example</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <canvas id="myCanvas" width="400" height="400"></canvas>
<button>Run again</button> <script src="js/index.js"></script>
</body>
</html>
Medium Loader Canvas Example - Script Codes CSS Codes
canvas { margin : 0 auto; display: block;
}
button { position: absolute; z-index: 2; background: #f06d06; right: 20px; top: 20px; color:#fff; text-transform: uppercase; border: none; padding: 10px 20px;
}
Medium Loader Canvas Example - Script Codes JS Codes
var canvas = document.getElementById("myCanvas");
canvas.width = 400;
canvas.height = 400;
var lineDashOffset = -600;
var speed = 3;
var ctx = canvas.getContext("2d");
ctx.lineDashOffset = lineDashOffset;
ctx.setLineDash([600]);
function animate() { if(lineDashOffset < 0) { lineDashOffset+=speed; ctx.clearRect(0,0,400,400); ctx.font = "20px Arial"; ctx.fillText(Math.floor(100 + lineDashOffset/6) + "%",120,100); ctx.lineDashOffset += speed; ctx.beginPath(); ctx.moveTo(50,20); ctx.lineTo(200,40); ctx.lineTo(250,100); ctx.lineTo(200,180); ctx.lineTo(100,180); ctx.closePath(); ctx.stroke(); } requestAnimationFrame(animate);
}
animate();
document.querySelector('button').addEventListener('click', function(){ lineDashOffset = -600; ctx.lineDashOffset = lineDashOffset;
})
Developer | Luca De Blasio |
Username | LucaDb |
Uploaded | September 04, 2022 |
Rating | 3 |
Size | 2,030 Kb |
Views | 38,456 |
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 |
PIXI Glitch FIlter | 2,553 Kb |
Prova gyro | 5,472 Kb |
Nintendo Switch | 1,989 Kb |
360 Video with Three js | 2,955 Kb |
Svg tiger | 23,970 Kb |
A Pen by Luca De Blasio | 2,271 Kb |
Threejs load obj | 4,774 Kb |
Svg vs base64img | 5,473 Kb |
PIXI text effect | 1,908 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 |
E-mail Template | SoloMDFK | 4,871 Kb |
Pure CSS candle light animation by One element | Ksksoft | 2,193 Kb |
Impress JS Algorhytmic Generator | Jeffscottward | 7,906 Kb |
BlueBox Fork | Huskynation | 12,675 Kb |
Nested flexbox layout for library catalog | Boycetrus | 3,271 Kb |
Reviews and Ratings Star | Zbnmstry | 1,591 Kb |
Header Line Issue | Charlie-volpe | 1,768 Kb |
SVG email test v2.0 | M_J_Robbins | 2,090 Kb |
A Pen by Final Boss tommyb9 | FBtommyb9 | 55,354 Kb |
Funny menu | AxeLVaisper | 4,671 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!