Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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.


Auto Save

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.


                // Developed by Ines Montani

// Variables

- radius = 175
- padding = 25
- stroke = 25
- size = (radius + padding) * 2
- diameter = Math.round(Math.PI * radius * 2)

// SVG circle

svg.score(width=size height=size viewBox="-25 -25 " + size + " " + size)
    circle.score-empty(cx=radius cy=radius r=radius stroke-width=stroke fill="none")
    circle.js-circle.score-circle(transform="rotate(-90 " + radius + " " + radius + ")" cx=radius cy=radius r=radius stroke-dasharray=diameter stroke-width=stroke stroke-dashoffset=diameter fill="none")
    text.js-text.score-text(x="50%" y="50%" dx="-25" text-anchor="middle")

// UI button

button.js-button.button Change value


                // Variables

$color-front: #1e1935
$color-subtle: #ddd
$font: "Poppins", Helvetica, Arial, sans-serif

// SVG styling and animation

    stroke: $color-front
    transition: stroke-dashoffset 1s ease-out

    stroke: $color-subtle

    fill: $color-front
    font: bold 4rem $font

// Demo UI

    display: flex
    flex-flow: column nowrap
    width: 100vw
    height: 100vh
    justify-content: center
    align-items: center

    margin-top: 2rem
    font: bold 1.75rem $font
    padding: 0.5rem 1.5rem
    background: transparent
    border: 6px solid
    cursor: pointer
    box-shadow: 3px 3px 0 $color-front


                // DOM Elements

const button = document.querySelector('.js-button')
const circle = document.querySelector('.js-circle')
const text = document.querySelector('.js-text')

// Circle radius, diameter and offset function

const radius = circle.getAttribute('r')
const diameter = Math.round(Math.PI * radius * 2)
const getOffset = (val = 0) => Math.round((100 - val) / 100 * diameter)

// Generate random number and set offset and percentage

const run = () => {
    const val = Math.floor(Math.random() * 100) = getOffset(val)
    text.textContent = `${val}%`

// Event listeners

button.addEventListener('click', run)
document.addEventListener('DOMContentLoaded', () => setTimeout(run, 10))