mirror of
https://github.com/MaciejkaG/statki.git
synced 2024-11-30 04:22:55 +01:00
Minor design/UI/UX improvements and fixes
This commit is contained in:
parent
fc01f72fa4
commit
ad23b8a18d
4
index.js
4
index.js
@ -622,6 +622,10 @@ io.on('connection', async (socket) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
socket.on('logout', () => {
|
||||||
|
session.destroy();
|
||||||
|
});
|
||||||
|
|
||||||
socket.on('disconnecting', () => {
|
socket.on('disconnecting', () => {
|
||||||
if (bships.isPlayerInRoom(socket)) {
|
if (bships.isPlayerInRoom(socket)) {
|
||||||
io.to(socket.rooms[1]).emit("player left");
|
io.to(socket.rooms[1]).emit("player left");
|
||||||
|
@ -338,3 +338,26 @@ nav span:hover {
|
|||||||
outline: none;
|
outline: none;
|
||||||
margin-left: 2rem;
|
margin-left: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#settingsView a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: var(--dynamic);
|
||||||
|
|
||||||
|
transition: opacity 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
#settingsView a:hover {
|
||||||
|
opacity: 0.6;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
#logout {
|
||||||
|
color: var(--danger);
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
transition: opacity 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
#logout:hover {
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
@ -99,7 +99,11 @@ loginForm.addEventListener('submit', (e) => {
|
|||||||
|
|
||||||
if (response.next === "done") {
|
if (response.next === "done") {
|
||||||
console.log("No authorisation required.");
|
console.log("No authorisation required.");
|
||||||
|
$("body").addClass("closed");
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
|
}, 700);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,6 +144,12 @@ $("#pvpMenuButton").on("click", function () {
|
|||||||
switchView('pvpMenuView');
|
switchView('pvpMenuView');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#logout").on("click", function() {
|
||||||
|
lockUI(true);
|
||||||
|
socket.emit("logout");
|
||||||
|
window.location.reload();
|
||||||
|
});
|
||||||
|
|
||||||
const form = document.getElementById('pvpJoinForm');
|
const form = document.getElementById('pvpJoinForm');
|
||||||
const input = document.getElementById('pvpJoinCode');
|
const input = document.getElementById('pvpJoinCode');
|
||||||
|
|
||||||
|
@ -23,10 +23,10 @@ function switchView(viewContainerId, useReplaceState=false) {
|
|||||||
function lockUI(doLock) {
|
function lockUI(doLock) {
|
||||||
if (doLock) {
|
if (doLock) {
|
||||||
$("body").css("pointer-events", "none");
|
$("body").css("pointer-events", "none");
|
||||||
$("body").css("opacity", "0.4");
|
$(".container").css("opacity", "0.4");
|
||||||
} else {
|
} else {
|
||||||
$("body").css("pointer-events", "inherit");
|
$("body").css("pointer-events", "inherit");
|
||||||
$("body").css("opacity", "1");
|
$(".container").css("opacity", "1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,6 +100,8 @@
|
|||||||
<select name="language" id="languages">
|
<select name="language" id="languages">
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
<h3><a href="/privacy" target="_blank">{{ t 'landing.Privacy policy' }}</a></h3>
|
||||||
|
<h3 id="logout">Log out</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user