default定数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The flag of Hong Kong SAR China (中華人民共和国香港特別行政区), HK, drawn again by hand at 1:1 by flag-icons 7.5.0 (MIT), as an SVG string: viewBox 512 by 512, 655 B.
The drawing flag("HK", { 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/hk.1x1";
定義
const svg: string = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path fill=\"#ec1b2e\" d=\"M0 0h512v512H0\"/><path id=\"hata-hk-1x1-a\" fill=\"#fff\" d=\"M282.3 119.2C203 114 166.6 218 241.6 256.4 215.6 234 221 201 231.5 184l1.9 1c-13.8 23.6-11.2 52.8 11 71-12.6-12.2-9.4-39 12.2-48.8s23.6-39.3 16.4-49.1q-14.7-25.6 9.3-39zM243.9 180l-4.7 7.4-1.8-8.6-8.6-2.3 7.8-4.3-.6-9 6.5 6.2 8.3-3.3-3.7 8 5.6 6.9z\"/><use href=\"#hata-hk-1x1-a\" transform=\"rotate(72 248.5 259.5)\"/><use href=\"#hata-hk-1x1-a\" transform=\"rotate(144 248.5 259.5)\"/><use href=\"#hata-hk-1x1-a\" transform=\"rotate(216 248.5 259.5)\"/><use href=\"#hata-hk-1x1-a\" transform=\"rotate(288 248.5 259.5)\"/></svg>"
例
例 1
import square from "@johnmorrisdotca/hata/flags/hk.1x1";
const host=document.createElement("div");
host.innerHTML = square;
console.log(host.querySelector("svg")?.getAttribute("viewBox"));例 2
import { svg } from "@johnmorrisdotca/hata/flags/hk.1x1";
console.log(svg.startsWith("<svg"),svg.length);true 655出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。