svg定数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The flag of Malaysia (マレーシア), MY, drawn again by hand at 4:3 by flag-icons 7.5.0 (MIT), as an SVG string: viewBox 640 by 480, 1.2 KB.
The drawing flag("MY", { 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 { svg } from "@johnmorrisdotca/hata/flags/my.4x3";
定義
const svg: string = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 480\"><g clip-path=\"url(#hata-my-4x3-a)\"><path fill=\"#c00\" d=\"M0 0h640v480H0z\"/><path fill=\"#c00\" d=\"M0 0h640v34.3H0z\"/><path fill=\"#fff\" d=\"M0 34.3h640v34.3H0z\"/><path fill=\"#c00\" d=\"M0 68.6h640v34.3H0z\"/><path fill=\"#fff\" d=\"M0 102.9h640V137H0z\"/><path fill=\"#c00\" d=\"M0 137.1h640v34.3H0z\"/><path fill=\"#fff\" d=\"M0 171.4h640v34.3H0z\"/><path fill=\"#c00\" d=\"M0 205.7h640V240H0z\"/><path fill=\"#fff\" d=\"M0 240h640v34.3H0z\"/><path fill=\"#c00\" d=\"M0 274.3h640v34.3H0z\"/><path fill=\"#fff\" d=\"M0 308.6h640v34.3H0z\"/><path fill=\"#c00\" d=\"M0 342.9h640V377H0z\"/><path fill=\"#fff\" d=\"M0 377.1h640v34.3H0z\"/><path fill=\"#c00\" d=\"M0 411.4h640v34.3H0z\"/><path fill=\"#fff\" d=\"M0 445.7h640V480H0z\"/><path fill=\"#006\" d=\"M0 .5h320v274.3H0z\"/><path fill=\"#fc0\" d=\"m207.5 73.8 6 40.7 23-34-12.4 39.2 35.5-20.8-28.1 30 41-3.2-38.3 14.8 38.3 14.8-41-3.2 28.1 30-35.5-20.8 12.3 39.3-23-34.1-6 40.7-5.9-40.7-23 34 12.4-39.2-35.5 20.8 28-30-41 3.2 38.4-14.8-38.3-14.8 41 3.2-28.1-30 35.5 20.8-12.4-39.3 23 34.1zm-33.3 1.7a71 71 0 0 0-100 65 71 71 0 0 0 100 65 80 80 0 0 1-83.2 6.2 80 80 0 0 1-43.4-71.2 80 80 0 0 1 126.6-65\"/></g><defs><clipPath id=\"hata-my-4x3-a\"><path fill=\"#fff\" d=\"M0 0h640v480H0z\"/></clipPath></defs></svg>"
例
例 1
import square from "@johnmorrisdotca/hata/flags/my.4x3";
const host=document.createElement("div");
host.innerHTML = square;
console.log(host.querySelector("svg")?.getAttribute("viewBox"));例 2
import { svg } from "@johnmorrisdotca/hata/flags/my.4x3";
console.log(svg.startsWith("<svg"),svg.length);true 1261出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。