forked from mirrors/homebox
chore: cleanup (#27)
* implement password score UI and functions * update strings tests to use `test`instead of `it` * update typing * refactor login/register UI+Logic * fix width on switches to properly display * fetch and store self in store * (WIP) unify card styles * update labels page * bump nuxt * use form area * use text area for description * unify confirm API * unify UI around pages * change header background height
This commit is contained in:
parent
b34cb2bbeb
commit
2e82398e5c
24 changed files with 1313 additions and 1934 deletions
40
frontend/components/global/PasswordScore.vue
Normal file
40
frontend/components/global/PasswordScore.vue
Normal file
|
@ -0,0 +1,40 @@
|
|||
<template>
|
||||
<div class="py-4">
|
||||
<p class="text-sm">Password Strength: {{ message }}</p>
|
||||
<progress
|
||||
class="progress w-full progress-bar"
|
||||
:value="score"
|
||||
max="100"
|
||||
:class="{
|
||||
'progress-success': score > 50,
|
||||
'progress-warning': score > 25 && score < 50,
|
||||
'progress-error': score < 25,
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const props = defineProps({
|
||||
password: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
valid: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
},
|
||||
});
|
||||
|
||||
const emits = defineEmits(["update:valid"]);
|
||||
|
||||
const { password } = toRefs(props);
|
||||
|
||||
const { score, message, isValid } = usePasswordScore(password);
|
||||
|
||||
watchEffect(() => {
|
||||
emits("update:valid", isValid.value);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
Loading…
Add table
Add a link
Reference in a new issue