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>
  <nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
    <img src="https://bit.ly/2NKLFXr" alt="">
    <div class="container-fluid">
      <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav me-auto mb-2 mb-md-0">
          <li class="nav-item">
            <a class="nav-link active" aria-current="page" href="#section-beaches">Beaches</a>
          </li>
          <li class="nav-item">
            <a class="nav-link active" aria-current="page" href="#section-civilization">Civilization</a>
          </li>
          <li class="nav-item">
            <a class="nav-link active" aria-current="page" href="#section-places">Places</a>
          </li>
        </ul>
      </div>
    </div>
  </nav>

  <section class="div-container" id="section-beaches">
    <div class="parallax parallax1">
      <div id="div-span-beaches" class="text">
        Amazing Beaches
      </div>
    </div>
    </div>
  </section>

  <section class="div-container" id="section-civilization">
    <div class="parallax parallax2">
      <div id="div-span-civilization" class="text">
        Rich Ancient Civilization
      </div>
    </div>
  </section>

  <section class="div-container" id="section-places">
    <div class="parallax parallax3">
      <div id="div-span-places" class="text">
        Wonderful Places to GO
      </div>
    </div>
  </section>

</body>

<!-- <div class="line"></div>

<header>
  <a href="https://greensock.com/scrolltrigger">
    <img class="greensock-icon" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/scroll-trigger-logo-light.svg" width="200" height="64" />
  </a>
</header> -->
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css2?family=Montserrat&display=swap");

body,
html {
  height: 100%;
  margin: 0;
  overflow-x: hidden;
  scroll-behavior: smooth;
  font-family: "Montserrat", sans-serif;
}

nav img {
  position: absolute;
  left: 1%;
  top: 1%;
  margin: 5px 0 5px 5px;
  width: 100px;
  height: 100px;
  line-height: 15px;
  border-radius: 50%;
  z-index: 1;
}

nav ul {
  text-align: center;
  margin-left: auto !important;
  margin-right: auto !important;
}

ul li {
  margin-right: 40px !important;
}

.navbar-toggler {
  margin-left: 85% !important;
}

.div-container {
  position: relative;
  top: 0;
  height: 100vh;
  width: 100%;
  margin: 0;
  z-index: 1;
  text-align: center;
}

.parallax {
  position: relative;
  /* Full height */
  height: 100%;
  margin: 0;
  /* Create the parallax scrolling effect */
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  max-height: 100%;
  width: 100%;
}

.parallax1 {
  background-image: url("https://cdn.turkishairlines.com/m/134a825baa0080c9/original/Travel-Guide-of-Sharm-El-Sheikh-via-Turkish-Airlines.jpg");
  max-height: 100%;
  width: 100%;
}

.parallax2 {
  background-image: url("http://kjncairosummer.files.wordpress.com/2011/08/middlecoffinleftviewwallpaper1.jpg");
  max-height: 100%;
  width: 100%;
}

.parallax3 {
  background-image: url("https://live.staticflickr.com/4140/4794905061_c61e2f66ec_b.jpg");
  max-height: 100%;
  width: 100%;
}

.text {
  font-family: "Montserrat", sans-serif;
  font-size: 5rem;
  font-weight: bold;
  color: white;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 20%;
  width: 100%;
  margin: auto;
  filter: blur(10px);
  display: none;
}

img {
  width: 500px;
  margin: 0 5% 0 5%;
  height: 300px;
  border-radius: 5px;
  box-shadow: 4px 4px 4px gray;
}

@media screen and (max-width: 900px) {
  .text {
    font-size: 4rem;
  }
}

@media screen and (max-width: 650px) {
  .text {
    font-size: 3rem;
  }

  nav img {
    width: 80px;
    height: 80px;
  }
}

              
            
!

JS

              
                gsap.registerPlugin(ScrollTrigger);

const containers = document.querySelectorAll(".div-container");

const text_elem = document.querySelectorAll(".text");

for (let i = 0; i < text_elem.length; i++) {
  gsap.to(text_elem[i], {
    scrollTrigger: {
      trigger: containers[i],
      start: "top 20%",
      toggleActions: "play reset play reset"
    },
    filter: "blur(0)",
    duration: 0.6,
    display: "block",
    yoyo: "true"
  });
}

              
            
!
999px

Console