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

              
                <!-- CONTROL ANGLE AND ROTATION--> 
ROTATION:
<input class="plan" checked type="radio" name="view" value="Plan"  /> Spine
<input class="front" type="radio" name="view" value="Front" /> Front
<input class="left" type="radio" name="view" value="Left"  /> Right 
<input class="animate" type="radio" name="view" value="animate"  /> Animate<br />

<!-- CONTROL CAMERA POSITION HEIGHT--> 
<p>CAMERA:</p>
<input class="camera-worm" type="radio" name="camera" value="camera-worm"  /> Worm
<input class="camera-center" type="radio" name="camera" value="camera-center" checked  />  Normal
<input class="camera-crow" type="radio" name="camera" value="camera-crow"  />  Crow


<!-- stage-->
<div class="stage"> 
  <div class="book_group">
    <div class="book_back"></div>  
    <div class="book_front"></div>
  </div>
</div>

<div original></div>
              
            
!

CSS

              
                //@import "compass/css3";

/* VARIABLES - FEEL FREE TO EDIT THESE */
$bookheight: 280px; /* Render size */
$book_graphic: "https://i.sli.mg/CTFzi1.png"; //sass
//$book_graphic: "https://i.imgur.com/1iiSn01.png"; //js
//$book_graphic: "https://i.imgur.com/qh2HMMe.png";//html5 games
//$book_graphic:"https://i.imgur.com/Da3Lwqm.png"; // css master
// $book_graphic:"https://i.imgur.com/YkqS3lP.png"; // git
//$book_graphic: "https://i.imgur.com/YOMQXGP.png";
// go
//$book_graphic: "https://i.imgur.com/COTiFcw.png"; // lean
$book_graphic:"https://raw.githubusercontent.com/alexmwalker/Complete-Cover-Archive/ec76bc3f/uxprototyping1/UX-prototyping--cropped.png"; // css master
$book_graphic: "https://raw.githubusercontent.com/alexmwalker/Complete-Cover-Archive/master/adobexd1/adobexd1.png";
$book_graphic: "https://raw.githubusercontent.com/alexmwalker/Complete-Cover-Archive/master/sketch1/sketch1.png";
//$book_graphic:"https://raw.githubusercontent.com/alexmwalker/Complete-Cover-Archive/master/cssmaster1/cssmaster1.png";
$book_graphic:"https://raw.githubusercontent.com/sitepoint/Complete-Cover-Archive/master/performance1/1x/tools-spread.png?=123";

$speed: 25s ; /* Animation speed */

/* CALCULATED VALUES */
$bookwidth:($bookheight*0.76);
$bookspine: ($bookheight*0.04);
$bookshadow: ($bookheight/16);
$perspective: $bookheight*3.5;

$LEgradient: linear-gradient( // lighting effects gradient
      90deg, 
      rgba(255,255,255,0.0) 0%,
      rgba(255,255,255,0.2) 25%, 
      rgba(0,0,0,0.35) 50%, 
      rgba(255,255,255,0) 100%
  );

.stage { /* The frame or lens */
  width: $bookwidth; 
  height: $bookheight;
  perspective: $perspective;
  margin: 5% 3%;
  position: relative;
  float: left;
  outline:1px #f00 border;
  perspective-origin: 50% 50%;
}
.camera-crow { /* crow's view */
  perspective-origin: 0 -55%;
}
.camera-worm { /* worm view */
  perspective-origin: 0 100%;
}
.book_group{
  transform-style: preserve-3d; 
  transform-origin: 50% 50% 50%;
  transform: rotateY(0deg) rotateX(0deg); //default view
  &:after{ // gray inner fill to block edge gaps
    content: "";
    display: block;
    position: absolute;
    z-index: -1; 
    transform-origin: 0% 0%;
    width: $bookwidth -1; //it was sticking out a tiny bit
    height: $bookheight;
    background: #999;
  }
}
.book_front, .book_back{
  width: $bookwidth;
  height: $bookheight;
  transform-style: preserve-3d;
  transform: rotateY(0deg) translateZ($bookspine/2);
  position: absolute;   
  background: #666;
  background-position: -200% 100%, right top, center top, left top ;
  background-size: 500% 200%, auto 100%, auto 100%, auto 100%; 
  &:before, &:after{ // shared attributes
    content: "";
    display: block;
    position: absolute;
    z-index: -1; 
    transform-origin: 0% 0%;
    width: $bookspine;
    height: $bookheight;
    background: linear-gradient(to bottom, rgba(237,237,237,1) 0%,rgba(200,200,200,1) 100%); //default fallback offwhite
  }
  &:before{ // spine
    background-image: 
      $LEgradient,
      url(none),
      url($book_graphic),
      url(none);
    background-position: -400% 100%, right top, center top, left top ;
    background-size: 1000% 200%, auto 100%, auto 100%, auto 100%; 
    transform: rotateY(-90deg) translateX(-$bookspine);
  }
  &:after{  // right edge
    transform: rotateY(90deg) translateZ($bookwidth);
  }
}

