Sync
This commit is contained in:
@@ -116,10 +116,11 @@ button.classic {
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
margin-left: 2%;
|
||||
margin-top: 5px;
|
||||
transition: .3s;
|
||||
margin-top: 5px;
|
||||
font-weight: 900;
|
||||
border-radius: 5px;
|
||||
z-index: 9;
|
||||
background-color: #39aa6d;
|
||||
}
|
||||
|
||||
@@ -247,6 +248,130 @@ main > section.twitch {
|
||||
right: 60px;
|
||||
}
|
||||
|
||||
input[type="range"] {
|
||||
width: 100%;
|
||||
border: none;
|
||||
accent-color: #2E8B57;
|
||||
background-color: #2E8B57;
|
||||
}
|
||||
|
||||
input[type="range"]#audioVolume {
|
||||
width: 83%;
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
input[type="password"] {
|
||||
width: 90%;
|
||||
border: 0px;
|
||||
color: #ffffff;
|
||||
outline: 0px;
|
||||
height: 30px;
|
||||
padding-left: 10px;
|
||||
margin-top: 4px;
|
||||
margin-bottom: 4px;
|
||||
border-radius: 5px;
|
||||
background-color: #292929;
|
||||
}
|
||||
|
||||
main > article.loginchoice {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 25%;
|
||||
height: 25%;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
border-radius: 10px;
|
||||
padding-top: 20px;
|
||||
transform: translate(-50%, -50%);
|
||||
background-color: #343434;
|
||||
}
|
||||
|
||||
main > article.loginchoice > input:nth-of-type(1) {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
button {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
button.login {
|
||||
width: 90%;
|
||||
height: 60px;
|
||||
border: none;
|
||||
outline: none;
|
||||
color: #ffffff;
|
||||
cursor: pointer;
|
||||
font-size: larger;
|
||||
font-weight: 900;
|
||||
border-radius: 10px;
|
||||
background-color: #292929;
|
||||
border: 3px #292929 solid;
|
||||
transition: .23s;
|
||||
margin-top: 13px;
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
button.login:hover {
|
||||
border-color: #12865c;
|
||||
}
|
||||
|
||||
button.login > img {
|
||||
width: 40px;
|
||||
margin-right: 10px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
div[frame="mojang"] > p {
|
||||
width: 90%;
|
||||
margin-left: 5%;
|
||||
text-align: left;
|
||||
font-size: small;
|
||||
margin-top: 4px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: underline;
|
||||
color: #12865c;
|
||||
}
|
||||
|
||||
article.game {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
article.game > label {
|
||||
font-size: small;
|
||||
margin-top: 7px;
|
||||
}
|
||||
|
||||
article.game > div.ranges {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
|
||||
article.game > div.ranges > span {
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
article.game > div.ranges > input {
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
div.checkboxes {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
input[type="checkbox"] {
|
||||
accent-color: #12865c;
|
||||
}
|
||||
|
||||
div.checkboxes > input[type="checkbox"] {
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
[hidden] {
|
||||
display: none;
|
||||
visibility: hidden;
|
||||
|
||||
BIN
app/assets/img/login_wallpaper.gif
Normal file
BIN
app/assets/img/login_wallpaper.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 257 MiB |
BIN
app/assets/img/microsoft.png
Normal file
BIN
app/assets/img/microsoft.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 795 B |
BIN
app/assets/img/mojang.png
Normal file
BIN
app/assets/img/mojang.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
@@ -1,15 +1,20 @@
|
||||
const navBar = document.querySelector("nav")
|
||||
const uiButton = document.querySelector("footer>section.left")
|
||||
const uiButtons = document.querySelector("footer>section.left")
|
||||
const footer = document.querySelector("footer")
|
||||
const leftSection = document.querySelector("section.left")
|
||||
const audioPourcentageLabel = document.querySelector("label[for='audioVolume']")
|
||||
const audio = new Audio()
|
||||
|
||||
function startAudio() {
|
||||
audio.src = "/app/assets/audio/Golden Hill (Radio Edit).mp3"
|
||||
audio.src = "./assets/audio/Golden Hill (Radio Edit).mp3"
|
||||
audio.loop = true
|
||||
audio.play()
|
||||
audio.onended = () => {
|
||||
if (!audio.paused) {
|
||||
audio.play()
|
||||
}
|
||||
}
|
||||
updateVolume(audio.volume)
|
||||
}
|
||||
|
||||
function muteAudio() {
|
||||
@@ -21,23 +26,71 @@ function unmuteAudio() {
|
||||
}
|
||||
|
||||
function showNavBar() {
|
||||
footer.style.zIndex = "-1"
|
||||
leftSection.style.zIndex = "-1"
|
||||
navBar.removeAttribute("hidden")
|
||||
for (const button of uiButton.children) {
|
||||
for (const button of uiButtons.children) {
|
||||
button.setAttribute("hidden", "")
|
||||
}
|
||||
}
|
||||
|
||||
function hideNavBar() {
|
||||
footer.style.zIndex = "9"
|
||||
leftSection.style.zIndex = "9"
|
||||
navBar.setAttribute("hidden", "")
|
||||
for (const button of uiButton.children) {
|
||||
for (const button of uiButtons.children) {
|
||||
button.removeAttribute("hidden")
|
||||
}
|
||||
}
|
||||
|
||||
function toggleAudio(element) {
|
||||
if (element.getAttribute("state") == 0) {
|
||||
system.call("audio::mute")
|
||||
element.setAttribute("state", 1)
|
||||
element.children[0].classList.replace("fa-music", "fa-music-slash")
|
||||
} else {
|
||||
system.call("audio::unmute")
|
||||
element.setAttribute("state", 0)
|
||||
element.children[0].classList.replace("fa-music-slash", "fa-music")
|
||||
}
|
||||
}
|
||||
|
||||
function toggleMusic(element) {
|
||||
if (element.getAttribute("state") == 0) {
|
||||
system.call("audio::mute")
|
||||
element.setAttribute("state", 1)
|
||||
element.children[0].classList.replace("fa-pause", "fa-play")
|
||||
element.children[1].innerText = "Reprendre"
|
||||
} else {
|
||||
system.call("audio::unmute")
|
||||
element.setAttribute("state", 0)
|
||||
element.children[0].classList.replace("fa-play", "fa-pause")
|
||||
element.children[1].innerText = "Pause"
|
||||
}
|
||||
}
|
||||
|
||||
function updateVolume(value) {
|
||||
audio.volume = value / 100
|
||||
audioPourcentageLabel.innerText = `${value}%`
|
||||
}
|
||||
|
||||
function logout() {
|
||||
localStorage.removeItem("user")
|
||||
document.location.href = './login.html'
|
||||
}
|
||||
|
||||
window.onload = () => {
|
||||
system.call("server::ping")
|
||||
system.call("player::profile")
|
||||
startAudio()
|
||||
}
|
||||
|
||||
system.result("server::ping", (data) => {
|
||||
playersStatus.innerText = `${data.players.online}/${data.players.max}`
|
||||
})
|
||||
|
||||
system.result("player::profile", (data) => {
|
||||
if (!localStorage.getItem("user")) {
|
||||
localStorage.setItem("user", JSON.stringify(data))
|
||||
}
|
||||
})
|
||||
30
app/assets/js/login.js
Normal file
30
app/assets/js/login.js
Normal file
@@ -0,0 +1,30 @@
|
||||
const loginchoice = document.querySelector("main > article.loginchoice")
|
||||
|
||||
function selectLoginType(type) {
|
||||
for (const frame of loginchoice.children) {
|
||||
frame.setAttribute("hidden", "")
|
||||
if (frame.getAttribute("frame") == type) {
|
||||
frame.removeAttribute("hidden")
|
||||
}
|
||||
}
|
||||
if (type == "microsoft") {
|
||||
system.call(`auth::${type}`)
|
||||
}
|
||||
}
|
||||
|
||||
system.result("auth::microsoft", () => {
|
||||
selectLoginType("select")
|
||||
})
|
||||
|
||||
system.result("auth::refresh", () => {
|
||||
selectLoginType("select")
|
||||
})
|
||||
|
||||
window.onload = () => {
|
||||
if (localStorage.getItem("user")) {
|
||||
system.call("auth::refresh", {
|
||||
user: JSON.parse(localStorage.getItem("user"))
|
||||
})
|
||||
selectLoginType("token")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user