cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              .lightFlash
#wrapper
	.container
		#hammer
			.front
				span.side
				span.side
				span.end
				span.end2
				span.bSide
				span.bSide2
			.back
				span.side
				span.side
				span.end
				span.end2
				span.end3
				span.end4
				span.bSide
				span.bSide2
				-for(j = 0; j < 5; j++)
						span.cLayer
			.right 
			.left
			.top 
				span.side
				span.side
				span.end
			.bottom 
				span.side
				span.side
				span.end
			.hammerSide 
				-for (i = 0; i < 17; i++)
					span.hSide
				.strap
					-for (i = 0; i < 13; i++)
						span.sLayer
            
          
!
            
              $darkGrey:#575859;
$lightGrey:#8B8C8F;
$shadow:#3f3f3f;
$hamDesign2:url(https://i.imgsafe.org/9c0bc95ad0.png);
$width:30vw;
body {
 width: 100vw;
 height: 100vh;
 overflow: hidden;
 background-color: black;
 background-image: radial-gradient(ellipse at bottom, rgba(aliceblue, .25) 0%, black 100%);
 &:before,
 &:after {
  content: '';
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  position: Absolute;
  pointer-events: none;
  background: url(https://www.lesigns.com/whoosh/lightning.gif);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  z-index: 1;
 }
 &:after {
  background: url(https://www.transparenttextures.com/patterns/concrete-wall.png);
  z-index: 9999;
  opacity: .25;
 }
 .lightFlash {
  width: 100%;
  height: 100%;
  position: Absolute;
  z-index: 1;
  animation: flash 4s cubic-bezier(.05, .81, .94, .15) infinite;
  &:before,
  &:after {
   content: '';
   width: 100%;
   height: 100%;
   position: absolute;
   top: 0;
   left: 0;
   background: url(https://i.imgsafe.org/b1951322c9.png);
   background-size: cover;
   background-repeat: no-repeat;
  }
  &:before {
   background: radial-gradient(ellipse at bottom, rgba(red, .1), rgba(#2719C7, .05));
  }
 }
}

#wrapper {
 width: $width;
 height: $width;
 top: 50%;
 left: 50%;
 transform: translate(-50%, -50%) scale(.75, .75);
 position: absolute;
 z-index: 10;
}

.container {
 width: $width;
 height: $width;
 position: absolute;
 perspective: 1000px;
 top: 50%;
 left: 50%;
 transform: translate(-45%, -125%) scale(.6, .3);
 z-index: 2;
 #hammer {
  width: 100%;
  height: 100%;
  position: absolute;
  transform-style: preserve-3d;
  animation: rotate 5s linear infinite;
  transform-origin: 50% 50%;
  transform: rotateX(-0deg) rotate(90deg);
  cursor: pointer;
  .hammerSide {
   width: 125%;
   height: 200%;
   background: transparent;
   box-shadow: initial;
   transform: translate(-50%, -50%) translate3d(52.5%, 17.5%, 25vw) rotateX(90deg);
   //Loop to create Handle
   $x: 1;
   @for $i from 1 through 17 {
    .hSide:nth-child(#{$i}) {
     $yRotate: $i * 21.2;
     $bPos: $x * 5%;
     $x: $x + 1;
     //End variable increments
     width: 4.25%;
     height: 175%;
     left: 47.5%;
     background-image: url(https://i.imgsafe.org/0616934e2e.jpg);
     background-position-x: $bPos;
     Background-size: calc(20 * 100%) 100%;
     position: absolute;
     transform: rotateY(($yRotate+ deg)) translate3d(0vw, 30vw, 4vw);
    }
   }
   .strap {
    width: 20%;
    height: 10%;
    position: absolute;
    background: transparent;
    bottom: -135%;
    left: 40%;
    -webkit-transform: translate3d(0%, 0%, 0vw);
    transform: translate3d(0%, 0%, 0vw);
    $b: 0;
    @for $i from 1 through 13 {
     .sLayer:nth-child(#{$i}) {
      $bPos: $b * 5%;
      $b: $b + 1;
      //End variable increments
      background-image: url(https://i.imgsafe.org/06193e960d.jpg);
      background-position-x: $bPos;
      Background-size: 100% calc(13 * 100%);
     }
    }
    .sLayer {
     width: 100%;
     height: 100%;
     background-repeat: no-repeat;
     position: absolute;
     left: 0;
     bottom: 0;
     transform-style: preserve-3d;
		 background-color:brown;
		 box-shadow: 0 0 10px brown;
     border-radius: 5px;
     &:nth-child(1) {
      transform: rotateX(90deg) translate3d(0%, 0%, 3vw);
      border-radius: 30%;
     }
     &:nth-child(2) {
      transform: rotateX(15deg) translate3d(0%, 0%, 2vw);
     }
     &:nth-child(3) {
      transform: rotateX(8deg) translate3d(0%, 81%, 2.2vw);
     }
     &:nth-child(4) {
      transform: rotateX(0deg) translate3d(0%, 170%, 3.3vw);
     }
     &:nth-child(5) {
      transform: rotateX(-8deg) translate3d(0%, 253%, 5vw);
     }
     &:nth-child(6) {
      transform: rotateX(-16deg) translate3d(0%, 340%, 7.5vw);
     }
     &:nth-child(7) {
      transform: rotateX(-57deg) translate3d(0%, 373%, 19.5vw);
      height: 60%;
     }
     &:nth-child(8) {
      transform: rotateX(-138deg) translate3d(0%, -532%, 17.75vw);
      height: 50%;
     }
     &:nth-child(9) {
      transform: rotateX(-165deg) translate3d(0%, -323%, 9.75vw);
     }
     &:nth-child(10) {
      transform: rotateX(-188deg) translate3d(0%, -274%, 2.55vw);
     }
     &:nth-child(11) {
      transform: rotateX(-195deg) translate3d(0%, -180%, 0.95vw);
     }
     &:nth-child(12) {
      transform: rotateX(-195deg) translate3d(0%, -81%, 0.95vw);
     }
     &:nth-child(13) {
      transform: rotateX(-195deg) translate3d(0%, -10%, 0.95vw);
     }
    }
   }
  }
  div {
   margin: 0;
   width: 130%;
   height: 70%;
   display: block;
   position: absolute;
   outline: 1px solid transparent;
   transform-style: preserve-3d;
   perspective: inherit;
   background: radial-gradient($lightGrey, $darkGrey);
   box-shadow: inset 0 0 15px black;
   i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
   }
   .side {
    height: 100%;
    width: 20%;
    position: absolute;
    right: -20%;
    background: linear-gradient(to right, $lightGrey, $darkGrey);
    transform: rotateY(45deg) translate3d(15%, 0%, -2.75vw);
    clip-path: polygon(0 0, 100% 5%, 100% 95%, 0 100%);
    box-shadow: inset 0 0 40px 2px black;
    &:before,
    &:after {
     content: '';
     width: 100%;
     height: 100%;
     position: Absolute;
     top: 0;
     left: 0;
    }
    &:after {
     background-image: $hamDesign2;
     background-size: 80% 80%;
     background-position: center center;
     background-repeat: no-repeat;
     -webkit-filter: invert(.3);
     mix-blend-mode: soft-light;
    }
    &:before {
     background: rgba(antiquewhite, .5);
     mix-blend-mode: multiply;
    }
    //For opposite side
    &:nth-child(2) {
     left: -20%;
     transform: rotateY(135deg) translate3d(15%, 0%, 2.75vw);
    }
   }
   .end,
   .end2,
   .end3,
   .end4 {
    height: 37%;
    width: 20%;
    left: 0;
    position: absolute;
    background: radial-gradient(ellipse at right, $lightGrey, $darkGrey);
    transform: rotateX(45deg) rotatey(-45deg) rotate(-0.75deg) translate3d(-58%, -85%, 4.8vw);
    clip-path: polygon(0 32%, 100% 0, 100% 100%, 0 66%);
    box-shadow: inset 0 0 5px $darkGrey, inset 0 0 30px black;
    &:after {
     content: '';
     width: 100%;
     height: 100%;
     position: Absolute;
     top: 0;
     left: 0;
     background: rgba(antiquewhite, .5);
     mix-blend-mode: multiply;
    }
   }
   .end2 {
    right: 0;
    left: initial;
    transform: rotateX(45deg) rotatey(45deg) rotate(-0.5deg) translate3d(65%, -249%, -58.45vw);
    clip-path: polygon(0 30%, 100% 0, 100% 100%, 0 68%);
   }
   .end3 {
    transform: rotateX(-43deg) rotatey(-45deg) rotate(1.25deg) translate3d(24%, 210%, 11vw);
   }
   .end4 {
    transform: rotateX(135deg) rotatey(-45deg) rotate(0.25deg) translate3d(259%, -372%, 29.75vw);
   }
  }
  .front {
   transform: rotateY( 0deg) translateZ( 25vw);
   background: radial-gradient($darkGrey, $lightGrey);
   .bSide,
   .bSide2 {
    content: '';
    position: absolute;
    width: 100%;
    height: 37%;
    background: radial-gradient($darkGrey, $lightGrey);
    &:after {
     content: '';
     width: 100%;
     height: 100%;
     position: Absolute;
     top: 0;
     left: 0;
     background: rgba(antiquewhite, .5);
     mix-blend-mode: multiply;
    }
   }
   .bSide {
    top: -37%;
    transform: rotateX(45deg) translate3d(0%, -15%, -2.75vw);
   }
   .bSide2 {
    bottom: -37%;
    transform: rotateX(-45deg) translate3d(0%, 15%, -2.75vw);
   }
   .side {
    clip-path: polygon(0 0, 100% 10%, 100% 90%, 0 100%);
   }
  }
  .back {
   background: radial-gradient($darkGrey, $lightGrey);
   transform: rotateX(180deg) rotate(180deg) translateZ(25vw);
   .bSide,
   .bSide2 {
    content: '';
    position: absolute;
    width: 100%;
    height: 37%;
    background: radial-gradient($darkGrey, $lightGrey);
    box-shadow: inset 0 0 20px black;
    &:after {
     content: '';
     width: 100%;
     height: 100%;
     position: Absolute;
     top: 0;
     left: 0;
     background: rgba(antiquewhite, .5);
     mix-blend-mode: multiply;
    }
   }
   .bSide {
    bottom: -37%;
    transform: rotateX(-45deg) translate3d(0%, 15%, -2.75vw);
   }
   .bSide2 {
    top: -37%;
    transform: rotateX(45deg) translate3d(0%, -15%, -2.75vw);
   }
   .side {
    clip-path: polygon(0 0, 100% 10%, 100% 90%, 0 100%);
   }
   $y: -5;
   @for $i from 9 through 15 {
    .cLayer:nth-child(#{$i}) {
     $y: $y + 5;
     //End variables
     background: green;
     position: absolute;
     width: 15vw;
     height: 15vw;
     background: rgb(51, 51, 51);
     border-radius: 50%;
     position: absolute;
     top: 50%;
     left: 50%;
     transform: translate(-50%, -50%) translateZ($y + px);
    }
   }
   .cLayer:nth-child(13) {
    background: radial-gradient($lightGrey, $darkGrey);
   }
  }
  .right {
   transform: rotateY(90deg) translate3d(0%, 0%, 25vw);
   clip-path: polygon(5% 0%, 95% 0%, 100% 10%, 100% 90%, 95% 100%, 5% 100%, 0% 90%, 0% 10%);
  }
  .left {
   transform: rotateY(-90deg) translate3d(0%, 0%, 25vw);
   clip-path: polygon(5% 0%, 95% 0%, 100% 10%, 100% 90%, 95% 100%, 5% 100%, 0% 90%, 0% 10%);
  }
  .top {
   height: 130%;
   background: radial-gradient($darkGrey, $lightGrey);
   transform: rotateX( 90deg) translateZ( 25vw);
   .end2 {
    transform: rotateX(45deg) rotatey(45deg) rotate(-0.5deg) translate3d(65%, -249%, -58.45vw);
    clip-path: polygon(0 30%, 100% 0, 100% 100%, 0 68%);
   }
  }
  .bottom {
   height: 130%;
   background: radial-gradient($darkGrey, $lightGrey);
   transform: rotateX( -90deg) translateZ(7vw);
  }
  .top,
  .bottom {
   .end {
    transform: rotateX(45deg) rotatey(-45deg) rotate(0.25deg) translate3d(-60%, -85%, 4.7vw);
    height: 20%;
    width: 20%;
   }
  }
 }
}

@keyframes rotate {
 0% {
  transform: rotateY(360deg) rotateX(-90deg);
 }
 100% {
  transform: rotateY(0deg) rotateX(-90deg);
 }
}

//Lightning simulation
@keyframes flash {
 0% {
  background: radial-gradient(ellipse farthest-corner at 50vw 50vw, rgba(whitesmoke, .5), black);
  -webkit-filter: brightness(100%);
 }
 10% {
  background: radial-gradient(ellipse farthest-corner at 50vw 50vw, rgba(whitesmoke, .6), black);
  -webkit-filter: brightness(105%);
 }
 12% {
  background: radial-gradient(ellipse farthest-corner at 70vw 70vw, rgba(whitesmoke, .8), black);
  -webkit-filter: brightness(100%);
 }
 14% {
  background: radial-gradient(ellipse farthest-corner at 50vw 50vw, rgba(whitesmoke, .6), black);
  -webkit-filter: brightness(105%);
 }
 16% {
  background: radial-gradient(ellipse farthest-corner at 50vw 50vw, rgba(whitesmoke, .5), black);
  -webkit-filter: brightness(115%);
 }
 48% {
  background: radial-gradient(ellipse farthest-corner at 50vw 50vw, rgba(whitesmoke, .5), black);
  -webkit-filter: brightness(100%);
 }
 50% {
  background: radial-gradient(ellipse farthest-corner at 50vw 50vw, rgba(whitesmoke, .6), black);
  -webkit-filter: brightness(105%);
 }
 52% {
  background: radial-gradient(ellipse farthest-corner at 30vw 70vw, rgba(whitesmoke, .8), black);
  -webkit-filter: brightness(100%);
 }
 54% {
  background: radial-gradient(ellipse farthest-corner at 40vw 20vw, rgba(whitesmoke, .6), black);
  -webkit-filter: brightness(105%);
 }
 56% {
  background: radial-gradient(ellipse farthest-corner at 50vw 50vw, rgba(whitesmoke, .5), black);
  -webkit-filter: brightness(115%);
 }
 90% {
  background: radial-gradient(ellipse farthest-corner at 50vw 50vw, rgba(whitesmoke, .5), black);
  -webkit-filter: brightness(105%);
 }
 92% {
  background: radial-gradient(ellipse farthest-corner at 50vw 50vw, rgba(whitesmoke, .6), black);
  -webkit-filter: brightness(100%);
 }
 94% {
  background: radial-gradient(ellipse farthest-corner at 20vw 20vw, rgba(whitesmoke, .9), black);
  -webkit-filter: brightness(105%);
 }
 96% {
  background: radial-gradient(ellipse farthest-corner at 70vw 70vw, rgba(whitesmoke, .6), black);
  -webkit-filter: brightness(115%);
 }
 100% {
  background: radial-gradient(ellipse farthest-corner at 50vw 50vw, rgba(whitesmoke, .5), black);
  -webkit-filter: brightness(100%);
 }
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console