本文へ移動

Karakuriからくり

8つの標準のパズルで遊び、探索や再現できる物理を使い、ポインターやキーボードで操作する盤を表示できます。

「からくり」は、仕組みや工夫した装置を表す言葉です。 名前について(英語)

目次

リファレンス · 操作とキャンバスの表示

Theme型

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

The colours and sizes a game draws with, read from the page's custom properties (--kk-*) so that it follows light, dark and the family's cloths.

インポート

import type { Theme } from "@johnmorrisdotca/karakuri/play";

ほかのエクスポート元: @johnmorrisdotca/karakuri

定義

interface Theme {
    board: string;
    deep: string;
    ink: string;
    muted: string;
    accent: string;
    good: string;
    bad: string;
    gold: string;
    water: string;
    lava: string;
    stone: string;
    paper: string;
    dark: boolean;
    font: string;
    lang: "en" | "ja";
}

メンバー

名前型説明
boardstring

The play area's floor.

deepstring

The darker ground, for grooves and shadows.

inkstring
mutedstring
accentstring

The line the player draws, and highlights.

goodstring
badstring
goldstring
waterstring
lavastring
stonestring
paperstring

A light colour that reads on accent, bad and the game colours.

darkboolean
fontstring
lang"en" | "ja"

The language words drawn on the canvas are in.

例

import type { Theme } from "@johnmorrisdotca/karakuri/play";
import { defaultTheme } from "@johnmorrisdotca/karakuri/play";

const value: Theme = defaultTheme();
console.log(value);
{
  board: '#f6f1e6',
  deep: '#e4dcc9',
  ink: '#2b2a28',
  muted: '#8a8473',
  accent: '#2f6f55',
  good: '#2f8f5b',
  bad: '#c2453a',
  gold: '#e0a82e',
  water: '#3b8fd9',
  lava: '#e8561f',
  stone: '#8d8a82',
  paper: '#fffdf7',
  dark: false,
  font: 'system-ui, sans-serif',
  lang: 'en'
}

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

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

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