Skip to content

Commit

Permalink
Add help modal
Browse files Browse the repository at this point in the history
  • Loading branch information
cassidoo committed Dec 29, 2018
1 parent ba85022 commit d9fd584
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 3 deletions.
11 changes: 11 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@
</div>
<div class="board" id="board">
</div>
<div class="help">
<img src="question-circle.svg" alt="how to play" />
<div class="helptext" tabindex="0">
<h3>How to Play</h3>
<p>
Click on the pancakes to add or remove butter from itself, plus the
ones on the top, left, bottom, and right of the pancake you clicked.
<br>Get butter on all of the pancakes to win!
</p>
</div>
</div>
<button class="volume">
<img src="volume-high.svg" id="vol" alt="volume" />
</button>
Expand Down
48 changes: 45 additions & 3 deletions main.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ body {
background: linear-gradient(to right, #f88f83 0%, #f56fe5 100%);
}

.help {
position: absolute;
bottom: 20px;
left: 20px;
width: 100px;
background: transparent;
border: none;
}

.volume {
position: absolute;
bottom: 20px;
Expand All @@ -102,10 +111,32 @@ body {
border: none;
}

.volume img {
.help img, .volume img {
width: 80px;
}

.helptext {
display: none;
position: absolute;
bottom: 20px;
left: 110px;
width: 600px;
padding: 15px;
background: #272039;
border-radius: 20px;
box-shadow: 0 5px 0 10px #211931;
box-sizing: border-box;
}

.helptext h3, .helptext p {
margin: 0;
}

.help:focus .helptext,
.help:hover .helptext {
display: block;
}

.board {
position: absolute;
top: 50%;
Expand Down Expand Up @@ -315,16 +346,27 @@ body {
width: 60px;
height: 36px;
}
.volume {
.help, .volume {
position: absolute;
bottom: auto;
right: auto;
top: 5px;
left: 5px;
width: 60px;
}
.volume img {
.help {
left: 70px;
}
.help img, .volume img {
width: 50px;
}
.helptext {
position: fixed;
top: 70px;
left: 0;
min-width: 300px;
width: 100%;
max-height: 180px;
}
}

Expand Down

0 comments on commit d9fd584

Please sign in to comment.