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.


                <div id="card-container" data-offset="2">
   <div class="pg">
      <img src="">
   <div id="card">
      <div class="shine"></div>
      <div class="text-block">
         <h1>Deadpool <small>(2016)</small></h1>
         <h3>Action, Adventure, Sci-Fi</h3>
            Deadpool is a 2016 American superhero film based on the Marvel Comics character of the same name. It is the eighth installment of the X-Men film series, and is directed by Tim Miller.
         <button>Watch Trailer</button>


                @import url(,300,700);
@import url(,900);

*{box-sizing: border-box;}
body, html { height: 100%; min-height: 100%; }
body {
   background: linear-gradient(#f6f7fc 0%, #d5e1e8 40%);
   transform-style: preserve-3d;
   transform: perspective(800px);
   font-family: 'Lato', sans-serif;

   width: 700px;
   height: 350px;
   top: 50%; left: 50%;
   margin: -175px 0 0 -350px;
   animation: backAn 60s infinite;
 background:url( 100% bottom;
     0px 45px 100px rgba(0, 0, 0, .4),
     inset 0 0 0 1000px rgba(156,27,27,.6);

#card .text-block{position:relative;z-index:2;text-shadow: 0px 3px 10px rgba(0, 0, 0, .7)}
#card .text-block h1{font-family: 'Rubik', sans-serif; font-size:3em; margin:0; text-transform:uppercase; font-weight:700;}
#card .text-block h1 small{font-size:.4em;color:#ccc;position:relative;bottom:10px}
#card .text-block h3{margin:0;font-weight:700;}
#card .text-block p{font-weight:300; width:60%}
#card .text-block button{transition: all .35s cubic-bezier(.37,.26,.35,1);border:4px solid #fff; padding:10px; background:transparent;font-family: 'Rubik', sans-serif;text-transform:uppercase; font-weight:700; cursor:pointer;}
#card .text-block button:hover{background:#B51D2A}

#card-container .pg{position:absolute;height:450px; width:40%; right:-10px;bottom:0px;z-index:2}
#card-container .pg > img{height:450px;}

.shine {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
background: linear-gradient(90deg, rgba(0,0,0,.4) 0%,rgba(0,0,0,.2) 60%);
z-index: 1;

@keyframes backAn {
  0%   { background-size:100% }
  50%   { background-size:250% }
  100%   { background-size:100% }



                var $poster = $('#card-container'),
  $shine = $('.shine'),
  w = $(window).width(),
  h = $(window).height();

$(window).on('mousemove', function(e) {
  var offsetX = 0.5 - e.pageX / w,
    offsetY = 0.5 - e.pageY / h,
    dy = e.pageY - h / 2,
    dx = e.pageX - w / 2,
    theta = Math.atan2(dy, dx),
    angle = theta * 180 / Math.PI - 90,
    offsetPoster = $'offset'),
    transformPoster = 'translateY(' + -offsetX * offsetPoster + 'px) rotateX(' + (-offsetY * offsetPoster) + 'deg) rotateY(' + (offsetX * (offsetPoster * 2)) + 'deg)';

  if (angle < 0) {
    angle = angle + 360;
  $shine.css('background', 'linear-gradient(' + angle + 'deg, rgba(0,0,0,' + (e.pageY / h /5)  + ') 0%,rgba(0,0,0,.25) 80%)');

  $poster.css('transform', transformPoster);