small changes

This commit is contained in:
Adrien MALINGREY 2019-10-28 00:47:15 +01:00
parent d04fc53849
commit 46c2782e4e
3 changed files with 12 additions and 16 deletions

View File

@ -7,8 +7,6 @@
} }
* { * {
padding: 0;
margin: 0;
color: white; color: white;
font-family: 'Share Tech'; font-family: 'Share Tech';
font-size: 1.05em; font-size: 1.05em;
@ -31,6 +29,11 @@ button {
width: 100%; width: 100%;
} }
a {
color: lightcyan;
text-decoration: none;
}
.actions { .actions {
display: grid; display: grid;
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(4, 1fr);
@ -41,11 +44,7 @@ button {
} }
.play { .play {
grid-column: 2 / 4;
text-align: center; text-align: center;
text-decoration: none;
text-shadow: 2px 1px rgb(153, 145, 175); text-shadow: 2px 1px rgb(153, 145, 175);
font-size: 1.5em; font-size: 1.5em;
width: 70%;
margin: 40px;
} }

View File

@ -8,9 +8,10 @@
</head> </head>
<body> <body>
<h1>WEBTRIS</h1> <h1>WEBTRIS</h1>
<div class="actions"> <div class="actions" id="actions">
<script>loadButtons()</script> </div>
<a href="webtris.html" class="play"><b>JOUER</b></a> <div class="play">
<a href="webtris.html"><b>JOUER</b></a>
</div> </div>
</body> </body>
</html> </html>

View File

@ -29,14 +29,10 @@ function getKey(action) {
return key return key
} }
function loadButtons() { window.onload = function() {
document.open() document.getElementById("actions").innerHTML = actionLabel.map(action => `<div>${action.label}</div>
document.write(
actionLabel.map(action => `<div>${action.label}</div>
<button type="button" onclick="changeKey(this, '${action.name}')">${getKey(action.name)}</button> <button type="button" onclick="changeKey(this, '${action.name}')">${getKey(action.name)}</button>
`).join("\n") `).join("\n")
)
document.close()
} }
function changeKey(button, action) { function changeKey(button, action) {