Canvas Arc
How do I make an canvas arc?
This is about the simplist of canvas arcs/circles; mostly for reference.. What is a canvas arc? How do you make a canvas arc? This script and codes were developed by Adam on 07 January 2023, Saturday.
Canvas Arc - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Canvas Arc</title> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ *, *:before, *:after { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; margin: 0; padding: 0;}
body {
background: #000;
}
.progress { position: relative; width: 300px; height: 300px;
}
.progress:before { content: ""; display: block; width: 100%; height: 100%; border: 60px solid #111; border-radius: 50%;
}
#bar { position: absolute; top: 0; left: 0;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="progress"> <canvas id="bar" width="300" height="300"></canvas>
</div> <script src="js/index.js"></script>
</body>
</html>
Canvas Arc - Script Codes CSS Codes
*, *:before, *:after { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; margin: 0; padding: 0;}
body {
background: #000;
}
.progress { position: relative; width: 300px; height: 300px;
}
.progress:before { content: ""; display: block; width: 100%; height: 100%; border: 60px solid #111; border-radius: 50%;
}
#bar { position: absolute; top: 0; left: 0;
}
Canvas Arc - Script Codes JS Codes
var canvas = document.getElementById('bar');
if (canvas.getContext){ var ctx = canvas.getContext('2d'); ctx.lineWidth = 45; ctx.strokeStyle = '#000'; ctx.shadowColor = '#08f'; ctx.shadowOffsetX = 0; ctx.shadowOffsetY = 0; ctx.shadowBlur = 25; ctx.beginPath(); var x = 150; // x coordinate var y = 150; // y coordinate var radius = 120; // Arc radius var startAngle = 0; // Starting point on circle var endAngle = Math.PI/0.6; // End point on circle var anticlockwise = 0%2==0 ? false : true; // clockwise or anticlockwise ctx.arc(x, y, radius, startAngle, endAngle, anticlockwise); { ctx.stroke(); }
}
Developer | Adam |
Username | depthdev |
Uploaded | January 07, 2023 |
Rating | 3 |
Size | 2,389 Kb |
Views | 10,120 |
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 |
Pure CSS Animated Photo Stack | 2,486 Kb |
Pure JavaScript Draggable Ball | 2,599 Kb |
YouTube URL Parser | 3,519 Kb |
Pure CSS Bulging Box | 2,224 Kb |
Responsive SVG Line Graph with Animation | 3,954 Kb |
CSS Book with Scrolling Highlighter | 0 Kb |
Responsive. Interactive. SVG. | 20,357 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 |
Pattern lab logo | TimPietrusky | 3,666 Kb |
Minimal Menu | Achudars | 3,430 Kb |
Perspective Origin Demo | Agelber | 3,614 Kb |
Spilled Paint | Darrylhuffman | 3,894 Kb |
Transitioning application screens with semantically named classes | Djgrant | 3,697 Kb |
Highbrow Basic HTML Lesson 8 | Kimlarocca | 2,094 Kb |
Draggable directive | YahyaKacem | 2,277 Kb |
A Pen by Moeid Saleem | Moeidsaleem | 1,862 Kb |
Mostly Fluid | Mccreath | 3,308 Kb |
Prototype Responsive Homepage | Heyitsolivia | 7,677 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!