[fix] fixed input lag, bugs
This commit is contained in:
@@ -55,7 +55,10 @@
|
|||||||
{:else if $DataBase.theme === 'waifuMobile'}
|
{:else if $DataBase.theme === 'waifuMobile'}
|
||||||
<div class="flex-grow h-full relative" style={bgImg.length < 4 ? wallPaper : bgImg}>
|
<div class="flex-grow h-full relative" style={bgImg.length < 4 ? wallPaper : bgImg}>
|
||||||
<BackgroundDom />
|
<BackgroundDom />
|
||||||
<div class="w-full absolute z-10 bottom-0 left-0" class:per33={$selectedCharID >= 0}>
|
<div class="w-full absolute z-10 bottom-0 left-0"
|
||||||
|
class:per33={$selectedCharID >= 0 && $DataBase.characters[$selectedCharID].viewScreen !== 'none'}
|
||||||
|
class:h-full={!($selectedCharID >= 0 && $DataBase.characters[$selectedCharID].viewScreen !== 'none')}
|
||||||
|
>
|
||||||
<DefaultChatScreen customStyle={`${externalStyles}backdrop-filter: blur(4px);`} bind:openChatList/>
|
<DefaultChatScreen customStyle={`${externalStyles}backdrop-filter: blur(4px);`} bind:openChatList/>
|
||||||
</div>
|
</div>
|
||||||
{#if $selectedCharID >= 0}
|
{#if $selectedCharID >= 0}
|
||||||
|
|||||||
@@ -359,6 +359,6 @@
|
|||||||
<Check bind:check={$DataBase.promptPreprocess} name={language.promptPreprocess}/>
|
<Check bind:check={$DataBase.promptPreprocess} name={language.promptPreprocess}/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Button onClick={() => {openPresetList = true}} className="mt-4">{language.presets}</Button>
|
<Button on:click={() => {openPresetList = true}} className="mt-4">{language.presets}</Button>
|
||||||
|
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -711,10 +711,10 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<Button size="lg" onClick={async () => {
|
<Button size="lg" on:click={async () => {
|
||||||
exportChar($selectedCharID)
|
exportChar($selectedCharID)
|
||||||
}} className="mt-2">{language.exportCharacter}</Button>
|
}} className="mt-2">{language.exportCharacter}</Button>
|
||||||
<Button size="lg" onClick={async () => {
|
<Button size="lg" on:click={async () => {
|
||||||
openHubUpload = true
|
openHubUpload = true
|
||||||
}} className="mt-2">{language.shareCloud}</Button>
|
}} className="mt-2">{language.shareCloud}</Button>
|
||||||
{#if openHubUpload}
|
{#if openHubUpload}
|
||||||
@@ -732,7 +732,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
<Button onClick={async () => {
|
<Button on:click={async () => {
|
||||||
const conf = await alertConfirm(language.removeConfirm + currentChar.data.name)
|
const conf = await alertConfirm(language.removeConfirm + currentChar.data.name)
|
||||||
if(!conf){
|
if(!conf){
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -554,25 +554,25 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{:else if sideBarMode === 1}
|
{:else if sideBarMode === 1}
|
||||||
<Button
|
<Button
|
||||||
onClick={createScratch}
|
on:click={createScratch}
|
||||||
className="mt-2"
|
className="mt-2"
|
||||||
>
|
>
|
||||||
{language.createfromScratch}
|
{language.createfromScratch}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={createImport}
|
on:click={createImport}
|
||||||
className="mt-2"
|
className="mt-2"
|
||||||
>
|
>
|
||||||
{language.importCharacter}
|
{language.importCharacter}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={createGroup}
|
on:click={createGroup}
|
||||||
className="mt-2"
|
className="mt-2"
|
||||||
>
|
>
|
||||||
{language.createGroup}
|
{language.createGroup}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={BotCreator.createBotFromWeb}
|
on:click={BotCreator.createBotFromWeb}
|
||||||
className="mt-2"
|
className="mt-2"
|
||||||
>
|
>
|
||||||
{language.createBotInternet}
|
{language.createBotInternet}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<button
|
<button
|
||||||
on:click={onClick}
|
on:click
|
||||||
class="{selected ? 'bg-borderc' : 'bg-gray-700'} border border-gray-600 text-white rounded-md shadow-sm hover:bg-borderc focus:outline-none focus:ring-2 focus:ring-borderc transition-colors duration-200{className ? (" " + className) : ""}"
|
class="{selected ? 'bg-borderc' : 'bg-gray-700'} border border-gray-600 text-white rounded-md shadow-sm hover:bg-borderc focus:outline-none focus:ring-2 focus:ring-borderc transition-colors duration-200{className ? (" " + className) : ""}"
|
||||||
class:px-4 = {size == "md"}
|
class:px-4 = {size == "md"}
|
||||||
class:px-2 = {size == "sm"}
|
class:px-2 = {size == "sm"}
|
||||||
@@ -14,7 +14,6 @@
|
|||||||
</button>
|
</button>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export let selected = false
|
export let selected = false
|
||||||
export let onClick = () => {}
|
|
||||||
export let className = ""
|
export let className = ""
|
||||||
export let size: "sm" | "md" | "lg" = "md"
|
export let size: "sm" | "md" | "lg" = "md"
|
||||||
</script>
|
</script>
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
class:px-6={size === 'lg'}
|
class:px-6={size === 'lg'}
|
||||||
class:py-3={size === 'lg'}
|
class:py-3={size === 'lg'}
|
||||||
bind:value
|
bind:value
|
||||||
|
on:change
|
||||||
>
|
>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -1,54 +1,66 @@
|
|||||||
<!-- <textarea
|
{#if optimaizedInput}
|
||||||
class={"bg-transparent input-text mt-2 mb-2 text-gray-200 resize-none focus:bg-selected w-full" + ((additionalClass) ? (' ' + additionalClass) : '')}
|
<textarea
|
||||||
class:text-sm={size === 'sm'}
|
class={"border border-gray-600 focus:border-borderc resize-none rounded-md shadow-sm text-white bg-transparent focus:ring-borderc focus:ring-2 focus:outline-none transition-colors duration-200" + ((additionalClass) ? (' ' + additionalClass) : '')}
|
||||||
class:text-md={size === 'md'}
|
class:text-sm={size === 'sm'}
|
||||||
class:text-lg={size === 'lg'}
|
class:text-md={size === 'md'}
|
||||||
class:text-xl={size === 'xl'}
|
class:text-lg={size === 'lg'}
|
||||||
class:text-xs={size === 'xs'}
|
class:text-xl={size === 'xl'}
|
||||||
class:p-2={padding}
|
class:text-xs={size === 'xs'}
|
||||||
class:mb-4={margin === 'bottom'}
|
class:px-4={padding}
|
||||||
class:mb-2={margin === 'both'}
|
class:py-2={padding}
|
||||||
class:mt-4={margin === 'top'}
|
class:mb-4={margin === 'bottom'}
|
||||||
class:mt-2={margin === 'both'}
|
class:mb-2={margin === 'both'}
|
||||||
class:w-full={fullwidth}
|
class:mt-4={margin === 'top'}
|
||||||
class:h-20={height === '20'}
|
class:mt-2={margin === 'both'}
|
||||||
class:h-32={height === '32'}
|
class:w-full={fullwidth}
|
||||||
class:h-full={height === 'full'}
|
class:h-20={height === '20'}
|
||||||
class:min-h-20={height === '20'}
|
class:h-32={height === '32'}
|
||||||
class:min-h-32={height === '32'}
|
class:h-full={height === 'full'}
|
||||||
|
class:min-h-20={height === '20'}
|
||||||
{autocomplete}
|
class:min-h-32={height === '32'}
|
||||||
{placeholder}
|
{autocomplete}
|
||||||
id={id}
|
{placeholder}
|
||||||
bind:value
|
id={id}
|
||||||
on:input={onInput}
|
bind:value={value}
|
||||||
/> -->
|
on:input={(e) => {
|
||||||
|
if(inpa++ > 10){
|
||||||
<textarea
|
value = e.currentTarget.value
|
||||||
class={"border border-gray-600 focus:border-borderc resize-none rounded-md shadow-sm text-white bg-transparent focus:ring-borderc focus:ring-2 focus:outline-none transition-colors duration-200" + ((additionalClass) ? (' ' + additionalClass) : '')}
|
inpa = 0
|
||||||
class:text-sm={size === 'sm'}
|
onInput()
|
||||||
class:text-md={size === 'md'}
|
}
|
||||||
class:text-lg={size === 'lg'}
|
}}
|
||||||
class:text-xl={size === 'xl'}
|
on:change={(e) => {
|
||||||
class:text-xs={size === 'xs'}
|
value = e.currentTarget.value
|
||||||
class:px-4={padding}
|
onInput()
|
||||||
class:py-2={padding}
|
}}
|
||||||
class:mb-4={margin === 'bottom'}
|
/>
|
||||||
class:mb-2={margin === 'both'}
|
{:else}
|
||||||
class:mt-4={margin === 'top'}
|
<textarea
|
||||||
class:mt-2={margin === 'both'}
|
class={"border border-gray-600 focus:border-borderc resize-none rounded-md shadow-sm text-white bg-transparent focus:ring-borderc focus:ring-2 focus:outline-none transition-colors duration-200" + ((additionalClass) ? (' ' + additionalClass) : '')}
|
||||||
class:w-full={fullwidth}
|
class:text-sm={size === 'sm'}
|
||||||
class:h-20={height === '20'}
|
class:text-md={size === 'md'}
|
||||||
class:h-32={height === '32'}
|
class:text-lg={size === 'lg'}
|
||||||
class:h-full={height === 'full'}
|
class:text-xl={size === 'xl'}
|
||||||
class:min-h-20={height === '20'}
|
class:text-xs={size === 'xs'}
|
||||||
class:min-h-32={height === '32'}
|
class:px-4={padding}
|
||||||
{autocomplete}
|
class:py-2={padding}
|
||||||
{placeholder}
|
class:mb-4={margin === 'bottom'}
|
||||||
id={id}
|
class:mb-2={margin === 'both'}
|
||||||
bind:value
|
class:mt-4={margin === 'top'}
|
||||||
on:input={onInput}
|
class:mt-2={margin === 'both'}
|
||||||
/>
|
class:w-full={fullwidth}
|
||||||
|
class:h-20={height === '20'}
|
||||||
|
class:h-32={height === '32'}
|
||||||
|
class:h-full={height === 'full'}
|
||||||
|
class:min-h-20={height === '20'}
|
||||||
|
class:min-h-32={height === '32'}
|
||||||
|
{autocomplete}
|
||||||
|
{placeholder}
|
||||||
|
id={id}
|
||||||
|
bind:value
|
||||||
|
on:input={onInput}
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export let size: 'xs'|'sm'|'md'|'lg'|'xl' = 'xs'
|
export let size: 'xs'|'sm'|'md'|'lg'|'xl' = 'xs'
|
||||||
export let autocomplete: 'on'|'off' = 'off'
|
export let autocomplete: 'on'|'off' = 'off'
|
||||||
@@ -61,4 +73,11 @@
|
|||||||
export let fullwidth = false
|
export let fullwidth = false
|
||||||
export let height:'20'|'32'|'full' = '20'
|
export let height:'20'|'32'|'full' = '20'
|
||||||
export let additionalClass = ''
|
export let additionalClass = ''
|
||||||
|
export let optimaizedInput = true
|
||||||
|
let inpa = 0
|
||||||
|
|
||||||
|
let optiValue = value
|
||||||
|
|
||||||
|
$: optiValue = value
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@@ -1,23 +1,3 @@
|
|||||||
<!-- <input
|
|
||||||
class={"text-neutral-200 bg-transparent input-text focus:bg-selected" + ((additionalClass) ? (' ' + additionalClass) : '')}
|
|
||||||
class:text-sm={size === 'sm'}
|
|
||||||
class:text-md={size === 'md'}
|
|
||||||
class:text-lg={size === 'lg'}
|
|
||||||
class:text-xl={size === 'xl'}
|
|
||||||
class:p-2={padding}
|
|
||||||
class:mb-4={marginBottom}
|
|
||||||
class:w-full={fullwidth}
|
|
||||||
class:h-full={fullh}
|
|
||||||
|
|
||||||
{autocomplete}
|
|
||||||
{placeholder}
|
|
||||||
id={id}
|
|
||||||
type="text"
|
|
||||||
bind:value
|
|
||||||
on:input={onInput}
|
|
||||||
> -->
|
|
||||||
|
|
||||||
|
|
||||||
<input
|
<input
|
||||||
class={"border border-gray-600 focus:border-borderc rounded-md shadow-sm text-white bg-transparent focus:ring-borderc focus:ring-2 focus:outline-none transition-colors duration-200" + ((additionalClass) ? (' ' + additionalClass) : '')}
|
class={"border border-gray-600 focus:border-borderc rounded-md shadow-sm text-white bg-transparent focus:ring-borderc focus:ring-2 focus:outline-none transition-colors duration-200" + ((additionalClass) ? (' ' + additionalClass) : '')}
|
||||||
class:text-sm={size === 'sm'}
|
class:text-sm={size === 'sm'}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
{#if privateMode}
|
{#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>
|
<span class="text-gray-400 text-sm">Private characters can be removed from the server if there is only a few downloads.</span>
|
||||||
{/if}
|
{/if}
|
||||||
<Button onClick={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")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user