workadventure/front/src/Components/WarningContainer/WarningContainer.svelte

45 lines
1.2 KiB
Svelte
Raw Normal View History

<script lang="typescript">
2021-12-06 16:12:37 +01:00
import { fly } from "svelte/transition";
import { userIsAdminStore, limitMapStore } from "../../Stores/GameStore";
2021-12-06 16:12:37 +01:00
import { ADMIN_URL } from "../../Enum/EnvironmentVariable";
2022-01-21 17:06:03 +01:00
import LL from "../../i18n/i18n-svelte";
2021-12-06 16:12:37 +01:00
const upgradeLink = ADMIN_URL + "/pricing";
const registerLink = ADMIN_URL + "/second-step-register";
</script>
2021-12-06 16:12:37 +01:00
<main class="warningMain" transition:fly={{ y: -200, duration: 500 }}>
{#if $userIsAdminStore}
2022-01-21 17:06:03 +01:00
<h2>{$LL.warning.title()}</h2>
2021-12-06 16:12:37 +01:00
<p>
2022-01-21 17:06:03 +01:00
{$LL.warning.content({ upgradeLink })}
2021-12-06 16:12:37 +01:00
</p>
{:else if $limitMapStore}
<p>
This map is available for 2 days. You can register your domain <a href={registerLink}>here</a>!
</p>
{:else}
2022-01-21 17:06:03 +01:00
<h2>{$LL.warning.title()}</h2>
<p>{$LL.warning.limit()}</p>
2021-12-06 16:12:37 +01:00
{/if}
</main>
<style lang="scss">
2021-12-06 16:12:37 +01:00
main.warningMain {
pointer-events: auto;
width: 100vw;
background-color: red;
text-align: center;
position: absolute;
left: 50%;
transform: translate(-50%, 0);
font-family: Lato;
min-width: 300px;
opacity: 0.9;
z-index: 2;
h2 {
2021-12-06 16:12:37 +01:00
padding: 5px;
}
}
2021-12-06 16:12:37 +01:00
</style>