diff --git a/src/components/InputStrength/index.scss b/src/components/InputStrength/index.scss new file mode 100644 index 0000000..5ed241e --- /dev/null +++ b/src/components/InputStrength/index.scss @@ -0,0 +1,76 @@ +.inputStrength { + width: 100%; + :deep(.#{'el'}-input__clear) { + margin-left: 5px; + } + &-input { + &_icon { + cursor: pointer; + } + } + &-line { + background-color: var(--el-text-color-disabled); + border-radius: var(--el-border-radius-base); + position: relative; + margin-bottom: 6px; + margin-left: auto; + margin-right: auto; + margin-top: 10px; + height: 6px; + &::before, + &::after { + position: absolute; + z-index: 10; + display: block; + width: 20%; + height: inherit; + background-color: transparent; + border-color: var(--el-color-white); + border-style: solid; + border-width: 0 5px; + content: ''; + } + + &::before { + left: 20%; + } + + &::after { + right: 20%; + } + + &_visual { + position: absolute; + width: 0; + height: inherit; + background-color: transparent; + border-radius: inherit; + transition: width 0.5s ease-in-out, background 0.25s; + + &[data-score='0'] { + width: 20%; + background-color: var(--el-color-danger); + } + + &[data-score='1'] { + width: 40%; + background-color: var(--el-color-danger); + } + + &[data-score='2'] { + width: 60%; + background-color: var(--el-color-warning); + } + + &[data-score='3'] { + width: 80%; + background-color: var(--el-color-success); + } + + &[data-score='4'] { + width: 100%; + background-color: var(--el-color-success); + } + } + } +} diff --git a/src/components/InputStrength/index.vue b/src/components/InputStrength/index.vue new file mode 100644 index 0000000..6ef7e4a --- /dev/null +++ b/src/components/InputStrength/index.vue @@ -0,0 +1,72 @@ + + + + +