Codrops 원본

Building a Scroll-Driven Dual-Wave Text Animation with GSAP

텍스트 · MIT

텍스트 더 보기
ORIGINAL PREVIEW
Building a Scroll-Driven Dual-Wave Text Animation with GSAP 정적 미리보기

갤러리 안에서는 화면을 벗어나거나 움직임을 멈추면 예제도 닫힙니다. 다시 재생할 때는 처음부터 시작해요.

큰 화면으로 보기 새 탭

SOURCE FILES

원본 코드 읽기

10개 파일

수집한 원본 소스와 실행 안내를 함께 제공합니다.

css/base.css
파일 저장

:root {
  --color-text: rgba(255, 255, 255, 0.6);
  --color-bg: #000;
  --color-link: rgba(255, 255, 255, 0.6);
  --color-link-hover: #fff;
  --page-padding: 1.5rem;
  font-size: 14px;
}

*,
*::after,
*::before {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'forma-djr-mono', monospace;
  background: var(--color-bg);
  color: var(--color-text);
  overflow-x: hidden;
}

@media (scripting: enabled) {
  .loading {
    &::before,
    &::after {
      content: '';
      position: fixed;
      z-index: 10000;
    }

    &::before {
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: var(--color-bg);
    }

    &::after {
      top: 50%;
      left: 50%;
      width: 100px;
      height: 1px;
      margin: 0 0 0 -50px;
      background: var(--color-link);
      animation: loaderAnim 1.5s ease-in-out infinite alternate forwards;
    }
  }
}

@keyframes loaderAnim {
  0% {
    transform: scaleX(0);
    transform-origin: 0% 50%;
  }

  50% {
    transform: scaleX(1);
    transform-origin: 0% 50%;
  }

  50.1% {
    transform: scaleX(1);
    transform-origin: 100% 50%;
  }

  100% {
    transform: scaleX(0);
    transform-origin: 100% 50%;
  }
}

/* Main Container */
.container {
  width: 100%;
  min-height: 100vh;
  padding: 0 var(--page-padding);
}

.spacer {
  height: 75svh;
}

.spacer-bottom {
  height: 100svh;
}

a {
  text-decoration: none;
  color: var(--color-link);
  outline: none;
  cursor: pointer;

  &:hover {
    text-decoration: underline;
    color: var(--color-link-hover);
  }

  &:focus {
    outline: none;
    background: lightgrey;

    &:not(:focus-visible) {
      background: transparent;
    }

    &:focus-visible {
      outline: 2px solid red;
      background: transparent;
    }
  }
}

.frame {
  text-transform: uppercase;
  padding: 3rem var(--page-padding) 0;
  display: grid;
  z-index: 1000;
  position: relative;
  grid-row-gap: 0.5rem;
  grid-column-gap: 2rem;
  pointer-events: none;
  justify-items: start;
  grid-template-columns: auto auto auto 1fr;
  grid-template-areas:
    'title title title title'
    'back archive github ...'
    'demos demos demos demos'
    'tags tags tags tags'
    'sponsor sponsor sponsor sponsor';

  #cdawrap {
    justify-self: start;
    grid-area: sponsor;
  }

  a,
  button {
    pointer-events: auto;
    color: var(--color-text);
  }

  .frame__title {
    grid-area: title;
    font-size: inherit;
    margin: 0;
  }

  .frame__back {
    grid-area: back;
    justify-self: start;
  }

  .frame__archive {
    grid-area: archive;
    justify-self: start;
  }

  .frame__github {
    grid-area: github;
  }

  .frame__tags {
    grid-area: tags;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .frame__demos {
    grid-area: demos;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }

  @media screen and (min-width: 53em) {
    padding: var(--page-padding);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    grid-template-columns: auto auto auto 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      'title title title title'
      'back github archive demos'
      'tags tags sponsor sponsor';

    .frame__demos,
    #cdawrap {
      justify-self: end;
      text-align: right;
      max-width: 300px;
    }
  }
}
index.html
파일 저장

