default定数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The flag of Nauru (ナウル), NR, drawn again by hand at 4:3 by flag-icons 7.5.0 (MIT), as an SVG string: viewBox 640 by 480, 599 B.
The drawing flag("NR", { shape: "4:3" }) uses, made for that shape by hand rather than cut from the flag. The /manifest entry's framings say how each frame was chosen.
インポート
import value from "@johnmorrisdotca/hata/flags/nr.4x3";
定義
const svg: string = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 480\"><defs><clipPath id=\"hata-nr-4x3-a\"><path fill-opacity=\".7\" d=\"M-54.7 0H628v512H-54.7z\"/></clipPath></defs><g fill-rule=\"evenodd\" stroke-width=\"1pt\" clip-path=\"url(#hata-nr-4x3-a)\" transform=\"translate(51.3)scale(.9375)\"><path fill=\"#002170\" d=\"M-140 0H884v512H-140z\"/><path fill=\"#ffb20d\" d=\"M-140 234.1H884V278H-140z\"/><path fill=\"#fff\" d=\"m161.8 438-33-33-10.5 45.4-12-45-31.9 34 12.1-45L42 407.9l33-33-45.4-10.6 45-12-34-31.8 45 12L72 288l33 33 10.6-45.4 12 45 31.8-34-12 45 44.5-13.5-33 33 45.4 10.5-45 12 34 32-45-12.2z\"/></g></svg>"
例
例 1
import square from "@johnmorrisdotca/hata/flags/nr.4x3";
const host=document.createElement("div");
host.innerHTML = square;
console.log(host.querySelector("svg")?.getAttribute("viewBox"));例 2
import { svg } from "@johnmorrisdotca/hata/flags/nr.4x3";
console.log(svg.startsWith("<svg"),svg.length);true 599出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。