本文へ移動

Jarajaraジャラジャラ

麻雀牌を描き、手牌や積み重ねた盤を配置し、シード付きの「合わせ」をひとりでも対戦卓でも遊べます。

「ジャラジャラ」は麻雀牌が触れ合う音を表す言葉です。 名前について(英語)

目次

リファレンス

牌と卓の要素

import { … } from "@johnmorrisdotca/jarajara/element";

最小化と gzip 圧縮をしたサイズは 97.7 kB(読み込むものをすべて含み、esbuild で計測)

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

Jarajara's custom elements, as classes, with nothing defined: import this to extend them or to define them under other names. @johnmorrisdotca/jarajara/element/define defines the lot as <jarajara-tile>, <jarajara-rack>, <jarajara-layout>, <jarajara-table>, <jarajara-group>, <jarajara-set> and <jarajara-viewer>. Safe to import on a server, where there is no page: the classes then extend nothing.

エクスポート

名前種類概要
Allowance型How many of a thing a game allows: a number, or no limit at all.
allowanceOf関数Read an allowance from an attribute: nothing or unlimited is no limit, off or 0 is none, a number is that many.
defineRack関数Register a rack under its standard tag or a host's own tag.
ELEMENT_SIZES定数The sizes every element takes, as a tile's width in pixels.
followLanguage関数Redraw an element when the page changes its language (<html lang>), as a language chooser does, until the function returned is called.
hintPair関数What a hint is: the free pair that leaves the stacks lowest after it, so a hint never digs a tile deeper than it must.
JarajaraGroupクラスA GROUP OF TILES, SHOWN: <jarajara-group group="winds">, the four winds with their names and how many of each the set holds.
JarajaraLayoutクラスA GAME OF AWASE ON ANY PAGE: <jarajara-layout size="15">, a stacked layout of tiles drawn on a cloth, with the rules of the solitaire in it: tap a free tile, then its match, and the pair goes.
JarajaraRackクラスA RACK OF TILES ON ANY PAGE, lined up in front of you: <jarajara-rack tiles="123m456p789s1112z">.
JarajaraSetクラスTHE WHOLE SET, SHOWN: <jarajara-set>, all 42 faces by suit with how many of each the 144 tiles hold, or, with tiles, what a hand or a wall holds of it: each face as have/total, faces it has none of dimmed.
JarajaraTableクラスAWASE AT A TABLE, ON ANY PAGE: <jarajara-table players="3">, two to four players round one layout, each taking a free pair in turn: the seats with their winds and scores, the layout on a cloth, and computers playing the seats that are not people's.
JarajaraTileクラスONE TILE ON ANY PAGE: <jarajara-tile code="F">, in any design and with any back, face up or face down, turned over by a tap when it has flip.
JarajaraViewerクラスA TILE LOOKED UP BY ITS CODE, NAME OR KEY: <jarajara-viewer query="east"> shows the tile big, with what it is called in English and in Japanese, its code, suit and rank, how many the set holds, what a pair of them scores at the table, and how a hand writes it.
languageOf関数The language an element speaks: its own lang, or the nearest one above it, or the page's; Japanese for anything that starts ja.
MOST_SOUNDING定数The most clicks sounding at one moment, across every element on the page.
RackDetail型How the rack lies, for the page to hear of: what is turned, raised and marked (by place in tiles), and how the tiles are put in order.
RackLayoutOptions型How a rack is laid out.
RackPlace型One tile's place: across and down in tile widths from where the rack starts.
rackPlaces関数Where each of count tiles lies, in order: the first at x 0, each a step on, groups set apart, raised tiles lifted.
RackTurnOptions型How a rack's tiles are turned face down or face up.
rackWidth関数How wide a rack is, in tile widths: the last tile's place and the tile itself.
setPageSounds関数Give every element on the page another player for its sounds: a page's own, or a test's stand-in that only records what was asked.
SpinOptions型How a tile is spun.
STRINGS定数THE WORDS THE ELEMENTS SAY, to a screen reader and in their own captions, in the two languages the family speaks.
TileRef型Tiles as a method is given them: a number is the place of one tile in the rack as it was written (tiles), from 0; a letter or a name ("F", "east", "3p") is every tile of that face; a list is each of its parts.

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

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