Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


	<div class="progressCircle">
				<div id="svgWrapper">
						<svg class="svg" width="220" height="220" viewPort="0 0 110 110" version="1.1" xmlns="">

								<linearGradient id="linear" x1="0" x2="1" y1="0" y2="0">
									<stop offset="0%"   stop-color="#DD2C41"/>
									<stop offset="100%" stop-color="#202050"/>

							<circle id="bar-bg" r="98" cx="110" cy="110" fill="transparent" stroke-dasharray="615.752" stroke-dashoffset="615.752"></circle>
							<circle id="bar" r="98" cx="110" cy="110" fill="transparent" stroke-dasharray="615.752" stroke-dashoffset="615.752"></circle>

		<span class="percentage">0%</span>

<div class="controls">
	<p>Enter a number between 0-100</p>
	<input type="number" min="0" max="100" aria-labelledby="submit" value="0">
	<button type="submit" id="submit">Enter</button>


                :root {
	--base: #202050;
	--primary: #DD2C41;
	--neutralLight: #e8e8e8;
	--neutralLightest: #fff;

body {
	font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;
	color: var(--base);
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	justify-content: center;
	grid-gap: 0 1rem;
	margin-top: 5vh;

// Progress circle
.progressCircle {
	position: relative;
	padding: 2rem;
	.svg {
			transform: rotate(-90deg);
			margin: auto;
			circle {
				transition: stroke-dashoffset 1s linear;
				stroke-width: 1.5em;
				stroke: var(--neutralLight);
			#bar-bg {
				stroke-dashoffset: 0;
			#bar {
				stroke: url('#linear');
	.percentage {
			position: absolute;
			left: 0;
			right: 0;
			text-align: center;
			top: 50%;
			transform: translateY(-50%);
			color: var(--base);
			font-size: 2.5rem;
			font-weight: bold;

// Style input and submit button
.controls {
	display: flex;
	flex-direction: column;
	align-items: center;
input {
		font-size: 100%;
		padding: 0.5rem 1.25rem;
		background: var(--neutralLightest);
		border: 0.1rem solid var(--neutralLight);
		border-radius: 1.5rem;
		margin-bottom: 1rem;

		&:focus {
			outline: 0;
			border-color: var(--base);

button {
	transition: background 0.2s ease;
	padding: 1rem 2rem;
	background: var(--base);
	border: 0;
	color: var(--neutralLightest);
	border-radius: 3rem;
	text-transform: uppercase;
	margin-bottom: 1rem;
	cursor: pointer;

	&:hover {
		background: var(--primary);



                $('input').on('change', function(){
	var value = parseInt($(this).val()) || 0; // Get value from input and convert any falsey result to 0
	// Cap input between 0 and 100
	if (value > 100) {
		value = 100;
	} else if (value < 0) {
		value = 0;
	var circle = $('.svg #bar'),
		r = circle.attr('r'),
		c = Math.PI * r * 2,
		pct = ((100 - value) / 100) * c; // Calculate the precentage of the svg dasharray length
	// Set progress stroke length in css
	circle.css({strokeDashoffset: pct});

	$('.percentage').html(value + '%'); // Display the percentage figure