UNPKG

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.87 kB
import { defineComponent as n, 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"], m = /* @__PURE__ */ e("mask", { id: "82d07237-7f76-4028-87f8-62dccea4508c" }, [ /* @__PURE__ */ e("circle", { cx: "256", cy: "256", r: "256", fill: "#fff" }) ], -1), u = { mask: "url(#82d07237-7f76-4028-87f8-62dccea4508c)" }, k = { key: 0 }, p = /* @__PURE__ */ e("path", { fill: "#ffda44", d: "M378.5 0H133.7l-22.3 256 22.3 256h244.8l22.3-256z" }, null, -1), v = /* @__PURE__ */ e("path", { fill: "#338af3", d: "M133.7 512V0H0v512z" }, null, -1), g = /* @__PURE__ */ e("path", { fill: "#6da544", d: "M512 0H378.5v512H512zM200.4 322.8 156 256l44.5-66.8 44.7 66.8zm111.4 0L267.1 256l44.6-66.8 44.5 66.8zm-55.7 89L211.6 345l44.5-66.7 44.5 66.7z" }, null, -1), x = { fill: "none" }, z = ["r"], B = /* @__PURE__ */ n({ __name: "vc", 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 (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}` }, [ m, e("g", u, [ t.flagName ? (c(), i("title", k, d(t.flagName), 1)) : f("", !0), p, v, g ]), e("g", x, [ e("circle", { cx: "256", cy: "256", r: a.value, fill: "none", style: _({ stroke: t.strokeColor, strokeWidth: t.strokeWidth }) }, null, 12, z) ]) ], 8, h)); } }); export { B as default }; //# sourceMappingURL=vc-20e2abdf.js.map