(function(){ try {var elementStyle = document.createElement('style'); elementStyle.appendChild(document.createTextNode("#ticker{overflow:hidden}.number__addEffect{font-weight:700;position:relative;animation:addEffect .6s infinite;font-weight:400}.number__removeEffect{font-weight:700;position:relative;animation:removeEffect .6s infinite;font-weight:400}span{animation-timing-function:ease}@keyframes addEffect{0%{bottom:15px;opacity:0}to{bottom:0}}@keyframes removeEffect{0%{top:0}to{top:15px;opacity:0}}")); document.head.appendChild(elementStyle);} catch(e) {console.error('vite-plugin-css-injected-by-js', e);} })();"use strict";/** * Vue 3 Price Ticker 0.1.0 * (c) 2022 * @Author: Hasan Parasteh * @Email: hasanparasteh@gmail.com * @license MIT */Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue"),d={class:"ticker",id:"ticker"},m=r.defineComponent({__name:"Ticker",props:{price:null,removeNumberEffect:null,addNumberEffect:{default:700}},setup(f){const c=f,o=r.toRef(c,"price");r.watch(o,()=>{a([...o.value.toString().split("")])}),r.onMounted(()=>{a([...o.value.toString().split("")])});function a(s){const n=Array.from(document.querySelectorAll("#ticker>span")),i=document.querySelector("#ticker");if(i===null)return;const t=[];if(s.forEach((u,e)=>{const l=document.createElement("span");l.innerText=String(u),l.setAttribute("data-index",e.toString()),t.push(l)}),n.length==0){i.replaceChildren(...t);return}s.forEach((u,e)=>{u!==n[e].innerText&&(n[e].classList.add("number__removeEffect"),setTimeout(()=>{t[e].classList.remove("number__removeEffect"),t[e].classList.add("number__addEffect")},c.removeNumberEffect),setTimeout(()=>{t[e].classList.remove("number__addEffect")},c.addNumberEffect))}),setTimeout(()=>{i.replaceChildren(...t)},c.removeNumberEffect)}return(s,n)=>(r.openBlock(),r.createElementBlock("div",d))}});exports.Ticker=m; //# sourceMappingURL=vue3-price-ticker.cjs.map