@lacspace/logo 1.2.0 → 1.2.1

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.
package/dist/index.js CHANGED
@@ -864,12 +864,11 @@ function animateLogo(input, opts = {}) {
864
864
  const dur = opts.duration ?? 1500;
865
865
  const iter = opts.loop ? "infinite" : "1";
866
866
  const shimmer = opts.shimmer !== false;
867
- const style = `<style>@keyframes lac-in{0%{opacity:0;transform:scale(.9)}60%{opacity:1}100%{opacity:1;transform:scale(1)}}@keyframes lac-wipe{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0 0 0)}}@keyframes lac-shim{0%{transform:translateX(${(-w * 0.6).toFixed(0)}px) skewX(-16deg)}55%{transform:translateX(${(w * 1.2).toFixed(0)}px) skewX(-16deg)}100%{transform:translateX(${(w * 1.2).toFixed(0)}px) skewX(-16deg)}}.lac-root{transform-origin:50% 50%;animation:lac-in ${dur}ms cubic-bezier(.2,.75,.2,1) ${iter} both,lac-wipe ${Math.round(dur * 0.7)}ms cubic-bezier(.4,0,.2,1) ${iter} both}.lac-shim{animation:lac-shim ${Math.round(dur * 1.25)}ms ease ${iter} both;mix-blend-mode:overlay}@media(prefers-reduced-motion:reduce){.lac-root{animation:none;clip-path:none}.lac-shim{display:none}}</style>`;
867
+ const style = `<style>@keyframes lac-in{0%{opacity:0;transform:translateY(${Math.round(h * 0.03)}px) scale(.9)}55%{opacity:1}100%{opacity:1;transform:none}}@keyframes lac-shim{0%{transform:translateX(${(-w * 0.55).toFixed(0)}px) skewX(-14deg)}50%,100%{transform:translateX(${(w * 1.15).toFixed(0)}px) skewX(-14deg)}}.lac-in{transform-box:fill-box;transform-origin:center;animation:lac-in ${dur}ms cubic-bezier(.2,.8,.2,1) ${iter} both}.lac-shim{transform-box:fill-box;transform-origin:center;opacity:.9;mix-blend-mode:overlay;animation:lac-shim ${Math.round(dur * 1.2)}ms ease ${Math.round(dur * 0.35)}ms ${iter} both}@media(prefers-reduced-motion:reduce){.lac-in{animation:none;opacity:1;transform:none}.lac-shim{display:none}}</style>`;
868
868
  const shimDefs = shimmer ? `<linearGradient id="lac-shim-g" x1="0" y1="0" x2="1" y2="0"><stop offset="0" stop-color="#fff" stop-opacity="0"/><stop offset=".5" stop-color="#fff" stop-opacity=".55"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient>` : "";
869
869
  const shimRect = shimmer ? `<rect class="lac-shim" x="0" y="0" width="${(w * 0.4).toFixed(0)}" height="${h}" fill="url(#lac-shim-g)"/>` : "";
870
- let svg = result.svg.replace(/^<svg /, `<svg class="lac-root" `);
871
- svg = svg.replace(/(<svg\b[^>]*>)/, `$1${style}<defs>${shimDefs}</defs>`);
872
- svg = svg.replace(/<\/svg>\s*$/, `${shimRect}</svg>`);
870
+ let svg = result.svg.replace(/(<svg\b[^>]*>)/, `$1${style}<defs>${shimDefs}</defs><g class="lac-in">`);
871
+ svg = svg.replace(/<\/svg>\s*$/, `</g>${shimRect}</svg>`);
873
872
  return svg;
874
873
  }
875
874