svg定数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The flag of São Tomé & Príncipe (サントメ・プリンシペ), ST, drawn again by hand at 4:3 by flag-icons 7.5.0 (MIT), as an SVG string: viewBox 640 by 480, 873 B.
The drawing flag("ST", { 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/st.4x3";
定義
const svg: string = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 480\"><path fill=\"#12ad2b\" d=\"M0 0h640v480H0z\"/><path fill=\"#ffce00\" d=\"M0 137.1h640V343H0z\"/><path fill=\"#d21034\" d=\"M0 0v480l240-240\"/><g id=\"hata-st-4x3-c\" transform=\"translate(351.6 240)scale(.34286)\"><g id=\"hata-st-4x3-b\"><path id=\"hata-st-4x3-a\" fill=\"#000001\" d=\"M0-200V0h100\" transform=\"rotate(18 0 -200)\"/><use width=\"100%\" height=\"100%\" href=\"#hata-st-4x3-a\" transform=\"scale(-1 1)\"/></g><use width=\"100%\" height=\"100%\" href=\"#hata-st-4x3-b\" transform=\"rotate(72)\"/><use width=\"100%\" height=\"100%\" href=\"#hata-st-4x3-b\" transform=\"rotate(144)\"/><use width=\"100%\" height=\"100%\" href=\"#hata-st-4x3-b\" transform=\"rotate(-144)\"/><use width=\"100%\" height=\"100%\" href=\"#hata-st-4x3-b\" transform=\"rotate(-72)\"/></g><use width=\"100%\" height=\"100%\" x=\"700\" href=\"#hata-st-4x3-c\" transform=\"translate(-523.2)\"/></svg>"
例
例 1
import square from "@johnmorrisdotca/hata/flags/st.4x3";
const host=document.createElement("div");
host.innerHTML = square;
console.log(host.querySelector("svg")?.getAttribute("viewBox"));例 2
import { svg } from "@johnmorrisdotca/hata/flags/st.4x3";
console.log(svg.startsWith("<svg"),svg.length);true 873出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。