本文へ移動

Hata旗

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

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

目次

リファレンス · BR-MAの旗のSVG

default定数

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

The flag of Maranhão (マラニョン州), BR-MA, as an SVG string: viewBox 1350 by 900 (3:2), 900 B. From Wikimedia Commons, "Bandeira do Maranhão.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 value from "@johnmorrisdotca/hata/flags/br-ma";

定義

const svg: string = "<svg data-hata=\"br-ma\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1350 900\"><defs><g id=\"hata-br-ma-c\" transform=\"scale(168.75)\"><g id=\"hata-br-ma-b\"><path id=\"hata-br-ma-a\" fill=\"#fff\" d=\"M0 0v1h.5z\" transform=\"translate(0,-1) rotate(18)\"/><use href=\"#hata-br-ma-a\" transform=\"scale(-1,1)\"/></g><use href=\"#hata-br-ma-b\" transform=\"rotate(72)\"/><use href=\"#hata-br-ma-b\" transform=\"rotate(-72)\"/><use href=\"#hata-br-ma-b\" transform=\"rotate(144)\"/><use href=\"#hata-br-ma-b\" transform=\"rotate(-144)\"/></g></defs><rect width=\"100%\" height=\"100%\" fill=\"#fff\"/><rect width=\"100%\" height=\"100\" fill=\"#c53425\"/><rect width=\"100%\" height=\"100\" y=\"400\" fill=\"#c53425\"/><rect width=\"100%\" height=\"100\" y=\"800\" fill=\"#c53425\"/><rect width=\"100%\" height=\"100\" y=\"200\"/><rect width=\"100%\" height=\"100\" y=\"600\"/><rect width=\"450\" height=\"50%\" fill=\"#25247b\"/><use x=\"225\" y=\"225\" href=\"#hata-br-ma-c\"/></svg>"

例

例 1

import flag from "@johnmorrisdotca/hata/flags/br-ma";

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/br-ma";
console.log(svg.startsWith("<svg"),svg.length);
true 900

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

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

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