<!DOCTYPE html>
<html lang="en" class="js">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link
      rel="icon"
      type="image/svg+xml"
      href="https://tympanus.net/favicon/favicon.svg"
    />
    <link rel="shortcut icon" href="https://tympanus.net/favicon/favicon.ico" />
    <meta
      name="description"
      content="Dual wave text animation with two columns"
    />
    <meta name="keywords" content="text animation, scroll, gsap, wave" />
    <link rel="stylesheet" href="https://use.typekit.net/rue2ale.css" />
    <meta name="author" content="Codrops" />
    <title>Dual Wave Text Animation | Codrops</title>
    <link rel="stylesheet" href="css/base.css" />
    <link rel="stylesheet" href="src/dual-wave/style.css" />
  </head>
  <body class="loading">
    <header class="frame">
      <h1 class="frame__title">Dual Wave Text Animation on Scroll</h1>
      <a class="frame__back" href="https://tympanus.net/codrops/?p=">Article</a>
      <a class="frame__archive" href="https://tympanus.net/codrops/hub/"
        >All demos</a
      >
      <a class="frame__github" href="https://github.com/codrops/">GitHub</a>
      <nav class="frame__tags">
        <a href="https://tympanus.net/codrops/demos/?tag=gsap">#gsap</a>
        <a href="https://tympanus.net/codrops/demos/?tag=scroll">#scroll</a>
      </nav>
    </header>
    <main id="smooth-wrapper" class="container">
      <div id="smooth-content">
        <div class="spacer"></div>
        <div
          class="dual-wave-wrapper"
          data-animation="dual-wave"
          data-wave-number="12"
          data-wave-speed="1"
        >
          <div class="wave-column wave-column-left">
            <div class="animated-text" data-image="tesla.webp">Volt R2</div>
            <!-- Tesla -->
            <div class="animated-text" data-image="chanel.webp">Éclat</div>
            <!-- Chanel -->
            <div class="animated-text" data-image="apple.webp">Project Ion</div>
            <!-- Apple -->
            <div class="animated-text" data-image="BMW.webp">AeroLine</div>
            <!-- BMW -->
            <div class="animated-text" data-image="YSL.webp">Série Noir</div>
            <!-- Saint Laurent -->
            <div class="animated-text" data-image="nike.webp">UltraRun</div>
            <!-- Nike -->
            <div class="animated-text" data-image="hermes.webp">Atelier 03</div>
            <!-- Hermès -->
            <div class="animated-text" data-image="adidas.webp">Pulse One</div>
            <!-- Adidas -->
            <div class="animated-text" data-image="prada.webp">Linea 24</div>
            <!-- Prada -->
            <div class="animated-text" data-image="google.webp">
              Echo Series
            </div>
            <!-- Google -->
            <div class="animated-text" data-image="polestar.webp">Zero</div>
            <!-- Polestar -->
            <div class="animated-text" data-image="balenciaga.webp">
              Shift/Black
            </div>
            <!-- Balenciaga -->
            <div class="animated-text" data-image="audi.webp">Solar Drift</div>
            <!-- Audi -->
            <div class="animated-text" data-image="valentino.webp">Nº 27</div>
            <!-- Valentino -->
            <div class="animated-text" data-image="samsung.webp">Mode/3</div>
            <!-- Samsung -->
            <div class="animated-text" data-image="bottega.webp">Pure Form</div>
            <!-- Bottega Veneta -->
            <div class="animated-text" data-image="sony.webp">Edge</div>
            <!-- Sony -->
            <div class="animated-text" data-image="aesop.webp">Stillwater</div>
            <!-- Aesop -->
            <div class="animated-text" data-image="dior.webp">Parfum Nº8</div>
            <!-- Dior -->
            <div class="animated-text" data-image="porsche.webp">Vantage</div>
            <!-- Porsche -->
            <div class="animated-text" data-image="microsoft.webp">Core</div>
            <!-- Microsoft -->
            <div class="animated-text" data-image="lexus.webp">
              Archive Green
            </div>
            <!-- Lexus -->
            <div class="animated-text" data-image="mercedes.webp">
              Rosso Linea
            </div>
            <!-- Mercedes-Benz -->
            <div class="animated-text" data-image="huawei.webp">A-17</div>
            <!-- Huawei -->
            <div class="animated-text" data-image="tesla.webp">Volt R2</div>
            <!-- Tesla -->
            <div class="animated-text" data-image="chanel.webp">Éclat</div>
            <!-- Chanel -->
            <div class="animated-text" data-image="apple.webp">Project Ion</div>
            <!-- Apple -->
            <div class="animated-text" data-image="BMW.webp">AeroLine</div>
            <!-- BMW -->
            <div class="animated-text" data-image="YSL.webp">Série Noir</div>
            <!-- Saint Laurent -->
            <div class="animated-text" data-image="nike.webp">UltraRun</div>
            <!-- Nike -->
            <div class="animated-text" data-image="hermes.webp">Atelier 03</div>
            <!-- Hermès -->
            <div class="animated-text" data-image="adidas.webp">Pulse One</div>
            <!-- Adidas -->
            <div class="animated-text" data-image="prada.webp">Linea 24</div>
            <!-- Prada -->
            <div class="animated-text" data-image="google.webp">
              Echo Series
            </div>
            <!-- Google -->
            <div class="animated-text" data-image="polestar.webp">Zero</div>
            <!-- Polestar -->
            <div class="animated-text" data-image="balenciaga.webp">
              Shift/Black
            </div>
            <!-- Balenciaga -->
            <div class="animated-text" data-image="audi.webp">Solar Drift</div>
            <!-- Audi -->
            <div class="animated-text" data-image="valentino.webp">Nº 27</div>
            <!-- Valentino -->
            <div class="animated-text" data-image="samsung.webp">Mode/3</div>
            <!-- Samsung -->
            <div class="animated-text" data-image="bottega.webp">Pure Form</div>
            <!-- Bottega Veneta -->
            <div class="animated-text" data-image="sony.webp">Edge</div>
            <!-- Sony -->
            <div class="animated-text" data-image="aesop.webp">Stillwater</div>
            <!-- Aesop -->
            <div class="animated-text" data-image="dior.webp">Parfum Nº8</div>
            <!-- Dior -->
            <div class="animated-text" data-image="porsche.webp">Vantage</div>
            <!-- Porsche -->
            <div class="animated-text" data-image="microsoft.webp">Core</div>
            <!-- Microsoft -->
            <div class="animated-text" data-image="lexus.webp">
              Archive Green
            </div>
            <!-- Lexus -->
            <div class="animated-text" data-image="mercedes.webp">
              Rosso Linea
            </div>
            <!-- Mercedes-Benz -->
            <div class="animated-text" data-image="huawei.webp">A-17</div>
            <!-- Huawei -->
          </div>
          <div class="image-thumbnail-wrapper">
            <img src="1.webp" alt="Campaign Image" class="image-thumbnail" />
          </div>
          <div class="wave-column wave-column-right">
            <div class="animated-text">Tesla</div>
            <div class="animated-text">Chanel</div>
            <div class="animated-text">Apple</div>
            <div class="animated-text">BMW</div>
            <div class="animated-text">Saint Laurent</div>
            <div class="animated-text">Nike</div>
            <div class="animated-text">Hermès</div>
            <div class="animated-text">Adidas</div>
            <div class="animated-text">Prada</div>
            <div class="animated-text">Google</div>
            <div class="animated-text">Polestar</div>
            <div class="animated-text">Balenciaga</div>
            <div class="animated-text">Audi</div>
            <div class="animated-text">Valentino</div>
            <div class="animated-text">Samsung</div>
            <div class="animated-text">Bottega Veneta</div>
            <div class="animated-text">Sony</div>
            <div class="animated-text">Aesop</div>
            <div class="animated-text">Dior</div>
            <div class="animated-text">Porsche</div>
            <div class="animated-text">Microsoft</div>
            <div class="animated-text">Lexus</div>
            <div class="animated-text">Mercedes-Benz</div>
            <div class="animated-text">Huawei</div>
            <div class="animated-text">Tesla</div>
            <div class="animated-text">Chanel</div>
            <div class="animated-text">Apple</div>
            <div class="animated-text">BMW</div>
            <div class="animated-text">Saint Laurent</div>
            <div class="animated-text">Nike</div>
            <div class="animated-text">Hermès</div>
            <div class="animated-text">Adidas</div>
            <div class="animated-text">Prada</div>
            <div class="animated-text">Google</div>
            <div class="animated-text">Polestar</div>
            <div class="animated-text">Balenciaga</div>
            <div class="animated-text">Audi</div>
            <div class="animated-text">Valentino</div>
            <div class="animated-text">Samsung</div>
            <div class="animated-text">Bottega Veneta</div>
            <div class="animated-text">Sony</div>
            <div class="animated-text">Aesop</div>
            <div class="animated-text">Dior</div>
            <div class="animated-text">Porsche</div>
            <div class="animated-text">Microsoft</div>
            <div class="animated-text">Lexus</div>
            <div class="animated-text">Mercedes-Benz</div>
            <div class="animated-text">Huawei</div>
          </div>
        </div>
        <div class="spacer-bottom"></div>
      </div>
    </main>
    <script type="module" src="src/main.js"></script>
  </body>
