[feat] pop level & author name realm
This commit is contained in:
@@ -398,4 +398,5 @@ export const languageEnglish = {
|
|||||||
ifChatIndex: "If chat index",
|
ifChatIndex: "If chat index",
|
||||||
ifRandom: "If random",
|
ifRandom: "If random",
|
||||||
hideRealm: "Hide RisuRealm",
|
hideRealm: "Hide RisuRealm",
|
||||||
|
popularityLevel: "Popularity Level {}",
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
import { parseMarkdownSafe } from "src/ts/parser";
|
import { parseMarkdownSafe } from "src/ts/parser";
|
||||||
import { DataBase } from "src/ts/storage/database";
|
import { DataBase } from "src/ts/storage/database";
|
||||||
import RealmLicense from "./RealmLicense.svelte";
|
import RealmLicense from "./RealmLicense.svelte";
|
||||||
|
import { characterFormatUpdate } from "src/ts/characters";
|
||||||
|
|
||||||
export let openedData:hubType
|
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="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">
|
<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>
|
<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">
|
<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}>
|
<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">
|
<span class="text-gray-400 break-words text-base chattext prose prose-invert">
|
||||||
@@ -34,7 +38,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex flex-wrap w-full flex-row gap-1 mt-2">
|
<div class="flex flex-wrap w-full flex-row gap-1 mt-2">
|
||||||
<span class="text-gray-500">
|
<span class="text-gray-500">
|
||||||
{language.chatAssumed.replace('{}', openedData.download.toString())}
|
{language.popularityLevel.replace('{}', openedData.download.toString())}
|
||||||
</span>
|
</span>
|
||||||
<div class="border-l-selected border-l ml-1 mr-1"></div>
|
<div class="border-l-selected border-l ml-1 mr-1"></div>
|
||||||
{#if openedData.hasEmotion}
|
{#if openedData.hasEmotion}
|
||||||
|
|||||||
@@ -42,26 +42,23 @@
|
|||||||
|
|
||||||
{/if}
|
{/if}
|
||||||
<div class="flex items-center flex-wrap mt-4">
|
<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" 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}}>🔒 Private</button> -->
|
<button class="bg-bgcolor p-2 rounded-lg ml-2" class:ring-1={privateMode} on:click={() => {privateMode = true}}>🔒 Anonymized</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center flex-wrap mt-2">
|
<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>
|
<button class="bg-bgcolor p-2 rounded-lg ml-2" class:ring-1={nsfwMode} on:click={() => {nsfwMode = true}}>🔞 NSFW</button>
|
||||||
</div>
|
</div>
|
||||||
{#if nsfwMode}
|
{#if nsfwMode}
|
||||||
<span class="text-gray-400 text-sm">Grotesque Contents and non-adult characters with NSFW would be banned.</span>
|
<span class="text-gray-400 text-sm">Grotesque Contents and non-adult characters with NSFW would be banned.</span>
|
||||||
{/if}
|
{/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 () => {
|
<Button on:click={async () => {
|
||||||
if(char.creatorNotes.length < 20){
|
if(char.creatorNotes.length < 20){
|
||||||
alertError("Creator Notes must be longer than 20 characters")
|
alertError("Creator Notes must be longer than 20 characters")
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
shareRisuHub(char, {
|
shareRisuHub(char, {
|
||||||
privateMode: privateMode,
|
anon: privateMode,
|
||||||
nsfw: nsfwMode,
|
nsfw: nsfwMode,
|
||||||
tag: tags,
|
tag: tags,
|
||||||
license: license
|
license: license
|
||||||
|
|||||||
@@ -497,9 +497,9 @@ export async function exportSpecV2(char:character, type:'png'|'json' = 'png') {
|
|||||||
|
|
||||||
export async function shareRisuHub(char:character, arg:{
|
export async function shareRisuHub(char:character, arg:{
|
||||||
nsfw: boolean,
|
nsfw: boolean,
|
||||||
privateMode:boolean
|
|
||||||
tag:string
|
tag:string
|
||||||
license: string
|
license: string
|
||||||
|
anon: boolean
|
||||||
}) {
|
}) {
|
||||||
char = cloneDeep(char)
|
char = cloneDeep(char)
|
||||||
char.license = arg.license
|
char.license = arg.license
|
||||||
@@ -508,9 +508,7 @@ export async function shareRisuHub(char:character, arg:{
|
|||||||
if(arg.nsfw){
|
if(arg.nsfw){
|
||||||
tagList.push("nsfw")
|
tagList.push("nsfw")
|
||||||
}
|
}
|
||||||
if(arg.privateMode){
|
|
||||||
tagList.push("private")
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
let tags = tagList.filter((v, i) => {
|
let tags = tagList.filter((v, i) => {
|
||||||
@@ -558,6 +556,7 @@ export async function shareRisuHub(char:character, arg:{
|
|||||||
img: Buffer.from(img).toString('base64'),
|
img: Buffer.from(img).toString('base64'),
|
||||||
resources: resources,
|
resources: resources,
|
||||||
token: get(DataBase)?.account?.token,
|
token: get(DataBase)?.account?.token,
|
||||||
|
anon: arg.anon,
|
||||||
apiver: 3
|
apiver: 3
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -587,6 +586,8 @@ export type hubType = {
|
|||||||
hasEmotion:boolean
|
hasEmotion:boolean
|
||||||
hasAsset:boolean
|
hasAsset:boolean
|
||||||
creator?:string
|
creator?:string
|
||||||
|
creatorName?:string
|
||||||
|
hot:number
|
||||||
license:string
|
license:string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user