本文へ移動

Koyomi Calendars暦

カレンダーのページをSVGで描きます。1日を18種類のアイコンで、1か月をポスターや卓上カレンダーで、そして日めくりも使えます。

「暦」(こよみ) は、カレンダーのことです。 名前について(英語)

目次

リファレンス · カレンダーアイコン

calendarLayout関数

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

The box, the page and the year's room of a theme, with and without a year.

A weekend page places its numerals on the diagonal, on purpose, the same for every weekend.

インポート

import { calendarLayout } from "@johnmorrisdotca/koyomi-calendars";

定義

function calendarLayout(theme: CalendarTheme, withYear: boolean, weekend?: boolean): CalendarLayout & { box: Rect; numeral: "centre" | "diagonal"; }

引数

名前型説明
theme"pins" | "loops" | "shadow" | "heavy" | "cartoon" | "flip" | "stack" | "line" | "curl" | "soft" | "desk" | "thin" | "frame" | "badge" | "sun" | "roll" | "plain" | "squircle"

The design to measure.

withYearboolean

Whether the icon shows a year, which takes room.

weekend (省略可)boolean

Whether to lay out a weekend page (only the designs that have one answer differently).

戻り値

CalendarLayout & { box: Rect; numeral: "centre" | "diagonal"; }

The theme's box (x, y, width, height), the page the day is centred in, the yearZone, and whether the numerals sit in the centre or on the diagonal.

例

import { calendarLayout } from "@johnmorrisdotca/koyomi-calendars";

const layout = calendarLayout("squircle", true);
console.log(layout.box.join(" "), layout.numeral);
0 0 256 256 centre

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

ソースを見るGitHub で編集@johnmorrisdotca/koyomi-calendars 0.3.0 のソースから作成しました。

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