Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add drop downs to Log-in and Register Fields #78

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 31 additions & 17 deletions website/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,29 @@
<nav>
<li id="home"><a href="#"><img src="./assets/logo.png"></a></li>
<li id="login-li">
<div class="loginContainer">
<form id="loginForm">
<input id="username-field" class="login-stuff" type="text" placeholder="Username" name="username"
maxlength="16" autocomplete="off" required />
<input id="password-field" class="login-stuff" type="text" placeholder="Password" name="password"
maxlength="16" autocomplete="off" required />
<button id="login" class="login-stuff" type="button">Login</button>
</form>
<div class="dropdown">
<button class="dropdown-btn">Log-in</button>
<div class="dropdown-content">
<div class="loginContainer">
<form id="loginForm">
<input id="username-field" class="login-stuff" type="text" placeholder="Username" name="username"
maxlength="16" autocomplete="off" required />
<input id="password-field" class="login-stuff" type="text" placeholder="Password" name="password"
maxlength="16" autocomplete="off" required />
<button id="login" class="login-stuff" type="button">Login</button>
</form>
</div>
<div class="loginContainer">
<form id="registerForm">
<input id="register-username-field" class="register-stuff" type="text" placeholder="Username" name="registerUsername" maxlength="16" autocomplete="off" required />
<input id="register-password-field" class="register-stuff" type="password" placeholder="Password" name="registerPassword" maxlength="16" autocomplete="off" required />
<input id="register-email-field" class="register-stuff" type="email" placeholder="Email" name="registerEmail" maxlength="32" autocomplete="off" required />
<button id="register" class="register-stuff" type="button">Register</button>
</form>
</div>
</div>
</div>
</li>
<li id="login-li">
<div class="loginContainer">
<form id="registerForm">
<input id="register-username-field" class="register-stuff" type="text" placeholder="Username" name="registerUsername" maxlength="16" autocomplete="off" required />
<input id="register-password-field" class="register-stuff" type="password" placeholder="Password" name="registerPassword" maxlength="16" autocomplete="off" required />
<input id="register-email-field" class="register-stuff" type="email" placeholder="Email" name="registerEmail" maxlength="32" autocomplete="off" required />
<button id="register" class="register-stuff" type="button">Register</button>
</form>
</li>
</nav>

<body>
Expand All @@ -45,6 +49,16 @@
<input id="gameTextInput" type="text" maxlength="47" style="position:fixed;top:0;left:-200px" ;>
</div>
</div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(".dropdown-btn").click(function(){
$(".dropdown-content").toggle();
});
});
</script>

<!-- Socket.IO v4.7.2 with Msgpack parser -->
<!-- May need to be updated whenever server's socket.io version is updated. -->
<script src="socket.io.msgpack.min.js"></script>
Expand Down
9 changes: 8 additions & 1 deletion website/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,14 @@ form {


}

.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
/* canvas styles */
.game-container{
height: 100%;
Expand Down