Skip to content

Update index.html, script.js, style.css #25

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
><i class="fa fa-bars"></i
></a>
<!-- TODO: Fix Issue, Desktop Nav Is Visible on Mobile -->
<a id="nav-logo" class="bar-item button padding-large white">JobSimulator.Dev</a>
<a id="nav-challenges" class="bar-item button padding-large hover-white">Browse Challenges</a>
<a id="nav-signup" class="bar-item button padding-large hover-white">Sign Up</a>
<a id="nav-logo" class="bar-item button padding-large white" href="#header">JobSimulator.Dev</a>
<a id="nav-challenges" class="bar-item button padding-large hover-white" href="#browse">Browse Challenges</a>
<a id="nav-signup" class="bar-item button padding-large hover-white" href="#signup">Sign Up</a>
</div>

<!-- Navbar on small screens -->
Expand All @@ -42,7 +42,7 @@ <h1 class="margin jumbo">Want to test your software dev skills?</h1>
<a href="#signup" class="button blue padding-large large margin-top">Sign Up</a>
</header>

<section id="challenges" class="row-padding pink padding-256 container">
<section id="browse" class="row-padding pink padding-256 container">
<div class="content">
<h1>Browse Our Challenges</h1>
<div id="challenge-grid">
Expand Down
24 changes: 22 additions & 2 deletions src/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,39 @@ addEventListener("submit", (event) => {
resetMessage();

let email = document.getElementById("email").value;

// TODO: Show Correct Status Messages on Signup Form
// 1. successful signup
// 2. empty email
// 3. taken email
// 4. repeat email
if (!email) {
renderEmailEmptyError();
} else {
// check for taken email
const takenEmail = usersTable.some(user => user.username === email);
if (takenEmail) {
renderEmailTakenError();
} else {
// check for repeat email
if(sessionStorage.getItem('email')=== email){
renderEmailTakenError();
}else{
// add the email to the users table
usersTable.push({username: email});
sessionStorage.setItem('email',email)
// log success message
renderSuccess();
}
}
}

});

let toggleNav = () => {
var nav = document.getElementById("mobile-nav");
if (nav.className.indexOf("show") == -1) {
nav.className += " show";
} else {
} else {
nav.className = nav.className.replace(" show", "");
}
};
10 changes: 8 additions & 2 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -670,9 +670,14 @@ form > span {
#jumbo-image {
max-height: 20rem;
/* TODO: Invert banner colors using CSS */
filter: invert(100%);
}

@media (max-width: 600px) {
#nav-challenges,
#nav-signup{
display: none;
}
.modal-content {
margin: 0 10px;
width: auto !important;
Expand All @@ -694,7 +699,8 @@ form > span {
.bar-item.mobile,
.dropdown-hover.mobile,
.dropdown-click.mobile {
text-align: center;
text-align: right;

}
.dropdown-hover.mobile,
.dropdown-hover.mobile .btn,
Expand Down Expand Up @@ -877,7 +883,7 @@ form > span {
#challenge-grid {
display: grid;
/* TODO: Fix Issue, Tiles Need to be 2x2 Grid. Change only grid-template-columns */
grid-template-columns: none;
grid-template-columns: 2fr 2fr;
grid-auto-rows: 10rem;
gap: 1rem;
padding-top: 2rem;
Expand Down