@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.cjs
CHANGED
|
@@ -866,12 +866,11 @@ function animateLogo(input, opts = {}) {
|
|
|
866
866
|
const dur = opts.duration ?? 1500;
|
|
867
867
|
const iter = opts.loop ? "infinite" : "1";
|
|
868
868
|
const shimmer = opts.shimmer !== false;
|
|
869
|
-
const style = `<style>@keyframes lac-in{0%{opacity:0;transform:scale(.9)}
|
|
869
|
+
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>`;
|
|
870
870
|
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>` : "";
|
|
871
871
|
const shimRect = shimmer ? `<rect class="lac-shim" x="0" y="0" width="${(w * 0.4).toFixed(0)}" height="${h}" fill="url(#lac-shim-g)"/>` : "";
|
|
872
|
-
let svg = result.svg.replace(
|
|
873
|
-
svg = svg.replace(
|
|
874
|
-
svg = svg.replace(/<\/svg>\s*$/, `${shimRect}</svg>`);
|
|
872
|
+
let svg = result.svg.replace(/(<svg\b[^>]*>)/, `$1${style}<defs>${shimDefs}</defs><g class="lac-in">`);
|
|
873
|
+
svg = svg.replace(/<\/svg>\s*$/, `</g>${shimRect}</svg>`);
|
|
875
874
|
return svg;
|
|
876
875
|
}
|
|
877
876
|
|