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

              
                <h1>IE10 preserve-3d GSAP test custom rectangle rotation x,y,z</h1>
<p>borders specially retained for clarity</p>

<div class="left-sidebar">
  <p>Width: <span class="width prop">100</span>px</p>
  <div id="slider-width" style="width:200px;"></div>
  <p>Height: <span class="height prop">100</span>px</p>
  <div id="slider-height" style="width:200px;"></div>
  <p>Depth: <span class="depth prop">100</span>px</p>
<div id="slider-depth" style="width:200px;"></div>
</div>

<div class="center-sidebar">
  <div id="box">
    <div class="box">
      <div class="side6 bottom">6</div>
      <div class="side5 top">5</div>
      <div class="side4 left"><div>4</div></div>
      <div class="side3 right"><div>3</div></div>
      <div class="side2 back">2</div>
      <div class="side1 front">1</div>
    </div>
  </div>
</div>
              
            
!

CSS

              
                body {
      background-color: #888;
      color: #FFF;
    }

    body:after {
      content: '';
      clear: both;
      display: block;
    }

    .left-sidebar {
      width: 300px;
      float: left;
    }

    .center-sidebar {
      width: 500px;
      float: left;
    }

    h2 {
      color: #FFF;
    }

    a,
    .prop{
      color: #F7E309;
    }

    #box {
      width: 100px;
      margin: 70px;
    }

    .box {
      width: 100px;
      height: 100px;
      margin: 30px auto;
      position: relative;
    }

    .box div {
      position: absolute;
      text-align: center;
      left: 0;
      top: 0;
      font-weight: bold;
      font-size: 40px;
      width: 100px;
      height: 100px;
      color: #111;
      /*transform-origin: 50% 50% -50px;*/
      border: 1px solid #666;
    }

    .box .side1 {
      background: hsla(0, 100%, 50%, 0.7);
    }

    .box .side2 {
      background: hsla(60, 100%, 50%, 0.7);
    }

    .box .side3 {
      /*background: hsla(120, 100%, 50%, 0.7);*/
    }

    .box .side3 div {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      overflow: hidden;
      background: hsla(120, 100%, 50%, 0.7);
    }

    .box .side4 {
      /*background: hsla(180, 100%, 50%, 0.7);*/
    }

    .box .side4 div {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      overflow: hidden;
      background: hsla(180, 100%, 50%, 0.7);
    }

    .box .side5 {
      background: hsla(240, 100%, 50%, 0.7);
    }

    .box .side6 {
      background: hsla(300, 100%, 50%, 0.7);
    }
              
            
!

JS

              
                var ie = (!!navigator.userAgent.match(/Trident\/7\./)) ? .5 : 1,
      perspective = 1000,
      duration = 5,
      animation = new TimelineMax({repeat: -1});

    $( "#slider-width").slider({
      range: "max",
      min: 50,
      max: 300,
      value: 100,
      slide: function( event, ui ) {
        setParametersBox(ui.value, 
                         $("#slider-height").slider("value"), 
                         $("#slider-depth").slider("value"));
       $(".width").text(ui.value);
      }
    });

	$( "#slider-height").slider({
      range: "max",
      min: 50,
      max: 300,
      value: 100,
      slide: function( event, ui ) {
        setParametersBox($("#slider-width").slider("value"),
          						ui.value,
                         $("#slider-depth").slider("value"));
       $(".height").text(ui.value);
      }
    });
	
	$( "#slider-depth").slider({
      range: "max",
      min: 50,
      max: 300,
      value: 100,
      slide: function( event, ui ) {
        setParametersBox($("#slider-width").slider("value"), 
                         $("#slider-height").slider("value"), 
                         ui.value);
       $(".depth").text(ui.value);
      }
    });

    new TimelineMax()
      .set($("#box"), {perspective: perspective*ie})
      .set($(".box"), {transformStyle: "preserve-3d"})
      .set($(".box div"), {transformPerspective: perspective*ie})
      .set($(".back"), {rotationY: 180})
      .set($(".right"), {rotationY:270})
      .set($(".left"), {rotationY:90})
      .set($(".top"), {rotationX: 90})
      .set($(".bottom"), {rotationX:270})

    setParametersBox(100, 100, 100)
    animateAngle(360, 360, 360);


    function setParametersBox(width, height, depth) {
      new TimelineMax()

//        default parameters box
        .set([$(".box"),$("#box")], {width: width, height: height})
        .set($(".box div"), {transformOrigin: '50% 50% -'+depth/2+'px'})

//        set parameters wall box
        .set($(".front"), {width: width, height: height, lineHeight: height+'px'})
        .set($(".back"), {width: width, height: height, lineHeight: height+'px'})
        .set($(".right"), {width: depth, height: height, left: (width-depth)/2, z: (width-depth)/2, transformOrigin: '50% 50% -'+width/2+'px', lineHeight: height+'px'})
        .set($(".left"), {width: depth, height: height, left: (width-depth)/2, z: (width-depth)/2, transformOrigin: '50% 50% -'+width/2+'px', lineHeight: height+'px'})
        .set($(".top"), {width: width, height: depth, top: (height-depth)/2, z: (height-depth)/2, transformOrigin: '50% 50% -'+height/2+'px', lineHeight: depth+'px'})
        .set($(".bottom"), {width: width, height: depth, top: (height-depth)/2, z: (height-depth)/2, transformOrigin: '50% 50% -'+height/2+'px', lineHeight: depth+'px'})
    }

    function animateAngle(x,y,z) {
      animation
        .clear()
        .to($(".front"), duration, {rotationX: x, rotationY: y, rotationZ: z, ease: Linear.easeNone})
        .to($(".back"), duration, {rotationX: -x, rotationY: 180+y, rotationZ: z, ease: Linear.easeNone}, 0, 0)
        .to($(".top"), duration, {rotationX: 90+x, rotationY: y, rotationZ: z, ease: Linear.easeNone}, 0, 0)
        .to($(".bottom"), duration, {rotationX: 270+x, rotationY: y, rotationZ: z, ease: Linear.easeNone}, 0, 0)
        .to($(".left"), duration, {rotationY: 90+y, rotationZ: z, ease: Linear.easeNone}, 0, 0)
        .to($(".left div"), duration, {rotationZ: x, ease: Linear.easeNone}, 0, 0)
        .to($(".right"), duration, {rotationY: 270+y, rotationZ: z, ease: Linear.easeNone}, 0, 0)
        .to($(".right div"), duration, {rotationZ: -x, ease: Linear.easeNone}, 0, 0);
    }
              
            
!
999px

Console