Add DevBanner

This commit is contained in:
Fred Boniface 2023-08-18 21:02:03 +01:00
parent f5a73f20e5
commit 680fb68ce2
2 changed files with 24 additions and 0 deletions

19
src/lib/DevBanner.svelte Normal file
View File

@ -0,0 +1,19 @@
<div id="banner">DEVMODE</div>
<style>
#banner {
width: 200px;
background: red;
color: #fff;
position: fixed;
text-align: center;
top: 25px;
line-height: 40px;
right: -50px;
left: auto;
-ms-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
z-index: 100;
}
</style>

View File

@ -1,5 +1,7 @@
<script> <script>
import '../app.css'; import '../app.css';
import { dev } from '$app/environment';
import DevBanner from '$lib/DevBanner.svelte';
</script> </script>
<svelte:head> <svelte:head>
@ -14,4 +16,7 @@
<link rel="manifest" href="/manifest.json" /> <link rel="manifest" href="/manifest.json" />
<title>OwlBoard</title> <title>OwlBoard</title>
</svelte:head> </svelte:head>
{#if dev}
<DevBanner />
{/if}
<slot /> <slot />