Skip to content

fixed all bugs #29

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
141 changes: 67 additions & 74 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,83 +1,76 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>JobSimulator.Dev</title>
<link rel="stylesheet" href="styles.css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
<script src="script.js"></script>
</head>

<body>
<!-- Navbar -->
<!-- TODO: Fix Issue, Nav Buttons Don't Work (Desktop & Mobile) -->
<nav class="top">
<div class="bar blue card left-align large">
<a
class="bar-item button hide-medium hide-large right padding-large hover-white large blue"
href="javascript:void(0);"
id="hamburger-button"
onclick="toggleNav()"
title="Toggle Navigation Menu"
><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>
</div>
<head>
<meta charset="utf-8" />
<title>JobSimulator.Dev</title>
<link rel="stylesheet" href="styles.css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
<script src="script.js"></script>
</head>

<!-- Navbar on small screens -->
<div id="mobile-nav" class="bar-block white hide hide-large hide-medium large">
<a id="mobile-nav-challenges" class="bar-item button padding-large">Browse Challenges</a>
<a id="mobile-nav-signup" class="bar-item button padding-large">Sign Up</a>
</div>
</nav>
<body>
<!-- Navbar -->
<!-- TODO: Fix Issue, Nav Buttons Don't Work (Desktop & Mobile) -->
<!--Fixed issues by adding href="#id" to jump to relevant section-->
<nav class="top">
<div class="bar blue card left-align large">
<a class="bar-item button hide-medium hide-large right padding-large hover-white large blue"
href="javascript:void(0);" id="hamburger-button" onclick="toggleNav()" title="Toggle Navigation Menu"><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" href="#header">JobSimulator.Dev</a>
<a id="nav-challenges" class="bar-item button padding-large hover-white hide-small" href="#challenges">Browse
Challenges</a>
<a id="nav-signup" class="bar-item button padding-large hover-white hide-small" href="#signup">Sign Up</a>
<!--added hide-small to classes in order to hide desktop navbar options on mobile-->
</div>

<!-- Header -->
<header id="header" class="container white center" style="padding: 128px 16px">
<img id="jumbo-image" src="./banner-image.png" />
<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>
<!-- Navbar on small screens -->
<div id="mobile-nav" class="bar-block white hide hide-large hide-medium large">
<a id="mobile-nav-challenges" class="bar-item button padding-large" href="#challenges">Browse Challenges</a>
<a id="mobile-nav-signup" class="bar-item button padding-large" href="#signup">Sign Up</a>
</div>
</nav>

<section id="challenges" class="row-padding pink padding-256 container">
<div class="content">
<h1>Browse Our Challenges</h1>
<div id="challenge-grid">
<a
class="challenge-tile"
target="_blank"
href="https://github.com/developer-job-simulation/vanilla-login-form"
>Vanilla Login Form</a
>
<a target="_blank" class="challenge-tile" href="https://github.com/developer-job-simulation/vanilla-table"
>Vanilla Table</a
>
<a target="_blank" class="challenge-tile" href="https://github.com/developer-job-simulation/react-ecommerce"
>React Ecommerce</a
>
<a target="_blank" class="challenge-tile" href="https://github.com/developer-job-simulation/react-mui-table"
>React Table</a
>
</div>
<!-- Header -->
<header id="header" class="container white center" style="padding: 128px 16px">
<img id="jumbo-image" src="./banner-image.png" />
<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">
<div class="content">
<h1>Browse Our Challenges</h1>
<div id="challenge-grid">
<a class="challenge-tile" target="_blank"
href="https://github.com/developer-job-simulation/vanilla-login-form">Vanilla Login Form</a>
<a target="_blank" class="challenge-tile"
href="https://github.com/developer-job-simulation/vanilla-table">Vanilla Table</a>
<a target="_blank" class="challenge-tile"
href="https://github.com/developer-job-simulation/react-ecommerce">React Ecommerce</a>
<a target="_blank" class="challenge-tile"
href="https://github.com/developer-job-simulation/react-mui-table">React Table</a>
</div>
</section>
</div>
</section>

<section id="signup" class="row-padding light-grey padding-256 container">
<div class="content">
<div id="signup-form">
<h1>Sign Up & Get Started</h1>
<form>
<span id="success-message" class="success-message" hidden="true">Success!</span>
<span id="taken-error-message" class="error-message" hidden="true">Error: Email Already Taken</span>
<span id="empty-error-message" class="error-message" hidden="true">Error: Email Address Empty.</span>
<input id="email" type="email" placeholder="Enter your email" />
<button>Submit</button>
</form>
</div>
<section id="signup" class="row-padding light-grey padding-256 container">
<div class="content">
<div id="signup-form">
<h1>Sign Up & Get Started</h1>
<form>
<span id="success-message" class="success-message" hidden="true">Success!</span>
<span id="taken-error-message" class="error-message" hidden="true">Error: Email Already Taken</span>
<span id="empty-error-message" class="error-message" hidden="true">Error: Email Address Empty.</span>
<input id="email" type="email" placeholder="Enter your email" />
<button>Submit</button>
</form>
</div>
</section>
</body>
</html>
</div>
</section>
</body>

</html>
11 changes: 11 additions & 0 deletions src/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ addEventListener("submit", (event) => {
// 2. empty email
// 3. taken email
// 4. repeat email

if (email === "") {
renderEmailEmptyError(); // 2. empty email
} else if (usersTable.some((user) => user.username === email)) {
renderEmailTakenError(); // 3. taken email
} else {
usersTable.push({ username: email });
renderSuccess(); // 1. successful signup, which pushes the email to the usersTable. This means that whenever the user tries to sign up with the same email, it will be rejected as a repeat email, solving 4. repeat email.
}


});

let toggleNav = () => {
Expand Down
3 changes: 2 additions & 1 deletion src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ a {
}
img {
border-style: none;
filter: invert(100%); /* Inverted all colors */
}

button,
Expand Down Expand Up @@ -877,7 +878,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: repeat(2, minmax(0, 1fr)); /*made grid 2x2 */
grid-auto-rows: 10rem;
gap: 1rem;
padding-top: 2rem;
Expand Down