本文へ移動

Hata旗

国や地域の旗を読み込み、対応する表示の形を選び、絵ごとの資料・作者・ライセンスを保てます。

「旗(はた)」は、旗を表す日本語です。 名前について(英語)

目次

リファレンス · US-TNの旗のSVG

svg定数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

The flag of Tennessee (テネシー州), US-TN, as an SVG string: viewBox 240 by 144 (5:3), 880 B. From Wikimedia Commons, "Flag of Tennessee.svg" (public domain); the /manifest entry gives its author, licence and why it was chosen. It has a viewBox and no width or height, so it fills the box it is put in at its own aspect ratio.

インポート

import { svg } from "@johnmorrisdotca/hata/flags/us-tn";

定義

const svg: string = "<svg data-hata=\"us-tn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 240 144\"><path fill=\"#c00\" d=\"M0 0h240v144H0z\"/><path fill=\"#fff\" d=\"M222 0h18v144h-18z\"/><path fill=\"#002d65\" d=\"M225 0h15v144h-15z\"/><path fill=\"#002d65\" d=\"M225 0h15v144h-15z\"/><g transform=\"translate(111,72)\"><circle r=\"39\" fill=\"#fff\"/><circle r=\"36\" fill=\"#002d65\"/><g id=\"hata-us-tn-c\" fill=\"#fff\" transform=\"rotate(18) translate(0,18.5)\"><g id=\"hata-us-tn-b\"><path id=\"hata-us-tn-a\" d=\"M0-17V0h9\" transform=\"rotate(18 0,-17)\"/><use href=\"#hata-us-tn-a\" transform=\"scale(-1,1)\"/></g><use href=\"#hata-us-tn-b\" transform=\"rotate(72)\"/><use href=\"#hata-us-tn-b\" transform=\"rotate(144)\"/><use href=\"#hata-us-tn-b\" transform=\"rotate(216)\"/><use href=\"#hata-us-tn-b\" transform=\"rotate(288)\"/></g><use href=\"#hata-us-tn-c\" transform=\"rotate(120)\"/><use href=\"#hata-us-tn-c\" transform=\"rotate(240)\"/></g></svg>"

例

例 1

import flag from "@johnmorrisdotca/hata/flags/us-tn";

const host=document.createElement("div");
host.innerHTML = flag; // or toDataUri(flag) from "@johnmorrisdotca/hata" for an <img src>
console.log(host.querySelector("svg")?.getAttribute("viewBox"));

例 2

import { svg } from "@johnmorrisdotca/hata/flags/us-tn";
console.log(svg.startsWith("<svg"),svg.length);
true 880

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/hata 1.6.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。