From b329bcdf9c7aaf69dc0d3cf04f8718ad1723a7c5 Mon Sep 17 00:00:00 2001
From: Tanner R <2151516+TannerR1776@users.noreply.github.com>
Date: Wed, 30 Jun 2021 21:11:53 -0500
Subject: [PATCH] feat(password): refactor password input component to better
support password managers
---
src/components/Seed.vue | 7 +--
src/components/Utility/InputPassword.vue | 71 ++++++++++++++++++----
src/global-styles/custom.scss | 76 ++++++++++++++++++++----
src/views/Login.vue | 36 +----------
src/views/Settings.vue | 10 ++--
src/views/Start.vue | 4 +-
6 files changed, 135 insertions(+), 69 deletions(-)
diff --git a/src/components/Seed.vue b/src/components/Seed.vue
index d74f2af8..7e3ac0a0 100644
--- a/src/components/Seed.vue
+++ b/src/components/Seed.vue
@@ -6,11 +6,8 @@
v-model="password"
ref="password"
placeholder="Password"
- inputGroupClass="neu-input-group"
- :inputClass="[
- isIncorrectPassword ? 'incorrect-password' : '',
- 'form-control form-control-lg neu-input w-100'
- ]"
+ displayStyle="FormStyle"
+ :displayInvalidAttempt="isIncorrectPassword"
:disabled="isLoadingSeed"
/>
diff --git a/src/components/Utility/InputPassword.vue b/src/components/Utility/InputPassword.vue
index 39cebfcd..86f9b1fd 100644
--- a/src/components/Utility/InputPassword.vue
+++ b/src/components/Utility/InputPassword.vue
@@ -1,16 +1,15 @@
-
-
-
+
-
+
@@ -18,13 +17,18 @@
-
+
diff --git a/src/global-styles/custom.scss b/src/global-styles/custom.scss
index 8a5900c0..fb83737a 100644
--- a/src/global-styles/custom.scss
+++ b/src/global-styles/custom.scss
@@ -129,6 +129,48 @@ a {
}
}
+.form-input-group {
+ border-radius: 1rem;
+
+ .form-input-group-input {
+ box-shadow: inset 2px 7px 9px -7px rgba(0,0,0,0.2), //top
+ inset 2px -7px 9px -7px rgba(0,0,0,0.2), //bottom
+ inset 5px 0 5px -7px rgba(0,0,0,0.2); //left
+ border: none !important;
+ }
+
+ .form-input-group-input:focus {
+ box-shadow: inset 3px 7px 9px -7px rgba(0,0,0,0.3), //top
+ inset 3px -7px 9px -7px rgba(0,0,0,0.3), //bottom
+ inset 5px 0 5px -7px rgba(0,0,0,0.3); //left
+ border: none !important;
+ }
+
+ .form-input-group-input:focus + .input-group-append > .btn-lg {
+ box-shadow: inset -3px 7px 9px -7px rgba(0,0,0,0.3), //top
+ inset -3px -7px 9px -7px rgba(0,0,0,0.3), //bottom
+ inset -5px 0 5px -7px rgba(0,0,0,0.3) //right
+ !important;
+ }
+
+ .input-group-append {
+ margin-left: 0px;
+ }
+
+ .input-group-append > .btn-lg {
+ padding: 0.375rem 0.75rem;
+ color: #616877;
+ box-shadow: inset -2px 7px 9px -7px rgba(0,0,0,0.2), //top
+ inset -2px -7px 9px -7px rgba(0,0,0,0.2), //bottom
+ inset -5px 0 5px -7px rgba(0,0,0,0.2) //right
+ !important;
+ background-color: unset;
+ }
+
+ .input-group-append > .btn-lg:active {
+ background-color: unset;
+ }
+}
.dropdown-menu {
background: #ffffff;
@@ -160,19 +202,33 @@ a {
}
.card-input-group {
- .card-input {
- padding-right: 3rem;
+ box-shadow: 0px 10px 30px rgba(209, 213, 223, 0.5);
+ border-radius: 1rem;
+
+ &:hover,
+ &:focus,
+ &:active {
+ box-shadow: 0px 10px 40px rgba(209, 213, 223, 0.9);
+ }
+
+ .card-input-group-input {
+ -webkit-appearance: none; //iOS messes up forms - See: https://stackoverflow.com/questions/10757146/iphone-ios-will-not-display-box-shadow-properly
+ border-radius: 1rem;
+ height: calc(2.25em + 1.125rem + 2px);
+ padding: 0.5rem 1rem;
+ outline: 0 !important;
+ border: none !important;
+
+ &:hover,
+ &:focus,
+ &:active {
+ box-shadow: none;
+ }
}
+
.input-group-append > .btn {
- background: none !important;
color: #616877;
- border: none !important;
- outline: none !important;
- box-shadow: none !important;
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- right: 0.5rem;
+ background-color: #ffffff !important;
}
}
diff --git a/src/views/Login.vue b/src/views/Login.vue
index f0fb9217..293c06dd 100644
--- a/src/views/Login.vue
+++ b/src/views/Login.vue
@@ -21,10 +21,8 @@
v-model="password"
ref="password"
placeholder="Password"
- :inputClass="[
- isIncorrectPassword ? 'incorrect-password' : '',
- 'card-input w-100'
- ]"
+ formStyle="CardInput"
+ :displayInvalidAttempt="isIncorrectPassword"
:disabled="isLoggingIn"
/>