//book backcover
.book_back{
  transform: rotateY(180deg) translateZ($bookspine/2); 
  width: $bookwidth;
  height: $bookheight;  
  z-index:0;
  background-image: 
      $LEgradient,
      url(none),
      url(none),
   url($book_graphic);
  background-position: -400% 100%, right top, center top, left top ;
    background-size: 500% 200%, auto 100%, auto 100%, auto 100%; 
  
   &:before{ //   bottom edge 
     height: $bookwidth;
     z-index:-1;
     background: #eee;
     display:none;
     transform: 
       rotateX(90deg) rotateZ(-90deg) translateZ(-$bookheight);
     box-shadow: 0px 0px $bookshadow 4px rgba(0, 0, 0, 0.55);
   }
  &:after{ //  top edge
    height: $bookwidth;
    z-index:-1;
    background: #eee;
    transform: 
    rotateX(90deg) rotateZ(-90deg);
  }
}
.book_front{
  z-index: 1; 
  background-image: 
      $LEgradient,
      url($book_graphic),
      url(none),
      url(none);
  background-position: -250% 100%, right top, center top, left top ;
  background-size: 200% 200%, auto 100%, auto 100%, auto 100%; 
  width: $bookwidth;
  height: $bookheight;
}

// Views



/* ANIMATION */
@keyframes rotate {
  0% { transform: rotateY(0) ; }
  100% { transform: rotateY(360deg) }
}

@keyframes lightingeffect { 
0% { 
  background-position: -200% 100%, right top, center top, left top ;
  background-size: 500% 200%, auto 100%, auto 100%, auto 100%;  
  }
25% { 
  background-position: -200% 100%, right top, center top, left top ;
  background-size: 500% 200%, auto 100%, auto 100%, auto 100%;  
  }
50% { 
  background-position: 0% 100%, right top, center top, left top ;
  background-size: 500% 200%, auto 100%, auto 100%, auto 100%;  
  }
75% {
  background-position: 200% 0, right top, center top, left top;
  background-size: 500% 200%, auto 100%, auto 100%, auto 100%;
  }
100% {
  background-position: 200% 0, right top, center top, left top;
  background-size: 500% 200%, auto 100%, auto 100%, auto 100%;
  }
}
  




/* BOOK VIEW CONTROLS */
.plan[type=radio]:checked ~ .stage .book_group{  
  transform: rotateY(40deg) rotateX(0deg) ; 
  transition: transform 1s ease-in-out;
}
.front[type=radio]:checked ~ .stage .book_group{  
  transform: rotateY(0deg) rotateZ(0deg) ; 
  transition: transform 1s ease-in-out;
}
.left[type=radio]:checked ~ .stage .book_group{  
  transform: rotateY(-125deg) rotateX(0deg) ; 
  transition: transform 1s ease-in-out;
} 
.animate[type=radio]:checked ~ .stage .book_group{  
  animation: rotate $speed infinite linear; 
  transition: transform 1s ease-in-out;
} 

.animate[type=radio]:checked ~ .stage .book_back{  
  animation: lightingeffect $speed infinite linear ; 
  animation-delay: $speed/4; 
} 

.animate[type=radio]:checked ~ .stage .book_front:before{  
  animation: lightingeffect $speed infinite linear; 
} 
.animate[type=radio]:checked ~ .stage .book_front{  
  animation: lightingeffect $speed infinite linear; 
  animation-delay: -$speed/4;
} 

.camera-worm[type=radio]:checked ~ .stage {  
   perspective-origin: 0 100%; 
  transition: perspective-origin 1s ease-in-out;
} 
.camera-center[type=radio]:checked ~ .stage {  
  perspective-origin: 50% 50%;  
  transition: perspective-origin 1s ease-in-out;
} 
.camera-crow[type=radio]:checked ~ .stage {  
  perspective-origin: 0 -50%;  
  transition: perspective-origin 1s ease-in-out;
} 
body {text-align:center}
              
            
!

JS

              
                
              
            
!
999px

Console