UI Improvements
This commit is contained in:
parent
4951c288fa
commit
22d79165b2
BIN
Assets/hacker-128.png
Normal file
BIN
Assets/hacker-128.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.2 KiB |
BIN
Assets/hacker-1k.png
Normal file
BIN
Assets/hacker-1k.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 68 KiB |
16
auth/auth.js
16
auth/auth.js
@ -191,6 +191,18 @@ const displayFingerprints = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const setUIData = (data) => {
|
||||||
|
if (document.getElementById("resizer")) {
|
||||||
|
document.getElementById("resizer").innerHTML = data.display_name;
|
||||||
|
}
|
||||||
|
if(document.getElementById("logo")){
|
||||||
|
var logo = document.getElementById("logo");
|
||||||
|
logo.src = data.avatar;
|
||||||
|
logo.style.borderRadius = "10%";
|
||||||
|
logo.alt = "Profile icon for " + data.display_name;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const checkLogin = () => {
|
const checkLogin = () => {
|
||||||
// check login status
|
// check login status
|
||||||
var token = localStorage.getItem("tty_token");
|
var token = localStorage.getItem("tty_token");
|
||||||
@ -214,7 +226,7 @@ const checkLogin = () => {
|
|||||||
}else {
|
}else {
|
||||||
localStorage.setItem("tty_token", response.refreshToken);
|
localStorage.setItem("tty_token", response.refreshToken);
|
||||||
localStorage.setItem("tty_userData", JSON.stringify(response.data));
|
localStorage.setItem("tty_userData", JSON.stringify(response.data));
|
||||||
document.getElementById("resizer").innerHTML = response.data.display_name;
|
setUIData(response.data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else {
|
}else {
|
||||||
@ -269,7 +281,7 @@ $(() => {
|
|||||||
}else{
|
}else{
|
||||||
localStorage.setItem("tty_token", response.refreshToken);
|
localStorage.setItem("tty_token", response.refreshToken);
|
||||||
localStorage.setItem("tty_userData", JSON.stringify(response.data));
|
localStorage.setItem("tty_userData", JSON.stringify(response.data));
|
||||||
document.getElementById("resizer").innerHTML = response.data.display_name;
|
setUIData(response.data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -4,6 +4,6 @@
|
|||||||
}else{
|
}else{
|
||||||
echo "<a href=\"https://tty.hackers.town\">";
|
echo "<a href=\"https://tty.hackers.town\">";
|
||||||
}?>
|
}?>
|
||||||
<img src="/Assets/HTown.png" class="logo self-align-center mx-auto d-block" alt="Hacker Town logo in ASCII art. Rendered as image to force correct visualization."/>
|
<img src="/Assets/HTown.png" class="logo self-align-center mx-auto d-block" alt="Hacker Town logo in ASCII art. Rendered as image to force correct visualization." id="logo"/>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,5 +4,5 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="row button">
|
<div class="row button">
|
||||||
<button id="bttn" class="keyButton" onclick="beginOauth()">Log In With HTown <!-- img src="/Assets/HTown.png" class="emoji"/ --></button>
|
<button id="bttn" class="keyButton" onclick="beginOauth()">Log In With <img src="/Assets/hacker-128.png" class="emoji" /></button>
|
||||||
</div>
|
</div>
|
||||||
|
2
index.js
2
index.js
@ -136,6 +136,8 @@ $(() => {
|
|||||||
Swal.fire({
|
Swal.fire({
|
||||||
...SwalConfig,
|
...SwalConfig,
|
||||||
text: message
|
text: message
|
||||||
|
}).then(() => {
|
||||||
|
window.location.replace("/");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user