Diorama

Made for a big screen.

This site is one 3D scene, built for a computer: a wide window and a mouse. Open dioramajs.dev on a desktop or a laptop to see it.This site is one 3D scene, built for a wide window. Make this one wider, or open dioramajs.dev on a larger screen.

GitHub

DioramaDocs

SmoothScroll interface

The part of Lenis 1.3 the page side uses on top of what the adapter needs.

View as Markdown
import type { SmoothScroll } from '@dioramajs/diorama/astro/client'
interface SmoothScroll extends LenisLike

Members

NameTypeDescription
readonly actualScrollnumber

Native scroll position, px.

readonly animatedScrollnumber

Smoothed scroll position, px.

readonly classNamestring

Lenis' classes for <html>, e.g. 'lenis lenis-stopped'.

destroy() => void

Removes Lenis from the page.

readonly isHorizontalboolean

Whether Lenis scrolls horizontally.

readonly isScrollingboolean | 'native' | 'smooth'

Whether and how Lenis is scrolling.

readonly limitnumber

Maximum scroll, px.

readonly options{ autoRaf?: boolean; readonly infinite?: boolean; readonly wrapper?: Window | Element }

Lenis options the adapter reads.

raf(time: number) => void

Advances Lenis to time, ms.

scrollTo(target: number, options: { force: boolean; immediate: boolean }) => void

Scrolls to a position. immediate ends a smooth scroll in flight, force works while stopped.

targetScrollnumber

Where a smooth scroll in flight ends, px.

timenumber

Lenis time, ms. The pump writes it to keep Lenis on the driver's clock.

on
on(event: 'scroll' | 'virtual-scroll', callback: () => void): () => void

Listens to a Lenis event. Returns the unsubscribe function.

resize
resize(): void

Measures the page again and takes the native scroll position.

Defined in packages/diorama/src/astro-client.ts.