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

              
                <body>
    <section class="principles">
        <div class="principles__container content-container">

            <div class="principles__scroll">
                <h2 class="principles__title">We Follow <span class = "marked">Agile Principles</span></h2>
                <div class="principles__counter">
                    <span class="principles__current">1</span> /
                    <span class="principles__total">10</span>
                </div>
                <div class="principles__list">
                    <div class="principles__item">
                        <span class="principles__number">01</span>
                        <p class="principles__description">Our highest priority is to satisfy the customer through early and continuous delivery of valuable software.</p>
                    </div>
                    <div class="principles__item">
                        <span class="principles__number">02</span>
                        <p class="principles__description">Welcome changing requirements, even late in development. Agile process harness change for the customer’s competitive advantage.</p>
                    </div>
                    <div class="principles__item">
                        <span class="principles__number">03</span>
                        <p class="principles__description">Deliver working software frequently, from a couple of weeks to a couple of months, with a preference to the shorter timescale.</p>
                    </div>
                    <div class="principles__item">
                        <span class="principles__number">04</span>
                        <p class="principles__description">Business and developers must work together daily throughout the project</p>
                    </div>
                    <div class="principles__item">
                        <span class="principles__number">05</span>
                        <p class="principles__description">Build projects around motivated individuals. Give them the environment and support they  need, and trust them to get the job done.</p>
                    </div>
                    <div class="principles__item">
                        <span class="principles__number">06</span>
                        <p class="principles__description">The most efficient and effective method of conveying information to and within a development team is face-to-face conversation.</p>
                    </div>
                    <div class="principles__item">
                        <span class="principles__number">07</span>
                        <p class="principles__description">Working software is the primary measure of progress.</p>
                    </div>
                    <div class="principles__item">
                        <span class="principles__number">08</span>
                        <p class="principles__description">Agile processes promote sustainable development. The sponsors, developers and users should be able to maintain a constant pace indefinitely.</p>
                    </div>
                    <div class="principles__item">
                        <span class="principles__number">09</span>
                        <p class="principles__description">Continuous attention to technical excellence and good design enhances agility.</p>
                    </div>
                    <div class="principles__item">
                        <span class="principles__number">10</span>
                        <p class="principles__description">The best architectures, requirements, and designs emerge from self-organizing teams.</p>
                    </div>
                </div>
            </div>
        </div>
    </section>
  
  <section class="spacer"></div>

    <script src='https://cdnjs.cloudflare.com/ajax/libs/gsap/3.8.0/gsap.min.js'></script>
    <script src='https://unpkg.com/gsap@3/dist/ScrollTrigger.min.js'></script>
    <script src="js/custom.js"></script>

</body>
              
            
!

CSS

              
                body {
  margin: 0; 
  overflow-x: hidden;
}

.principles{
  padding: 60px 20px 120px;
  box-sizing: border-box;
}

.principles__container{
    margin: 0 auto;
    width: 100%;
    position: relative;
}
.principles__title{
    font-family: 'Montserrat', sans-serif;
    font-weight: bold;
    font-size: 42px;
    line-height: 54px;
    color: #1C2F6B;
    margin-bottom: 32px;
}

.principles__counter{
  position: absolute;
  right: 0;
  top: 0;
  font-family: 'Montserrat', sans-serif;
  font-weight: bold;
  font-size: 24px;
  line-height: 36px;
  color: #30C5FF;
}

.principles__list {
  display: flex;
  padding-left: calc(50vw - 370px/2);
}

.principles__item{
  background-color: #F5F9FF;
  min-width: 370px;
  padding: 32px;
  margin-left: 30px;
  //transition: .5s all ease;
  cursor: pointer;
  height: 290px;
  box-sizing: border-box;
}

.principles__item:first-of-type{
  margin-left: 0;
}

.principles__item:after {
  display: block;
  width: 100%;
  height: 100%;
  content: "";
  background-color: #1C2F6B;
  position: absolute;
  left: 0;
  top: 0;
  -webkit-transform-origin: 50% 100%;
  transform-origin: 50% 100%;
  -webkit-transform: scaleY(0);
  transform: scaleY(0);
  -webkit-transition: -webkit-transform .3s;
  transition: -webkit-transform .3s;
  transition: transform .3s;
  transition: transform .3s,-webkit-transform .3s;
  z-index: -1;
}

.principles__item.active:after {
  -webkit-transform: scaleY(1);
  transform: scaleY(1);
}

.principles__item:hover{
  background-color: #1C2F6B;
}
.principles__item:hover .principles__description,
.principles__item.active .principles__description{
  color: #fff;
}
.principles__number{
  color: #30C5FF;
  margin-bottom: 5px;
  font-size: 20px;
  font-weight: bold;
  font-family: 'Montserrat', sans-serif;
}
.principles__description{
  color: #1C2F6B;
  font-size: 20px;
  font-weight: bold;
  font-family: 'Montserrat', sans-serif;
  transition: .5s all ease;
}

              
            
!

JS

              
                gsap.registerPlugin(ScrollTrigger);

const sections = gsap.utils.toArray(".principles__item");
let maxWidth = 0;

const getMaxWidth = () => {
  maxWidth = 0;
  sections.forEach((section) => {
    maxWidth += section.offsetWidth;
    maxWidth += gsap.getProperty(section, 'marginLeft');    
  });
  maxWidth += 20;  
  maxWidth += window.innerWidth;
  maxWidth -= sections[0].offsetWidth;  
  return maxWidth;
};

getMaxWidth();
ScrollTrigger.addEventListener("refreshInit", getMaxWidth);

gsap.set('section.spacer', { minHeight: window.innerHeight - document.querySelector('.principles').offsetHeight })

gsap.to(sections, {
  x: () => `-${maxWidth - window.innerWidth}`,
  ease: "none",
  scrollTrigger: {
    trigger: ".principles",
    pin: true,
    scrub: 0.5,
    markers: true,
    end: () => `+=${maxWidth}`,
    invalidateOnRefresh: true
  }
});

sections.forEach((sct, i) => {
  ScrollTrigger.create({
    trigger: sct,
    start: () => 'top top-=' + (sct.offsetLeft - window.innerWidth/2) * (maxWidth / (maxWidth - window.innerWidth)),
    end: () => '+=' + sct.offsetWidth * (maxWidth / (maxWidth - window.innerWidth)),
    toggleClass: {targets: sct, className: "active"}
  });
});
              
            
!
999px

Console