From 5143b0c847cbdaa127b7b7979e3fed9947170982 Mon Sep 17 00:00:00 2001 From: Gaurav Karakoti Date: Fri, 27 Dec 2024 13:12:30 +0530 Subject: [PATCH 1/5] Made the basic website with features opportunity cards and Search Functionality --- Opportunities/index.html | 83 ++++++++++++++++ Opportunities/opportunities.json | 20 ++++ Opportunities/script.js | 52 ++++++++++ Opportunities/styles.css | 164 +++++++++++++++++++++++++++++++ 4 files changed, 319 insertions(+) create mode 100644 Opportunities/index.html create mode 100644 Opportunities/opportunities.json create mode 100644 Opportunities/script.js create mode 100644 Opportunities/styles.css diff --git a/Opportunities/index.html b/Opportunities/index.html new file mode 100644 index 00000000..4b2f1758 --- /dev/null +++ b/Opportunities/index.html @@ -0,0 +1,83 @@ + + + + + Opportunities Hub + + + + +
+ + +
+ + +
+
+ + +
+
+

Discover Opportunities in the Tech Industry

+

Explore jobs, internships, hackathons, open-source projects, and more!

+ +
+
+ + + + + +
+

Start Your Journey Today!

+

Submit an opportunity or explore categories to find your next big break.

+
+ + +
+
+ + + + + + \ No newline at end of file diff --git a/Opportunities/opportunities.json b/Opportunities/opportunities.json new file mode 100644 index 00000000..7df3bfcc --- /dev/null +++ b/Opportunities/opportunities.json @@ -0,0 +1,20 @@ +[ + { + "title": "Remote Developer Job", + "company": "XYZ Corp", + "tags": ["Remote", "Full-time"], + "applyLink": "#" + }, + { + "title": "UI/UX Internship", + "company": "ABC Design", + "tags": ["Internship", "Paid"], + "applyLink": "#" + }, + { + "title": "Hackathon: Innovate 2024", + "company": "TechFest", + "tags": ["Hackathon", "Cash Prizes"], + "applyLink": "#" + } +] diff --git a/Opportunities/script.js b/Opportunities/script.js new file mode 100644 index 00000000..8346427e --- /dev/null +++ b/Opportunities/script.js @@ -0,0 +1,52 @@ +let opportunities = []; // To store fetched opportunities +// Fetch opportunities from the JSON file and render them dynamically +fetch('opportunities.json') + .then(response => response.json()) + .then(data => { + opportunities = data; // Save data for filtering + const container = document.getElementById('opportunity-container'); + + data.forEach(opportunity => { + const card = document.createElement('div'); + card.classList.add('opportunity-card'); + + card.innerHTML = ` +

${opportunity.title}

+

Company: ${opportunity.company}

+

Tags: ${opportunity.tags.join(', ')}

+ + `; + + container.appendChild(card); + }); + renderOpportunities(opportunities); + }) + .catch(error => console.error('Error loading opportunities:', error)); +function renderOpportunities(data) { + const container = document.getElementById('opportunity-container'); + container.innerHTML = ''; // Clear previous content + + data.forEach(opportunity => { + const card = document.createElement('div'); + card.classList.add('opportunity-card'); + + card.innerHTML = ` +

${opportunity.title}

+

Company: ${opportunity.company}

+

Tags: ${opportunity.tags.join(', ')}

