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"], v = /* @__PURE__ */ t("mask", { id: "133be630-9564-4ee6-ae3a-53f7dbc3287a" }, [
/* @__PURE__ */ t("circle", {
cx: "256",
cy: "256",
r: "256",
fill: "#fff"
})
], -1), m = { mask: "url(#133be630-9564-4ee6-ae3a-53f7dbc3287a)" }, u = { key: 0 }, k = /* @__PURE__ */ t("path", {
fill: "#333",
d: "M0 0h208l48 32 48-32h208v208l-32 48 32 48v208H304l-48-32-48 32H0V304l32-48-32-48Z"
}, null, -1), g = /* @__PURE__ */ t("path", {
fill: "#eee",
d: "M208 0v208H0v96h208v208h96V304h208v-96H304V0h-96z"
}, null, -1), p = { fill: "none" }, x = ["r"], b = /* @__PURE__ */ n({
__name: "gb-con",
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 (w, y) => (c(), i("svg", {
xmlns: "http://www.w3.org/2000/svg",
class: "svg-circle-flags",
viewBox: `${s.value} ${s.value} ${l.value} ${l.value}`
}, [
v,
t("g", m, [
e.flagName ? (c(), i("title", u, 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, x)
])
], 8, f));
}
});
export {
b as default
};
//# sourceMappingURL=gb-con-8c4ca819.js.map