@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.cjs +3 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
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)}
|
|
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(
|
|
871
|
-
svg = svg.replace(
|
|
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
|
|