API
Svelte Reveal also exposes several functions you can call to change the default options and global configuration of this library. Since these functions operate on a global level across all components using Svelte Reveal, you are supposed to only call them from a single file, otherwise you’ll keep overriding the default options and global config from multiple points.
setOnce
signature: (once: boolean) => RevealConfig
Sets the reveal animations activation status on page reload.
setDeviceStatus
signature: (device: Device, status: boolean) => RevealConfig
Sets the status of a device.
setDevicesStatus
signature: (devices: Device[], status: boolean) => RevealConfig
Sets the status of multiple devices.
setDeviceBreakpoint
signature: (device: Device, breakpoint: number) => RevealConfig
Sets the breakpoint of a device.
setDevice
signature: (device: Device, settings: DeviceConfig) => RevealConfig
Sets the settings of a device.
setResponsive
signature: (responsive: Responsive) => RevealConfig
Updates how responsiveness is handled by the library.
setObserverRoot
signature: (root: Element | Document | null) => IntersectionObserverConfig
Sets the Intersection Observer root
element.
setObserverRootMargin
signature: (rootMargin: string) => IntersectionObserverConfig
Sets the Intersection Observer rootMargin
property.
setObserverThreshold
signature: (threshold: number) => IntersectionObserverConfig
Sets the Intersection Observer threshold
property.
setObserverConfig
signature: (observerConfig: IntersectionObserverConfig) => IntersectionObserverConfig
Sets the Intersection Observer configuration.
setConfig
signature: (userConfig: RevealConfig) => RevealConfig
Updates the library global configuration.
setDefaultOptions
signature: (options: RevealOptions) => RevealOptions
Updates the default options to be used for the reveal effect.