本文へ移動

Hata旗

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

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

目次

リファレンス · SH--UNION-FLAGの旗のSVG

svg定数

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

The Union Flag: one of the flags of St. Helena (セントヘレナ), SH, in real use, as an SVG string: viewBox 60 by 30 (2:1), 634 B. From Wikimedia Commons, "Flag of the United Kingdom (1-2).svg" (public domain). flag("SH", { variant: "union-flag" }) loads it, and variantsOf("SH") says its status, dates and why it is offered.

インポート

import { svg } from "@johnmorrisdotca/hata/flags/sh--union-flag";

定義

const svg: string = "<svg data-hata=\"sh--union-flag\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 60 30\"><clipPath id=\"hata-sh--union-flag-a\"><path d=\"M0 0v30h60V0z\"/></clipPath><clipPath id=\"hata-sh--union-flag-b\"><path d=\"M30 15h30v15zv15H0zH0V0zV0h30z\"/></clipPath><g clip-path=\"url(#hata-sh--union-flag-a)\"><path fill=\"#012169\" d=\"M0 0v30h60V0z\"/><path stroke=\"#fff\" stroke-width=\"6\" d=\"m0 0 60 30m0-30L0 30\"/><path stroke=\"#c8102e\" stroke-width=\"4\" d=\"m0 0 60 30m0-30L0 30\" clip-path=\"url(#hata-sh--union-flag-b)\"/><path stroke=\"#fff\" stroke-width=\"10\" d=\"M30 0v30M0 15h60\"/><path stroke=\"#c8102e\" stroke-width=\"6\" d=\"M30 0v30M0 15h60\"/></g></svg>"

例

例 1

import flag from "@johnmorrisdotca/hata/flags/sh--union-flag";

const host=document.createElement("div");
host.innerHTML = flag;
console.log(host.querySelector("svg")?.getAttribute("viewBox"));

例 2

import { svg } from "@johnmorrisdotca/hata/flags/sh--union-flag";
console.log(svg.startsWith("<svg"),svg.length);
true 634

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

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

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