Pen Settings

HTML

CSS

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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <div class="pacman"></div>
              
            
!

CSS

              
                // Change this value to adapt the size
$size: 100px;

.pacman {
    position: relative;
    border-radius: 50%;
    width: $size;
    height: $size;
    background: conic-gradient(
            yellow 0,
            yellow 17.5%,
            transparent 12.5%,
            transparent 32.5%,
            yellow 32.5%
        );
    font-size: $size;
    animation: eating 0.3s ease-in alternate infinite;

    &::before {
        display: block;
        position: absolute;
        left: 55%;
        top: 15%;
        border-radius: 50%;
        width: 15%;
        height: 15%;
        background-color: #000;
        content: '';
    }

    &::after {
        display: block;
        position: absolute;
        left: 125%;
        top: 40%;
        z-index: -1;
        border-radius: 50%;
        width: 0.25em;
        height: 0.25em;
        box-shadow: 1em 0 0 #bbb, 2em 0 0 #ccc, 3em 0 0 #ddd, 4em 0 0 #eee;
        background-color: #aaa;
        content: '';
        animation: eaten 2s linear infinite;
    }
}

@keyframes eating {
    0% {
        background: conic-gradient(
            yellow 0,
            yellow 17.5%,
            transparent 17.5%,
            transparent 32.5%,
            yellow 32.5%
        );
    }
    15% {
        background: conic-gradient(
            yellow 0,
            yellow 18.5%,
            transparent 18.5%,
            transparent 31.5%,
            yellow 31.5%
        );
    }
    30% {
        background: conic-gradient(
            yellow 0,
            yellow 19.5%,
            transparent 19.5%,
            transparent 30.5%,
            yellow 30.5%
        );
    }
    45% {
        background: conic-gradient(
            yellow 0,
            yellow 20.5%,
            transparent 20.5%,
            transparent 29.5%,
            yellow 29.5%
        );
    }
    60% {
        background: conic-gradient(
            yellow 0,
            yellow 21.5%,
            transparent 21.5%,
            transparent 28.5%,
            yellow 28.5%
        );
    }
    75% {
        background: conic-gradient(
            yellow 0,
            yellow 22.5%,
            transparent 22.5%,
            transparent 27.5%,
            yellow 27.5%
        );
    }
    87% {
        background: conic-gradient(
            yellow 0,
            yellow 23.5%,
            transparent 23.5%,
            transparent 26.5%,
            yellow 26.5%
        );
    }
    100% {
        background: conic-gradient(
            yellow 0,
            yellow 25%,
            transparent 25%,
            transparent 25%,
            yellow 25%
        );
    }
}

@keyframes eaten {
    from {
        left: 125%;
    }
    to {
        left: 25%;
    }
}

              
            
!

JS

              
                // Look Ma', no JS!
              
            
!
999px

Console