瀏覽代碼

enh: model editor reset image

Timothy Jaeryang Baek 5 月之前
父節點
當前提交
e67fdce727
共有 1 個文件被更改,包括 16 次插入3 次删除
  1. 16 3
      src/lib/components/workspace/Models/ModelEditor.svelte

+ 16 - 3
src/lib/components/workspace/Models/ModelEditor.svelte

@@ -317,6 +317,7 @@
 						info.meta.profile_image_url = compressedSrc;
 
 						inputFiles = null;
+						filesInputElement.value = '';
 					};
 				};
 
@@ -345,7 +346,7 @@
 				<div class="self-center md:self-start flex justify-center my-2 flex-shrink-0">
 					<div class="self-center">
 						<button
-							class="rounded-2xl flex flex-shrink-0 items-center {info.meta.profile_image_url !==
+							class="rounded-xl flex flex-shrink-0 items-center {info.meta.profile_image_url !==
 							'/static/favicon.png'
 								? 'bg-transparent'
 								: 'bg-white'} shadow-xl group relative"
@@ -358,13 +359,13 @@
 								<img
 									src={info.meta.profile_image_url}
 									alt="model profile"
-									class="rounded-lg size-72 md:size-60 object-cover shrink-0"
+									class="rounded-xl size-72 md:size-60 object-cover shrink-0"
 								/>
 							{:else}
 								<img
 									src="/static/favicon.png"
 									alt="model profile"
-									class=" rounded-lg size-72 md:size-60 object-cover shrink-0"
+									class=" rounded-xl size-72 md:size-60 object-cover shrink-0"
 								/>
 							{/if}
 
@@ -393,6 +394,18 @@
 								class="absolute top-0 bottom-0 left-0 right-0 bg-white dark:bg-black rounded-lg opacity-0 group-hover:opacity-20 transition"
 							></div>
 						</button>
+
+						<div class="flex w-full mt-1 justify-end">
+							<button
+								class="px-2 py-1 text-gray-500 rounded-lg text-xs"
+								on:click={() => {
+									info.meta.profile_image_url = '/static/favicon.png';
+								}}
+								type="button"
+							>
+								Reset Image</button
+							>
+						</div>
 					</div>
 				</div>