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 id="animation-target">
  <svg class="pulse" viewBox="0 0 1024 1024" aria-labelledby="svg-title">
    <title id="svg-title">Animating circles</title>
    <circle cx="512" cy="512" r="512"></circle>
    <circle cx="512" cy="512" r="512"></circle>
    <circle cx="512" cy="512" r="512"></circle>
<button id="animation-toggle">Turn <span>off</span> animation</button>
<p>Animation source: <a href=""></a></p>


                button#animation-toggle {
  background-color: black;
  border: none;
  border-radius: 0;
  color: white;
  font-size: 1em;
  padding: 0.5em 1em;
#animation-target {
  border: 1px solid;
  height: 400px;
  margin-bottom: 1em;
  overflow: hidden;
  position: relative;
  width: 600px; 
.pulse {
	z-index: -1;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	max-width: 30rem;
	circle {
		fill: #ff5154;
		transform: scale(0);
		opacity: 0.4;
		transform-origin: 50% 50%;
		animation: pulse 2.5s cubic-bezier(.5,.5,0,1) infinite;
		&:nth-child(2) {
			fill: #7fc6a4;
			animation: pulse 2.5s 0.75s cubic-bezier(.5,.5,0,1) infinite;
		&:nth-child(3) {
			fill: #e5f77d;
			animation: pulse 2.5s 1.5s cubic-bezier(.5,.5,0,1) infinite;

@keyframes pulse {
	25% {
		opacity: 0.4;
	100% {
		transform: scale(1);
    opacity: 0;

@mixin noAnimate {
  .pulse, circle {
    animation: none !important;
  .pulse circle {
    opacity: 0.75;
    transform: scale(0.25);
  .pulse circle:nth-child(2) {
    opacity: 0.25;
    transform: scale(0.75);
  .pulse circle:nth-child(3) {
    opacity: 0.5;
    transform: scale(0.5);
.no-animate {
  @include noAnimate;

/* if reduced-motion is selected on OSX/iOS */
@media (prefers-reduced-motion) {
  /* hide toggle button */
  #animation-toggle {
    display: none;
  /* make sure animations actually stop */
  @include noAnimate;


                var animating = true;
var animationTarget = document.getElementById('animation-target');
var toggleBtn = document.getElementById('animation-toggle');
var toggleBtnText = toggleBtn.querySelector('span');
toggleBtn.addEventListener('click', toggleBtnHandler);

function toggleBtnHandler(event) {
  if (animating) {
  } else {
function disableAnimation() {
  toggleBtnText.textContent = 'on';
  animating = false;
  localStorage.setItem('animating', 'false');
function enableAnimation() {
  toggleBtnText.textContent = 'off';
  animating = true;
  localStorage.setItem('animating', 'true');

if (localStorage.getItem('animating') === 'false') {