UNPKG

@scalar/api-client

Version:

the open source API testing client

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