+ + `; + + container.appendChild(card); + }); +} +document.getElementById('search-input').addEventListener('input', (e) => { + const query = e.target.value.toLowerCase(); + const filtered = opportunities.filter(opportunity => + opportunity.title.toLowerCase().includes(query) || + opportunity.company.toLowerCase().includes(query) || + opportunity.tags.some(tag => tag.toLowerCase().includes(query)) + ); + + renderOpportunities(filtered); +}); \ No newline at end of file diff --git a/Opportunities/styles.css b/Opportunities/styles.css new file mode 100644 index 00000000..d04dd319 --- /dev/null +++ b/Opportunities/styles.css @@ -0,0 +1,164 @@ +/* General Styles */ +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + line-height: 1.6; + color: #333; +} + +header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 1rem 2rem; + background: #0078D4; + color: #fff; +} + +header .logo h1 { + margin: 0; + font-size: 1.5rem; +} + +nav ul { + list-style: none; + display: flex; + margin: 0; + padding: 0; +} + +nav ul li { + margin: 0 1rem; +} + +nav ul li a { + color: #fff; + text-decoration: none; + font-weight: bold; +} + +.auth-buttons button { + background: #fff; + color: #0078D4; + border: none; + padding: 0.5rem 1rem; + margin-left: 0.5rem; + border-radius: 5px; + cursor: pointer; +} + +.hero-section { + background: #f4f4f4; + padding: 3rem 2rem; + text-align: center; +} + +.hero-section .hero-content h2 { + font-size: 2rem; + margin-bottom: 1rem; +} + +.hero-section .search-bar { + margin-top: 1rem; +} + +.search-bar input { + padding: 0.5rem; + width: 70%; + border: 1px solid #ccc; + border-radius: 5px; +} + +.search-bar button { + padding: 0.5rem 1rem; + background: #0078D4; + color: #fff; + border: none; + border-radius: 5px; + cursor: pointer; +} + +.featured-section { + padding: 2rem; + background: #fff; +} + +.featured-section h3 { + text-align: center; + margin-bottom: 2rem; +} + +.featured-grid { + display: flex; + gap: 2rem; + justify-content: center; + flex-wrap: wrap; +} + +.opportunity-card { + background: #f9f9f9; + border: 1px solid #ccc; + border-radius: 5px; + padding: 1rem; + text-align: center; + width: 250px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); +} + +.opportunity-card h4 { + font-size: 1.2rem; + margin-bottom: 0.5rem; +} + +.opportunity-card button { + padding: 0.5rem 1rem; + background: #0078D4; + color: #fff; + border: none; + border-radius: 5px; + cursor: pointer; + margin-top: 1rem; +} + +.cta-section { + background: #0078D4; + color: #fff; + text-align: center; + padding: 2rem; +} + +.cta-section h3 { + margin-bottom: 1rem; +} + +.cta-buttons button { + background: #fff; + color: #0078D4; + border: none; + padding: 0.5rem 1rem; + margin: 0.5rem; + border-radius: 5px; + cursor: pointer; +} + +footer { + background: #333; + color: #fff; + text-align: center; + padding: 1rem; + margin-top: 2rem; +} + +.footer-links { + list-style: none; + padding: 0; + display: flex; + justify-content: center; + gap: 1rem; +} + +.footer-links li a { + color: #fff; + text-decoration: none; +} \ No newline at end of file From e64a2fadd0bf8d1031b07e79869cff626a074128 Mon Sep 17 00:00:00 2001 From: Gaurav Karakoti Date: Fri, 27 Dec 2024 15:55:09 +0530 Subject: [PATCH 2/5] Added filters and opportunity submission form with approve and rejection from admin --- Opportunities/.gitignore | 1 + Opportunities/index.html | 43 +- Opportunities/opportunities.json | 32 +- Opportunities/package-lock.json | 1187 ++++++++++++++++++++++++++++++ Opportunities/package.json | 19 + Opportunities/script.js | 158 +++- Opportunities/server.js | 98 +++ Opportunities/styles.css | 118 ++- README.md | 1 + 9 files changed, 1629 insertions(+), 28 deletions(-) create mode 100644 Opportunities/.gitignore create mode 100644 Opportunities/package-lock.json create mode 100644 Opportunities/package.json create mode 100644 Opportunities/server.js diff --git a/Opportunities/.gitignore b/Opportunities/.gitignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/Opportunities/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/Opportunities/index.html b/Opportunities/index.html index 4b2f1758..c644e8c5 100644 --- a/Opportunities/index.html +++ b/Opportunities/index.html @@ -26,7 +26,11 @@

Opportunities Hub

- +
+

Admin Panel

+
+ +
@@ -38,6 +42,14 @@

Discover Opportunities in the Tech Industry

+
+

Filter by Category

+
+ +
+
+
+

Submit an Opportunity

+
+ + + + + + + + + + + + + + + + +
+ + +