mirror of
https://github.com/OpenLiberty/liberty-bikes.git
synced 2024-11-27 01:20:01 +08:00
Improve landscape layout across device sizes
This commit is contained in:
parent
55078e8b24
commit
f5c73f1af2
@ -1,11 +1,14 @@
|
||||
<div id="titlebar" class="navbar">
|
||||
<h1>Liberty Bikes</h1>
|
||||
</div>
|
||||
<div id="game-buttons" class="navbar">
|
||||
<button type="button" (click)="startGame()">Start Game</button>
|
||||
<button type="button" (click)="requeue()">Requeue</button>
|
||||
</div>
|
||||
<div id="controller" [style.height.px]="windowHeight">
|
||||
<canvas id="dpad-canvas" width="800" height="800"></canvas>
|
||||
<div id="controls-container" [style.height.px]="windowHeight">
|
||||
<div id="titlebar" class="navbar">
|
||||
<h1>Liberty Bikes</h1>
|
||||
</div>
|
||||
<div id="game-buttons" class="navbar">
|
||||
<button type="button" (click)="startGame()">Start Game</button>
|
||||
<button type="button" (click)="requeue()">Requeue</button>
|
||||
</div>
|
||||
<div id="controller">
|
||||
<canvas id="dpad-canvas" width="800" height="800"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -13,6 +13,17 @@ body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#controls-container {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
|
||||
width: 100%;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
|
||||
@ -29,6 +40,8 @@ body {
|
||||
top: 0;
|
||||
width: 100%;
|
||||
|
||||
background: none;
|
||||
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@ -57,6 +70,8 @@ body {
|
||||
width: 100%;
|
||||
|
||||
padding: 0px 5px;
|
||||
|
||||
border-top: 1px solid white;
|
||||
}
|
||||
|
||||
#game-buttons button {
|
||||
@ -79,25 +94,61 @@ body {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
@media screen and (max-height: 465px) {
|
||||
#titlebar h1 {
|
||||
font-size: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (orientation: landscape) {
|
||||
:host {
|
||||
#controls-container {
|
||||
display: grid;
|
||||
grid-template-rows: 1fr 1fr;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-template-columns: auto 1fr;
|
||||
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
#titlebar {
|
||||
position: relative;
|
||||
grid-area: 1 / 2;
|
||||
|
||||
background: none;
|
||||
height: 100%;
|
||||
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
#game-buttons {
|
||||
position: relative;
|
||||
grid-area: 2 / 2;
|
||||
|
||||
height: 100%;
|
||||
|
||||
justify-content: space-around;
|
||||
align-items: flex-start;
|
||||
|
||||
border-top: none;
|
||||
background: none;
|
||||
}
|
||||
|
||||
#game-buttons button {
|
||||
width: 150px;
|
||||
height: 100px;
|
||||
letter-spacing: unset;
|
||||
}
|
||||
|
||||
#controller {
|
||||
grid-area: 1 / 1 / span 2 / span 1;
|
||||
grid-template: calc(100vmin - #{($titlebar) * 2}) / calc(100vmin - #{($titlebar) * 2});
|
||||
}
|
||||
|
||||
@media screen and (max-height: 320px), screen and (max-width: 569px) {
|
||||
#game-buttons button {
|
||||
height: 50px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user