added help page (closes #15)

This commit is contained in:
Nathan DECHER
2020-04-06 22:03:20 +02:00
parent e34e7e07bd
commit a87b4679f4
5 changed files with 109 additions and 0 deletions
+16
View File
@@ -162,6 +162,22 @@
location.hash='menu';
};
// show help page
help=async () => {
stopGame();
let iframe=document.createElement('iframe');
iframe.src='help.html';
iframe.style.width='100%';
iframe.style.height='100%';
await new Popup(
"Help",
[iframe],
{ok: "OK"},
true
).display();
location.hash='menu';
};
// display the win popup
handleWin=async snek => {
// hide the HUD
+16
View File
@@ -0,0 +1,16 @@
.help {
display: block;
article {
margin-bottom: 2ex;
}
section {
margin-bottom: 1ex;
}
ul {
margin-left: 2ex;
font-size: 1.6em;
}
}
+1
View File
@@ -48,6 +48,7 @@
flex-direction: column;
align-items: center;
overflow-y: auto;
flex: 1;
& > * {
margin: .5rem;
+12
View File
@@ -31,6 +31,10 @@ h1, h2, h3, h4, h5, h6 {
margin-bottom: .1em;
}
p + p {
margin-top: 1em;
}
a {
text-decoration: inherit;
display: contents;
@@ -40,6 +44,11 @@ em {
font-style: italic;
}
code {
background: @accentbg;
font-weight: bold;
}
header, footer {
background: @accentbg;
@@ -131,3 +140,6 @@ p {
// setup the hud
@import 'hud';
// setup the help file
@import 'help';