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.87 kB
JavaScript
import { defineComponent as n, computed as o, openBlock as i, createElementBlock as r, createElementVNode as t, toDisplayString as d, createCommentVNode as f, normalizeStyle as _ } from "vue";
const h = ["viewBox"], m = /* @__PURE__ */ t("mask", { id: "1d142f8a-55b2-4d4e-8dc2-0a8f1f8e07b9" }, [
/* @__PURE__ */ t("circle", {
cx: "256",
cy: "256",
r: "256",
fill: "#fff"
})
], -1), u = { mask: "url(#1d142f8a-55b2-4d4e-8dc2-0a8f1f8e07b9)" }, k = { key: 0 }, v = /* @__PURE__ */ t("path", {
fill: "#338af3",
d: "M0 0h512v512H0z"
}, null, -1), p = /* @__PURE__ */ t("path", {
fill: "#eee",
d: "m256 111.3 11 34h35.8l-29 21 11.1 34-28.9-21-29 21 11.1-34-29-21H245zM111.3 256l34-11v-35.8l21 29 34-11.1-21 28.9 21 29-34-11.1-21 29V267zM256 400.7l-11-34h-35.8l29-21-11.1-34 28.9 21 29-21-11.1 34 29 21H267zM400.7 256l-34 11v35.8l-21-29-34 11.1 21-28.9-21-29 34 11.1 21-29V245z"
}, null, -1), g = { fill: "none" }, x = ["r"], W = /* @__PURE__ */ n({
__name: "fm",
props: {
flagName: {},
strokeColor: { default: "#000" },
strokeWidth: { default: 0 }
},
setup(c) {
const e = c, l = o(() => 512 + 2 * e.strokeWidth), s = o(() => -e.strokeWidth), a = o(() => 256 + e.strokeWidth / 2);
return (w, z) => (i(), r("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 ? (i(), r("title", k, d(e.flagName), 1)) : f("", !0),
v,
p
]),
t("g", g, [
t("circle", {
cx: "256",
cy: "256",
r: a.value,
fill: "none",
style: _({ stroke: e.strokeColor, strokeWidth: e.strokeWidth })
}, null, 12, x)
])
], 8, h));
}
});
export {
W as default
};
//# sourceMappingURL=fm-3e93ccf3.js.map