</html>
함께 쓰는 파일 8개 보기
src/dual-wave/DualWaveAnimation.js
파일 저장

import gsap from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";

export class DualWaveAnimation {
  constructor(wrapper, options = {}) {
    this.wrapper =
      wrapper instanceof Element ? wrapper : document.querySelector(wrapper);

    // Read config from data attributes
    const waveNumber = this.wrapper?.dataset.waveNumber
      ? parseFloat(this.wrapper.dataset.waveNumber)
      : 2;
    const waveSpeed = this.wrapper?.dataset.waveSpeed
      ? parseFloat(this.wrapper.dataset.waveSpeed)
      : 1;

    this.config = {
      waveNumber,
      waveSpeed,
      ...options,
    };

    this.currentImage = null;
  }

  init() {
    if (!this.wrapper) {
      console.warn("Wrapper not found");
      return;
    }

    this.leftColumn = this.wrapper.querySelector(".wave-column-left");
    this.rightColumn = this.wrapper.querySelector(".wave-column-right");

    if (!this.leftColumn || !this.rightColumn) {
      console.warn("Columns not found");
      return;
    }

    this.setupAnimation();
  }

  setupAnimation() {
    // Get texts from both columns
    this.leftTexts = gsap.utils.toArray(
      this.leftColumn.querySelectorAll(".animated-text")
    );
    this.rightTexts = gsap.utils.toArray(
      this.rightColumn.querySelectorAll(".animated-text")
    );

    this.thumbnail = this.wrapper.querySelector(".image-thumbnail");

    if (this.leftTexts.length === 0 || this.rightTexts.length === 0) return;

    // Create quick setters for smooth text animations
    this.leftQuickSetters = this.leftTexts.map((text) =>
      gsap.quickTo(text, "x", { duration: 0.6, ease: "power4.out" })
    );

    this.rightQuickSetters = this.rightTexts.map((text) =>
      gsap.quickTo(text, "x", { duration: 0.6, ease: "power4.out" })
    );

    // Calculate initial ranges and positions
    this.calculateRanges();
    this.setInitialPositions(this.leftTexts, this.leftRange, 1);
    this.setInitialPositions(this.rightTexts, this.rightRange, -1);

    // Setup scroll trigger
    this.setupScrollTrigger();

    // Recalculate ranges on window resize
    this.resizeHandler = () => {
      this.calculateRanges();
    };
    window.addEventListener("resize", this.resizeHandler);
  }

