Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <div class="triangleouter">
 <div class='wrap'>
  <div class='tri'></div>
  <div class='tri'></div>
  <div class='tri'></div>
  <div class='tri'></div>
  <div class='tri'></div>
  <div class='tri'></div>
  <div class='tri'></div>
  <div class='tri'></div>
  <div class='tri'></div>
  <div class='tri'></div>
  <div class='tri'></div>
  <div class='tri'></div>
  <div class='tri'></div>
  <div class='tri'></div>
  <div class='tri'></div>
</div>
</div>
<h1 class="text-light">CSS Triangle Travelers</h1>
<p class="text-light">Originally by Nate Wiley</p>
              
            
!

CSS

              
                html, body {
  height: 100%;
}

html {
  height: 100%;
  background-color: #090a0f;
  background: radial-gradient(ellipse at bottom, #1b2735, #090a0f);
  overflow: hidden;
}

body {
  background: transparent;
}


.triangleouter {
 position:absolute;
  top:0;
  left:0;
  z-index:-1;
  width:100vw;
  height:100vh;
}
.wrap {
  transform-style: preserve-3d;
  perspective: 800px;
   width:100vw;
  height:100vh;
}

.tri {
  height: 0;
  width: 0;
  position: absolute;
  top: 50%;
  left: 50%;
}

.tri:nth-child(1) {
  border-top: 26px solid #00eaff;
  border-right: 26px solid transparent;
  border-left: 26px solid transparent;
  margin-left: -13px;
  margin-top: -13px;
  -webkit-filter: grayscale(1);
  filter: grayscale(1);
  transform: rotate(320deg) translate3d(0, 0, -1500px) scale(0);
  animation: anim1 15s infinite linear;
  animation-delay: -1s;
  opacity: 0;
}

@keyframes anim1 {
  0% {
    opacity: 1;
    transform: rotate(480deg) translate3d(465px, 604px, 1000px) scale(1);
  }
}
.tri:nth-child(2) {
  border-top: 3px solid red;
  border-right: 3px solid transparent;
  border-left: 3px solid transparent;
  margin-left: -1.5px;
  margin-top: -1.5px;
  -webkit-filter: grayscale(1);
  filter: grayscale(1);
  transform: rotate(359deg) translate3d(0, 0, -1500px) scale(0);
  animation: anim2 15s infinite linear;
  animation-delay: -2s;
  opacity: 0;
}

@keyframes anim2 {
  0% {
    opacity: 1;
    transform: rotate(538.5deg) translate3d(82px, 296px, 1000px) scale(1);
  }
}
.tri:nth-child(3) {
  border-top: 25px solid #00ff59;
  border-right: 25px solid transparent;
  border-left: 25px solid transparent;
  margin-left: -12.5px;
  margin-top: -12.5px;
  -webkit-filter: grayscale(1);
  filter: grayscale(1);
  transform: rotate(290deg) translate3d(0, 0, -1500px) scale(0);
  animation: anim3 15s infinite linear;
  animation-delay: -3s;
  opacity: 0;
}

@keyframes anim3 {
  0% {
    opacity: 1;
    transform: rotate(435deg) translate3d(901px, 162px, 1000px) scale(1);
  }
}
.tri:nth-child(4) {
  border-top: 25px solid #5500ff;
  border-right: 25px solid transparent;
  border-left: 25px solid transparent;
  margin-left: -12.5px;
  margin-top: -12.5px;
  -webkit-filter: grayscale(1);
  filter: grayscale(1);
  transform: rotate(298deg) translate3d(0, 0, -1500px) scale(0);
  animation: anim4 15s infinite linear;
  animation-delay: -4s;
  opacity: 0;
}

@keyframes anim4 {
  0% {
    opacity: 1;
    transform: rotate(447deg) translate3d(454px, 309px, 1000px) scale(1);
  }
}
.tri:nth-child(5) {
  border-top: 34px solid #4d00ff;
  border-right: 34px solid transparent;
  border-left: 34px solid transparent;
  margin-left: -17px;
  margin-top: -17px;
  -webkit-filter: grayscale(1);
  filter: grayscale(1);
  transform: rotate(258deg) translate3d(0, 0, -1500px) scale(0);
  animation: anim5 15s infinite linear;
  animation-delay: -5s;
  opacity: 0;
}

@keyframes anim5 {
  0% {
    opacity: 1;
    transform: rotate(387deg) translate3d(715px, 517px, 1000px) scale(1);
  }
}
.tri:nth-child(6) {
  border-top: 41px solid #9dff00;
  border-right: 41px solid transparent;
  border-left: 41px solid transparent;
  margin-left: -20.5px;
  margin-top: -20.5px;
  -webkit-filter: grayscale(1);
  filter: grayscale(1);
  transform: rotate(114deg) translate3d(0, 0, -1500px) scale(0);
  animation: anim6 15s infinite linear;
  animation-delay: -6s;
  opacity: 0;
}

@keyframes anim6 {
  0% {
    opacity: 1;
    transform: rotate(171deg) translate3d(982px, 979px, 1000px) scale(1);
  }
}
.tri:nth-child(7) {
  border-top: 38px solid #00ffbb;
  border-right: 38px solid transparent;
  border-left: 38px solid transparent;
  margin-left: -19px;
  margin-top: -19px;
  -webkit-filter: grayscale(1);
  filter: grayscale(1);
  transform: rotate(114deg) translate3d(0, 0, -1500px) scale(0);
  animation: anim7 15s infinite linear;
  animation-delay: -7s;
  opacity: 0;
}

@keyframes anim7 {
  0% {
    opacity: 1;
    transform: rotate(171deg) translate3d(621px, 192px, 1000px) scale(1);
  }
}
.tri:nth-child(8) {
  border-top: 3px solid #0091ff;
  border-right: 3px solid transparent;
  border-left: 3px solid transparent;
  margin-left: -1.5px;
  margin-top: -1.5px;
  -webkit-filter: grayscale(1);
  filter: grayscale(1);
  transform: rotate(314deg) translate3d(0, 0, -1500px) scale(0);
  animation: anim8 15s infinite linear;
  animation-delay: -8s;
  opacity: 0;
}

@keyframes anim8 {
  0% {
    opacity: 1;
    transform: rotate(471deg) translate3d(712px, 81px, 1000px) scale(1);
  }
}
.tri:nth-child(9) {
  border-top: 18px solid #00ff95;
  border-right: 18px solid transparent;
  border-left: 18px solid transparent;
  margin-left: -9px;
  margin-top: -9px;
  -webkit-filter: grayscale(1);
  filter: grayscale(1);
  transform: rotate(320deg) translate3d(0, 0, -1500px) scale(0);
  animation: anim9 15s infinite linear;
  animation-delay: -9s;
  opacity: 0;
}

@keyframes anim9 {
  0% {
    opacity: 1;
    transform: rotate(480deg) translate3d(921px, 515px, 1000px) scale(1);
  }
}
.tri:nth-child(10) {
  border-top: 1px solid #ff0099;
  border-right: 1px solid transparent;
  border-left: 1px solid transparent;
  margin-left: -0.5px;
  margin-top: -0.5px;
  -webkit-filter: grayscale(1);
  filter: grayscale(1);
  transform: rotate(295deg) translate3d(0, 0, -1500px) scale(0);
  animation: anim10 15s infinite linear;
  animation-delay: -10s;
  opacity: 0;
}

@keyframes anim10 {
  0% {
    opacity: 1;
    transform: rotate(442.5deg) translate3d(142px, 332px, 1000px) scale(1);
  }
}
.tri:nth-child(11) {
  border-top: 2px solid #00ffa2;
  border-right: 2px solid transparent;
  border-left: 2px solid transparent;
  margin-left: -1px;
  margin-top: -1px;
  -webkit-filter: grayscale(1);
  filter: grayscale(1);
  transform: rotate(201deg) translate3d(0, 0, -1500px) scale(0);
  animation: anim11 15s infinite linear;
  animation-delay: -11s;
  opacity: 0;
}

@keyframes anim11 {
  0% {
    opacity: 1;
    transform: rotate(301.5deg) translate3d(712px, 614px, 1000px) scale(1);
  }
}
.tri:nth-child(12) {
  border-top: 13px solid #ff0037;
  border-right: 13px solid transparent;
  border-left: 13px solid transparent;
  margin-left: -6.5px;
  margin-top: -6.5px;
  -webkit-filter: grayscale(1);
  filter: grayscale(1);
  transform: rotate(204deg) translate3d(0, 0, -1500px) scale(0);
  animation: anim12 15s infinite linear;
  animation-delay: -12s;
  opacity: 0;
}

@keyframes anim12 {
  0% {
    opacity: 1;
    transform: rotate(306deg) translate3d(213px, 186px, 1000px) scale(1);
  }
}
.tri:nth-child(13) {
  border-top: 49px solid #a2ff00;
  border-right: 49px solid transparent;
  border-left: 49px solid transparent;
  margin-left: -24.5px;
  margin-top: -24.5px;
  -webkit-filter: grayscale(1);
  filter: grayscale(1);
  transform: rotate(257deg) translate3d(0, 0, -1500px) scale(0);
  animation: anim13 15s infinite linear;
  animation-delay: -13s;
  opacity: 0;
}

@keyframes anim13 {
  0% {
    opacity: 1;
    transform: rotate(385.5deg) translate3d(673px, 615px, 1000px) scale(1);
  }
}
.tri:nth-child(14) {
  border-top: 28px solid #ff8400;
  border-right: 28px solid transparent;
  border-left: 28px solid transparent;
  margin-left: -14px;
  margin-top: -14px;
  -webkit-filter: grayscale(1);
  filter: grayscale(1);
  transform: rotate(61deg) translate3d(0, 0, -1500px) scale(0);
  animation: anim14 15s infinite linear;
  animation-delay: -14s;
  opacity: 0;
}

@keyframes anim14 {
  0% {
    opacity: 1;
    transform: rotate(91.5deg) translate3d(956px, 15px, 1000px) scale(1);
  }
}
html.tritravelers .tri:nth-child(15) {
  border-top: 39px solid #1eff00;
  border-right: 39px solid transparent;
  border-left: 39px solid transparent;
  margin-left: -19.5px;
  margin-top: -19.5px;
  -webkit-filter: grayscale(1);
  filter: grayscale(1);
  transform: rotate(176deg) translate3d(0, 0, -1500px) scale(0);
  animation: anim15 15s infinite linear;
  animation-delay: -15s;
  opacity: 0;
}

@keyframes anim15 {
  0% {
    opacity: 1;
    transform: rotate(264deg) translate3d(157px, 189px, 1000px) scale(1);
  }
}


              
            
!

JS

              
                
              
            
!
999px

Console