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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                 <a href="/" class="logo"><img src="//cssanimation.rocks/images/logo.svg"></a>
  <article class="wwdc">
    <span class="spin">
      <!-- Large Circles -->
      <div class="large circle one"></div>
      <div class="large circle two"></div>
      <div class="large circle three"></div>
      <div class="large circle four"></div>
      <div class="large circle five"></div>
      <div class="large circle six"></div>
      <div class="large circle seven"></div>
      <div class="large circle eight"></div>
    </span>
    <span class="pulse">
      <!-- Small Shapes -->
      <div class="small circle one"></div>
      <div class="small squircle two"></div>
      <div class="small circle three"></div>
      <div class="small squircle four"></div>
      <div class="small circle five"></div>
      <div class="small squircle six"></div>
      <div class="small circle seven"></div>
      <div class="small squircle eight"></div>
    </span>
      <!-- Squircles -->
      <span class="spin-reverse">
        <div class="large squircle one"></div>
      </span>
      <div class="large squircle two">
        <div class="content">
          <svg viewBox="0 0 160 164" xmlns="http://www.w3.org/2000/svg">
         <g>
          <g id="svg_1">
           <path d="m127.805969,90.003128c0.224838,24.213104 21.241287,32.270615 21.474121,32.373459c-0.177704,0.56826 -3.358078,11.482742 -11.072464,22.756622c-6.668747,9.746841 -13.590027,19.457977 -24.493088,19.659103c-10.713348,0.197403 -14.158287,-6.353043 -26.406677,-6.353043c-12.24469,0 -16.072174,6.151901 -26.213551,6.550446c-10.52422,0.398254 -18.538303,-10.539917 -25.26247,-20.251053c-13.740021,-19.864456 -24.24024,-56.132286 -10.1411,-80.613663c7.004152,-12.157551 19.521101,-19.85622 33.10713,-20.053638c10.334515,-0.197132 20.089069,6.952717 26.406689,6.952717c6.313614,0 18.167473,-8.59832 30.628998,-7.335548c5.21682,0.217129 19.860519,2.1073 29.263641,15.871029c-0.75766,0.469692 -17.472931,10.200527 -17.291229,30.443592m-20.134499,-59.456692c5.587379,-6.7633 9.348007,-16.178439 8.322067,-25.546439c-8.053787,0.32369 -17.792625,5.36682 -23.569427,12.126399c-5.177124,5.985922 -9.711121,15.566772 -8.48777,24.749359c8.976891,0.69453 18.147476,-4.561718 23.73513,-11.329308"/>
          </g>
         </g>
        </svg>
        <h1>The epicenter of change.</h1>
        <p><strong>WWDC</strong>15</p>
      </div>
    </div>
  </article>
  <p class="message">Learn how to do this and other CSS animation<br><a href="//cssanimation.rocks/courses/animation-101/" target="_blank">Join my email course</a></p>

              
            
!

CSS

              
                .logo {
  width: 8em;
  position: absolute;
  left: 1em;
  top: 1em;
}

span {
  display: block;
  position: absolute;
  top: calc(50% - 10em);
  left: calc(50% - 10em);
  width: 20em;
  height: 20em;
}

span.spin {
  animation: spin 10s linear infinite;
}

span.spin-reverse {
  animation: spin 30s linear infinite;
}

span.pulse {
  animation: spin-pulse 20s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotateZ(0);
  }
  100% {
    transform: rotateZ(360deg);
  }
}

@keyframes spin-pulse {
  0% {
    transform: scale(1) rotateZ(0);
  }
  50% {
    transform: scale(0.9) rotateZ(180deg);
  }
  100% {
    transform: scale(1) rotateZ(360deg);
  }
}

body {
  background: #fff;
  font-family: 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #fff;
  font-size: 24px;
}

.circle {
  border-radius: 50%;
  left: calc(50% - 6.25em);
  top: calc(50% - 12.5em);
  transform-origin: 50% 12.5em;
}

.squircle {
  border-radius: 25%;
}

.circle, .squircle {
  width: 12.5em;
  height: 12.5em;
  position: absolute;
  border-top: 0.1em solid rgba(255,255,255,0.4);
}

.large.circle {
  box-shadow: 0 1em 2em rgba(0,0,0,0.5);
}

.small {
  width: 4em;
  height: 4em;
  left: calc(50% - 2em);
  top: calc(50% - 15em);
  transform-origin: 50% 15em;
  box-shadow: 0 0.25em 0.5em rgba(0,0,0,0.2);
}

$transparency: 0.75;

.one {
  background: rgba(16, 63, 236, $transparency);
  transform: rotateZ(225deg);
}
.two {
  background: rgba(37, 172, 162, $transparency);
  transform: rotateZ(180deg);
}
.three {
  background: rgba(233, 124, 32, $transparency);
  transform: rotateZ(135deg);
}
.four {
  background: rgba(235, 67, 35, $transparency);
  transform: rotateZ(90deg);
}
.five {
  background: rgba(190, 28, 65, $transparency);
  transform: rotateZ(45deg);
}
.six {
  background: rgba(208, 57, 159, $transparency);
  transform: rotateZ(0);
}
.seven {
  background: rgba(150, 32, 198, $transparency);
  transform: rotateZ(-45deg);
}
.eight {
  background: rgba(95, 33, 203, $transparency);
  transform: rotateZ(-90deg);
}

.small.squircle {
  background: none;
  box-shadow: none;

  &::after {
    content: "";
    border-radius: 25%;
    width: 100%;
    height: 100%;
    position: absolute;
    background: red;
    transform: rotateZ(-45deg);
    box-shadow: -0.25em 0.25em 0.5em rgba(0,0,0,0.2);
  }

  &.two::after {
    background: rgba(37, 172, 162, $transparency);
  }
  &.four::after {
    background: rgba(235, 67, 35, $transparency);
  }
  &.six::after {
    background: rgba(208, 57, 159, $transparency);
  }
  &.eight::after {
    background: rgba(95, 33, 203, $transparency);
  }
}

.large.squircle {
  position: absolute;
  background: rgba(30, 7, 66, 0.65);
  border: none;
  left: calc(50% - 7.5em);
  top: calc(50% - 7.5em);
  width: 15em;
  height: 15em;
  transform: none;

  &.one {
    transform: rotateZ(45deg);
  }
}

.content {
  text-align: center;

  svg {
    fill: #fff;
    width: 3em;
    margin: 1.25em auto 1em;
  }

  h1 {
    font-weight: lighter;
    font-size: 1.75em;
    margin: 0.25em auto 1em;
    max-width: 6em;
  }

}

.message {
  position: absolute;
  left: 1em;
  bottom: 1em;
  right: 0;
  color: #222;
  text-align: left;

  a {
    text-decoration: none;
    font-weight: bold;
    color: #999;
  }
}

              
            
!

JS

              
                /* CSSAnimation.rocks

Learn all about CSS animation with my email course: https://cssanimation.rocks/courses/animation-101/

*/
              
            
!
999px

Console