Add background embeding to module

This commit is contained in:
kwaroran
2024-07-10 17:03:43 +09:00
parent 3eafd786f6
commit 9a53bd642e
4 changed files with 29 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
<script lang="ts">
import { ParseMarkdown, risuChatParser } from "src/ts/parser";
import { DataBase, type Database, type character, type groupChat } from "src/ts/storage/database";
import { CurrentVariablePointer, selectedCharID } from "src/ts/stores";
import { CurrentVariablePointer, moduleBackgroundEmbedding, selectedCharID } from "src/ts/stores";
import { onDestroy } from "svelte";
let backgroundHTML = ''
@@ -41,10 +41,10 @@
</script>
{#if backgroundHTML}
{#if backgroundHTML || $moduleBackgroundEmbedding}
{#key $CurrentVariablePointer}
<div class="absolute top-0 left-0 w-full h-full">
{#await ParseMarkdown(risuChatParser(backgroundHTML, {chara:currentChar}), currentChar, 'back') then md}
{#await ParseMarkdown(risuChatParser((backgroundHTML || '') + ($moduleBackgroundEmbedding || ''), {chara:currentChar}), currentChar, 'back') then md}
{@html md}
{/await}
</div>