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

              
                <!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Nargess Shabani's portfolio</title>
  <link rel="stylesheet" href="style.css">

</head>

<body>

<div class="scroll-horizontal-container">
  <div class="screen">
    I need while this page is scrolling horizontaly by mouse wheel <br>
pictures accordion to expand to its 100% width as the people scroll the page. not by hovering.
<br>
    so I started to use the go horizontal structure of the magic Scroll and nothing is working and I don't know why.
  </div>
  <!-- screen 5 -->
  <!-- recent project accordion -->
  <div  class="screen">
    <div id="trigger" class="accordion">
      <article >
        <section tabindex="1">
          <div id="target">
            <a href="#">
              <h2>Lorem Ipsum</h2>
              <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit</p>
            </a>
          </div>
       </section>
        <section tabindex="2">
          <div>
            <a href="#">
              <h2>Lorem Ipsum</h2>
              <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit</p>
            </a>
          </div>
        </section>
        <section tabindex="3">
          <div>
            <a href="#">
              <h2>Lorem Ipsum</h2>
              <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit</p>
            </a>
          </div>
        </section>
        <section tabindex="4">
          <div>
            <a href="#">
              <h2>Lorem Ipsum</h2>
              <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit</p>
            </a>
          </div>
    </section>
      </article>
      </div>
    <!-- end slider -->    

  </div>
<script src="//cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.6/ScrollMagic.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.6/plugins/debug.addIndicators.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/2.1.2/TweenMax.min.js"></script>  
<script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.6/ScrollMagic.min.js"></script>
<script  src="js/index.js"></script>



</body>


              
            
!

CSS

              
                
* {
  box-sizing: border-box;
}


Body {
  margin: 0 auto;
}


::-webkit-scrollbar {
  width: 0px;
  height: 0px;
}
::-webkit-scrollbar-button {
  width: 0px;
  height: 0px;
}

.scroll-horizontal-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow-x: scroll;
}

.screen {
  width: 100%;
  height: 100%;
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.accordion {
  
  min-width: 300px;
 
  overflow: hidden;
  margin: 0px auto;
}
.accordion article {
  width: 100%;
  display: table;
  table-layout: fixed;
  margin: 0;
  padding: 0;
}
.accordion article section {
  display: table-cell;
  vertical-align: bottom;
  position: relative;
  width: auto;
  background-repeat: no-repeat;
  background-position: center center;
  transition: all 900ms ease-in;
}
.accordion article section div {
  display: block;
  overflow: hidden;
  width: 100%;
}
.accordion article section div a {
  display: block;
  height: 100vh;
  width: 100%;
  position: relative;
  z-index: 3;
  padding: 15px 20px;
  box-sizing: border-box;
  color: #fff;
  text-decoration: none;
  transition: all 200ms ease-in;
}
.accordion article section div a * {
  opacity: 0;
  margin: 0;
  width: 100%;
  text-overflow: ellipsis;
  position: relative;
  z-index: 5;
  white-space: nowrap;
  overflow: hidden;
  transform: translateX(-20px);
  transition: all 1.5s ease-in-out;
}
.accordion article section div a h2 {
  font-family: sans-serif;
  text-overflow: clip;
  font-size: 24px;
  text-transform: uppercase;
  margin-bottom: 2px;
  top: 160px;
}
.accordion article section div a p {
  top: 200px;
  font-size: 1.5em;
}
/**/
.accordion article section:nth-child(1) {
  /*fix image path*/
  background-image: url(https://images.unsplash.com/photo-1554128012-e1bfc7170867?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1772&q=80);
  background-repeat: no-repeat;
  background-position:center;
  background-size: cover;
}
.accordion article section:nth-child(2) {

  background-image: url(https://images.unsplash.com/photo-1555883006-0f5a0915a80f?ixlib=rb-1.2.1&auto=format&fit=crop&w=1256&q=80);
  background-repeat: no-repeat;
  background-position:center;
  background-size: cover;
}
.accordion article section:nth-child(3) {

  background-image: url(https://images.unsplash.com/photo-1556038024-07f7daf0b84f?ixlib=rb-1.2.1&auto=format&fit=crop&w=1351&q=80);
  background-repeat: no-repeat;
  background-position:center;
  background-size: cover;
}
.accordion article section:nth-child(4) {

  background-image: url(https://images.unsplash.com/photo-1556220079-4f707a952005?ixlib=rb-1.2.1&auto=format&fit=crop&w=2550&q=80);
  background-repeat: no-repeat;
  background-position:center;
  background-size: cover;
  
}


              
            
!

JS

              
                (function () {
  let element = document.querySelector('.scroll-horizontal-container')
  element.addEventListener('wheel', (e) => {
    if (e.deltaY !== 0) {
      e.preventDefault()
      window.requestAnimationFrame(() => {
        element.scrollLeft += e.deltaY
      })
    }
  })
})()

// var controller = new ScrollMagic.Controller();
var tween = TweenMax.to("#target",10, {z: -150});
// build scee
var scene = new ScrollMagic.Scene({
  triggerElement: "#trigger", 
  duration: 500})
.setTween(tween);

              
            
!
999px

Console