本文へ移動

Jarajaraジャラジャラ

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

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

目次

リファレンス

SVGの図柄と見た目

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

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

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

The tiles, drawn: each of the 42 faces as SVG text, a tile on its own, its back, and a whole layout of stacked tiles, on a cloth if you like. Strings, not components, so they go into any page with any framework or none.

エクスポート

名前種類概要
backBase関数The colour of a back's plate, which is also the colour of the tile's thickness seen from the back: a built-in back's own base (with the caller's colour), a design's body, or null for a name with no back here.
blockColours関数The colours of a design's blocks, from its own: the back plate is colours.body (the green of most real tiles unless the design says another, or the caller's body), the ivory layer a shade of the face, and the seam round the face is the design's rim if it stands out from the face, otherwise a line that does: darker on a light face, lighter on a dark one.
BlockColours型The colours a block is drawn in.
BlockDirection型Which way a view lifts the layers and shows the thickness: x is 1 when each layer is lifted to the right (and the thickness shows on the left), -1 the other way round; y is 1 when it is lifted upward (thickness below), -1 downward.
blockSvg関数The block drawn behind a face: the back plate and the ivory layer in steps from the far side to the face, and the shading of the sides (the side the light falls on lighter, the other darker).
Cloth型A cloth's name.
CLOTHS定数The cloths, in the order the family lists them.
clothVars関数A cloth as CSS custom properties (--jarajara-felt, --jarajara-felt-deep, --jarajara-felt-ink); nothing for a name that is not a cloth.
directionOf関数The direction a view draws in.
faceEdgeSvg関数The outline and the raised edge laid over a face, in the face's own units.
faceWords関数What a face is called, in English: "3 of characters", "east wind", "red dragon", "plum (flower)".
isBuiltInBack関数Whether a name is one of the five backs drawn here.
isCloth関数Whether a text names a cloth.
isTileDesignName関数Whether a text names one of the designs.
isTileMirror関数Whether a text names a view.
JARAJARA_CLOTHS定数THE CLOTHS A TABLE MAY BE LAID IN: the same five the whole family offers, and itsutsu.com's boards: green (the family's own), blue, red, black, and wood.
jarajaraDesign関数Jarajara's own design as a design, made the first time it is asked for: the 42 faces, its jade back and the plain ivory tile.
layoutBox関数The drawing's width and height for a layout's size, room left for the thickness and the layers.
layoutFrame関数THE TILES' DRAWN EXTENT, plus an even margin: the smallest box that holds every tile of a layout as it is drawn, with its thickness and its layer offsets, in whichever view (mirror) puts them.
LayoutFrame型The drawing's viewBox: where it starts and how large it is, in the face's units.
layoutSvg関数The whole layout as one <svg>, the tiles in cells where they lie (a face letter a slot, "." for one taken).
LayoutSvgOptions型Native tile, highlight, artwork, cloth and layout-view choices for SVG rendering.
loadTileDesign関数A design by name.
RED_FIVE_CODES定数The codes of the fives of characters, circles and bamboo: the tiles a set may make red.
redFiveIndexes関数WHICH TILES OF A LIST ARE THE RED FIVES.
shadowSvg関数The shadow a tile casts on what lies under it: soft, in three widening layers, falling the way the thickness shows and reaching further the higher the tile (layer 0 is a tile on the table: a tight contact shadow).
TILE_BACKS定数THE BACKS OF THE TILES, drawn as SVG in the tile's own 30 by 40: what a tile lying face down shows.
TILE_BODY定数The tile itself: its ivory face, the rim round it, the bone of its side (the sliver a flat picture shows) and the green of the back plate its thickness is drawn in.
TILE_BOX定数The box a solid tile is drawn in, in the face's units: the face, its thickness down and to the left, and a margin for the outlines.
TILE_DEPTH定数How thick a tile is, and so how far each layer is lifted, in the face's units.
TILE_DESIGNS定数THE DESIGNS A TILE MAY BE DRAWN IN.
TILE_FONT定数The fonts the characters are drawn in, Japanese serif first; a page may load its own and name it here.
TILE_INK定数The inks a face is drawn in.
TILE_MARKS定数The marks a page may put on tiles: the one chosen, ones hinted, the matches Find lights, and a wash over the blocked.
TILE_MIRRORS定数The ways a board may be looked at: as it is, turned left to right, turned top to bottom, or both.
TILE_SIZE定数THE FACES OF THE TILES, as SVG text: a Japanese-style set in the plainest strokes that still read at thirty pixels.
tileAt関数Where a slot's tile face is drawn, raised by its layer along the thickness's direction.
tileBackDrawing関数The back of a tile in a design, plate and pattern, fitted to the tile's 30 by 40.
tileBackFace関数A back's plate and pattern in the tile's 30 by 40, without the sliver of side or the <svg>: the inside of a <symbol>, or the back an element puts behind a tile it turns over.
TileBackName型A back's name: one of the five drawn here, or a design's own (riichi, riichi-black).
TileBackOptions型How a back is drawn.
tileBackSvg関数One tile's back on its own, as a whole <svg> in the same box as tileSvg: the back plate over a solid block, its thickness showing on two sides (the back plate's own colour, with the ivory layer beyond it).
tileBodySvg関数The tile's own plate in a design, fitted to the tile's 30 by 40; null for a design that draws the plain rounded rectangle.
tileColours関数The colours of a tile's rim and thickness: a design's, or Jarajara's own ivory and jade.
TileDesign型A SET OF DRAWN TILES, a design: how the tile itself is drawn, its back, and each face's picture.
TileDesignName型A design's name.
tileFaceSvg関数One face's drawing, in the tile's own 30 by 40, with no tile under it: the inside of a <symbol> or a <g>, for a board that draws its own tiles.
tileFaceSymbols関数Every face as a <symbol> in one <defs>, ids <prefix>-<code>, so a board of 144 tiles draws 42 pictures and places each with a <use>.
TileMirror型One of the four views.
tileSvg関数One tile on its own, as a whole <svg>: a solid block, the face on its ivory over a back plate whose thickness shows on two sides, named for a screen reader.
TileSvgOptions型How a tile on its own is drawn.
TileSymbolOptions型How a set of symbols is made.

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

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