Documentation
Install

Install

npm install glazejs gsap

Setup

import gsap from "gsap";
import glaze from "glazejs";
 
// using cdn
// import glaze from "https://esm.sh/glazejs";
// import gsap from "https://esm.sh/gsap";
 
glaze({
  lib: {
    gsap: {
      core: gsap,
    },
  },
});

Config

glaze({
  // the root element which will be searched for elements
  element: document,
  // the attribute to search for
  dataAttribute: "data-animate",
  // custom breakpoints
  breakpoints: {
    default: "(min-width: 1px)",
  },
  // defaults for animations
  defaults: {
    tl: "ease-power2.inOut",
    element: "to:x-500",
  },
  // custom presets
  presets: {
    helicopter: "from:rotate-2160|duration-10",
  },
  // watch elements for changes and restart animations with new settings
  watch: false,
});