Amélioration js
This commit is contained in:
джерело
8cede4db62
коміт
e4fb9b60c2
2 змінених файлів з 10 додано та 3 видалено
|
@ -118,10 +118,12 @@ main{
|
||||||
|
|
||||||
#buttonBlock{
|
#buttonBlock{
|
||||||
height:4vw;
|
height:4vw;
|
||||||
|
display:flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
#button {
|
#button {
|
||||||
margin-top:2vw;
|
|
||||||
display:flex;
|
display:flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -166,6 +168,7 @@ footer{
|
||||||
justify-content:flex-end;
|
justify-content:flex-end;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size:1vw;
|
font-size:1vw;
|
||||||
|
margin-top:2vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
#names{
|
#names{
|
||||||
|
|
|
@ -7,14 +7,17 @@ let pseudo = ""
|
||||||
//functions
|
//functions
|
||||||
|
|
||||||
function initPseudoInput(){
|
function initPseudoInput(){
|
||||||
console.log(pseudo);
|
|
||||||
pseudoInput.value = ""
|
pseudoInput.value = ""
|
||||||
console.log(pseudo);
|
}
|
||||||
|
|
||||||
|
function initError(){
|
||||||
|
errorTxt.innerText = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleNavigation(){
|
function handleNavigation(){
|
||||||
console.log(pseudo);
|
console.log(pseudo);
|
||||||
if (pseudo){
|
if (pseudo){
|
||||||
|
initError();
|
||||||
button.childNodes[1].setAttribute("href","etrange_decouverte.html")
|
button.childNodes[1].setAttribute("href","etrange_decouverte.html")
|
||||||
localStorage.setItem("pseudo",pseudo);
|
localStorage.setItem("pseudo",pseudo);
|
||||||
} else {
|
} else {
|
||||||
|
@ -29,6 +32,7 @@ function handlePseudoChange(event){
|
||||||
}
|
}
|
||||||
|
|
||||||
initPseudoInput();
|
initPseudoInput();
|
||||||
|
initError();
|
||||||
|
|
||||||
// event listeners
|
// event listeners
|
||||||
pseudoInput.addEventListener("change",handlePseudoChange)
|
pseudoInput.addEventListener("change",handlePseudoChange)
|
||||||
|
|
Завантаження…
Посилання в новій задачі