Compare commits
3 Commits
25e61c553f
...
v0.0.5
| Author | SHA1 | Date | |
|---|---|---|---|
| 37c6978d1b | |||
| 9389df28e4 | |||
| b94bc612c3 |
@@ -33,7 +33,7 @@ var (
|
||||
)
|
||||
|
||||
func ReadBlankPhoto() {
|
||||
blank, err := helpers.ReadFile("static/blank_profile.jpg")
|
||||
blank, err := helpers.ReadFile("static/images/blank_profile.jpg")
|
||||
if err != nil {
|
||||
logging.Fatal("Could not load blank profile image")
|
||||
}
|
||||
|
||||
@@ -28,9 +28,16 @@
|
||||
|
||||
<div>
|
||||
<label class="input_label">Password</label><br />
|
||||
<input type="password" name="password" placeholder="" required />
|
||||
<div class="password_box">
|
||||
<input type="password" name="password" placeholder="" required />
|
||||
<button type="button" class="show_password_toggle closed"></button>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit">Login</button>
|
||||
</form>
|
||||
|
||||
<script src="/static/error/error.js" type="text/javascript"></script>
|
||||
<script
|
||||
src="/static/javascript/show_password.js"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
<link rel="stylesheet" href="static/profile_page.css" />
|
||||
<link rel="stylesheet" href="static/progress_bar.css" />
|
||||
|
||||
<div id="popup_background" class="blocked"></div>
|
||||
<div id="popup_background" class="blocked hidden"></div>
|
||||
|
||||
<div id="change_password_dialogue" class="card static_center">
|
||||
<div id="change_password_dialogue" class="card static_center hidden">
|
||||
<div class="dialouge_title">Change Password</div>
|
||||
<button id="close_password_dialogue">X</button>
|
||||
|
||||
@@ -36,35 +36,44 @@
|
||||
|
||||
<div>
|
||||
<label class="input_label">Current password</label><br />
|
||||
<input
|
||||
type="password"
|
||||
id="current_password"
|
||||
name="current_password"
|
||||
placeholder=""
|
||||
required
|
||||
/>
|
||||
<div class="password_box">
|
||||
<input
|
||||
type="password"
|
||||
id="current_password"
|
||||
name="current_password"
|
||||
placeholder=""
|
||||
required
|
||||
/>
|
||||
<button type="button" class="show_password_toggle closed"></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="input_label">New password</label><br />
|
||||
<input
|
||||
type="password"
|
||||
id="new_password"
|
||||
name="new_password"
|
||||
placeholder=""
|
||||
required
|
||||
/>
|
||||
<div class="password_box">
|
||||
<input
|
||||
type="password"
|
||||
id="new_password"
|
||||
name="new_password"
|
||||
placeholder=""
|
||||
required
|
||||
/>
|
||||
<button type="button" class="show_password_toggle closed"></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="input_label">New password (repeat)</label><br />
|
||||
<input
|
||||
type="password"
|
||||
id="new_password_repeat"
|
||||
name="new_password_repeat"
|
||||
placeholder=""
|
||||
required
|
||||
/>
|
||||
<div class="password_box">
|
||||
<input
|
||||
type="password"
|
||||
id="new_password_repeat"
|
||||
name="new_password_repeat"
|
||||
placeholder=""
|
||||
required
|
||||
/>
|
||||
<button type="button" class="show_password_toggle closed"></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@@ -112,7 +121,7 @@
|
||||
|
||||
<button id="edit_picture_button">
|
||||
<img
|
||||
src="/static/crayon_icon.png"
|
||||
src="/static/images/crayon_icon.png"
|
||||
id="edit_picture_image"
|
||||
/>
|
||||
</button>
|
||||
@@ -216,3 +225,8 @@
|
||||
src="/static/javascript/handle_password_change.js"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
|
||||
<script
|
||||
src="/static/javascript/show_password.js"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
|
||||
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
BIN
static/images/closed_eye.png
Normal file
BIN
static/images/closed_eye.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
BIN
static/images/filled_eye.png
Normal file
BIN
static/images/filled_eye.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
22
static/javascript/show_password.js
Normal file
22
static/javascript/show_password.js
Normal file
@@ -0,0 +1,22 @@
|
||||
const showPasswordButtons = document.getElementsByClassName(
|
||||
"show_password_toggle",
|
||||
);
|
||||
|
||||
for (const button of showPasswordButtons) {
|
||||
button.addEventListener("click", function () {
|
||||
const input = this.parentElement.querySelector(
|
||||
"input[type='password'], input[type='text']",
|
||||
);
|
||||
if (!input) return;
|
||||
const isHidden = input.type === "password";
|
||||
input.type = isHidden ? "text" : "password";
|
||||
|
||||
if (isHidden) {
|
||||
this.classList.add("open");
|
||||
this.classList.remove("closed");
|
||||
} else {
|
||||
this.classList.remove("open");
|
||||
this.classList.add("closed");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -95,3 +95,37 @@ input::placeholder {
|
||||
margin-bottom: 0px;
|
||||
color: var(--text-main) !important;
|
||||
}
|
||||
|
||||
.password_box {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.show_password_toggle {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
bottom: 50%;
|
||||
transform: translateY(50%);
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
.show_password_toggle.closed {
|
||||
background-image: url("/static/images/closed_eye.png");
|
||||
}
|
||||
|
||||
.show_password_toggle.open {
|
||||
background-image: url("/static/images/filled_eye.png");
|
||||
}
|
||||
|
||||
.show_password_toggle:hover {
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
.show_password_toggle:focus {
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user