All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.animations.scroll.js.map Maven / Gradle / Ivy

{"version":3,"file":"scroll.js","sourceRoot":"","sources":["../../src/animations/scroll.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,MAAM,GAAG,CAAC,OAAoB,EAAE,EAAU,EAAE,EAAU,EAAE,EAAE;IAC/D,IAAI,UAAkB,CAAC;IACvB,IAAI,SAAiB,CAAC;IAEtB,OAAO,OAAO,CAAC;QACd,WAAW,EAAE,GAAG,EAAE;YACjB,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;YAChC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QAC/B,CAAC;QACD,QAAQ;QACR,OAAO;QACP,OAAO,EAAE,QAAQ,CAAC,EAAE;YACnB,OAAO,CAAC,UAAU,GAAG,UAAU,GAAG,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAC,CAAC,kBAAkB;YACrE,OAAO,CAAC,SAAS,GAAG,SAAS,GAAG,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAC,CAAC,kBAAkB;QACpE,CAAC;KACD,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import animate, { duration } from \"./animate.js\";\n\nconst scroll = (element: HTMLElement, dx: number, dy: number) => {\n\tlet scrollLeft: number;\n\tlet scrollTop: number;\n\n\treturn animate({\n\t\tbeforeStart: () => {\n\t\t\tscrollLeft = element.scrollLeft;\n\t\t\tscrollTop = element.scrollTop;\n\t\t},\n\t\tduration,\n\t\telement,\n\t\tadvance: progress => {\n\t\t\telement.scrollLeft = scrollLeft + (progress * dx); // easing - linear\n\t\t\telement.scrollTop = scrollTop + (progress * dy); // easing - linear\n\t\t},\n\t});\n};\n\nexport default scroll;\n"]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy