@rtstic.dev/pulse 0.0.31 → 0.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";(()=>{document.addEventListener("DOMContentLoaded",()=>{let b=window.matchMedia("(min-width: 992px)"),u=null;function h(){let a=[{identifier:"1",autoplayDuration:"11000ms"},{identifier:"2",autoplayDuration:"5000ms"},{identifier:"3",autoplayDuration:"8000ms"}];function m(t){return t.endsWith("ms")?parseInt(t.replace("ms",""),10):t.endsWith("s")?parseFloat(t.replace("s",""))*1e3:0}function c(t){document.querySelectorAll("[pulse-tab-content]").forEach(n=>{let i=n.getAttribute("pulse-tab-content");n.setAttribute("active-tabcontent",i===t?"true":"false")}),document.querySelectorAll("[pulse-tab-link]").forEach(n=>{let i=n.getAttribute("pulse-tab-link");n.setAttribute("active-tablink",i===t?"true":"false")}),v(t)}function v(t){document.querySelectorAll("[pulse-tab-content]").forEach(o=>{let n=o.getAttribute("pulse-tab-content"),i=o.querySelector("video");i&&(n===t?(i.loop=!0,i.play().catch(()=>{})):(i.pause(),i.currentTime=0,i.loop=!1))})}function T(t){let e=a.find(o=>o.identifier===t);return e?m(e.autoplayDuration):0}function L(t){return a.findIndex(e=>e.identifier===t)}let l=null,s=0;function f(){let t=a[s],e=m(t.autoplayDuration);c(t.identifier),g(t.identifier,e),s=(s+1)%a.length,l=window.setTimeout(f,e)}function y(){d(),s=0,f()}function d(){l!==null&&(clearTimeout(l),l=null)}function g(t,e){document.querySelectorAll("[pulse-tab-link]").forEach(n=>{let i=n.getAttribute("pulse-tab-link"),r=n.querySelector("[tablink-path]");r&&(r.style.transition="none",r.style.width="0%",i===t&&(r.getBoundingClientRect(),r.style.transition=`width ${e}ms linear`,r.style.width="100%"))})}return document.querySelectorAll("[pulse-tab-link]").forEach(t=>{t.addEventListener("click",()=>{let e=t.getAttribute("pulse-tab-link");if(!e)return;d(),c(e);let o=T(e);g(e,o);let n=L(e);n!==-1&&(s=(n+1)%a.length),l=window.setTimeout(f,o)})}),c(a[0].identifier),y(),window.activateTab=c,window.startTabAutoplay=y,window.stopTabAutoplay=d,d}function p(a){a.matches?u||(u=h()):u&&(u(),u=null)}p(b),b.addEventListener("change",p)});})();
1
+ "use strict";(()=>{document.addEventListener("DOMContentLoaded",()=>{let b=window.matchMedia("(min-width: 992px)"),u=null;function h(){let a=[{identifier:"1",autoplayDuration:"22000ms"},{identifier:"2",autoplayDuration:"12000ms"},{identifier:"3",autoplayDuration:"18000ms"}];function m(t){return t.endsWith("ms")?parseInt(t.replace("ms",""),10):t.endsWith("s")?parseFloat(t.replace("s",""))*1e3:0}function c(t){document.querySelectorAll("[pulse-tab-content]").forEach(n=>{let i=n.getAttribute("pulse-tab-content");n.setAttribute("active-tabcontent",i===t?"true":"false")}),document.querySelectorAll("[pulse-tab-link]").forEach(n=>{let i=n.getAttribute("pulse-tab-link");n.setAttribute("active-tablink",i===t?"true":"false")}),v(t)}function v(t){document.querySelectorAll("[pulse-tab-content]").forEach(o=>{let n=o.getAttribute("pulse-tab-content"),i=o.querySelector("video");i&&(n===t?(i.loop=!0,i.play().catch(()=>{})):(i.pause(),i.currentTime=0,i.loop=!1))})}function T(t){let e=a.find(o=>o.identifier===t);return e?m(e.autoplayDuration):0}function L(t){return a.findIndex(e=>e.identifier===t)}let l=null,s=0;function f(){let t=a[s],e=m(t.autoplayDuration);c(t.identifier),g(t.identifier,e),s=(s+1)%a.length,l=window.setTimeout(f,e)}function y(){d(),s=0,f()}function d(){l!==null&&(clearTimeout(l),l=null)}function g(t,e){document.querySelectorAll("[pulse-tab-link]").forEach(n=>{let i=n.getAttribute("pulse-tab-link"),r=n.querySelector("[tablink-path]");r&&(r.style.transition="none",r.style.width="0%",i===t&&(r.getBoundingClientRect(),r.style.transition=`width ${e}ms linear`,r.style.width="100%"))})}return document.querySelectorAll("[pulse-tab-link]").forEach(t=>{t.addEventListener("click",()=>{let e=t.getAttribute("pulse-tab-link");if(!e)return;d(),c(e);let o=T(e);g(e,o);let n=L(e);n!==-1&&(s=(n+1)%a.length),l=window.setTimeout(f,o)})}),c(a[0].identifier),y(),window.activateTab=c,window.startTabAutoplay=y,window.stopTabAutoplay=d,d}function p(a){a.matches?u||(u=h()):u&&(u(),u=null)}p(b),b.addEventListener("change",p)});})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtstic.dev/pulse",
3
- "version": "0.0.31",
3
+ "version": "0.0.32",
4
4
  "description": "pulse website",
5
5
  "license": "license-of-your-project",
6
6
  "keywords": [],