Pen Settings



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


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


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.


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.


                <div class="hero-section">
  <div class="hero-content">
    <h1 class="hero-title">
      Level up your single-use <span class="word-container">
        <div class="rotating-word">Design</div>
        <div class="rotating-word">Qualification</div>
        <div class="rotating-word">Supply chain</div>
        <div class="rotating-word">Sustainability</div>



                @import url(';700&display=swap');

body {
  font-family: 'Inter', sans-serif;

.hero-section {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  overflow: hidden;
  padding-top: 100px;

.hero-content {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;

.hero-title {
  font-size: 5vw;
  line-height: 6vw;
  display: inline-block;
  vertical-align: top;
  white-space: nowrap; /* Prevent line breaks */

.word-container {
  display: inline-block;
  position: relative;
  overflow: hidden;
  height: 24vw; /* Match line-height * 4 to fit 4 words */
  vertical-align: top; /* Align the container to the top */
  margin-top: -6vw;

.rotating-word {
  display: block;
  width: 100%;
  text-align: left;
  height: 6vw; /* Ensure the height matches the container */
  line-height: 6vw; /* Match the line-height to ensure vertical alignment */



                document.addEventListener("DOMContentLoaded", function() {
  const container = document.querySelector('.word-container');
  const words = document.querySelectorAll('.rotating-word');
  const wordHeight = container.clientHeight / 4; // Adjusted to fit 4 words in view

  // Duplicate the word list to enable seamless looping
  words.forEach(word => {
    const clone = word.cloneNode(true);

  function scrollWords() {
    const timeline = gsap.timeline({ repeat: -1, defaults: { ease: "power2.inOut" } });, { y: `-=${wordHeight}px`, duration: 1 })
      .add(() => {
        // Move the first child to the end of the container
        gsap.set(container, { y: 0 }); // Reset the container position

        // Update opacity
      }, "+=1"); // Pause for 1 second before repeating

  function updateOpacity() {
    const allWords = container.querySelectorAll('.rotating-word');
    allWords.forEach((word, index) => {
      if (index === 1) {
        gsap.set(word, { opacity: 1 });
      } else if (index === 0 || index === 2) {
        gsap.set(word, { opacity: 0.65 });
      } else {
        gsap.set(word, { opacity: 0.4 });

  // Set initial opacity