StringTune/Docs

Modules

StringScroller

Forwards wheel interaction from a local surface into the main scroll controller.

Type
Built-in module
Status
Advanced
Scope
Element-level
Activation
string="scroller"

StringScroller

StringScroller is a wheel proxy. It listens for native wheel events on the annotated element and re-emits the original event on the shared StringTune event bus as wheel.

That makes an alternate surface act like scroll input for the active global scroll controller.

Public API

Attributes

StringScroller does not read any module-specific public attributes in the current runtime. Activation is only:

  • string="scroller"

CSS Variables and DOM Output

This module does not write CSS variables, transforms, or classes.

Its public output is one shared event:

  • wheel

Events

ChannelPayloadFired when
wheelnative WheelEventThe user wheels over the string="scroller" element

Mirror Behavior

This module has no mirror output contract.

Quick Example

HTML
<div string="scroller" class="scroller-demo">
  Wheel here
</div>
CSS
.scroller-demo {
  position: fixed;
  left: 24px;
  right: 24px;
  top: 24px;
  height: calc(50vh - 24px);
  display: grid;
  place-items: center;
  border: 1px solid black;
  background: white;
  color: black;
}

Registration

TypeScript
import StringTune, { StringScroller } from '@fiddle-digital/string-tune';

const stringTune = StringTune.getInstance();
stringTune.use(StringScroller);
stringTune.start(60);

Detailed Behavior

  • The module adds one native wheel listener per connected element.
  • On disconnect, it removes the stored listener from the element.
  • StringScroller does not scroll the element itself. It only forwards wheel input into the global StringTune pipeline.