MCPcopy Create free account
hub / github.com/cryptii/cryptii / scrollHandleDidScroll

Method scrollHandleDidScroll

src/View/Pipe.js:446–459  ·  view source on GitHub ↗

* Triggered at each scroll handle scroll tick.

()

Source from the content-addressed store, hash-verified

444 * Triggered at each scroll handle scroll tick.
445 */
446 scrollHandleDidScroll () {
447 if (this._scrollHandleIndex === null) {
448 // Stop when scroll handle is no longer active
449 return
450 }
451
452 // Calculate intermediate scroll position
453 const direction = this._scrollHandleIndex === 0 ? -1 : 1
454 const duration = (new Date().getTime() - this._scrollHandleStartTime) / 1000
455 const delta = direction * Math.pow(duration, 2) * scrollHandleSpeed
456 this.scrollTo(this._scrollHandleStartPosition + delta)
457
458 window.requestAnimationFrame(this.scrollHandleDidScroll.bind(this))
459 }
460
461 /**
462 * Triggered when scroll handle stops scrolling.

Callers

nothing calls this directly

Calls 1

scrollToMethod · 0.95

Tested by

no test coverage detected