  calculateRanges() {
    // Calculate ranges based on column widths minus max element width
    const maxLeftTextWidth = Math.max(
      ...this.leftTexts.map((t) => t.offsetWidth)
    );
    const maxRightTextWidth = Math.max(
      ...this.rightTexts.map((t) => t.offsetWidth)
    );

    this.leftRange = {
      minX: 0,
      maxX: this.leftColumn.offsetWidth - maxLeftTextWidth,
    };
    this.rightRange = {
      minX: 0,
      maxX: this.rightColumn.offsetWidth - maxRightTextWidth,
    };
  }

  setInitialPositions(texts, range, multiplier) {
    const rangeSize = range.maxX - range.minX;

    texts.forEach((text, index) => {
      const initialPhase = this.config.waveNumber * index - Math.PI / 2;
      const initialWave = Math.sin(initialPhase);
      const initialProgress = (initialWave + 1) / 2;
      const startX = (range.minX + initialProgress * rangeSize) * multiplier;

      gsap.set(text, { x: startX });
    });
  }

  setupScrollTrigger() {
    this.scrollTrigger = ScrollTrigger.create({
      trigger: this.wrapper,
      start: "top bottom",
      end: "bottom top",
      onUpdate: (self) => this.handleScroll(self),
    });
  }

  handleScroll(self) {
    const globalProgress = self.progress;

    // Since left and right texts are always aligned, we only need to check one column
    const closestIndex = this.findClosestToViewportCenter();

    // Update both columns with their respective multipliers
    this.updateColumn(
      this.leftTexts,
      this.leftQuickSetters,
      this.leftRange,
      globalProgress,
      closestIndex,
      1
    );

    this.updateColumn(
      this.rightTexts,
      this.rightQuickSetters,
      this.rightRange,
      globalProgress,
      closestIndex,
      -1
    );

    // Get the focused text element for thumbnail update
    const focusedText = this.leftTexts[closestIndex];
    this.updateThumbnail(this.thumbnail, focusedText);
  }

