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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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="perspective">
    <div class="card1 card-left">
      <a href="/collections/shop/products/dark-navy-camber-hoodie">
        <div class="itemleft" >
              <img class="imgitem-left" src=" https://cdn.shopify.com/s/files/1/0537/2038/3657/files/HOOD-burg3.png?v=1626882879 " alt="hoodieburgundy" >
        </div>
      </a>
        <div>
            <h1 class="itemleft-title">Burgundy Camber Hoodie </h1>
            <h3 class="itemleft-price">£95</h3>
        </div>
    </div>



    <div class="card2 card-right">
        <div class="itemright">
              <img class="imgitem-right" src=" https://cdn.shopify.com/s/files/1/0537/2038/3657/files/HOOD-navy3.png?v=1626971833 " alt="hoodienavy" >
        </div>
        <div>
            <h1 class="itemright-title">Dark Navy Camber Hoodie</h1>
            <h3 class="itemright-price">£95</h3>
        </div>
    </div>



    <div class="card3 card-left">
        <a href="/collections/shop/products/dark-navy-camber-hoodie">
        <div class="itemleft">
              <img class="imgitem-left" src=" https://cdn.shopify.com/s/files/1/0537/2038/3657/files/HOOD-grey3.png?v=1626971834 " alt="hoodiegrey" >
        </div>
        </a>
        <div>
            <h1 class="itemleft-title">Grey Camber Hoodie </h1>
            <h3 class="itemleft-price">£95</h3>
        </div>
    </div>

    <div class="card4 card-right">
        <div class="itemright">
              <img class="imgitem-right" src=" https://cdn.shopify.com/s/files/1/0537/2038/3657/files/HOOD-green3.png?v=1626971833 " alt="hoodiegreen" >
        </div>
        <div>
            <h1 class="itemright-title">Green Camber Hoodie</h1>
            <h3 class="itemright-price">£95</h3>
        </div>
    </div>
    <div class="card5 card-left">
        <a href="/collections/shop/products/dark-navy-camber-hoodie">
        <div class="itemleft">
              <img class="imgitem-left" src=" https://cdn.shopify.com/s/files/1/0537/2038/3657/files/HOOD-gold3.png?v=1626971833 " alt="hoodiegold" >
        </div>
        </a>
        <div>
            <h1 class="itemleft-title">Gold Camber Hoodie </h1>
            <h3 class="itemleft-price">£95</h3>
        </div>
    </div>

    <div class="card6 card-right">
        <div class="itemright">
              <img class="imgitem-right" src=" https://cdn.shopify.com/s/files/1/0537/2038/3657/files/HOOD-red3.png?v=1626971833 " alt="hoodiered" >
        </div>
        <div>
            <h1 class="itemright-title">Red Camber Hoodie</h1>
            <h3 class="itemright-price">£95</h3>
        </div>
    </div>
    <div class="card7 card-left">
        <a href="/collections/shop/products/dark-navy-camber-hoodie">
        <div class="itemleft">
              <img class="imgitem-left" src=" https://cdn.shopify.com/s/files/1/0537/2038/3657/files/HOOD-royal3.png?v=1626971833 " alt="hoodieroyal" >
        </div>
        </a>
        <div>
            <h1 class="itemleft-title">Royal Camber Hoodie </h1>
            <h3 class="itemleft-price">£95</h3>
        </div>
    </div>
  
  
  
  
  

</div>
              
            
!

CSS

              
                * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: eurostile,sans-serif;
  font-weight: 400;
  font-style: normal;
  width: 100%;
  overflow-x: hidden;
}


.perspective{
  perspective: 2500px;
  overflow-x: hidden;
  overflow-y: hidden;
  }

.card-left, .card-right{
  height: 500px;
  width: 101%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  transform-style: preserve-3d;
}
.itemleft {
  cursor: pointer;
  position: absolute;
  left: 0px;
  margin-left: 5%;
  top: 20px;

}
.itemright {
  cursor: pointer;
  position: absolute;
  right: 5%;
  top: 70px;

}
.itemleft img, .itemright img{
  max-height: 550px;

}

