MCPcopy Index your code
hub / github.com/Fiddle-Digital/string-scroll / onResize

Method onResize

src/index.ts:499–530  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

497 }
498
499 public onResize() {
500 this.scrollbar?.resize()
501 this.animations.forEach((animation) => {
502 animation.resize()
503 });
504 if (w.innerWidth < 1024 || isTouchDevice()) {
505 this.scrollMode = this.mMode
506 } else {
507 this.scrollMode = this.dMode
508 }
509 if (this.wW != w.innerWidth || w.innerWidth > 1024) {
510 this.wW = w.innerWidth
511 this.wH = w.innerHeight
512 }
513 if (this.wW != w.innerWidth || w.innerWidth > 1024) {
514 let b = d.body,
515 h = d.documentElement
516 let dHeight = Math.max(b.scrollHeight, b.offsetHeight,
517 h.clientHeight, h.scrollHeight, h.offsetHeight)
518 this.sEn.data.bS = dHeight - this.wH
519
520 this.animations.forEach((animation) => {
521 animation.scrollEmit({
522 current: this.sEn.data.c,
523 target: this.sEn.data.t,
524 value: this.sEn.v,
525 })
526 });
527 }
528
529
530 }
531}
532
533export {

Callers 3

constructorMethod · 0.95
startMethod · 0.95
onMutationObserverMethod · 0.95

Calls 3

isTouchDeviceFunction · 0.85
scrollEmitMethod · 0.80
resizeMethod · 0.45

Tested by

no test coverage detected