@alegendstale/holly-components
Version:
Reusable UI components created using lit
32 lines (31 loc) • 966 B
JavaScript
import { customElement as a } from "lit/decorators.js";
import { ResponsiveSvg as p } from "../responsive-svg/responsive-svg.js";
import m from "./draw-svg.styles.js";
import { HCIntersectionEvent as l } from "../../events/intersection.js";
import { IntersectionController as v } from "../../controllers/IntersectionController.js";
var g = Object.getOwnPropertyDescriptor, u = (t, n, c, i) => {
for (var e = i > 1 ? void 0 : i ? g(n, c) : n, s = t.length - 1, o; s >= 0; s--)
(o = t[s]) && (e = o(e) || e);
return e;
};
let r = class extends p {
constructor() {
super(...arguments), this.intersection = new v(this);
}
svgClasses() {
return {
...super.svgClasses(),
animation: this.intersection.isIntersecting
};
}
updated(t) {
super.updated(t), this.dispatchEvent(new l({ isIntersecting: this.intersection.isIntersecting }));
}
};
r.styles = [...p.styles, m];
r = u([
a("draw-svg")
], r);
export {
r as DrawSvg
};