[feat] pop level & author name realm
This commit is contained in:
@@ -398,4 +398,5 @@ export const languageEnglish = {
|
||||
ifChatIndex: "If chat index",
|
||||
ifRandom: "If random",
|
||||
hideRealm: "Hide RisuRealm",
|
||||
popularityLevel: "Popularity Level {}",
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
import { parseMarkdownSafe } from "src/ts/parser";
|
||||
import { DataBase } from "src/ts/storage/database";
|
||||
import RealmLicense from "./RealmLicense.svelte";
|
||||
import { characterFormatUpdate } from "src/ts/characters";
|
||||
|
||||
export let openedData:hubType
|
||||
|
||||
@@ -19,6 +20,9 @@
|
||||
<div class="p-6 max-w-full bg-darkbg rounded-md flex flex-col gap-4 w-2xl overflow-y-auto">
|
||||
<div class="w-full flex flex-col">
|
||||
<h1 class="text-2xl font-bold max-w-full overflow-hidden whitespace-nowrap text-ellipsis">{openedData.name}</h1>
|
||||
{#if openedData.creatorName}
|
||||
<span class="text-gray-500">{openedData.creatorName}</span>
|
||||
{/if}
|
||||
<div class="flex justify-start gap-4 mt-4">
|
||||
<img class="h-36 w-36 rounded-md object-top object-cover" alt={openedData.name} src={`${hubURL}/resource/` + openedData.img}>
|
||||
<span class="text-gray-400 break-words text-base chattext prose prose-invert">
|
||||
@@ -34,7 +38,7 @@
|
||||
</div>
|
||||
<div class="flex flex-wrap w-full flex-row gap-1 mt-2">
|
||||
<span class="text-gray-500">
|
||||
{language.chatAssumed.replace('{}', openedData.download.toString())}
|
||||
{language.popularityLevel.replace('{}', openedData.download.toString())}
|
||||
</span>
|
||||
<div class="border-l-selected border-l ml-1 mr-1"></div>
|
||||
{#if openedData.hasEmotion}
|
||||
|
||||
@@ -42,26 +42,23 @@
|
||||
|
||||
{/if}
|
||||
<div class="flex items-center flex-wrap mt-4">
|
||||
<button class="bg-bgcolor p-2 rounded-lg" class:ring-1={!privateMode} on:click={() => {privateMode = false}}>🌏 Public</button>
|
||||
<!-- <button class="bg-bgcolor p-2 rounded-lg ml-2" class:ring-1={privateMode} on:click={() => {privateMode = true}}>🔒 Private</button> -->
|
||||
<button class="bg-bgcolor p-2 rounded-lg" class:ring-1={!privateMode} on:click={() => {privateMode = false}}>🌏 Show Author ID</button>
|
||||
<button class="bg-bgcolor p-2 rounded-lg ml-2" class:ring-1={privateMode} on:click={() => {privateMode = true}}>🔒 Anonymized</button>
|
||||
</div>
|
||||
<div class="flex items-center flex-wrap mt-2">
|
||||
<button class="bg-bgcolor p-2 rounded-lg" class:ring-1={!nsfwMode} on:click={() => {nsfwMode = false}}>🧑🧒🧒 Safe</button>
|
||||
<button class="bg-bgcolor p-2 rounded-lg" class:ring-1={!nsfwMode} on:click={() => {nsfwMode = false}}>🎖️ Safe</button>
|
||||
<button class="bg-bgcolor p-2 rounded-lg ml-2" class:ring-1={nsfwMode} on:click={() => {nsfwMode = true}}>🔞 NSFW</button>
|
||||
</div>
|
||||
{#if nsfwMode}
|
||||
<span class="text-gray-400 text-sm">Grotesque Contents and non-adult characters with NSFW would be banned.</span>
|
||||
{/if}
|
||||
{#if privateMode}
|
||||
<span class="text-gray-400 text-sm">Private characters can be removed from the server if there is only a few downloads.</span>
|
||||
{/if}
|
||||
<Button on:click={async () => {
|
||||
if(char.creatorNotes.length < 20){
|
||||
alertError("Creator Notes must be longer than 20 characters")
|
||||
}
|
||||
else{
|
||||
shareRisuHub(char, {
|
||||
privateMode: privateMode,
|
||||
anon: privateMode,
|
||||
nsfw: nsfwMode,
|
||||
tag: tags,
|
||||
license: license
|
||||
|
||||
@@ -497,9 +497,9 @@ export async function exportSpecV2(char:character, type:'png'|'json' = 'png') {
|
||||
|
||||
export async function shareRisuHub(char:character, arg:{
|
||||
nsfw: boolean,
|
||||
privateMode:boolean
|
||||
tag:string
|
||||
license: string
|
||||
anon: boolean
|
||||
}) {
|
||||
char = cloneDeep(char)
|
||||
char.license = arg.license
|
||||
@@ -508,9 +508,7 @@ export async function shareRisuHub(char:character, arg:{
|
||||
if(arg.nsfw){
|
||||
tagList.push("nsfw")
|
||||
}
|
||||
if(arg.privateMode){
|
||||
tagList.push("private")
|
||||
}
|
||||
|
||||
|
||||
|
||||
let tags = tagList.filter((v, i) => {
|
||||
@@ -558,6 +556,7 @@ export async function shareRisuHub(char:character, arg:{
|
||||
img: Buffer.from(img).toString('base64'),
|
||||
resources: resources,
|
||||
token: get(DataBase)?.account?.token,
|
||||
anon: arg.anon,
|
||||
apiver: 3
|
||||
})
|
||||
})
|
||||
@@ -587,6 +586,8 @@ export type hubType = {
|
||||
hasEmotion:boolean
|
||||
hasAsset:boolean
|
||||
creator?:string
|
||||
creatorName?:string
|
||||
hot:number
|
||||
license:string
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user