@scalar/api-client
Version:
the open source API testing client
41 lines (40 loc) • 1.5 kB
JavaScript
import { defineComponent as h, computed as f, createElementBlock as i, openBlock as o, normalizeClass as y, Fragment as v, renderList as x, normalizeStyle as m, createElementVNode as $, toDisplayString as k } from "vue";
const p = 500, l = 100, B = /* @__PURE__ */ h({
__name: "ScalarAsciiArt",
props: {
art: {},
animate: { type: Boolean }
},
setup(u) {
const d = u, n = f(() => d.art.split(`
`)), g = (a, s) => {
var e, t, r, c;
return {
animationDuration: `${a * l}ms, ${p}ms`,
animationTimingFunction: `steps(${a}), step-end`,
animationDelay: `${s * l}ms, 0ms`,
animationIterationCount: `1, ${((((e = n.value) == null ? void 0 : e.length) ?? 0) + (((c = (r = n.value) == null ? void 0 : r[((t = n.value) == null ? void 0 : t.length) - 1]) == null ? void 0 : c.length) ?? 0) + 5) * l / p}`
};
};
return (a, s) => (o(), i("div", {
"aria-hidden": "true",
class: y(["ascii-art font-code flex flex-col items-start text-[6px] leading-[7px]", { "ascii-art-animate": a.animate }]),
role: "presentation",
inert: ""
}, [
(o(!0), i(v, null, x(n.value, (e, t) => (o(), i("span", {
key: t,
class: "inline-block",
style: m({ width: `calc(${e.length + 1}ch)` })
}, [
$("span", {
class: "inline-block whitespace-pre overflow-hidden",
style: m(g(e.length, t))
}, k(e), 5)
], 4))), 128))
], 2));
}
});
export {
B as default
};