vue-circle-flags
Version:
A vue component with a collection of 400+ circular SVG country flags. Wrapper of HatScripts/circle-flags
51 lines (50 loc) • 1.71 kB
JavaScript
import { defineComponent as n, computed as o, openBlock as c, createElementBlock as i, createElementVNode as t, toDisplayString as d, createCommentVNode as h, normalizeStyle as _ } from "vue";
const f = ["viewBox"], m = /* @__PURE__ */ t("mask", { id: "d31331b8-541b-4c63-8a30-8941f1eba5d6" }, [
/* @__PURE__ */ t("circle", {
cx: "256",
cy: "256",
r: "256",
fill: "#fff"
})
], -1), u = { mask: "url(#d31331b8-541b-4c63-8a30-8941f1eba5d6)" }, v = { key: 0 }, k = /* @__PURE__ */ t("path", {
fill: "#0052b4",
d: "M0 68 68 0h376l68 68v376l-68 68H68L0 444Z"
}, null, -1), g = /* @__PURE__ */ t("path", {
fill: "#eee",
d: "M0 0v68l188 188L0 444v68h68l188-188 188 188h68v-68L324 256 512 68V0h-68L256 188 68 0H0z"
}, null, -1), p = { fill: "none" }, b = ["r"], W = /* @__PURE__ */ n({
__name: "gb-sct",
props: {
flagName: {},
strokeColor: { default: "#000" },
strokeWidth: { default: 0 }
},
setup(r) {
const e = r, l = o(() => 512 + 2 * e.strokeWidth), s = o(() => -e.strokeWidth), a = o(() => 256 + e.strokeWidth / 2);
return (x, w) => (c(), i("svg", {
xmlns: "http://www.w3.org/2000/svg",
class: "svg-circle-flags",
viewBox: `${s.value} ${s.value} ${l.value} ${l.value}`
}, [
m,
t("g", u, [
e.flagName ? (c(), i("title", v, d(e.flagName), 1)) : h("", !0),
k,
g
]),
t("g", p, [
t("circle", {
cx: "256",
cy: "256",
r: a.value,
fill: "none",
style: _({ stroke: e.strokeColor, strokeWidth: e.strokeWidth })
}, null, 12, b)
])
], 8, f));
}
});
export {
W as default
};
//# sourceMappingURL=gb-sct-6387ad15.js.map