default定数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The flag of Türkiye (トルコ), TR, drawn again by hand at 1:1 by flag-icons 7.5.0 (MIT), as an SVG string: viewBox 512 by 512, 514 B.
The drawing flag("TR", { 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 value from "@johnmorrisdotca/hata/flags/tr.1x1";
定義
const svg: string = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><g fill-rule=\"evenodd\"><path fill=\"#e30a17\" d=\"M0 0h512v512H0z\"/><path fill=\"#fff\" d=\"M348.8 264c0 70.6-58.3 127.9-130.1 127.9s-130.1-57.3-130.1-128 58.2-127.8 130-127.8S348.9 193.3 348.9 264z\"/><path fill=\"#e30a17\" d=\"M355.3 264c0 56.5-46.6 102.3-104.1 102.3s-104-45.8-104-102.3 46.5-102.3 104-102.3 104 45.8 104 102.3z\"/><path fill=\"#fff\" d=\"m374.1 204.2-1 47.3-44.2 12 43.5 15.5-1 43.3 28.3-33.8 42.9 14.8-24.8-36.3 30.2-36.1-46.4 12.8z\"/></g></svg>"
例
例 1
import square from "@johnmorrisdotca/hata/flags/tr.1x1";
const host=document.createElement("div");
host.innerHTML = square;
console.log(host.querySelector("svg")?.getAttribute("viewBox"));例 2
import { svg } from "@johnmorrisdotca/hata/flags/tr.1x1";
console.log(svg.startsWith("<svg"),svg.length);true 514出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。