  updateColumn(texts, setters, range, progress, focusedIndex, multiplier) {
    const rangeSize = range.maxX - range.minX;

    texts.forEach((text, index) => {
      const finalX =
        this.calculateWavePosition(index, progress, range.minX, rangeSize) *
        multiplier;

      setters[index](finalX);

      if (index === focusedIndex) {
        text.classList.add("focused");
      } else {
        text.classList.remove("focused");
      }
    });
  }

  updateThumbnail(thumbnail, focusedText) {
    if (!thumbnail || !focusedText) return;

    // Get image from left column (single source)
    let newImage = focusedText.dataset.image;

    // If focused text has no image, look for the same index in left column
    if (!newImage) {
      const focusedIndex = this.rightTexts.indexOf(focusedText);
      if (focusedIndex !== -1 && this.leftTexts[focusedIndex]) {
        newImage = this.leftTexts[focusedIndex].dataset.image;
      }
    }

    // Only change image if different
    if (newImage && this.currentImage !== newImage) {
      this.currentImage = newImage;
      thumbnail.src = newImage;
    }

    // Position thumbnail to stay centered in viewport, clamped to allow centering on first/last text
    const wrapperRect = this.wrapper.getBoundingClientRect();
    const viewportCenter = window.innerHeight / 2;
    const thumbnailHeight = thumbnail.offsetHeight;
    const wrapperHeight = this.wrapper.offsetHeight;

    // Calculate ideal Y position (centered in viewport)
    const idealY = viewportCenter - wrapperRect.top - thumbnailHeight / 2;

    // Clamp to allow image to overflow wrapper to center on first/last text
    const minY = -thumbnailHeight / 2;
    const maxY = wrapperHeight - thumbnailHeight / 2;
    const clampedY = Math.max(minY, Math.min(maxY, idealY));

    // Apply position directly without animation for perfect scroll sync
    gsap.set(thumbnail, { y: clampedY });
  }

  calculateWavePosition(index, globalProgress, minX, range) {
    const phase =
      this.config.waveNumber * index +
      this.config.waveSpeed * globalProgress * Math.PI * 2 -
      Math.PI / 2;
    const wave = Math.sin(phase);
    const cycleProgress = (wave + 1) / 2;
    return minX + cycleProgress * range;
  }

  findClosestToViewportCenter() {
    const viewportCenter = window.innerHeight / 2;
    let closestIndex = 0;
    let minDistance = Infinity;

    // Only check left column since left and right are always horizontally aligned
    this.leftTexts.forEach((text, index) => {
      const rect = text.getBoundingClientRect();
      const elementCenter = rect.top + rect.height / 2;
      const distance = Math.abs(elementCenter - viewportCenter);

      if (distance < minDistance) {
        minDistance = distance;
        closestIndex = index;
      }
    });

    return closestIndex;
  }

  destroy() {
    if (this.scrollTrigger) {
      this.scrollTrigger.kill();
    }
    if (this.resizeHandler) {
      window.removeEventListener("resize", this.resizeHandler);
    }
  }
}
src/dual-wave/style.css
파일 저장

.dual-wave-wrapper {
  display: flex;
  width: 100%;
  position: relative;
  gap: 25vw;
}

.wave-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  font-size: clamp(2rem, 10vw, 3rem);
  font-weight: 400;
  line-height: 0.7;
  position: relative;
  z-index: 100;
}

