Skip to the content

Hata旗

Load a native country or region flag, choose supported framing and keep each drawing’s source, author and licence.

Hata (旗) is Japanese for a flag. About the name

Contents

Reference · MA.1X1 flag SVG

svgconstant

The flag of Morocco (モロッコ), MA, drawn again by hand at 1:1 by flag-icons 7.5.0 (MIT), as an SVG string: viewBox 512 by 512, 219 B. The drawing flag("MA", { shape: "1:1" }) uses (and the round frame, in a circle), made for that shape by hand rather than cut from the flag. The /manifest entry's framings say how each frame was chosen.

Import it

import { svg } from "@johnmorrisdotca/hata/flags/ma.1x1";

Definition

const svg: string = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path fill=\"#c1272d\" d=\"M512 0H0v512h512z\"/><path fill=\"none\" stroke=\"#006233\" stroke-width=\"12.5\" d=\"m256 191.4-38 116.8 99.4-72.2H194.6l99.3 72.2z\"/></svg>"

Examples

Example 1

import square from "@johnmorrisdotca/hata/flags/ma.1x1";

const host=document.createElement("div");
host.innerHTML = square;
console.log(host.querySelector("svg")?.getAttribute("viewBox"));

Example 2

import { svg } from "@johnmorrisdotca/hata/flags/ma.1x1";
console.log(svg.startsWith("<svg"),svg.length);
true 219

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hata 1.6.0.