vue-circle-flags
Version:
A vue component with a collection of 400+ circular SVG country flags. Wrapper of HatScripts/circle-flags
55 lines (54 loc) • 1.88 kB
JavaScript
import { defineComponent as n, computed as o, openBlock as c, createElementBlock as i, createElementVNode as e, toDisplayString as d, createCommentVNode as h, normalizeStyle as _ } from "vue";
const f = ["viewBox"], v = /* @__PURE__ */ e("mask", { id: "214627ac-10c1-41f6-b6ae-a6187980144f" }, [
/* @__PURE__ */ e("circle", {
cx: "256",
cy: "256",
r: "256",
fill: "#fff"
})
], -1), u = { mask: "url(#214627ac-10c1-41f6-b6ae-a6187980144f)" }, m = { key: 0 }, k = /* @__PURE__ */ e("path", {
fill: "#0052b4",
d: "M0 0h512v133.7l-39 121.6 39 123.2V512H0V378.5L34.2 255 0 133.7z"
}, null, -1), p = /* @__PURE__ */ e("path", {
fill: "#d80027",
d: "M0 133.7h512v244.8H0z"
}, null, -1), g = /* @__PURE__ */ e("path", {
fill: "#eee",
d: "M345 306.1v-33.3h-22.2v-44.5L300.5 206l-22.2 22.3v-44.5L256 161.5l-22.3 22.3v44.5L211.5 206l-22.3 22.3v44.5H167v33.4h-22.3v33.4h222.6v-33.5z"
}, null, -1), x = { fill: "none" }, w = ["r"], B = /* @__PURE__ */ n({
__name: "kh",
props: {
flagName: {},
strokeColor: { default: "#000" },
strokeWidth: { default: 0 }
},
setup(r) {
const t = r, l = o(() => 512 + 2 * t.strokeWidth), s = o(() => -t.strokeWidth), a = o(() => 256 + t.strokeWidth / 2);
return (y, W) => (c(), i("svg", {
xmlns: "http://www.w3.org/2000/svg",
class: "svg-circle-flags",
viewBox: `${s.value} ${s.value} ${l.value} ${l.value}`
}, [
v,
e("g", u, [
t.flagName ? (c(), i("title", m, d(t.flagName), 1)) : h("", !0),
k,
p,
g
]),
e("g", x, [
e("circle", {
cx: "256",
cy: "256",
r: a.value,
fill: "none",
style: _({ stroke: t.strokeColor, strokeWidth: t.strokeWidth })
}, null, 12, w)
])
], 8, f));
}
});
export {
B as default
};
//# sourceMappingURL=kh-c316556a.js.map