<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport"…
- User
.container { background: #ffffff; border-radius: 10px; box-shadow: 20px 20px 60px #d9d9d9, -20px -20px 60px #ffffff; padding: 40px; max-width: 1000px; width: 100%; } h1 { text-align: center; margin-bottom: 30px; background: linear-gradient(180deg, #904e95, #e96443); background-clip: text; -webkit-background-clip: text; color: transparent; font-size: 2em; font-weight: bold; } .filters { display: flex; justify-content: space-between; margin-bottom: 30px; } select, input[type="search"] { padding: 10px; border: none; border-radius: 5px; box-shadow: inset 5px 5px 10px #d9d9d9, inset -5px -5px 10px #ffffff; font-size: 1em; outline: none; } select:focus, input[type="search"]:focus { box-shadow: 5px 5px 10px #d9d9d9, -5px -5px 10px #ffffff; } .job-listing { background: #f0f0f0; border-radius: 10px; box-shadow: 5px 5px 10px #d9d9d9, -5px -5px 10px #ffffff; padding: 20px; margin-bottom: 20px; position: relative; transition: transform 0.2s ease, box-shadow 0.2s ease; } .job-listing:hover { transform: translateY(-5px); box-shadow: 10px 10px 20px #d9d9d9, -10px -10px 20px #ffffff; } .job-title { font-size: 1.2em; font-weight: bold; color: #333; } .job-details { margin-top: 10px; color: #666; } .job-details i { margin-right: 5px; } /* Glow effect on hover */ .job-listing::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 10px; background: linear-gradient( 45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000 ); background-size: 400% 400%; animation: glow 5s ease infinite; opacity: 0; transition: opacity 0.2s ease; z-index: -1; } .job-listing:hover::before { opacity: 0.3; } @keyframes glow { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } } #cursor { width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(to right, #1a2980, #26d0ce); position: fixed; pointer-events: none; z-index: 9999; transition: transform 0.1s ease; transform: translate(-50%, -50%);}
.logo-icon { width: 100px; height: 100px; border-radius: 50%; overflow: hidden; animation: rotate 5s linear infinite; }
.loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(91, 175, 149, 0.568); display: flex; justify-content: center; align-items: center; z-index: 10000; display: none; } @keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } </style>function searchJobs() { const searchQuery = document .getElementById("job-search") .value.toLowerCase(); const jobs = document.querySelectorAll(".job-listing"); jobs.forEach((job) => { const title = job .querySelector(".job-title") .textContent.toLowerCase(); if (title.includes(searchQuery)) { job.style.display = "block"; } else { job.style.display = "none"; } }); } const cursor = document.getElementById('cursor'); let mouseX = 0, mouseY = 0; let currentX = 0, currentY = 0; const speed = 0.1; document.addEventListener('mousemove', (e) => { mouseX = e.clientX; mouseY = e.clientY; }); function updateCursor() { currentX += (mouseX - currentX) * speed; currentY += (mouseY - currentY) * speed; cursor.style.left = `${currentX}px`; cursor.style.top = `${currentY}px`; requestAnimationFrame(updateCursor); } requestAnimationFrame(updateCursor); </script>Job Detail Page: Detailed information about a those job. goto job detail page when a user presses one among the job-title. each job listing has different detailed information random useful information
- Assistant
To achieve the functionality of navigating to a detailed job information page when a user clicks on the job title, we'll need to add some JavaScript that handles this interaction. Additionally, we need a sample Job Detail Page template that can display detailed information based on which job was clicked.
Let's start by modifying the existing HTML and JavaScript code. We'll introduce a new div with the id
job-detailto display detailed job information.Here's the complete code with modifications:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="icon" type="image/png" href="looka.com_editor_192053877(Asus Zenbook Fold)-modified.png" /> <title>Job Board</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" /> <style> body { font-family: "Roboto", sans-serif; background: #f0f0f0; display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; } .container { background: #ffffff; border-radius: 10px; box-shadow: 20px 20px 60px #d9d9d9, -20px -20px 60px #ffffff; padding: 40px; max-width: 1000px; width: 100%; } h1 { text-align: center; margin-bottom: 30px; background: linear-gradient(180deg, #904e95, #e96443); background-clip: text; -webkit-background-clip: text; color: transparent; font-size: 2em; font-weight: bold; } .filters { display: flex; justify-content: space-between; margin-bottom: 30px; } select, input[type="search"] { padding: 10px; border: none; border-radius: 5px; box-shadow: inset 5px 5px 10px #d9d9d9, inset -5px -5px 10px #ffffff; font-size: 1em; outline: none; } select:focus, input[type="search"]:focus { box-shadow: 5px 5px 10px #d9d9d9, -5px -5px 10px #ffffff; } .job-listing { background: #f0f0f0; border-radius: 10px; box-shadow: 5px 5px 10px #d9d9d9, -5px -5px 10px #ffffff; padding: 20px; margin-bottom: 20px; position: relative; transition: transform 0.2s ease, box-shadow 0.2s ease; cursor: pointer; } .job-listing:hover { transform: translateY(-5px); box-shadow: 10px 10px 20px #d9d9d9, -10px -10px 20px #ffffff; } .job-title { font-size: 1.2em; font-weight: bold; color: #333; } .job-details { margin-top: 10px; color: #666; } .job-details i { margin-right: 5px; } /* Glow effect on hover */ .job-listing::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 10px; background: linear-gradient( 45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000 ); background-size: 400% 400%; animation: glow 5s ease infinite; opacity: 0; transition: opacity 0.2s ease; z-index: -1; } .job-listing:hover::before { opacity: 0.3; } @keyframes glow { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } } #cursor { width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(to right, #1a2980, #26d0ce); position: fixed; pointer-events: none; z-index: 9999; transition: transform 0.1s ease; transform: translate(-50%, -50%); } .logo-icon { width: 100px; height: 100px; border-radius: 50%; overflow: hidden; animation: rotate 5s linear infinite; } .loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(91, 175, 149, 0.568); display: flex; justify-content: center; align-items: center; z-index: 10000; display: none; } @keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } #job-detail { display: none; background: #f0f0f0; border-radius: 10px; box-shadow: 5px 5px 10px #d9d9d9, -5px -5px 10px #ffffff; padding: 20px; margin-top: 20px; } .back-btn { display: inline-block; margin-top: 10px; padding: 10px 20px; border: none; border-radius: 5px; background: #e96443; color: #fff; cursor: pointer; } </style> </head> <body> <div class="loading-overlay"> <img src="looka.com_editor_192053877(Asus Zenbook Fold).png" alt="Rounded Logo Icon" class="logo-icon" /> </div> <div class="container"> <div id="cursor"></div> <h1>Job Listings</h1> <div class="filters"> <select id="job-category" onchange="filterJobs()"> <option value="all">All Categories</option> <option value="engineering">Engineering</option> <option value="data-science">Data Science</option> <option value="design">Design</option> <option value="management">Management</option> <option value="support">Support</option> </select> <input type="search" id="job-search" oninput="searchJobs()" placeholder="Search job titles..." /> </div> <div id="job-listings"> <div class="job-listing" data-category="engineering" onclick="showJobDetail('Software Engineer', 'Google', 'Mountain View, CA', 'Description of Software Engineer at Google. Requirements, benefits, etc.')"> <div class="job-title">Software Engineer</div> <div class="job-details"><i class="fas fa-building"></i> Google</div> <div class="job-details"> <i class="fas fa-map-marker-alt"></i> Mountain View, CA </div> </div> <div class="job-listing" data-category="data-science" onclick="showJobDetail('Data Scientist', 'Amazon', 'Seattle, WA', 'Description of Data Scientist at Amazon. Requirements, benefits, etc.')"> <div class="job-title">Data Scientist</div> <div class="job-details"><i class="fas fa-building"></i> Amazon</div> <div class="job-details"> <i class="fas fa-map-marker-alt"></i> Seattle, WA </div> </div> <!-- Add other job listings here with onclick handlers similar to the above --> </div> <div id="job-detail"> <h2 id="detail-title"></h2> <p id="detail-company"></p> <p id="detail-location"></p> <p id="detail-description"></p> <button class="back-btn" onclick="hideJobDetail()">Back to Listings</button> </div> </div> <script> function filterJobs() { const category = document.getElementById("job-category").value; const jobs = document.querySelectorAll(".job-listing"); jobs.forEach((job) => { if (category === "all" || job.dataset.category === category) { job.style.display = "block"; } else { job.style.display = "none"; } }); } function searchJobs() { const searchQuery = document .getElementById("job-search") .value.toLowerCase(); const jobs = document.querySelectorAll(".job-listing"); jobs.forEach((job) => { const title = job .querySelector(".job-title") .textContent.toLowerCase(); if (title.includes(searchQuery)) { job.style.display = "block"; } else { job.style.display = "none"; } }); } const cursor = document.getElementById('cursor'); let mouseX = 0, mouseY = 0; let currentX = 0, currentY = 0; const speed = 0.1; document.addEventListener('mousemove', (e) => { mouseX = e.clientX; mouseY = e.clientY; }); function updateCursor() { currentX += (mouseX - currentX) * speed; currentY += (mouseY - currentY) * speed; cursor.style.left = `${currentX}px`; cursor.style.top = `${currentY}px`; requestAnimationFrame(updateCursor); } requestAnimationFrame(updateCursor); function showJobDetail(title, company, location, description) { document.getElementById('job-listings').style.display = 'none'; document.getElementById('job-detail').style.display = 'block'; document.getElementById('detail-title').textContent = title; document.getElementById('detail-company').textContent = company; document.getElementById('detail-location').textContent = location; document.getElementById('detail-description').textContent = description; } function hideJobDetail() { document.getElementById('job-listings').style.display = 'block'; document.getElementById('job-detail').style.display = 'none'; } </script> </body> </html>Key Additions:
- Each job listing now has an
onclickevent that calls theshowJobDetailfunction with detailed information as parameters. - Added a new
divwith idjob-detailto display the detailed job information. showJobDetailandhideJobDetailJavaScript functions manage the visibility and content of the job detail section.
- Each job listing now has an