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