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

Method init

src/Animations/StringAnimation.ts:66–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64 return this.allObjects.has(id) ? this.allObjects.get(id) : undefined
65 }
66 init(){
67 let progE = document.querySelectorAll(`[${this._key}]:not([data-string-connect]):not([${this._key}-inited])`)
68 Array.from(progE)
69 .forEach((el: any) => {
70 this.addObject(el)
71 });
72 let connectE = document.querySelectorAll(`[data-string-connect]`)
73 Array.from(connectE).forEach((el: any) => {
74 let connectId = attr(el, `data-string-connect`)
75 if(this.objectsMap.has(connectId)){
76 el.setAttribute(`data-string-id`, attr(el, `data-string-id`, `${this._key}-${this.id}`))
77 let stringConnectObject = new StringScrollObject(el, this.progressKey, this.progressFactorKey, this.bufferProgressKey)
78 this.objectsMap.get(connectId)?.connects.push(stringConnectObject)
79 }
80 })
81 }
82 resize(){
83 let windowHeight = window.innerHeight
84 Array.from(this.allObjects).map(([name, value]) => {

Callers 1

startMethod · 0.80

Calls 4

addObjectMethod · 0.95
attrFunction · 0.90
hasMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected