options as index

This commit is contained in:
Adrien MALINGREY 2019-10-27 18:59:44 +01:00
parent 32b1799c6b
commit 209f48699d
5 changed files with 128 additions and 38 deletions

54
css/index.css Normal file
View File

@ -0,0 +1,54 @@
@font-face {
font-family: 'Share Tech';
font-style: normal;
font-weight: 400;
src: local('Share Tech Regular'), local('ShareTech-Regular'), url(../fonts/ShareTech.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
* {
padding: 0;
margin: 0;
color: white;
font-family: 'Share Tech';
font-size: 1.05em;
}
body {
background-image: url("../images/bg.jpg");
background-size: cover;
}
h1 {
font-size: 3em;
margin: 40px 20px 20px 20px;
text-shadow: 3px 2px rgb(153, 145, 175);
text-align: center;
}
button {
color: black;
width: 100%;
}
.actions {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-gap: 20px;
margin: 40px auto;
width: 700px;
justify-items: left;
}
.cookie {
margin: 40px 0 0 0;
font-size: 0.8em;
justify-self: center;
width: auto;
grid-column: 1 / 5;
}
.play {
grid-column: 2 / 4;
justify-self: center;
}

View File

@ -4,8 +4,8 @@
font-weight: 400;
src: local('Share Tech Regular'), local('ShareTech-Regular'), url(../fonts/ShareTech.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
}
@font-face {
font-family: 'Share Tech Mono';
font-style: normal;
font-weight: 400;
@ -13,33 +13,42 @@
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
* {
* {
padding: 0;
margin: 0;
color: white;
}
font-family: 'Share Tech';
}
body {
background-image: url("../images/bg.jpg");
background-size: cover;
}
h1 {
font-size: 3em;
margin: 40px 20px 20px 20px;
text-shadow: 3px 2px rgb(153, 145, 175);
text-align: center;
}
canvas {
display: block;
flex-shrink: 0;
}
.columns {
.flex-columns {
display: flex;
flex-direction: row;
justify-content: center;
margin: auto;
}
.space {
.flex-space {
flex-grow: 2;
}
.rows {
.flex-rows {
display: flex;
flex-direction: column;
margin: 5% 2%;
@ -47,23 +56,24 @@ canvas {
}
.hold {
max-width: 120px;
width: 120px;
}
.stats {
display: flex;
flex-direction: row;
margin: 10% 0;
font-size: 2.5vw;
font-size: 1.2em;
width: 120px;
}
.stats-names {
font-family: 'Share Tech';
text-align: left;
}
.stats-values {
text-align: right;
min-width: 15vw;
font-family: 'Share Tech Mono';
}
@ -73,6 +83,6 @@ canvas {
}
.next {
max-width: 120px;
width: 120px;
margin: 5% 2%;
}

View File

@ -3,35 +3,26 @@
<head>
<meta charset="utf-8" />
<title>Webtris</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<!--[if lt IE 9]><script type="text/javascript" src="js/excanvas.js"></script><![endif]-->
<script type="text/javascript" src="js/webtris.js"></script>
<link rel="stylesheet" type="text/css" href="css/index.css" />
</head>
<body>
<div class="columns">
<div class="space"></div>
<div class="rows">
<div class="columns">
<div class="space"></div>
<canvas id="hold" class="hold" width="120" height="120"></canvas>
<h1>WEBTRIS</h1>
<form action="webtris.html" method="post">
<div class="actions">
<div>GAUCHE</div><button type="button">ArrowLeft</button>
<div>DROITE</div><button type="button">ArrowRight</button>
<div>CHUTE LENTE</div><button type="button">ArrowDown</button>
<div>CHUTE RAPIDE</div><button type="button">Space</button>
<div>ROTATION HORAIRE</div><button type="button">ArrowUp</button>
<div>ROTATION INVERSE</div><button type="button">z</button>
<div>GARDE</div><button type="button">c</button>
<div>PAUSE</div><button type="button">Escape</button>
<div class="cookie">
<input type="checkbox" id="cookie" name="cookie">
<label for="cookie">Utiliser un cookie pour enregistrer les préférences sur cet ordinateur ?</label>
</div>
<div class="space"></div>
<div class="stats">
<div class="stats-names">
SCORE<br/>
HIGH<br/>
LEVEL<br/>
GOAL<br/>
LINES<br/>
TIME<br/>
</div>
<div id="stats-values" class="stats-values"></div>
</div>
</div>
<canvas id="matrix" class="matrix" width="200" height="400">Votre navigateur ne supporte pas HTML5, veuillez le mettre à jour pour jouer.</canvas>
<canvas id="next" class="next" width="120" height="400"></canvas>
<div class="space"></div>
<button type="submit" class="play">PLAY</button>
</div>
</form>
</body>
</html>

View File

@ -413,7 +413,6 @@ class Matrix {
this.piece.draw(this.context, ghost_pos)
// Lines cleared
console.log(this.linesCleared.length)
if (this.linesCleared.length) {
this.context.save()
this.context.shadowColor = "white"

36
webtris.html Normal file
View File

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Webtris</title>
<link rel="stylesheet" type="text/css" href="css/webtris.css" />
<!--[if lt IE 9]><script type="text/javascript" src="js/excanvas.js"></script><![endif]-->
<script type="text/javascript" src="js/webtris.js"></script>
</head>
<body>
<h1>WEBTRIS</h1>
<div class="flex-columns">
<div class="flex-rows">
<div class="flex-columns">
<div class="flex-space"></div>
<canvas id="hold" class="hold" width="120" height="120"></canvas>
</div>
<div class="flex-space"></div>
<div class="stats">
<div class="stats-names">
SCORE<br/>
HIGH<br/>
LEVEL<br/>
GOAL<br/>
LINES<br/>
TIME<br/>
</div>
<div id="stats-values" class="stats-values"></div>
</div>
</div>
<canvas id="matrix" class="matrix" width="200" height="400">Votre navigateur ne supporte pas HTML5, veuillez le mettre à jour pour jouer.</canvas>
<canvas id="next" class="next" width="120" height="400"></canvas>
</div>
</body>
</html>