default定数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The flag of Rwanda (ルワンダ), RW, drawn again by hand at 4:3 by flag-icons 7.5.0 (MIT), as an SVG string: viewBox 640 by 480, 666 B.
The drawing flag("RW", { 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/rw.4x3";
定義
const svg: string = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 480\"><path fill=\"#20603d\" d=\"M0 0h640v480H0z\"/><path fill=\"#fad201\" d=\"M0 0h640v360H0z\"/><path fill=\"#00a1de\" d=\"M0 0h640v240H0z\"/><g transform=\"translate(511 125.4)scale(.66667)\"><g id=\"hata-rw-4x3-b\"><path id=\"hata-rw-4x3-a\" fill=\"#e5be01\" d=\"M116.1 0 35.7 4.7l76.4 25.4-78.8-16.3L100.6 58l-72-36.2L82 82.1 21.9 28.6l36.2 72-44.3-67.3L30 112 4.7 35.7 0 116.1-1-1z\"/><use width=\"100%\" height=\"100%\" href=\"#hata-rw-4x3-a\" transform=\"scale(1 -1)\"/></g><use width=\"100%\" height=\"100%\" href=\"#hata-rw-4x3-b\" transform=\"scale(-1 1)\"/><circle r=\"34.3\" fill=\"#e5be01\" stroke=\"#00a1de\" stroke-width=\"3.4\"/></g></svg>"
例
例 1
import square from "@johnmorrisdotca/hata/flags/rw.4x3";
const host=document.createElement("div");
host.innerHTML = square;
console.log(host.querySelector("svg")?.getAttribute("viewBox"));例 2
import { svg } from "@johnmorrisdotca/hata/flags/rw.4x3";
console.log(svg.startsWith("<svg"),svg.length);true 666出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。