diff --git a/client/board.js b/client/board.js new file mode 100644 index 0000000..e6e5b11 --- /dev/null +++ b/client/board.js @@ -0,0 +1,18 @@ +// traverse HTML and fill in table + +const BoardLookup = { + '3LS': 'x3 Letter Score', + '2LS': 'x2 Letter Score', + '3WS': 'x3 Word Score', + '2WS': 'x2 Word Scre', + '★': 'x2 Word Score' +}; + +const BoardLocations = { + 'A1': '2WS' + + +}; + + + diff --git a/client/dragable.js b/client/dragable.js new file mode 100644 index 0000000..35b048f --- /dev/null +++ b/client/dragable.js @@ -0,0 +1,29 @@ +// I decided not to use the drag and drop API +// purely because its very ugly + +document.querySelector('#game-container').addEventListener('mousemove', mouseMove); +document.querySelector('#game-container').addEventListener('mouseup', mouseUp); + +document.querySelectorAll('piece').forEach(element => { + element.addEventListener('mousedown', e => mouseDown(e, element)); +}); + +function mouseDown(event, element = 'none') +{ + event.preventDefault(); + + console.log(element, event); +} + +function mouseMove(event, element = 'none') +{ + event.preventDefault(); + +} + +function mouseUp(event, element = 'none') +{ + event.preventDefault(); + + console.log(element, event); +} diff --git a/client/game.css b/client/game.css index dfcba50..63dd82e 100644 --- a/client/game.css +++ b/client/game.css @@ -1,28 +1,68 @@ +#game-container { + border: 1px dotted black; + padding-bottom: 20%; +} + +#game-inventory-table { + display: table; + + max-width: 70%; + + text-align: center; + font-size: 3.2vw; +} + +.game-inventory-cell { + display: table-cell; +} + +piece { + cursor: move; + border: 1px solid black; + background-color: blanchedalmond; + width: 100%; + height: 0; + padding-bottom: 5%; +} + #game-board { display: table; - text-align: center; - font-size: 10px; + table-layout: fixed; - width: 50%; + position: static; + width: 100%; + height: 100%; + + max-height: 70%; + max-width: 70%; + + text-align: center; + font-size: 3.2vw; /* roughly 15 / table width */ } .game-board-header { display: table-row-group; - background-color: gray; } .game-board-header-cell { display: table-cell; + + width: 100%; + height: 0; + padding-bottom: 1%; } .game-board-col-header { display: table-column-group; - background-color: gray; } .game-board-col-header-cell { display: table-cell; + + width: 100%; + height: 0; + padding-bottom: 1%; } .game-board-row { @@ -31,21 +71,31 @@ .game-board-cell { display: table-cell; - /* width: 5%; */ + + width: 100%; + height: 0; + padding-bottom: 1%; + + font-size: 2vw; /* roughly 15 / table width */ + background: radial-gradient(circle, rgba(255,255,255,1) 38%, rgba(244,244,244,1) 94%); } .double-word { - + background: radial-gradient(circle, rgba(255,180,243,1) 32%, rgba(255,159,245,1) 84%); } .tripple-word { - + background: radial-gradient(circle, rgba(249,129,117,1) 32%, rgba(252,101,101,1) 84%); } .tripple-letter { - + background: radial-gradient(circle, rgba(185,180,255,1) 32%, rgba(180,159,255,1) 84%); } .double-letter { - + background: radial-gradient(circle, rgba(170,230,255,1) 32%, rgba(159,204,255,1) 84%); +} + +.center-star { + background: lightsalmon; } diff --git a/client/game.html b/client/game.html index b090b11..63a3126 100644 --- a/client/game.html +++ b/client/game.html @@ -6,6 +6,7 @@ +
+ +