mirror of
https://github.com/danbulant/heaventaker
synced 2026-07-07 04:00:40 +00:00
Basic game overlay
This commit is contained in:
parent
44c7088ced
commit
5a44a5fe6c
6 changed files with 57 additions and 0 deletions
BIN
images/png/game_overlay.png
Normal file
BIN
images/png/game_overlay.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 268 KiB |
|
|
@ -11,6 +11,8 @@ body {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
font-family: 'Times New Roman W', 'Times New Roman', Times, serif;
|
||||||
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
|
|
|
||||||
BIN
public/sprite/game_overlay.webp
Normal file
BIN
public/sprite/game_overlay.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
|
|
@ -4,6 +4,7 @@
|
||||||
import Overlay from "./pages/overlay.svelte";
|
import Overlay from "./pages/overlay.svelte";
|
||||||
import { characters } from "./stores/characters.js";
|
import { characters } from "./stores/characters.js";
|
||||||
import { dialog } from "./stores/dialog.js";
|
import { dialog } from "./stores/dialog.js";
|
||||||
|
import Game from "./pages/game.svelte";
|
||||||
|
|
||||||
var page = "game";
|
var page = "game";
|
||||||
var current = localStorage.getItem("dialog-page") || 0;
|
var current = localStorage.getItem("dialog-page") || 0;
|
||||||
|
|
@ -45,6 +46,8 @@
|
||||||
<title>Heaventaker</title>
|
<title>Heaventaker</title>
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
|
<Game />
|
||||||
|
|
||||||
<Overlay active={gameActive}>
|
<Overlay active={gameActive}>
|
||||||
<Dialog bind:current {characters} bind:page />
|
<Dialog bind:current {characters} bind:page />
|
||||||
</Overlay>
|
</Overlay>
|
||||||
|
|
|
||||||
7
src/pages/game.svelte
Normal file
7
src/pages/game.svelte
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
<script>
|
||||||
|
import GameOverlay from "./gameOverlay.svelte";
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<GameOverlay steps={11} chapter={"I"} />
|
||||||
45
src/pages/gameOverlay.svelte
Normal file
45
src/pages/gameOverlay.svelte
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
<script>
|
||||||
|
export var steps;
|
||||||
|
export var chapter;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="overlay">
|
||||||
|
<img src="/sprite/game_overlay.webp" alt="" class="left" draggable={false}>
|
||||||
|
<div class="left-info">{steps}</div>
|
||||||
|
<img src="/sprite/game_overlay.webp" alt="" class="right" draggable={false}>
|
||||||
|
<div class="right-info">{chapter}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.left {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
height: 100vh;
|
||||||
|
transform: scaleX(-1);
|
||||||
|
}
|
||||||
|
.left-info {
|
||||||
|
position: fixed;
|
||||||
|
top: 72vh;
|
||||||
|
font-size: 13vh;
|
||||||
|
left: 16vh;
|
||||||
|
color: white;
|
||||||
|
width: 24vh;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.right {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
|
.right-info {
|
||||||
|
position: fixed;
|
||||||
|
top: 72vh;
|
||||||
|
font-size: 13vh;
|
||||||
|
right: 16vh;
|
||||||
|
color: white;
|
||||||
|
width: 24vh;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in a new issue