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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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.container
  - for (var i = 0; i < 200; i++)
    div.particle__wrap
      div.particle_rotate
        div.particle_pos
          div.particle
              
            
!

CSS

              
                html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

div {
  transform-style: preserve-3d;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    ellipse at left top,
    #fdb7b9 20%,
    #de5d6f 50%,
    #b1414d
  );
  perspective: 280px; //奥いきを調整
}

.container {
  transform: rotate(24deg);
}

@for $i from 1 through 200 {
  .particle__wrap {
    position: absolute;
    &:nth-of-type(#{$i}) {
      animation: rotate linear infinite;
      animation-delay: random(9999) + 50000 * -1ms;
      animation-duration: random(50000) + 20000 + ms;
    }
  }
}

@keyframes rotate {
  0% {
    transform: rotateY(0);
  }
  100% {
    transform: rotateY(1turn);
  }
}

.particle {
  position: absolute;
  top: -280px; //topの位置調整
  width: 15px;
  height: 15px;
  background-color: #000;
  border-radius: 50%;
}

@for $i from 1 through 200 {
  .particle__wrap {
    position: absolute;
    &:nth-of-type(#{$i}) {
      & .particle_rotate {
        transform: rotateX(random(45) + deg);
      }
      & .particle_pos {
        transform: translateY(random(200) + 180 + px);
      }
      & .particle {
        left: calc(30% + #{random(300) + 200}px);
      }
    }
  }
}

@for $i from 1 through 200 {
  .particle__wrap:nth-of-type(#{$i}) .particle {
    background-color: #f9f2ee;
    box-shadow: 0px 0px 10px 1px #f9f2ee;
    animation: rotate01 random(30000) + 3000 + ms infinite;
    @keyframes rotate01 {
      0% {
        transform: rotateY(0);
        opacity: 0.8;
      }
      25% {
        opacity: 0.6;
      }
      50% {
        transform: rotateY(180deg);
        opacity: 0.8;
      }
      100% {
        transform: rotateY(180deg);
        opacity: 0.6;
      }
    }
  }
}

// @for $i from 120 through 200 {
//   .particle__wrap:nth-of-type(#{$i}) .particle {
//     background-color: #f9d2d3;
//     animation: rotate02 random(30000) + 3000 + ms infinite;
//     @keyframes rotate02 {
//       0% {
//         transform: rotateY(0);
//         opacity: 0.4;
//       }
//       25% {
//         opacity: 0.1;
//       }
//       50% {
//         transform: rotateY(180deg);
//         opacity: 0.4;
//       }
//       100% {
//         transform:rotateY(180deg);
//         opacity: 0.1;
//       }
//     }
//   }
// }

              
            
!

JS

              
                
              
            
!
999px

Console