From 3bac4bbe9a3d47cafa1b96ac7c4f9e7ec490b1e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20B=C3=BClow?= Date: Wed, 4 Jan 2023 09:10:46 +0100 Subject: [PATCH] added decrypt functionality --- src/App.svelte | 9 ++-- src/app.css | 7 +++ src/lib/DecryptButton.svelte | 94 +++++++++++++++++++++++++++++++++++ src/lib/EncryptButton.svelte | 42 ++++++++++------ src/lib/PasswordButton.svelte | 38 +++++++++++++- 5 files changed, 170 insertions(+), 20 deletions(-) create mode 100644 src/lib/DecryptButton.svelte diff --git a/src/App.svelte b/src/App.svelte index a955571..0bd94d6 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,17 +1,18 @@

Encrypt and decrypt files

-
- +
+ +
-
- Password: +
diff --git a/src/app.css b/src/app.css index bcc7233..ee7a390 100644 --- a/src/app.css +++ b/src/app.css @@ -48,6 +48,13 @@ h1 { text-align: center; } +div.container { + display: flex; /* Make the container a flex container */ + justify-content: center; /* Center the items horizontally */ + margin-bottom: 2em; +} + + button { border-radius: 8px; border: 1px solid transparent; diff --git a/src/lib/DecryptButton.svelte b/src/lib/DecryptButton.svelte new file mode 100644 index 0000000..e732f8e --- /dev/null +++ b/src/lib/DecryptButton.svelte @@ -0,0 +1,94 @@ + + + + +
+
+ Drag and drop a file here to upload + {filename} + +
+
diff --git a/src/lib/EncryptButton.svelte b/src/lib/EncryptButton.svelte index ded2d3f..cc8b937 100644 --- a/src/lib/EncryptButton.svelte +++ b/src/lib/EncryptButton.svelte @@ -1,15 +1,9 @@ +
@@ -67,6 +78,7 @@ on:drop|preventDefault={handleDrop} > Drag and drop a file here to upload + {filename} +
- diff --git a/src/lib/PasswordButton.svelte b/src/lib/PasswordButton.svelte index 763abeb..ee874d2 100644 --- a/src/lib/PasswordButton.svelte +++ b/src/lib/PasswordButton.svelte @@ -18,6 +18,42 @@ function copyToClipboard() { ); } +function updatePassword(password) { + globalPassword.set(password) +} + - \ No newline at end of file + + +
+ Password +
+ + + +
+
\ No newline at end of file