X-Git-Url: https://git.cworth.org/git?p=lmno.games;a=blobdiff_plain;f=scribe%2Fscribe.jsx;h=548a0edc826c44258bf05af1e2cdc73325d7da18;hp=78155949f782174a6ff40d2a80c7b5948f715868;hb=3eded2a202f7b3d636e4b76e3c9aa0c32e2bae3f;hpb=e7e45fef427d3d76f7f88ca919c73e28de5a301b diff --git a/scribe/scribe.jsx b/scribe/scribe.jsx index 7815594..548a0ed 100644 --- a/scribe/scribe.jsx +++ b/scribe/scribe.jsx @@ -79,6 +79,123 @@ events.addEventListener("game-state", event => { * Game and supporting classes * *********************************************************/ +const scribe_glyphs = [ + { + name: "Single", + squares: [1,0,0, + 0,0,0, + 0,0,0] + }, + { + name: "Double", + squares: [1,1,0, + 0,0,0, + 0,0,0] + }, + { + name: "Line", + squares: [1,1,1, + 0,0,0, + 0,0,0] + }, + { + name: "Pipe", + squares: [0,0,1, + 1,1,1, + 0,0,0] + }, + { + name: "Squat-T", + squares: [1,1,1, + 0,1,0, + 0,0,0] + }, + { + name: "4-block", + squares: [1,1,0, + 1,1,0, + 0,0,0] + }, + { + name: "T", + squares: [1,1,1, + 0,1,0, + 0,1,0] + }, + { + name: "Cross", + squares: [0,1,0, + 1,1,1, + 0,1,0] + }, + { + name: "6-block", + squares: [1,1,1, + 1,1,1, + 0,0,0] + }, + { + name: "Bomber", + squares: [1,1,1, + 0,1,1, + 0,0,1] + }, + { + name: "Chair", + squares: [0,0,1, + 1,1,1, + 1,0,1] + }, + { + name: "J", + squares: [0,0,1, + 1,0,1, + 1,1,1] + }, + { + name: "Earring", + squares: [0,1,1, + 1,0,1, + 1,1,1] + }, + { + name: "House", + squares: [0,1,0, + 1,1,1, + 1,1,1] + }, + { + name: "H", + squares: [1,0,1, + 1,1,1, + 1,0,1] + }, + { + name: "U", + squares: [1,0,1, + 1,0,1, + 1,1,1] + }, + { + name: "Ottoman", + squares: [1,1,1, + 1,1,1, + 1,0,1] + }, + { + name: "O", + squares: [1,1,1, + 1,0,1, + 1,1,1] + }, + { + name: "9-block", + squares: [1,1,1, + 1,1,1, + 1,1,1] + } +]; + function copy_to_clipboard(id) { const tmp = document.createElement("input"); @@ -165,6 +282,50 @@ function PlayerInfo(props) { ); } +function Glyph(props) { + + const glyph_dots = []; + + let last_square = 0; + for (let i = 0; i < 9; i++) { + if (props.squares[i]) + last_square = i; + } + + const height = Math.floor(20 * (Math.floor(last_square / 3) + 1)); + + const viewbox=`0 0 60 ${height}`; + + for (let row = 0; row < 3; row++) { + for (let col = 0; col < 3; col++) { + if (props.squares[3 * row + col]) { + let cy = 10 + 20 * row; + let cx = 10 + 20 * col; + glyph_dots.push( + + ); + } + } + } + + return (
+ {props.name} +
+ + + {glyph_dots} + + +
+
+ ); +} + function Square(props) { let className = "square"; @@ -415,6 +576,19 @@ class Game extends React.Component { onClick={(i,j) => this.handle_click(i, j, first_move)} /> + , +
+ { + scribe_glyphs.map(glyph => { + return ( + + ); + }) + }
]; }