.wave-column-left {
  align-items: flex-start;
}

.wave-column-right {
  align-items: flex-end;
}

.animated-text {
  width: max-content;
  color: #4d4d4d;
  text-transform: uppercase;
  transition: color 300ms ease-out;
}

.animated-text.focused {
  color: white;
  z-index: 2;
}

.image-thumbnail-wrapper {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, 0);
  width: 15vw;
  height: auto;
  z-index: 1;
  pointer-events: none;
  display: grid;
  place-items: center;
}

.image-thumbnail {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 30vh;
}

@media (max-width: 1023px) {
  .dual-wave-wrapper {
    gap: 10vw;
  }

  .wave-column {
    gap: 2.5rem;
    font-size: 5vw;
  }

  .image-thumbnail-wrapper {
    width: 50vw;
  }
}
src/main.js
파일 저장

import gsap from "gsap";
import { ScrollSmoother, ScrollTrigger } from "gsap/all";
import { DualWaveAnimation } from "./dual-wave/DualWaveAnimation.js";
import { preloadImages } from "./utils.js";

// Register GSAP plugins globally
gsap.registerPlugin(ScrollTrigger, ScrollSmoother);

// Initialize smooth scroll
ScrollSmoother.create({
  smooth: 1.5,
  normalizeScroll: true,
});

// Initialize dual wave animation
const wrapper = document.querySelector(".dual-wave-wrapper");
if (wrapper) {
  const animation = new DualWaveAnimation(wrapper);
  // Wait for all images to preload before initializing layout and scroll effects
  preloadImages(".dual-wave-wrapper").then(() => {
    document.body.classList.remove("loading");
    animation.init();
  });
}
src/utils.js
파일 저장

// Global image cache to prevent garbage collection and re-fetching
const imageCache = new Map();

/**
 * Preloads all images from data-image attributes and img elements within a container.
 * Images are cached globally to prevent re-fetching on subsequent uses.
 *
 * @function
 * @param {string} containerSelector - CSS selector for the container with images
 * @returns {Promise} - Resolves when all images are loaded
 */
const preloadImages = (containerSelector) => {
  return new Promise((resolve) => {
    const container = document.querySelector(containerSelector);

    if (!container) {
      resolve();
      return;
    }

    // Collect all unique image sources to preload (using relative paths for Codrops deployment)
    const imagesToLoad = new Set();

    // 1. Collect images from data-image attributes
    container.querySelectorAll('[data-image]').forEach((el) => {
      const imgSrc = el.dataset.image;
      if (imgSrc) imagesToLoad.add(imgSrc);
    });

    // 2. Collect visible <img> elements (use getAttribute to preserve relative paths)
    container.querySelectorAll('img').forEach((img) => {
      const imgSrc = img.getAttribute('src');
      if (imgSrc) imagesToLoad.add(imgSrc);
    });

    // No images to load
    if (imagesToLoad.size === 0) {
      resolve();
      return;
    }

    // Preload all collected images and cache them
    let loaded = 0;
    const total = imagesToLoad.size;

    imagesToLoad.forEach((src) => {
      // Skip if already cached
      if (imageCache.has(src)) {
        loaded++;
        if (loaded === total) resolve();
        return;
      }

      const img = new Image();

      // Resolve when image loads or fails
      img.onload = () => {
        // Cache the image object to prevent garbage collection
        imageCache.set(src, img);
        loaded++;
        if (loaded === total) resolve();
      };

      img.onerror = () => {
        loaded++;
        if (loaded === total) resolve();
      };

      img.src = src;
    });
  });
};

export { preloadImages };
vite.config.js
파일 저장

import { resolve } from "path";
import { defineConfig } from "vite";

export default defineConfig({
  base: "./",
  build: {
    rollupOptions: {
      input: {
        main: resolve(__dirname, "index.html"),
      },
    },
  },
});
Media credits and license evidence실행 안내·자료
파일 저장

README.md
## Credits

