Circle Progression Plugin

Developer
Size
2,612 Kb
Views
24,288

How do I make an circle progression plugin?

Circles that fill to a desired percentage.. What is a circle progression plugin? How do you make a circle progression plugin? This script and codes were developed by Adam Grayson on 10 November 2022, Thursday.

Circle Progression Plugin Previews

Circle Progression Plugin - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Circle Progression Plugin</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="google chart"> <div class="tag">google</div>
</div>
<div class="moz chart"> <div class="tag">mozilla</div>
</div>
<div class="safari chart"> <div class="tag">safari</div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Circle Progression Plugin - Script Codes CSS Codes

* { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -o-box-sizing: border-box; box-sizing: border-box;
}
body, html { background:#333333;
}
.chart { position:relative; margin:30px auto 0 auto;
}
.tag { width:100%; font-family:"Trebuchet", trebuchet, sans-serif; text-align:center; position:absolute; top:43%; color:#777777;
}

Circle Progression Plugin - Script Codes JS Codes

(function($){	$.fn.percentPie = function(options){	var settings = $.extend({	width: 100,	trackColor: "EEEEEE",	barColor: "777777",	barWeight: 30,	startPercent: 0,	endPercent: 1,	fps: 60	}, options);	this.css({	width: settings.width,	height: settings.width	});	var that = this,	hoverPolice = false,	canvasWidth = settings.width,	canvasHeight = canvasWidth,	id = $('canvas').length,	canvasElement = $('<canvas id="'+ id +'" width="' + canvasWidth + '" height="' + canvasHeight + '"></canvas>'),	canvas = canvasElement.get(0).getContext("2d"),	centerX = canvasWidth/2,	centerY = canvasHeight/2,	radius = settings.width/2 - settings.barWeight/2;	counterClockwise = false,	fps = 1000 / settings.fps,	update = .01;	this.angle = settings.startPercent;	this.drawArc = function(startAngle, percentFilled, color){	var drawingArc = true;	canvas.beginPath();	canvas.arc(centerX, centerY, radius, (Math.PI/180)*(startAngle * 360 - 90), (Math.PI/180)*(percentFilled * 360 - 90), counterClockwise);	canvas.strokeStyle = color;	canvas.lineWidth = settings.barWeight;	canvas.stroke();	drawingArc = false;	}	this.fillChart = function(stop){	var loop = setInterval(function(){	hoverPolice = true;	canvas.clearRect(0, 0, canvasWidth, canvasHeight);	that.drawArc(0, 360, settings.trackColor);	that.angle += update;	that.drawArc(settings.startPercent, that.angle, settings.barColor);	if(that.angle > stop){	clearInterval(loop);	hoverPolice = false;	}	}, fps);	}	this.mouseover(function(){	if(hoverPolice == false){	that.angle = settings.startPercent;	that.fillChart(settings.endPercent);	}	});	this.fillChart(settings.endPercent);	this.append(canvasElement);	return this;	}
}(jQuery));
$(document).ready(function() {	$('.google').percentPie({	width: 100,	trackColor: "#444444",	barColor: "#2682D5",	barWeight: 20,	endPercent: .9,	fps: 60	}); $('.moz').percentPie({	width: 100,	trackColor: "#444444",	barColor: "#33CBE0",	barWeight: 20,	endPercent: .75,	fps: 60	}); $('.safari').percentPie({	width: 100,	trackColor: "#444444",	barColor: "#60DB5C",	barWeight: 20,	endPercent: .5,	fps: 60	});
});
Circle Progression Plugin - Script Codes
Circle Progression Plugin - Script Codes
Home Page Home
Developer Adam Grayson
Username agrayson
Uploaded November 10, 2022
Rating 3.5
Size 2,612 Kb
Views 24,288
Do you need developer help for Circle Progression Plugin?

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!

Adam Grayson (agrayson) Script Codes
Create amazing sales emails with AI!

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!