Pen Settings



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


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


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.


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.


  .face#face1 1
  .face#face2 2
  .face#face3 3
  .face#face4 4
  .face#face5 5
  .face#face6 6

  h2 Controls
    legend X Rotation
    input#x(type="range" min="0" max="360" value="45")
    #xValue 45 degree
    legend Y Rotation
    input#y(type="range" min="0" max="360" value="45")
    #yValue 45 degree
    legend Z Rotation
    input#z(type="range" min="0" max="360" value="45")
    #zValue 45 degree


                @mixin flex($j: center, $a: center, $d: row)
  display: flex
  justify-content: $j
  align-items: $a
  flex-direction: $d

  width: 100vw
  height: 100vh
  margin: 0
  @include flex($d: column)
  font-family: 'PT Sans', sans-serif

  position: relative
  width: 100px
  height: 100px
  border-radius: 20px
  background: transparent
  transform: rotateX(45deg) rotateZ(45deg)
  transform-style: preserve-3d
  transform-origin: 50px 50px 0
    width: 100px
    height: 100px
    background: #ddd
    position: absolute
    transition: all 0.2s
    backface-visibility: visible
    font-size: 1.2rem
    opacity: 0.8
    @include flex()
    background: green
    transform: translateZ(-50px)
    background: red
    transform: translateX(50px) rotateY(90deg)
    background: blue
    transform: translateX(-50px) rotateY(90deg)
    background: yellow
    transform: translateZ(50px)
    background: purple
    transform: translateY(-50px) rotateX(90deg)
    background: cyan
    transform: translateY(50px) rotateX(-90deg)

$var1: transparent
$var2: #fff
$var3: #434343
$var4: #43e5f7
$width: 10rem    
  margin-top: 50px
  text-align: center
    width: $width
  margin: 5px
  > div
    margin: 2px
    font-size: 1.1rem

@media screen and (-webkit-min-device-pixel-ratio:0) 
    overflow: hidden
    width: $width
    -webkit-appearance: none
    background-color: $var1
    height: 10px
    -webkit-appearance: none
    color: #13bba4
    margin-top: -1px
    width: 10px
    -webkit-appearance: none
    height: 10px
    cursor: ew-resize
    background: $var3
    box-shadow: -80px 0 0 80px $var4
/** FF*/
  background-color: $var4

  background-color: $var1

/* IE*/

  background-color: $var4

  background-color: $var1
#xValue, #yValue, #zValue
  background: #eee
  border-radius: 10px
  @include flex()
  height: 2rem
  width: 10rem



                const x = document.getElementById('x')
const y = document.getElementById('y');
const z = document.getElementById('z');
const cube = document.getElementById('container');
let values = {x: "45",y: "45", z: "0"};

const changeFunc = (e)=>{
  const currentId =;
  values[currentId] =;
  let value = `rotateX(${values.x}deg) rotateY(${values.y}deg) rotateZ(${values.z}deg)`; = value;
  document.getElementById(`${currentId}Value`).innerText = `${values[currentId]} degree`;
x.addEventListener('input', changeFunc);
y.addEventListener('input', changeFunc);
z.addEventListener('input', changeFunc);