updated login/signup page

This commit is contained in:
josephroy99 2024-02-14 20:46:37 +00:00
parent c2184986f7
commit a450e8c3f0
2 changed files with 115 additions and 20 deletions

View File

@ -90,14 +90,14 @@
dialog { dialog {
position: absolute; position: absolute;
border: black solid 2px; border: none;
left: 50%; left: 50%;
top: 50%; top: 50%;
margin: 0px; margin: 0px;
transform: translate(-50%,-50%); transform: translate(-50%,-50%);
border-radius: 20px; border-radius: 20px;
width: 500px; width: 500px;
height: 500px; height: 540px;
background: white; background: white;
padding: 0px; padding: 0px;
box-sizing: border-box; box-sizing: border-box;
@ -109,11 +109,58 @@
dialog input { dialog input {
box-sizing: border-box; box-sizing: border-box;
margin: 50px; width: 100%;
width: calc(100% - 100px); border: #5b8dff solid 2px;
border: none;
padding: 10px; padding: 10px;
border-radius: 100000px; border-radius: 100000px;
background-color: #f8f8f8;
outline: none;
font-family: 'Protest Strike'
}
dialog input[type=submit] {
border: none;
margin: 40px 0px;
background-color: #00bfff;
color: white;
font-size: 1.3em;
}
dialog label {
display: block;
margin: 30px 0px 10px 20px;
}
dialog div {
margin: 10% 10% 0px 10%;
}
dialog p {
font-size: 40px;
}
dialog img {
position: absolute;
margin: 10px;
right: 0%;
height: 30px;
width: 30px;
padding: 5px;
border: none;
border-radius: 10%;
transition: all ease-in-out 50ms;
}
dialog img:hover {
background-color: rgb(0, 0, 0, 0.588);
}
.signup-dialog {
height: 600px;
}
.login-dialog {
height: 500px;
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
@ -135,6 +182,10 @@
border: black 2px solid; border: black 2px solid;
} }
dialog img:hover {
background-color: rgb(255, 255, 255, 0.588);
}
.input-button { .input-button {
background: white; background: white;
color:black; color:black;
@ -197,7 +248,7 @@
Sort Your Finances. Sort Your Finances.
</h2> </h2>
</span> </span>
<input id="show-login-dialog" class="input-button signup-button" type="button" value="Create account"> <input id="show-signup-dialog" class="input-button signup-button" type="button" value="Create account">
<div class="horizontal-splitter"> <div class="horizontal-splitter">
<div class="side-line"> <div class="side-line">
@ -209,30 +260,64 @@
</div> </div>
</div> </div>
<input class="input-button" type="button" value="Login"> <input id="show-login-dialog" class="input-button" type="button" value="Login">
</div> </div>
</div> </div>
<dialog id="signup-dialog"> <dialog id="signup-dialog" class="signup-dialog">
<img src="x-button.png" class="close-dialog"/>
<div>
<form>
<p>We just need a few details.</p>
<label>Name</label>
<input type="text" placeholder="Enter your Name">
<label>Email</label>
<input type="text" placeholder="Enter your Email"> <input type="text" placeholder="Enter your Email">
<label>Password</label>
<input type="text" placeholder="Enter a Password">
<input type="submit" value="Start DinoSaving!">
</form>
</div>
</dialog> </dialog>
<dialog id="login-dialog"> <dialog id="login-dialog" class="login-dialog">
<input type="text" placeholder="Enter your Username or Email"> <img src="x-button.png" class="close-dialog"/>
<div>
<form>
<p>Please enter your login details.</p>
<label>Email</label>
<input type="text" placeholder="Enter your Email">
<label>Password</label>
<input type="text" placeholder="Enter your Password">
<input type="submit" value="Login!">
</form>
</div>
</dialog> </dialog>
</body> </body>
</html> </html>
<script> <script>
function openCheck(dialog) { document.addEventListener('DOMContentLoaded', function () {
if (dialog.open) {
console.log("Dialog open");
} else {
console.log("Dialog closed");
}
return dialog.open; var allCloseButtons = document.querySelectorAll('.close-dialog');
}
allCloseButtons.forEach(function (closeButton) {
closeButton.addEventListener('click', function () {
var allDialogs = document.querySelectorAll('dialog');
allDialogs.forEach(function (dialog) {
dialog.close();
});
});
});
});
document.addEventListener('DOMContentLoaded', function () { document.addEventListener('DOMContentLoaded', function () {
var loginDialog = document.getElementById('show-login-dialog'); var loginDialog = document.getElementById('show-login-dialog');
@ -243,7 +328,17 @@
currentModal.close(); currentModal.close();
currentModal.showModal(); currentModal.showModal();
openCheck(currentModal); });
});
document.addEventListener('DOMContentLoaded', function () {
var loginDialog = document.getElementById('show-signup-dialog');
loginDialog.addEventListener('click', function () {
var currentModal = document.getElementById('signup-dialog');
currentModal.close();
currentModal.showModal();
}); });
}); });

BIN
roysathome.net/x-button.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 B