[feat] hide realm

This commit is contained in:
kwaroran
2023-07-29 10:00:32 +09:00
parent 22e780d6a1
commit 5d8a23bd36
4 changed files with 31 additions and 21 deletions

View File

@@ -397,4 +397,5 @@ export const languageEnglish = {
isNull: "is not set", isNull: "is not set",
ifChatIndex: "If chat index", ifChatIndex: "If chat index",
ifRandom: "If random", ifRandom: "If random",
hideRealm: "Hide RisuRealm",
} }

View File

@@ -84,6 +84,10 @@
<Check bind:check={$DataBase.showMemoryLimit} name={language.showMemoryLimit}/> <Check bind:check={$DataBase.showMemoryLimit} name={language.showMemoryLimit}/>
</div> </div>
<div class="flex items-center mt-2">
<Check bind:check={$DataBase.hideRealm} name={language.hideRealm}/>
</div>
<div class="flex items-center mt-2"> <div class="flex items-center mt-2">
<Check check={$DataBase.customBackground !== ''} onChange={async (check) => { <Check check={$DataBase.customBackground !== ''} onChange={async (check) => {
if(check){ if(check){

View File

@@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { appVer, webAppSubVer } from "src/ts/storage/database"; import { DataBase, appVer, webAppSubVer } from "src/ts/storage/database";
import GithubStars from "../Others/GithubStars.svelte"; import GithubStars from "../Others/GithubStars.svelte";
import Hub from "./Realm/RealmMain.svelte"; import Hub from "./Realm/RealmMain.svelte";
import { sideBarStore } from "src/ts/stores"; import { sideBarStore } from "src/ts/stores";
@@ -34,26 +34,30 @@
<span class="mt-2 text-gray-400 text-start">{language.officialDiscordDesc}</span> <span class="mt-2 text-gray-400 text-start">{language.officialDiscordDesc}</span>
</button> </button>
</div> </div>
{#await getRisuHub({ <div class="mt-4 mb-4 w-full border-t border-t-selected"></div>
search: '', <h1 class="text-2xl font-bold">Recent Characters from {language.hub} <button class="text-base font-medium float-right p-1 bg-darkbg rounded-md hover:ring" on:click={() => {
page: -10, openHub = true
nsfw: false, }}>Get More</button></h1>
sort: '' {#if !$DataBase.hideRealm}
}) then charas} {#await getRisuHub({
<div class="mt-4 mb-4 w-full border-t border-t-selected"></div> search: '',
<h1 class="text-2xl font-bold">Recent Characters from {language.hub} <button class="text-base font-medium float-right p-1 bg-darkbg rounded-md hover:ring" on:click={() => { page: -10,
openHub = true nsfw: false,
}}>Get More</button></h1> sort: ''
{#if charas.length > 0} }) then charas}
<div class="w-full flex gap-4 p-2 flex-wrap justify-center"> {#if charas.length > 0}
{#each charas as chara} <div class="w-full flex gap-4 p-2 flex-wrap justify-center">
<RisuHubIcon onClick={() => {openHub = true}} chara={chara} /> {#each charas as chara}
{/each} <RisuHubIcon onClick={() => {openHub = true}} chara={chara} />
</div> {/each}
{:else} </div>
<div class="text-gray-500">Failed to load {language.hub}...</div> {:else}
{/if} <div class="text-gray-500">Failed to load {language.hub}...</div>
{/await} {/if}
{/await}
{:else}
<div class="text-gray-500">{language.hideRealm}</div>
{/if}
{:else} {:else}
<div class="flex items-center mt-4"> <div class="flex items-center mt-4">
<button class="mr-2 text-gray-400 hover:text-green-500" on:click={() => (openHub = false)}> <button class="mr-2 text-gray-400 hover:text-green-500" on:click={() => (openHub = false)}>

View File

@@ -591,6 +591,7 @@ export interface Database{
animationSpeed:number animationSpeed:number
botSettingAtStart:false botSettingAtStart:false
NAIsettings:NAISettings NAIsettings:NAISettings
hideRealm:boolean
} }
interface hordeConfig{ interface hordeConfig{