Skip to content

Commit 6ceb331

Browse files
committed
Fix: animations
1 parent e33e1a9 commit 6ceb331

File tree

6 files changed

+28
-0
lines changed

6 files changed

+28
-0
lines changed

app/src/js/disableUI.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const folderSelectBtn = document.querySelector("#folder-picker");
99
const clearAllBtn = document.querySelector("#clear-btn");
1010
const encryptBtn = document.querySelector("#encrypt-btn");
1111
const decryptBtn = document.querySelector("#decrypt-btn");
12+
const checkPasswordBtn = document.querySelector("#check-password-btn");
1213
// Password
1314
const passwordInput = document.querySelector("#password-input");
1415

@@ -19,6 +20,7 @@ export function disableUI() {
1920
encryptBtn.disabled = true;
2021
decryptBtn.disabled = true;
2122
passwordInput.disabled = true;
23+
checkPasswordBtn.disabled = true;
2224
//
2325
clearAllBtn.classList.add("opacity-10");
2426
fileBrowseContainer.classList.add("opacity-40");

app/src/js/passwordCheck/checking.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
const messageBox = document.querySelector("#message-box-2");
22
const checkPasswordBtn = document.querySelector("#check-password-btn");
3+
const encryptBtn = document.querySelector("#encrypt-btn");
4+
const decryptBtn = document.querySelector("#decrypt-btn");
35

46
export const checkingAnimation = () => {
57
checkPasswordBtn.disabled = true;
8+
encryptBtn.disabled = true;
9+
decryptBtn.disabled = true;
10+
encryptBtn.classList.add("opacity-50", "hover:cursor-not-allowed");
11+
decryptBtn.classList.add("opacity-50", "hover:cursor-not-allowed");
612
checkPasswordBtn.classList.add("opacity-50", "hover:cursor-not-allowed");
713
checkPasswordBtn.classList.remove("hover:opacity-90");
814
messageBox.classList.remove("hidden", "opacity-10");

app/src/js/passwordCheck/error.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
const messageBox = document.querySelector("#message-box-2");
22
const checkPasswordBtn = document.querySelector("#check-password-btn");
3+
const encryptBtn = document.querySelector("#encrypt-btn");
4+
const decryptBtn = document.querySelector("#decrypt-btn");
35

46
export const errorAnimation = () => {
57
messageBox.innerHTML = "⚠️ Service Down, Try again later";
68
messageBox.classList.add("shake-up-down");
79
messageBox.classList.remove("hidden");
810
setTimeout(() => {
911
checkPasswordBtn.disabled = false;
12+
encryptBtn.disabled = false;
13+
decryptBtn.disabled = false;
14+
encryptBtn.classList.remove("opacity-50", "hover:cursor-not-allowed");
15+
decryptBtn.classList.remove("opacity-50", "hover:cursor-not-allowed");
1016
checkPasswordBtn.classList.remove("opacity-50", "hover:cursor-not-allowed");
1117
checkPasswordBtn.classList.add("hover:opacity-90");
1218
messageBox.innerHTML = "";

app/src/js/passwordCheck/hashFound.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const messageBox = document.querySelector("#message-box-2");
22
const checkPasswordBtn = document.querySelector("#check-password-btn");
3+
const encryptBtn = document.querySelector("#encrypt-btn");
4+
const decryptBtn = document.querySelector("#decrypt-btn");
35

46
export const hashFoundAnimation = (data) => {
57
messageBox.innerHTML = "";
@@ -8,6 +10,10 @@ export const hashFoundAnimation = (data) => {
810
messageBox.classList.remove("hidden");
911
setTimeout(() => {
1012
checkPasswordBtn.disabled = false;
13+
encryptBtn.disabled = false;
14+
decryptBtn.disabled = false;
15+
encryptBtn.classList.remove("opacity-50", "hover:cursor-not-allowed");
16+
decryptBtn.classList.remove("opacity-50", "hover:cursor-not-allowed");
1117
checkPasswordBtn.classList.remove("opacity-50", "hover:cursor-not-allowed");
1218
checkPasswordBtn.classList.add("hover:opacity-90");
1319
messageBox.innerHTML = "";

app/src/js/passwordCheck/hashNotFound.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const messageBox = document.querySelector("#message-box-2");
22
const checkPasswordBtn = document.querySelector("#check-password-btn");
3+
const encryptBtn = document.querySelector("#encrypt-btn");
4+
const decryptBtn = document.querySelector("#decrypt-btn");
35

46
export const hashNotFoundAnimation = () => {
57
messageBox.innerHTML = "";
@@ -8,6 +10,10 @@ export const hashNotFoundAnimation = () => {
810
messageBox.classList.remove("hidden");
911
setTimeout(() => {
1012
checkPasswordBtn.disabled = false;
13+
encryptBtn.disabled = false;
14+
decryptBtn.disabled = false;
15+
encryptBtn.classList.remove("opacity-50", "hover:cursor-not-allowed");
16+
decryptBtn.classList.remove("opacity-50", "hover:cursor-not-allowed");
1117
checkPasswordBtn.classList.remove("opacity-50", "hover:cursor-not-allowed");
1218
checkPasswordBtn.classList.add("hover:opacity-90");
1319
messageBox.innerHTML = "";

app/src/js/reset.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const clearAllBtn = document.querySelector("#clear-btn");
1010
const encryptBtn = document.querySelector("#encrypt-btn");
1111
const decryptBtn = document.querySelector("#decrypt-btn");
1212
const resetBtn = document.querySelector("#reset-btn");
13+
const checkPasswordBtn = document.querySelector("#check-password-btn");
1314
// Password
1415
const passwordInput = document.querySelector("#password-input");
1516
// Progress
@@ -28,6 +29,7 @@ function reset() {
2829
decryptBtn.disabled = false;
2930
decryptBtn.disabled = false;
3031
passwordInput.disabled = false;
32+
checkPasswordBtn.disabled = false;
3133
clearAllBtn.disabled = true;
3234
//
3335
fileBrowseContainer.classList.remove("opacity-40");

0 commit comments

Comments
 (0)