UNPKG

web-scrolling-text

Version:

A lightweight, customizable text animation library for creating smooth scrolling text effects with support for React, Next.js, Angular and vanilla JavaScript

8 lines (7 loc) 1.26 kB
/** * ScrollingText-swing v6.1.5 * build on Wed, 31 Dec 2025 04:31:27 GMT * (c) 2025 Hardik Naik * Released under the MIT License. */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):((t="undefined"!=typeof globalThis?globalThis:t||self).ScrollingTextAnimation=t.ScrollingTextAnimation||{},t.ScrollingTextAnimation.swing=e())}(this,(function(){"use strict";var t="scrolling-text-swing-in",e="scrolling-text-swing-out";return function(t,e){void 0===e&&(e={});var o=e.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===o&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}("@keyframes scrolling-text-swing-in{20%{transform:rotate(15deg)}40%{transform:rotate(-10deg)}60%{transform:rotate(5deg)}80%{transform:rotate(-5deg)}to{transform:rotate(0deg)}}@keyframes scrolling-text-swing-out{0%{opacity:1}20%{opacity:.8;transform:scale3d(.9,.9,.9)}50%,55%{opacity:0;transform:scale3d(1.1,1.1,1.1)}to{opacity:0;transform:scale3d(.3,.3,.3)}}"),{enterAnimation:t,exitAnimation:e}}));