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.77 kB
JavaScript
import { defineComponent as a, computed as o, openBlock as c, createElementBlock as i, createElementVNode as e, toDisplayString as d, createCommentVNode as f, normalizeStyle as _ } from "vue";
const h = ["viewBox"], u = /* @__PURE__ */ e("mask", { id: "24aaee14-b08f-4933-9ccd-24f8f7f686df" }, [
/* @__PURE__ */ e("circle", {
cx: "256",
cy: "256",
r: "256",
fill: "#fff"
})
], -1), m = { mask: "url(#24aaee14-b08f-4933-9ccd-24f8f7f686df)" }, v = { key: 0 }, k = /* @__PURE__ */ e("path", {
fill: "#d80027",
d: "M0 110.2 110.2 0H512v401.8L401.8 512H0z"
}, null, -1), p = /* @__PURE__ */ e("path", {
fill: "#eee",
d: "M110.2 0H63L0 63v47.2L401.8 512H449l63-63v-47.2z"
}, null, -1), g = /* @__PURE__ */ e("path", {
fill: "#333",
d: "M512 512v-63L63 0H0v63l449 449z"
}, null, -1), x = { fill: "none" }, w = ["r"], B = /* @__PURE__ */ a({
__name: "tt",
props: {
flagName: {},
strokeColor: { default: "#000" },
strokeWidth: { default: 0 }
},
setup(r) {
const t = r, l = o(() => 512 + 2 * t.strokeWidth), s = o(() => -t.strokeWidth), n = 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}`
}, [
u,
e("g", m, [
t.flagName ? (c(), i("title", v, d(t.flagName), 1)) : f("", !0),
k,
p,
g
]),
e("g", x, [
e("circle", {
cx: "256",
cy: "256",
r: n.value,
fill: "none",
style: _({ stroke: t.strokeColor, strokeWidth: t.strokeWidth })
}, null, 12, w)
])
], 8, h));
}
});
export {
B as default
};
//# sourceMappingURL=tt-ccf82cb8.js.map