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

              
                <html>
<body>
  <main class="horizontal" id="intro" role="main">
  <section class="full-screen blue" id="start">
    <h1>Anchor Navigation</h1>
  </section>

  <section class="full-screen orange" id="section-1">
    <div>
      <p class="growing-img">Section Uno</p>
    </div>
    
    <img class="image" src="https://images.pexels.com/photos/41953/earth-blue-planet-globe-planet-41953.jpeg" width="500" alt="">
  </section>

  <section class="full-screen red" id="section-2">
    <div>
      <p>Section Dos</p>
    </div>
  </section>

  <section class="full-screen blue" id="section-3">
    <div>
      <p>Section Tres</p>
    </div>
  </section>
</main>
  </body>
  </html>
              
            
!

CSS

              
                * {
  direction: rtl;
  padding: 0;
  margin: 0;
  
}

html {
      overflow-y: hidden;
    overflow-x: scroll;
}

.horizontal {
  display: flex;
  flex-dirextion: row;
}

.full-screen {
  min-width: 90vw;
  min-height: 95vh;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}

.orange {
  background: orange;
  font-size: 3rem;
}
.red {
  background: red;
}
.blue {
  background: blue;
}

#pinContainer {
		width: 100%;
		height: 100%;
		overflow: hidden;
	}
.panel {
		height: 100%;
		width: 100%;
		position: absolute;
    background-color: #f00;
}


/*scrollmagic rtl css*/

              
            
!

JS

              
                import ScrollMagic from "https://cdn.skypack.dev/scrollmagic@2.0.8";
import * as gsap from "https://cdn.skypack.dev/gsap@3.6.1";
import * as scrollmagicPlugins from "https://cdn.skypack.dev/scrollmagic-plugins@1.0.8";
import scrolltrigger from "https://cdn.skypack.dev/scrolltrigger@1.0.1";

gsap.registerPlugin(scrolltrigger)


init = () => {
  
}

window.addEventListener('load', function() {
  init();
})

/*
scrollmagicPlugins.ScrollMagicPluginIndicator(ScrollMagic);
scrollmagicPlugins.ScrollMagicPluginGsap(ScrollMagic, gsap.TweenMax);

        const controller = new ScrollMagic.Controller({vertical: false});


        // Increase img
        //in rtl horizontal scrolling  works in the opposite way
        //the final value is actually the initial one
        const tween = gsap.TweenMax.to('.image', 1.5, { transform: 'scale(0.2) translateX(-50rem)'});

        // build scene
        const scene1 = new ScrollMagic.Scene({
            triggerElement: '.orange',
            duration: '80%',
            triggerHook: 0.5,
        })
            scene1
            .setTween(tween)
            .addIndicators({
                name: 'increase img scene',
            })
            .addTo(controller);

*/
// jQuery(document).ready(function($) {
//             document.addEventListener('mousewheel', function(e) {
//              $('html, body').stop().animate({
//                  scrollLeft: '-='+(e.deltaY * 3)+'px '}, 400);
//             });
//        });

$("html, body").on("mousewheel", function(e) {
  e.preventDefault();
  var delta = 3*(parseInt(e.originalEvent.deltaY)/33);
  var scto = $(this).scrollLeft() - delta;
  $(this).scrollLeft(scto);
});
              
            
!
999px

Console