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,
.signup {
#login,
#signup {
display: none;
background: #fff;
@ -22,7 +22,7 @@
font-size: 18px;
}
.login > button,
.signup > button {
#login > button,
#signup > button {
cursor: pointer;
}

View file

@ -7,7 +7,7 @@
<link rel="stylesheet" href="css/title-bar.css" />
<link rel="stylesheet" href="css/login-signup.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>
<body>
@ -15,10 +15,10 @@
<img src="assets/logo.png" />
<span class="profil">
<button onclick="toggleLogin()">Login</button>
<button onclick="toggleSignup()">Signup</button>
<button onclick="toggleLogin();">Login</button>
<button onclick="toggleSignup();">Signup</button>
<div class="login">
<div id="login">
<button onclick="toggleLogin()" class="close">X</button>
Login
@ -38,7 +38,7 @@
</form>
</div>
<div class="signup">
<div id="signup">
<button onclick="toggleSignup()" class="close">X</button>
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();
/////////////////////////
// LoginSignup stuff ? //
/////////////////////////
function toggleLoginSignup(l, s) {
document.getElementById("show-login").checked = l;
document.getElementById("show-signup").checked = s;
}