JSFiddle - React, Tailwind, and code Playground
HTML
<!-- Here will be Sssssnake -->
<body>
<div class="offset"></div>
<div class="container">
<canvas id="snake" />
</div>
</body>
CSS
* {
box-sizing: border-box;
}
html, body {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
background-color: black;
}
.offset {
height: 10%;
}
.container {
height: 80%;
width: 80%;
margin: 0 auto;
}
canvas {
height: 100%;
width: 100%;
border: 0.5em solid white;
border-radius: 0.5em;
}
JavaScript
function Game(canvas) {
this.ctx = canvas.getContext('2d');
}
Game.prototype.draw = function(){};
function Snake(len) {
}
Snake.prototype.step = function(){};
function Cell(x, y, width) {
}