From 5a7e89205e87bc1858a470f76c2b52c711bb55f3 Mon Sep 17 00:00:00 2001
From: Mistivia <i@mistivia.com>
Date: Mon, 17 Mar 2025 01:42:52 +0800
Subject: add clear deck

---
 src/components/main_panel.svelte | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/components/main_panel.svelte b/src/components/main_panel.svelte
index 1eb71ed..44febb8 100644
--- a/src/components/main_panel.svelte
+++ b/src/components/main_panel.svelte
@@ -27,6 +27,14 @@
         }
     }
 
+    function clearDeck() {
+        setDeck({
+            'main': [],
+            'extra': [],
+            'side': [],
+        });
+    }
+
     function saveDeck() {
         let deckString = genYdk($deck);
         downloadStringAsFile(deckString)
@@ -85,6 +93,7 @@
     <div class="control-bar">
         <button class="btn" onclick={openDeck}>打开</button>
         <button class="btn" onclick={saveDeck}>保存</button>
+        <button class="btn" onclick={clearDeck}>清空</button>
         <button class="btn" onclick={copyDeck}>复制到剪贴板</button>
         <button class="btn" onclick={shareDeck}>分享</button>
         <select bind:value={$format} class="select-format" id="format" onchange={()=>setFormat($format)}>
-- 
cgit v1.0

