Skip to content
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
20 changes: 18 additions & 2 deletions public/js/interactivity.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ document.addEventListener('DOMContentLoaded', function() {
updateProfile({ name, email, bio, jobsAppliedFor });
});

document.getElementById('applyJobForm').addEventListener('submit', function(e) {
document.getElementById('newApplyJobForm').addEventListener('submit', function(e) {
e.preventDefault();
const formData = new FormData(this);
const skillsRequired = formData
Expand All @@ -39,8 +39,24 @@ document.addEventListener('DOMContentLoaded', function() {
e.preventDefault();
window.location.href = '/jobpost';
});

document.querySelector('.jobFilterDropdown').addEventListener('change', function(e) {
const filterValue = e.target.value;
filterJobs(filterValue);
});
});

function filterJobs(filterValue) {
const allJobs = document.querySelectorAll('.jobListing');
allJobs.forEach(job => {
if (job.dataset.jobDomain === filterValue || filterValue === 'all') {
job.style.display = '';
} else {
job.style.display = 'none';
}
});
}

const express = require('express');
const router = express.Router();
const Job = require('../models/Job');
Expand Down Expand Up @@ -137,4 +153,4 @@ function submitJobPosting(jobData) {
function validateEmail(email) {
const re = /^(([^<>()\[\]\\.,;:\s@\"]+(\.[^<>()\[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
}
}
49 changes: 38 additions & 11 deletions styles/main.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
:root {
--primary-color: #007fff;
--primary-color-hover: #0056b9;
--background-color: #f0f2f5;
--text-color: #333;
--button-background-color: #007fff;
--button-background-color-hover: #0056b9;
--button-text-color: #ffffff;
--font-family: 'Arial', sans-serif;
--box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
--box-shadow-strong: 0 0 12px rgba(0, 0, 0, 0.1);
}

* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: 'Arial', sans-serif;
background-color: #f0f2f5;
color: #333;
font-family: var(--font-family);
background-color: var(--background-color);
color: var(--text-color);
line-height: 1.6;
position: relative;
}
Expand All @@ -33,7 +46,7 @@ form {
background: #ffffff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
box-shadow: var(--box-shadow);
margin-top: 20px;
}

Expand All @@ -56,8 +69,8 @@ textarea {

button {
display: inline-block;
background: #007fff;
color: #ffffff;
background: var(--button-background-color);
color: var(--button-text-color);
border: none;
padding: 12px 24px;
margin-top: 12px;
Expand All @@ -67,15 +80,15 @@ button {
}

button:hover {
background: #0056b9;
background: var(--button-background-color-hover);
}

.job-card {
background: #ffffff;
padding: 24px;
margin-bottom: 24px;
border-radius: 10px;
box-shadow: 0 0 12px rgba(0, 0, 0, 0.1);
box-shadow: var(--box-shadow-strong);
}

.job-card h2 {
Expand All @@ -102,19 +115,33 @@ button:focus {
outline: 3px solid #007bff;
}


@media (max-width: 768px) {
.container {
width: 95%;
}

.job-card {
padding: 12px;
margin-bottom: 12px;
}
}

@media (max-width: 480px) {
.job-card h2 {
font-size: 18px;
}

.job-card p {
font-size: 14px;
}
}

footer {
background-color: #000;
color: #000; /* Corrected color to white for visibility */
color: #fff; /* Assuming this was intended to be corrected for visibility */
padding: 20px;
text-align: center;
text-shadow: none;
z-index: 1000;
position: relative;
}
}
48 changes: 35 additions & 13 deletions views/jobListing.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,45 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Job Listings</title>
<link rel="stylesheet" href="/css/styles.css">
<style>
@media (max-width: 600px) {
.job-listings-container {
flex-direction: column;
}
}
@media (min-width: 601px) {
.job-listings-container {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
}
.job-listing {
width: 45%;
}
}
</style>
</head>
<body>
<div class="container">
<% if(jobs && jobs.length > 0) { %>
<% jobs.forEach(function(job) { %>
<div class="job-listing">
<h2><%= job.companyName %></h2>
<p>Role: <%= job.role %></p>
<p>Domain: <%= job.domain %></p>
<p>Location: <%= job.location %></p>
<p>Skills Required: <%= job.skillsRequired.join(', ') %></p>
<p>Nature of Work: <%= job.natureOfWork %></p>
<a href="<%= job.jobPostingLink %>" class="apply-button">Apply</a>
</div>
<% }); %>
<div class="job-listings-container">
<% jobs.forEach(function(job) { %>
<div class="job-listing" style="margin: 20px; padding: 10px; background-color: var(--light-background); border: 1px solid var(--border-color); box-shadow: 0px 4px 6px rgba(0,0,0,0.1);">
<h2><%= job.companyName %></h2>
<p>Role: <%= job.role %></p>
<p>Domain: <%= job.domain %></p>
<p>Location: <%= job.location %></p>
<p>Skills Required: <%= job.skillsRequired.join(', ') %></p>
<p>Nature of Work: <%= job.natureOfWork %></p>
<a href="<%= job.jobPostingLink %>" class="apply-button" style="font-size: 14px; padding: 10px 15px; background-color: var(--primary-color); color: var(--text-on-primary); text-decoration: none;">Apply</a>
</div>
<% }); %>
</div>
<% } else { %>
<p>No job listings available at the moment.</p>
<div class="empty-state" style="text-align: center; padding: 20px; margin-top: 20px; background-color: var(--light-background); color: var(--text-color);">
<p>No job listings available at the moment.</p>
</div>
<% } %>
</div>
</body>
</body>
</html>