Skip to content
Snippets Groups Projects
Commit 96cfb9af authored by Elisabethein's avatar Elisabethein
Browse files

Added show password to login #154

parent 9b9b6925
Branches Elisabet
No related tags found
No related merge requests found
Pipeline #48325 passed
...@@ -12,7 +12,18 @@ ...@@ -12,7 +12,18 @@
<div class="form-field"> <div class="form-field">
<label for="password">Salasõna</label> <label for="password">Salasõna</label>
<input type="password" id="password" v-model="password" placeholder="Sisesta salasõna" required /> <div class="password-container">
<input
:type="showPassword ? 'password-text' : 'password'"
id="password"
v-model="password"
placeholder="Sisesta salasõna"
required
/>
<span class="toggle-password" @click="togglePasswordVisibility">
{{ showPassword ? 'Peida' : 'Näita' }}
</span>
</div>
</div> </div>
<div class="button-container"> <div class="button-container">
...@@ -31,11 +42,14 @@ export default { ...@@ -31,11 +42,14 @@ export default {
return { return {
email: '', email: '',
password: '', password: '',
showPassword: false,
}; };
}, },
methods: { methods: {
...mapActions(['login']), ...mapActions(['login']),
togglePasswordVisibility() {
this.showPassword = !this.showPassword;
},
async handleLogin() { async handleLogin() {
try { try {
//const response = await fetch('http://localhost:8080/api/login', { //const response = await fetch('http://localhost:8080/api/login', {
...@@ -113,6 +127,38 @@ input { ...@@ -113,6 +127,38 @@ input {
font-size: 1em; font-size: 1em;
} }
.password-container {
width: 100%;
padding: 10px;
border: none;
border-radius: 5px;
margin-top: 5px;
font-size: 1em;
background-color: #fff;
display: flex;
align-items: center;
}
input[type="password"],
input[type="password-text"]{
border: none;
outline: none;
padding: 0;
flex: 1;
background: transparent;
}
.toggle-password {
margin-left: 10px;
cursor: pointer;
color: #5E89A8;
font-size: 0.9em;
}
.toggle-password:hover {
text-decoration: underline;
}
.button-container { .button-container {
text-align: right; /* Align button to the right */ text-align: right; /* Align button to the right */
} }
...@@ -131,19 +177,4 @@ button.login-button:hover { ...@@ -131,19 +177,4 @@ button.login-button:hover {
background-color: #89d970; background-color: #89d970;
} }
.forgot-password {
text-align: left;
margin-bottom: 10px;
}
.forgot-password a {
text-decoration: none;
color: #5E89A8;
font-size: 0.9em;
}
.forgot-password a:hover {
text-decoration: underline;
}
</style> </style>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment