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 class="camera">
				<div class="die12">
					<div class="die12-facebox1 die12-facebox">
						<div class="face1 die12-face"></div>
						<div class="face2 die12-face"></div>
						<div class="face3 die12-face"></div>
						<div class="face4 die12-face"></div>
						<div class="face5 die12-face"></div>
						<div class="face6 die12-face"></div>
					</div>
					<div class="die12-facebox2 die12-facebox">
						<div class="face1 die12-face"></div>
						<div class="face2 die12-face"></div>
						<div class="face3 die12-face"></div>
						<div class="face4 die12-face"></div>
						<div class="face5 die12-face"></div>
						<div class="face6 die12-face"></div>
					</div>
				</div>
</div>
              
            
!

CSS

              
                .camera {
  width: 300px;
  height: 300px;
  
  perspective-origin: 50% 0%;
  perspective: 500px;
  
  position: relative;
  margin-left: 100px;
  
  background-color: black;
}
.camera * {
  transform-style: preserve-3d;
}
.die12 {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 81px 170px 0;
  animation: overrotate 14s linear infinite;
}

@keyframes overrotate {
  0% {
    transform: rotateY(0) rotateX(0);
  }
  100% {
    transform: rotateY(-359.9deg) rotateX(359.9deg);
  }
}


.die12-face {
  width: 162px;
  height: 154px;
  opacity: 0.9;
  position: absolute;
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
  background-color: green;
  background-image: url("https://en.doc.boardgamearena.com/images/2/27/110_110_dice.png");
  background-size: 600% auto;
}

.die12-facebox,.die12-face {
  transform-origin: 81px 85px 0;
}


.die12 .face1 {

}
.die12 .face2 {
  transform: rotateZ(0) rotateX(-116.56deg) 
    translateY(-69px)  translateY(-31px) translateZ(62px);
}

.die12 .face3 {
  transform: rotateZ(72deg) rotateX(-116.56deg) 
    translateY(-69px) translateY(-31px) translateZ(62px);
}
.die12 .face4 {
  transform: rotateZ(144deg) rotateX(-116.56deg) 
    translateY(-69px) translateY(-31px) translateZ(62px);
}
.die12 .face5 {
  transform: rotateZ(-144deg) rotateX(-116.56deg) 
    translateY(-69px) translateY(-31px) translateZ(62px);
}
.die12 .face6 {
  transform: rotateZ(-72deg) rotateX(-116.56deg) 
    translateY(-69px) translateY(-31px) translateZ(62px);
}


.die12-facebox1 {
  transform: rotateX(90deg) translateZ(-223px);
}

.die12-facebox2 {
  transform: rotateX(-90deg);
}

.die12 .face1{
  background-position: calc(100% / 5 * 0) 0%;
}
.die12 .face2{
  background-position: calc(100% / 5 * 1) 0%;
}
.die12 .face3{
  background-position: calc(100% / 5 * 2) 0%;
}
.die12 .face4{
  background-position: calc(100% / 5 * 3) 0%;
}
.die12 .face5{
  background-position: calc(100% / 5 * 4) 0%;
}
.die12 .face6{
  background-position: calc(100% / 5 * 5) 0%;
}
              
            
!

JS

              
                
              
            
!
999px

Console