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. |
withYear | boolean | 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出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。