Skip to content
Download

Framework overview

Every Ssscript project ships with a Webflow-first JavaScript framework: modules auto-mount from data-module attributes, lifecycle hooks coordinate page transitions, and shared services handle scroll, viewport detection, and animation frames.

ConceptWhat it does
Module systemOne file per feature in src/modules/; mounts on data-module="<name>"
Component lifecycleonDestroy, onPageIn, onPageOut hooks for transitions and cleanup
Scroll systemLenis smooth scroll with priority-based subscriptions
Observer & trackViewport detection (onView) and scroll progress (onTrack)
SubscriptionsGlobal Raf and Resize services for frame and resize events
src/
├── app.ts # Entry point
├── modules/ # Your components (data-module)
│ └── _/ # Module system internals
├── lib/ # scroll, subs, gsap, pages
├── styles/
│ ├── app.css # @import hub only
│ └── mod/ # Webflow-impossible CSS per module
└── webflow/ # Designer detection

Layout, typography, and most styling belong in Webflow Designer. Repo CSS is only for things Webflow cannot express (keyframes, pre-JS hidden states, complex animations). See Building a component for a hands-on walkthrough.

  • Markup and classes are created in Webflow — not as .html files in the repo.
  • Modules receive an existing DOM element and query children with data-* attributes.
  • The Webflow integration guide covers MCP, site linking, and Designer vs published behavior.