- Images generated with [Midjourney](https://midjourney.com)


## License

[MIT](LICENSE)
LICENSE실행 안내·자료
파일 저장

MIT License

Copyright (c) 2009 - 2025 [Codrops](https://codrops.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Bundled dependency licenses실행 안내·자료
파일 저장

GSAP standard license snapshot
Source: https://gsap.com/community/standard-license/
Retrieved: 2026-09-22T04:22:49.089Z
Original distribution copyright and version headers remain in the runtime code.

Standard "No Charge" GSAP License

 I. DEFINITIONS

 “GSAP License” means the terms and conditions of this GSAP Software License Agreement.

 "GSAP Products" means any Software made available at gsap.com (https://gsap.com) or any successor sites, including but not limited to the GSAP animation library and related plugins, tools, or extensions.

 "Permitted Uses" means the implementation and/or use of GSAP Products on any website, web application, or digital interface by any person or entity (which may include, for clarity, those of companies that compete with Webflow in other areas of business).

 "Prohibited Uses" means any implementation and/or use of GSAP Products in tools that allow users to build visual animations without code that encourages, induces, or materially assists in creating a solution that competes with Webflow’s visual animation building capabilities.

 "Competitive Products" means any software, tool, or service that enables users to create, edit, or manage animations through a visual interface or builder similar to Webflow (https://webflow.com).

 II. GRANT OF LICENSE

 Subject to the terms and conditions of this GSAP License, Webflow grants you a non-exclusive, worldwide license to use, reproduce, display, and implement GSAP Products solely for Permitted Uses.

 III. RESTRICTIONS

 You may not:

 Use any GSAP Products for any Prohibited Uses without prior written consent;

 Reverse engineer any GSAP Products for the purpose of creating Competitive Products;

 Remove or alter any proprietary notices or branding from GSAP Products.

 IV. OWNERSHIP AND INTELLECTUAL PROPERTY

 All intellectual property rights in GSAP Products, including but not limited to copyright, patents, trademarks, and trade secrets, remain the exclusive property of Webflow. This GSAP License does not transfer any ownership rights in GSAP Products to you.

 V. TERMINATION

 Webflow may terminate this GSAP License and revoke your access in its discretion if you fail to comply with any of these terms and conditions. Upon termination, you must cease all use of GSAP Products and destroy all copies in your possession.

 VI. MISCELLANEOUS PROVISIONS

 General: This GSAP License is incorporated into and subject to Webflow’s Terms of Service available here (https://webflow.com/legal/terms) ("Terms of Service"). In the event of any conflict or inconsistency between this GSAP License and the Terms of Service, the terms of this GSAP License shall govern in relation to your use of any GSAP Products.

 Amendments: Webflow reserves the right to update or modify this GSAP License at any time by posting the revised terms on this website, provided that any such updates or modifications shall not result in any material degradation to the security, integrity, or functionality of any GSAP Products. You understand and agree that your continued use of any GSAP Products after such revisions to this GSAP License constitutes your acceptance of this GSAP License as revised. If you do not accept the revised GSAP License, you are prohibited from using versions of the GSAP Products released after the effective date of the revised GSAP License (as well as any updates made to previous versions). Notwithstanding, you may continue using previous versions of GSAP Products under the applicable terms licensed to you prior to the effective date of the revised GSAP License (for clarity, excluding any updates made thereto).

 No Waiver: Failure of Webflow to enforce any provision of this GSAP License shall not constitute a waiver of future enforcement of that or any other provision.

 FAQ

 Is it acceptable for AI tools like ChatGPT, Cursor, Lovable, Webstudio, etc. to generate GSAP code?
 Absolutely! AI-generated code is not a "Prohibited Use".

 What if a WordPress plugin or theme or other niche tool allows users to create GSAP-driven effects through a visual interface? Is that prohibited?
 We want to encourage developers to build on top of GSAP, including visual tools that don't directly compete with Webflow's rich animation-building capabilities. If you are not sure if your product might be considered a "Prohibited Use", feel free to contact us (https://gsap.com/contact) so we can talk through it!

 Can I really use GSAP in commercial projects without paying anything?
 Yes, really! Commercial usage is covered under the standard license. All of GSAP including the plugins that were formerly "members-only" like SplitText (https://gsap.com/docs/v3/Plugins/SplitText/) and MorphSVG (https://gsap.com/docs/v3/Plugins/MorphSVGPlugin) can be used in commercial projects at no charge. Enjoy! 💚

 Effective date: April 30, 2025

 Last modified date: May 30, 2025

 Copyright (©) 2025, Webflow