fix: javascript for login/signup popups

This commit is contained in:
Laureηt 2022-05-27 16:05:30 +02:00
parent fbc6dbf283
commit 434342bc86
No known key found for this signature in database
GPG key ID: D88C6B294FD40994
4 changed files with 31 additions and 18 deletions

View file

@ -1,5 +1,5 @@
.login, #login,
.signup { #signup {
display: none; display: none;
background: #fff; background: #fff;
@ -22,7 +22,7 @@
font-size: 18px; font-size: 18px;
} }
.login > button, #login > button,
.signup > button { #signup > button {
cursor: pointer; cursor: pointer;
} }

View file

@ -7,7 +7,7 @@
<link rel="stylesheet" href="css/title-bar.css" /> <link rel="stylesheet" href="css/title-bar.css" />
<link rel="stylesheet" href="css/login-signup.css" /> <link rel="stylesheet" href="css/login-signup.css" />
<link rel="stylesheet" href="css/pixels.css" /> <link rel="stylesheet" href="css/pixels.css" />
<!-- <script type="text/javascript" src="js/ixels.js"></script> --> <script src="js/login-signup.js"></script>
</head> </head>
<body> <body>
@ -15,10 +15,10 @@
<img src="assets/logo.png" /> <img src="assets/logo.png" />
<span class="profil"> <span class="profil">
<button onclick="toggleLogin()">Login</button> <button onclick="toggleLogin();">Login</button>
<button onclick="toggleSignup()">Signup</button> <button onclick="toggleSignup();">Signup</button>
<div class="login"> <div id="login">
<button onclick="toggleLogin()" class="close">X</button> <button onclick="toggleLogin()" class="close">X</button>
Login Login
@ -38,7 +38,7 @@
</form> </form>
</div> </div>
<div class="signup"> <div id="signup">
<button onclick="toggleSignup()" class="close">X</button> <button onclick="toggleSignup()" class="close">X</button>
Signup Signup

View file

@ -0,0 +1,22 @@
function toggleLogin() {
signup = document.getElementById("signup");
signup.style.display = "none";
toggleElement("login");
}
function toggleSignup() {
login = document.getElementById("login");
login.style.display = "none";
toggleElement("signup");
}
function toggleElement(id) {
element = document.getElementById(id);
if (element.style.display === "none" || element.style.display === "") {
element.style.display = "unset";
} else {
element.style.display = "none";
}
}

View file

@ -222,12 +222,3 @@ function updatePixelBuyPreview(pixel) {
} }
initBuyPixel(); initBuyPixel();
/////////////////////////
// LoginSignup stuff ? //
/////////////////////////
function toggleLoginSignup(l, s) {
document.getElementById("show-login").checked = l;
document.getElementById("show-signup").checked = s;
}