[feat] added license

This commit is contained in:
kwaroran
2023-07-19 22:01:23 +09:00
parent dfc27df7c7
commit 07f6117a01
13 changed files with 269 additions and 106 deletions

View File

@@ -8,6 +8,8 @@
import { User } from 'lucide-svelte';
import { hubURL } from 'src/ts/characterCards';
import TextInput from '../UI/GUI/TextInput.svelte';
import { openURL } from 'src/ts/storage/globalApi';
import Button from '../UI/GUI/Button.svelte';
let btn
let input = ''
@@ -56,49 +58,70 @@
{@html msg}
{/await}
</span>
{:else if $alertStore.type === 'tos'}
<!-- svelte-ignore a11y-missing-attribute -->
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div class="text-white">You should accept RisuRealm's <a class="text-green-600 hover:text-green-500 transition-colors duration-200 cursor-pointer" on:click={() => {
openURL('https://sv.risuai.xyz/hub/tos')
}}>Terms of Service</a> to continue</div>
{:else if $alertStore.type !== 'select'}
<span class="text-gray-300">{$alertStore.msg}</span>
{/if}
{#if $alertStore.type === 'ask'}
<div class="flex gap-2 w-full">
<button bind:this={btn} class="mt-4 border-borderc bg-transparent outline-none border-solid border-1 p-2 text-lg text-neutral-200 hover:bg-green-500 transition-colors flex-1 focus:border-3" on:click={() => {
<Button className="mt-4 flex-grow" on:click={() => {
alertStore.set({
type: 'none',
msg: 'yes'
})
}}>YES</button>
<button class="mt-4 border-borderc bg-transparent outline-none border-solid border-1 p-2 text-lg text-neutral-200 hover:bg-red-500 transition-colors focus:border-3 flex-1" on:click={() => {
}}>YES</Button>
<Button className="mt-4 flex-grow" on:click={() => {
alertStore.set({
type: 'none',
msg: 'no'
})
}}>NO</button>
}}>NO</Button>
</div>
{:else if $alertStore.type === 'tos'}
<div class="flex gap-2 w-full">
<Button className="mt-4 flex-grow" on:click={() => {
alertStore.set({
type: 'none',
msg: 'yes'
})
}}>Accept</Button>
<Button className="mt-4 flex-grow" on:click={() => {
alertStore.set({
type: 'none',
msg: 'no'
})
}}>Do not Accept</Button>
</div>
{:else if $alertStore.type === 'select'}
{#each $alertStore.msg.split('||') as n, i}
<button bind:this={btn} class="mt-4 border-borderc bg-transparent outline-none border-solid border-1 p-2 text-lg text-neutral-200 hover:bg-green-500 transition-colors focus:border-3" on:click={() => {
<Button className="mt-4" on:click={() => {
alertStore.set({
type: 'none',
msg: i.toString()
})
}}>{n}</button>
}}>{n}</Button>
{/each}
{:else if $alertStore.type === 'error' || $alertStore.type === 'normal' || $alertStore.type === 'markdown'}
<button bind:this={btn} class="mt-4 border-borderc bg-transparent outline-none border-solid border-1 p-2 text-lg text-neutral-200 hover:bg-green-500 transition-colors focus:border-3" on:click={() => {
<Button bind:this={btn} className="mt-4" on:click={() => {
alertStore.set({
type: 'none',
msg: ''
})
}}>OK</button>
}}>OK</Button>
{:else if $alertStore.type === 'input'}
<TextInput value="" id="alert-input" autocomplete="off"/>
<button bind:this={btn} class="mt-4 border-borderc bg-transparent outline-none border-solid border-1 p-2 text-lg text-neutral-200 hover:bg-green-500 transition-colors focus:border-3" on:click={() => {
<TextInput value="" id="alert-input" autocomplete="off" marginTop />
<Button className="mt-4" on:click={() => {
alertStore.set({
type: 'none',
//@ts-ignore
msg: document.querySelector('#alert-input')?.value
})
}}>OK</button>
}}>OK</Button>
{:else if $alertStore.type === 'login'}
<div class="fixed top-0 left-0 bg-black bg-opacity-50 w-full h-full flex justify-center items-center">
<iframe src={hubURL + '/hub/login'} title="login" class="w-full h-full">