.itemleft-title{

  position: absolute;
  font-size: 3rem;
  right: 160px;
  color: white;
  z-index: 1100;
  pointer-events: none;
}
.itemleft-price{
  position: absolute;
  font-size: 1.3rem;
  padding: 4.5rem 0rem;
  right: 160px;
  color: white;
  z-index: 1100;
  pointer-events: none;
}
.itemright-title{
  position: absolute;
  font-size: 3rem;
  left: 160px;
  color: white;
  z-index: 1100;
  pointer-events: none;
}
.itemright-price{
  position: absolute;
  font-size: 1.3rem;
  padding: 4.5rem 0rem;
  left: 160px;
  color: white;
  z-index: 1100;
  pointer-events: none;
}
.imgitem-left{
  transform: rotate(15deg);
  z-index: 2;
}
.imgitem-right{
  transform: rotate(-15deg);
  z-index: 2;
}
/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

.card1 {
  z-index: 498;
  background-color: #f6ac2b;
  margin-top: 50px;

}
/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
.card2 {
  background-color: #99a7ef;
  z-index: 399;
}
/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
.card3 {
  background-color: #ff321f;
  z-index: 298;
}

/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
.card4 {
  background-color: #156295;
  z-index: 197;
}

/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
.card5 {
  background-color: pink;
  z-index: 188;
}

/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

.card6 {
  background-color: brown;
  z-index: 138;
}
/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
.card7 {
  background-color: grey;
  z-index: 97;
}
              
            
!

JS

              
                 //gsap.defaults({duration: 10})
gsap.registerPlugin(ScrollTrigger);
   gsap.utils.toArray(".card-left").forEach(cardLeft => {
     let imgitemLeft = cardLeft.querySelector(".imgitem-left"),
         titleLeft = cardLeft.querySelector(".itemleft-title"),
         priceLeft = cardLeft.querySelector(".itemleft-price");

     imgitemLeft.addEventListener("mouseenter", e => {
       gsap.to(titleLeft, {z: 150});
       gsap.to(priceLeft, {z: 170});
       gsap.to(imgitemLeft, {z: 90, rotation: 0, duration:0.75, ease:"power1.out"});
     });
     imgitemLeft.addEventListener("mousemove", e => {
       gsap.to(cardLeft, {
         rotationY: (window.innerWidth / 2 - e.clientX) / 60,
         rotationX: (window.innerHeight / 2 - e.clientY) / 65,
         overwrite: true
       });
     });
     imgitemLeft.addEventListener("mouseleave", e => {
       gsap.to(cardLeft, {
         rotationX: 0,
         rotationY: 0,
         overwrite: true
       });
       gsap.to([imgitemLeft, titleLeft, priceLeft], {z: 0,duration:0.75, overwrite: true });
       gsap.to(imgitemLeft, {rotation: 15, duration:0.75});
     });

   });

   ///////// RIGHT /////////////
   gsap.utils.toArray(".card-right").forEach(cardRight => {
     let imgitemRight = cardRight.querySelector(".imgitem-right"),
         titleRight = cardRight.querySelector(".itemright-title"),
         priceRight = cardRight.querySelector(".itemright-price");

     imgitemRight.addEventListener("mouseenter", e => {

       gsap.to(titleRight, {z: 150});
       gsap.to(priceRight, {z: 170});
       gsap.to(imgitemRight, {z: 90, rotation: 0, duration:0.75, ease:"power1.out"});
     });
     imgitemRight.addEventListener("mousemove", e => {
       gsap.to(cardRight, {
         rotationY: (window.innerWidth / 2 - e.clientX) / 60,
         rotationX: (window.innerHeight / 2 - e.clientY) / 65,
         overwrite: true
       });
     });
     imgitemRight.addEventListener("mouseleave", e => {
       gsap.to(cardRight, {
         rotationX: 0,
         rotationY: 0,
         overwrite: true
       });
       gsap.to([imgitemRight, titleRight, priceRight], {z: 0,duration:0.75 });
       gsap.to(imgitemRight, {rotation: -15,duration:0.75});
     });

   });
              
            
!
999px

Console