mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-08-20 09:39:02 +02:00
* Some HTML/CSS improvement suggestions by Anne Zheng
This commit is contained in:
parent
6d8336209f
commit
c80d2a0dea
@ -1,57 +1,114 @@
|
|||||||
body {
|
* {
|
||||||
text-align: left;
|
box-sizing: border-box;
|
||||||
background: #ffffff;
|
margin: 0;
|
||||||
}
|
padding: 0;
|
||||||
|
}
|
||||||
#tetris {
|
|
||||||
display: flex;
|
body {
|
||||||
font: "16px Roboto";
|
font-family: 'Roboto', serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
#my-canvas {
|
#tetris {
|
||||||
background: #ffffff;
|
display: flex;
|
||||||
margin-left: 10px;
|
width: 540px;
|
||||||
margin-top: 10px;
|
margin: 3em auto;
|
||||||
width: 300px;
|
}
|
||||||
height: 480px;
|
|
||||||
}
|
#my-canvas {
|
||||||
|
width: 300px;
|
||||||
.btn-primary {
|
height: 480px;
|
||||||
margin: 10px;
|
}
|
||||||
background-color: lightskyblue;
|
|
||||||
border-radius: 3px;
|
#info {
|
||||||
border: 2px solid;
|
display: grid;
|
||||||
height: 30px;
|
grid-row-gap: 0.5em;
|
||||||
padding-right: 15px;
|
height: 470px;
|
||||||
padding-left: 15px;
|
grid-template-rows: 2fr 1fr 1fr 1fr 6.5fr 1fr;
|
||||||
font-weight: bold;
|
}
|
||||||
}
|
|
||||||
|
#info > #logo {
|
||||||
.envelope {
|
grid-row: 1;
|
||||||
border-width: medium;
|
}
|
||||||
border-color: grey;
|
|
||||||
margin-left: 10px;
|
#info > #score-envelope {
|
||||||
margin-top: 10px;
|
grid-row: 2;
|
||||||
display: flex;
|
border: 2px solid grey;
|
||||||
border-spacing: 5px;
|
border-radius: 5px;
|
||||||
border-style: solid;
|
display: flex;
|
||||||
border-radius: 4px;
|
align-items: center;
|
||||||
padding: 3px;
|
font-weight: bold;
|
||||||
font-weight: bold;
|
}
|
||||||
color: #194a8d;
|
|
||||||
}
|
#info > #level-envelope {
|
||||||
|
grid-row: 3;
|
||||||
.label {
|
border: 2px solid grey;
|
||||||
margin-right:20px;
|
border-radius: 5px;
|
||||||
}
|
display: flex;
|
||||||
#score-envelope {
|
align-items: center;
|
||||||
}
|
font-weight: bold;
|
||||||
#level-envelope {
|
}
|
||||||
}
|
|
||||||
|
#info > #status-envelope {
|
||||||
#status-envelope {
|
grid-row: 4;
|
||||||
}
|
border: 2px solid grey;
|
||||||
|
border-radius: 5px;
|
||||||
#controls-envelope {
|
display: flex;
|
||||||
display: block; !important
|
align-items: center;
|
||||||
}
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
#info > #controls-envelope {
|
||||||
|
grid-row: 5;
|
||||||
|
border: 2px solid grey;
|
||||||
|
border-radius: 5px;
|
||||||
|
padding-top: 0.5em;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#info > #btn-reset {
|
||||||
|
grid-row: 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
#controls > p {
|
||||||
|
border-radius: 5px;
|
||||||
|
background: #b8caf4;
|
||||||
|
margin: 0.4em;
|
||||||
|
padding: 0.5em;
|
||||||
|
cursor: pointer;
|
||||||
|
box-shadow: 0.05em 0.1em rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-right: 0.5em;
|
||||||
|
padding-left: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.source {
|
||||||
|
display: flex;
|
||||||
|
width: 540px;
|
||||||
|
margin: -40px auto;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
input{
|
||||||
|
border: 0;
|
||||||
|
width: 70%;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
button{
|
||||||
|
background: #2B60DE;
|
||||||
|
color: #eee;
|
||||||
|
font-weight: bold;
|
||||||
|
border: 0;
|
||||||
|
padding: 12px 0;
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 5px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
<!doctype html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="wideth=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/all.min.css">
|
||||||
<link rel="stylesheet" type="text/css" href="tetris.css">
|
<link rel="stylesheet" type="text/css" href="tetris.css">
|
||||||
<title>Tetris using pas2js</title>
|
<title>Tetris using pas2js</title>
|
||||||
<script src="tetris.js"></script>
|
<script src="tetris.js"></script>
|
||||||
@ -14,7 +16,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="info">
|
<div id="info">
|
||||||
<div id="logo">
|
<div id="logo">
|
||||||
<img id="logo-img" src="tetrislogo.png" width="161" height="54"/>
|
<img id="logo-img" src="tetrislogo.png" width="80%"/>
|
||||||
</div>
|
</div>
|
||||||
<div id="score-envelope" class="envelope">
|
<div id="score-envelope" class="envelope">
|
||||||
<div id="score-label" class="label">Score:</div>
|
<div id="score-label" class="label">Score:</div>
|
||||||
@ -31,17 +33,19 @@
|
|||||||
<div id="controls-envelope" class="envelope">
|
<div id="controls-envelope" class="envelope">
|
||||||
<div id="controls-label" class="label">Controls:</div>
|
<div id="controls-label" class="label">Controls:</div>
|
||||||
<div id="controls">
|
<div id="controls">
|
||||||
<p><span id="control-left">Arrow-Left:</span> Move left</p>
|
<p><span id="control-left"><i class="fas fa-arrow-left"></i> Arrow-Left:</span> Move left</p>
|
||||||
<p><span id="control-right">Arrow-Right:</span> Move right</p>
|
<p><span id="control-right"><i class="fas fa-arrow-right"></i> Arrow-Right:</span> Move right</p>
|
||||||
<p><span id="control-down">Arrow-Down:</span> Move down</p>
|
<p><span id="control-down"><i class="fas fa-arrow-down"></i> Arrow-Down:</span> Move down</p>
|
||||||
<p><span id="control-rotate">Arrow-up:</span> Rotate block</p>
|
<p><span id="control-rotate"><i class="fas fa-arrow-up"></i> Arrow-Up:</span> Rotate block</p>
|
||||||
<p><span id="control-drop">Space bar:</span> Drop block</p>
|
<p><span id="control-drop"><i class="fas fa-square"></i> Space bar:</span> Drop block</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button id="btn-reset" class="btn-primary">Restart</button>
|
<button id="btn-reset" class="btn-primary">Restart</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
Sources: <a target="new" href="tetris.lpr">Program</a> <a target="new" href="utetris.pp">unit</a>.
|
<div class="source">
|
||||||
|
Sources: <a target="new" href="tetris.lpr">Program</a> <a target="new" href="utetris.pp">unit</a>.
|
||||||
|
</div>
|
||||||
<script>
|
<script>
|
||||||
window.addEventListener("load", rtl.run);
|
window.addEventListener("load", rtl.run);
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user