mirror of
https://github.com/MewoLab/AquaDX.git
synced 2025-10-25 12:02:40 +00:00
[+] register notice
This commit is contained in:
parent
2dc53cfbd7
commit
f6aa7d1fe3
32
AquaNet/src/components/MunetRegisterBanner.svelte
Normal file
32
AquaNet/src/components/MunetRegisterBanner.svelte
Normal file
@ -0,0 +1,32 @@
|
||||
<script lang="ts">
|
||||
export let username: string;
|
||||
export let email: string;
|
||||
|
||||
let shouldShow = navigator.language.startsWith('zh');
|
||||
|
||||
// 会导致瞬间出现,但是不知道为什么 svelte 的 transition 动画不工作
|
||||
// if (!shouldShow) {
|
||||
// fetch('https://47.122.72.135/ip/isChina')
|
||||
// .then(it => it.json())
|
||||
// .then(it => shouldShow = it)
|
||||
// .catch(() => shouldShow = false);
|
||||
// }
|
||||
|
||||
const jump = () => {
|
||||
const params = new URLSearchParams();
|
||||
if (username) params.set('username', username);
|
||||
if (email) params.set('email', email);
|
||||
location.href = `https://portal.mumur.net/register?${params.toString()}`;
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if shouldShow}
|
||||
<div class="cursor-pointer" on:click={jump}>
|
||||
<h2>MuNET 了解一下!</h2>
|
||||
<div>
|
||||
<p>MuNET 是 AquaDX 的继任者,提供更适合中国用户的服务器和更好的游戏体验。</p>
|
||||
<p>如果你还没有游戏数据,建议在 MuNET 上创建账号并开始游戏。点击立即前往</p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@ -2,9 +2,7 @@
|
||||
import { fade } from "svelte/transition"
|
||||
import { t } from "../../libs/i18n";
|
||||
import ActionCard from "../../components/ActionCard.svelte";
|
||||
import StatusOverlays from "../../components/StatusOverlays.svelte";
|
||||
import { CARD, GAME, USER } from "../../libs/sdk";
|
||||
import Icon from "@iconify/svelte";
|
||||
|
||||
export let username: string;
|
||||
let shouldShow = navigator.language.startsWith('zh');
|
||||
@ -60,7 +58,6 @@
|
||||
{/if}
|
||||
|
||||
<style lang="sass">
|
||||
@use "../../vars"
|
||||
h3
|
||||
font-size: 1.3rem
|
||||
margin: 0
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
import Icon from "@iconify/svelte";
|
||||
import { USER } from "../libs/sdk";
|
||||
import { t } from "../libs/i18n"
|
||||
import MunetRegisterBanner from "../components/MunetRegisterBanner.svelte";
|
||||
|
||||
let params = new URLSearchParams(window.location.search)
|
||||
|
||||
@ -220,6 +221,9 @@
|
||||
on:turnstile-expired={_ => window.location.reload()}
|
||||
on:turnstile-timeout={_ => console.log(error = t('welcome.turnstile-timeout'))} />
|
||||
{/if}
|
||||
{#if isSignup}
|
||||
<MunetRegisterBanner username={username} email={email}/>
|
||||
{/if}
|
||||
</div>
|
||||
{:else if state === "submitreset"}
|
||||
<div class="login-form" transition:slide>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user