PageSourceSearch

https://goldbug.com/cdn/shop/t/13/assets/marquee3k.js?v=23044496152134956901763958595

js goldbug.com collected 2026-09-24 19:18:40 UTC 3,862 bytes, 2 lines download raw bytes

1(function(root,factory){typeof define=="function"&&define.amd?define([],factory):typeof exports=="object"?module.exports=factory():root.Marquee3k=factory()})(this,function(){"use strict";let animationId=0;class Marquee3k{constructor(element,options){if(element.children.length===0)throw new Error("Encountered a marquee element without children, please supply a wrapper for your content");this.element=element,this.selector=options.selector,this.speed=element.dataset.speed||.25,this.pausable=element.dataset.pausable==="true",this.reverse=element.dataset.reverse==="true",this.paused=!1,this.parent=element.parentElement,this.parentProps=this.parent.getBoundingClientRect(),this.content=element.children[0],this.innerContent=this.content.innerHTML,this.wrapStyles="",this.offset=0,this._setupWrapper(),this._setupContent(),this._setupEvents(),this.wrapper.appendChild(this.content),this.element.appendChild(this.wrapper)}_setupWrapper(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("marquee3k__wrapper"),this.wrapper.style.whiteSpace="nowrap"}_setupContent(){this.content.classList.add(`${this.selector}__copy`),this.content.style.display="inline-block",this.contentWidth=this.content.offsetWidth,this.requiredReps=this.contentWidth>this.parentProps.width?2:Math.ceil((this.parentProps.width-this.contentWidth)/this.contentWidth)+1;for(let i=0;i<this.requiredReps;i++)this._createClone();this.reverse&&(this.offset=this.contentWidth*-1),this.element.classList.add("is-init")}_setupEvents(){this.element.addEventListener("mouseenter",()=>{this.pausable&&(this.paused=!0)}),this.element.addEventListener("mouseleave",()=>{this.pausable&&(this.paused=!1)})}_createClone(){const clone=this.content.cloneNode(!0);clone.style.display="inline-block",clone.classList.add(`${this.selector}__copy`),this.wrapper.appendChild(clone)}animate(){if(!this.paused){const isScrolled=this.reverse?this.offset<0:this.offset>this.contentWidth*-1,direction=this.reverse?-1:1,reset=this.reverse?this.contentWidth*-1:0;isScrolled?this.offset-=this.speed*direction:this.offset=reset,this.wrapper.style.whiteSpace="nowrap",this.wrapper.style.transform=`translate(${this.offset}px, 0) translateZ(0)`}}_refresh(){this.contentWidth=this.content.offsetWidth}repopulate(difference,isLarger){if(this.contentWidth=this.content.offsetWidth,isLarger){const amount=Math.ceil(difference/this.contentWidth)+1;for(let i=0;i<amount;i++)this._createClone()}}static refresh(index){MARQUEES[index]._refresh()}static pause(index){MARQUEES[index].paused=!0}static play(index){MARQUEES[index].paused=!1}static toggle(index){MARQUEES[index].paused=!MARQUEES[index].paused}static refreshAll(){for(let i=0;i<MARQUEES.length;i++)MARQUEES[i]._refresh()}static pauseAll(){for(let i=0;i<MARQUEES.length;i++)MARQUEES[i].paused=!0}static playAll(){for(let i=0;i<MARQUEES.length;i++)MARQUEES[i].paused=!1}static toggleAll(){for(let i=0;i<MARQUEES.length;i++)MARQUEES[i].paused=!MARQUEES[i].paused}static init(options={selector:"marquee3k"}){animationId&&window.cancelAnimationFrame(animationId),window.MARQUEES=[];const marquees=Array.from(document.querySelectorAll(`.${options.selector}`));let previousWidth=window.innerWidth,timer;for(let i=0;i<marquees.length;i++){const marquee=marquees[i],instance=new Marquee3k(marquee,options);MARQUEES.push(instance)}animate();function animate(){for(let i=0;i<MARQUEES.length;i++)MARQUEES[i].animate();animationId=window.requestAnimationFrame(animate)}window.addEventListener("resize",()=>{clearTimeout(timer),timer=setTimeout(()=>{const isLarger=previousWidth<window.innerWidth,difference=window.innerWidth-previousWidth;for(let i=0;i<MARQUEES.length;i++)MARQUEES[i].repopulate(difference,isLarger);previousWidth=this.innerWidth},250)})}}return Marquee3k});
2//# sourceMappingURL=/cdn/shop/t/13/assets/marquee3k.js.map?v=23044496152134956901763958595

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.