From e5de7a7e386b9e44cd3d9ddb6a61b57819d70a57 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Sun, 21 May 2023 19:55:20 +0900 Subject: [PATCH 1/8] [feat] reverted name to supamemory --- src/lang/en.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lang/en.ts b/src/lang/en.ts index 7b7f0987..9432d6fe 100644 --- a/src/lang/en.ts +++ b/src/lang/en.ts @@ -248,8 +248,8 @@ export const languageEnglish = { creator: "Creator", CharVersion: "Character Version", Speech: "Speech", - ToggleSuperMemory: "Toggle SuperMemory", - SuperMemory:"SuperMemory", + ToggleSuperMemory: "Toggle SupaMemory", + SuperMemory:"SupaMemory", useExperimental: "Able Experimental Features", showMemoryLimit: "Show Memory Limit", roundIcons: "Round Icons", From 843ad49842147184cd9587b34e40a89bfc7978fd Mon Sep 17 00:00:00 2001 From: kwaroran Date: Sun, 21 May 2023 20:09:14 +0900 Subject: [PATCH 2/8] [refactor] performance improvements --- src/lib/SideBars/Sidebar.svelte | 8 ++++++-- src/lib/SideBars/SidebarAvatar.svelte | 9 ++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/lib/SideBars/Sidebar.svelte b/src/lib/SideBars/Sidebar.svelte index 012be298..239c60d9 100644 --- a/src/lib/SideBars/Sidebar.svelte +++ b/src/lib/SideBars/Sidebar.svelte @@ -73,6 +73,7 @@ } let charImages: string[] = []; + let IconRounded = false const unsub = DataBase.subscribe((db) => { let newCharImages: string[] = []; @@ -82,6 +83,9 @@ if (!isEqual(charImages, newCharImages)) { charImages = newCharImages; } + if(IconRounded !== db.roundIcons){ + IconRounded = db.roundIcons + } }); onDestroy(unsub); @@ -117,7 +121,7 @@ }} tabindex="0" > - + {:else} @@ -132,7 +136,7 @@ }} tabindex="0" > - + {/if} {#if editMode} diff --git a/src/lib/SideBars/SidebarAvatar.svelte b/src/lib/SideBars/SidebarAvatar.svelte index c7250796..ac271354 100644 --- a/src/lib/SideBars/SidebarAvatar.svelte +++ b/src/lib/SideBars/SidebarAvatar.svelte @@ -1,6 +1,5 @@ @@ -13,7 +12,7 @@ style:width={size + "px"} style:height={size + "px"} style:minWidth={size + "px"} - class:rounded-md={!$DataBase.roundIcons} class:rounded-full={$DataBase.roundIcons} + class:rounded-md={!rounded} class:rounded-full={rounded} /> {:then img} avatar {/await} @@ -32,7 +31,7 @@ style:width={size + "px"} style:height={size + "px"} style:minWidth={size + "px"} - class:rounded-md={!$DataBase.roundIcons} class:rounded-full={$DataBase.roundIcons} + class:rounded-md={!rounded} class:rounded-full={rounded} /> {/if} From d174aa07966c2cd2376b03991c06bebf4f909043 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Sun, 21 May 2023 20:25:49 +0900 Subject: [PATCH 3/8] [feat] added none icon --- public/none.webp | Bin 0 -> 624 bytes src/lib/SideBars/Sidebar.svelte | 43 ++++++++++---------------------- 2 files changed, 13 insertions(+), 30 deletions(-) create mode 100644 public/none.webp diff --git a/public/none.webp b/public/none.webp new file mode 100644 index 0000000000000000000000000000000000000000..500b7152cc9a13168f41d8e0a0fea470b8b0d7f4 GIT binary patch literal 624 zcmWIYbaTsKVqge&bqWXzu!!JdU|`??;(9OwiYVkTGB616FwAAtYG7z!u#451>ZZ6* zQQ*{?6lvBYU$z(Q^0>wD`q*x+0|88u^1a7*u~|;&I}ZY`EHUj$d6C zKXL8}>sOCk(hR4i$jxN3F?UVb@%6UB#TS+0zpFAc%Tkm!=+@aDVEFg1dkI(9N0!GO z%Q!Vpp5GC=?SS15OIucv@mwa#Hfvo2oa{X1x)6YM*;y z$@1%2iuHku9D9`aHnsQOublJrc#_8Z4*u#-G0qW!mI7zfwmKi!A6S~(&fh&z;dnyl zCKWk>)$9+;m`!&c+johj%RrW6x~V_AT=kt}eP89<{?6rgy&G}3h(BC&F@NVzu`4cz z&FvjbZp5x(NM-n|9M`hEWA~jM9;%#Nf|l#f{(64r?q~k@m)AFKT(oCz=bj0d6@UTH z;2PoSb`3~-dTN1Vf{j6lk(mJ)31BS6$O@*zfP85vI}XU!fT{sTC4(U&6N3PdP6Oi1 zb{4SuG9ViS5`Y+F7K|=P%*-p%%S$a$Fx4~AGiG3AV3@$pzyefZU}S8-xBy`@(*lS| j4L~_&BsMFQy#pu?0!%>jnZPClSy}*DP}2+z3_!8~CT+w; literal 0 HcmV?d00001 diff --git a/src/lib/SideBars/Sidebar.svelte b/src/lib/SideBars/Sidebar.svelte index 239c60d9..8cc57828 100644 --- a/src/lib/SideBars/Sidebar.svelte +++ b/src/lib/SideBars/Sidebar.svelte @@ -108,37 +108,20 @@ - {#if charimg !== ""} - -
{ + +
{ + changeChar(i); + }} + on:keydown={(e) => { + if (e.key === "Enter") { changeChar(i); - }} - on:keydown={(e) => { - if (e.key === "Enter") { - changeChar(i); - } - }} - tabindex="0" - > - -
- {:else} - -
{ - changeChar(i); - }} - on:keydown={(e) => { - if (e.key === "Enter") { - changeChar(i); - } - }} - tabindex="0" - > - -
- {/if} + } + }} + tabindex="0" + > + +
{#if editMode}
+
{ + e.preventDefault() + e.dataTransfer.dropEffect = 'move' + e.currentTarget.classList.add('bg-green-500') + }} on:dragleave={(e) => { + e.currentTarget.classList.remove('bg-green-500') + }} on:drop={(e) => { + e.preventDefault() + e.currentTarget.classList.remove('bg-green-500') + const da = JSON.parse(e.dataTransfer.getData("application/json")) + if(da.type === "risuDrag"){ + inserter(da.index,{index:0}) + } + }} /> {#if menuMode === 0} - {#each charImages as charimg, i} -
+ {#each charImages as char, ind} +
{avatarDragStart({index:ind}, e)}} + on:dragover={avatarDragOver} + on:drop={(e) => {avatarDrop({index:ind}, e)}} + >
{ - changeChar(i); - }} - on:keydown={(e) => { - if (e.key === "Enter") { - changeChar(i); + on:click={() => { + if(char.type === "normal"){ + changeChar(char.index); + } + }} + on:keydown={(e) => { + if (e.key === "Enter") { + if(char.type === "normal"){ + changeChar(char.index); + } + } + }} + tabindex="0" + > + {#if char.type === 'normal'} + + {:else if char.type === "folder"} + { + if(char.type !== 'folder'){ + return + } + if(openFolders.includes(char.id)){ + openFolders.splice(openFolders.indexOf(char.id), 1) + } + else{ + openFolders.push(char.id) + } + openFolders = openFolders + }}> + {#if openFolders.includes(char.id)} + + {:else} + + {/if} + + {/if} +
+
+ {#if char.type === 'folder' && openFolders.includes(char.id)} +
+
+
{ + e.preventDefault() + e.dataTransfer.dropEffect = 'move' + e.currentTarget.classList.add('bg-green-500') + }} on:dragleave={(e) => { + e.currentTarget.classList.remove('bg-green-500') + }} on:drop={(e) => { + e.preventDefault() + e.currentTarget.classList.remove('bg-green-500') + const da = JSON.parse(e.dataTransfer.getData("application/json")) + if(da.type === "risuDrag", char.type === 'folder'){ + inserter(da.index,{index:0,folder:char.id}) } - }} - tabindex="0" - > - -
- {#if editMode} -
- - -
- {/if} -
+ + +
{ + if(char2.type === "normal"){ + changeChar(char2.index); + } + }} + on:keydown={(e) => { + if (e.key === "Enter") { + if(char2.type === "normal"){ + changeChar(char2.index); + } + } + }} + tabindex="0" + > + +
+
+
{ + e.preventDefault() + e.dataTransfer.dropEffect = 'move' + e.currentTarget.classList.add('bg-green-500') + }} on:dragleave={(e) => { + e.currentTarget.classList.remove('bg-green-500') + }} on:drop={(e) => { + e.preventDefault() + e.currentTarget.classList.remove('bg-green-500') + const da = JSON.parse(e.dataTransfer.getData("application/json")) + if(da.type === "risuDrag" && char.type === 'folder'){ + inserter(da.index,{index:ind+1,folder:char.id}) + } + }} /> + {/each} +
+ {/if} +
{ + e.preventDefault() + e.dataTransfer.dropEffect = 'move' + e.currentTarget.classList.add('bg-green-500') + }} on:dragleave={(e) => { + e.currentTarget.classList.remove('bg-green-500') + }} on:drop={(e) => { + e.preventDefault() + e.currentTarget.classList.remove('bg-green-500') + const da = JSON.parse(e.dataTransfer.getData("application/json")) + if(da.type === "risuDrag"){ + inserter(da.index,{index:ind+1}) + } + }} /> {/each}
; export let size = "22"; + export let onClick = () => {} - + + {#if src} - {#await src} + {#if src === "slot"} + {:else} + {#await src} +