Spaces:
Paused
Paused
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>{% block title %}Codingo - AI-Powered Recruitment Platform{% endblock %}</title> | |
| <style> | |
| :root { | |
| --primary: #4361ee; | |
| --secondary: #3a0ca3; | |
| --accent: #4cc9f0; | |
| --light: #f8f9fa; | |
| --dark: #212529; | |
| --success: #2ecc71; | |
| --warning: #f39c12; | |
| --danger: #e74c3c; | |
| } | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | |
| } | |
| body { | |
| background-color: var(--light); | |
| color: var(--dark); | |
| line-height: 1.6; | |
| perspective: 1000px; | |
| overflow-x: hidden; | |
| } | |
| header { | |
| background: linear-gradient(135deg, var(--primary), var(--secondary)); | |
| color: white; | |
| padding: 1rem; | |
| position: sticky; | |
| top: 0; | |
| z-index: 100; | |
| box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); | |
| } | |
| .container { | |
| width: 100%; | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| padding: 0 1rem; | |
| } | |
| .nav-container { | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| } | |
| .logo { | |
| display: flex; | |
| align-items: center; | |
| font-size: 2rem; | |
| font-weight: bold; | |
| color: white; | |
| text-decoration: none; | |
| transition: transform 0.3s ease; | |
| } | |
| .logo:hover { | |
| transform: scale(1.05); | |
| } | |
| .logo-part1 { | |
| color: white; | |
| } | |
| .logo-part2 { | |
| color: #FF8C42; | |
| font-style: italic; | |
| text-shadow: 0px 0px 10px rgba(255, 140, 66, 0.7); | |
| animation: glow 2s ease-in-out infinite alternate; | |
| } | |
| @keyframes glow { | |
| from { | |
| text-shadow: 0 0 5px rgba(255, 140, 66, 0.7); | |
| } | |
| to { | |
| text-shadow: 0 0 15px rgba(255, 140, 66, 1), 0 0 20px rgba(255, 140, 66, 0.8); | |
| } | |
| } | |
| .logo-part3 { | |
| color: var(--accent); | |
| } | |
| .login-buttons { | |
| display: flex; | |
| align-items: center; | |
| gap: 1rem; | |
| flex-wrap: wrap; | |
| } | |
| /* Style for the welcome message */ | |
| .welcome-message { | |
| color: white; | |
| font-weight: 500; | |
| display: flex; | |
| align-items: center; | |
| background-color: rgba(255, 255, 255, 0.1); | |
| padding: 0.5rem 1rem; | |
| border-radius: 5px; | |
| transition: all 0.3s ease; | |
| } | |
| .welcome-message:before { | |
| content: '👋 '; | |
| margin-right: 0.5rem; | |
| } | |
| /* Enhanced logout button */ | |
| .btn-logout { | |
| background-color: transparent; | |
| border: 2px solid var(--accent); | |
| color: var(--accent); | |
| font-weight: 600; | |
| padding: 0.5rem 1.5rem; | |
| border-radius: 5px; | |
| transition: all 0.3s ease; | |
| } | |
| .btn-logout:hover { | |
| background-color: var(--accent); | |
| color: var(--dark); | |
| transform: translateY(-2px); | |
| box-shadow: 0 5px 15px rgba(76, 201, 240, 0.3); | |
| } | |
| .btn { | |
| padding: 0.5rem 1.5rem; | |
| border-radius: 5px; | |
| border: none; | |
| cursor: pointer; | |
| font-weight: 500; | |
| transition: all 0.3s ease; | |
| text-decoration: none; | |
| position: relative; | |
| overflow: hidden; | |
| z-index: 1; | |
| } | |
| .btn::before { | |
| content: ''; | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| width: 0%; | |
| height: 100%; | |
| background-color: rgba(255, 255, 255, 0.1); | |
| transition: all 0.3s ease; | |
| z-index: -1; | |
| } | |
| .btn:hover::before { | |
| width: 100%; | |
| } | |
| .btn-primary { | |
| background-color: var(--accent); | |
| color: var(--dark); | |
| box-shadow: 0 4px 8px rgba(76, 201, 240, 0.3); | |
| } | |
| .btn-outline { | |
| background-color: transparent; | |
| border: 2px solid white; | |
| color: white; | |
| } | |
| .btn:hover { | |
| transform: translateY(-2px); | |
| box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); | |
| } | |
| /* Fixed chatbot button */ | |
| #chatbot-nav { | |
| position: fixed; | |
| bottom: 20px; | |
| right: 20px; | |
| width: 60px; | |
| height: 60px; | |
| background-color: var(--primary); | |
| border-radius: 50%; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| cursor: pointer; | |
| box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); | |
| z-index: 999; | |
| transition: all 0.3s ease; | |
| font-size: 24px; | |
| } | |
| #chatbot-nav:hover { | |
| transform: scale(1.1); | |
| background-color: var(--secondary); | |
| box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); | |
| } | |
| /* Chatbot box */ | |
| #chatbot-box { | |
| position: fixed; | |
| bottom: 100px; | |
| right: 20px; | |
| width: 350px; | |
| height: 500px; | |
| background-color: white; | |
| border-radius: 10px; | |
| box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15); | |
| display: none; | |
| flex-direction: column; | |
| z-index: 998; | |
| } | |
| /* Responsive adjustments */ | |
| @media (max-width: 768px) { | |
| #chatbot-nav { | |
| bottom: 15px; | |
| right: 15px; | |
| width: 50px; | |
| height: 50px; | |
| font-size: 20px; | |
| } | |
| #chatbot-box { | |
| width: calc(100vw - 40px); | |
| max-width: 350px; | |
| right: 20px; | |
| bottom: 80px; | |
| height: 400px; | |
| } | |
| .login-buttons { | |
| justify-content: flex-end; | |
| } | |
| .welcome-message { | |
| font-size: 0.9rem; | |
| padding: 0.4rem 0.8rem; | |
| } | |
| .btn { | |
| padding: 0.4rem 1rem; | |
| font-size: 0.9rem; | |
| } | |
| } | |
| @media (max-width: 480px) { | |
| .nav-container { | |
| flex-wrap: wrap; | |
| gap: 1rem; | |
| } | |
| .login-buttons { | |
| width: 100%; | |
| justify-content: center; | |
| } | |
| .logo { | |
| font-size: 1.5rem; | |
| } | |
| } | |
| .hero { | |
| background: linear-gradient(rgba(67, 97, 238, 0.8), rgba(58, 12, 163, 0.9)), url("/api/placeholder/1200/600") no-repeat center center/cover; | |
| color: white; | |
| text-align: center; | |
| padding: 5rem 1rem; | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| .hero::before { | |
| content: ''; | |
| position: absolute; | |
| top: -50%; | |
| left: -50%; | |
| width: 200%; | |
| height: 200%; | |
| background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 60%); | |
| animation: rotate 30s linear infinite; | |
| z-index: 1; | |
| } | |
| @keyframes rotate { | |
| from { | |
| transform: rotate(0deg); | |
| } | |
| to { | |
| transform: rotate(360deg); | |
| } | |
| } | |
| .hero-content { | |
| display: flex; | |
| flex-direction: column; | |
| align-items: center; | |
| transform-style: preserve-3d; | |
| transition: transform 0.3s ease; | |
| position: relative; | |
| z-index: 2; | |
| } | |
| .hero h1 { | |
| font-size: 3rem; | |
| margin-bottom: 1.5rem; | |
| font-weight: 700; | |
| text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); | |
| transform: translateZ(20px); | |
| animation: fadeIn 1s ease-out; | |
| } | |
| @keyframes fadeIn { | |
| from { | |
| opacity: 0; | |
| transform: translateY(20px) translateZ(20px); | |
| } | |
| to { | |
| opacity: 1; | |
| transform: translateY(0) translateZ(20px); | |
| } | |
| } | |
| .hero p { | |
| font-size: 1.2rem; | |
| max-width: 800px; | |
| margin: 0 auto 2rem; | |
| transform: translateZ(10px); | |
| animation: fadeIn 1s ease-out 0.3s both; | |
| } | |
| .luna-avatar-container { | |
| position: relative; | |
| width: 250px; | |
| height: 250px; | |
| margin-bottom: 2rem; | |
| perspective: 1000px; | |
| } | |
| .luna-avatar { | |
| width: 100%; | |
| height: 100%; | |
| border-radius: 50%; | |
| border: 4px solid var(--accent); | |
| box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(76, 201, 240, 0.5); | |
| overflow: hidden; | |
| animation: float 4s ease-in-out infinite; | |
| position: relative; | |
| z-index: 2; | |
| background: linear-gradient(135deg, rgba(76, 201, 240, 0.2), rgba(58, 12, 163, 0.2)); | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| } | |
| .luna-glow { | |
| position: absolute; | |
| width: 100%; | |
| height: 100%; | |
| border-radius: 50%; | |
| background: radial-gradient(circle, rgba(76, 201, 240, 0.8) 0%, rgba(76, 201, 240, 0) 70%); | |
| filter: blur(15px); | |
| opacity: 0.7; | |
| z-index: 1; | |
| animation: pulse 4s ease-in-out infinite alternate; | |
| } | |
| @keyframes pulse { | |
| 0% { | |
| transform: scale(0.9); | |
| opacity: 0.5; | |
| } | |
| 100% { | |
| transform: scale(1.1); | |
| opacity: 0.7; | |
| } | |
| } | |
| @keyframes float { | |
| 0% { | |
| transform: translateY(0px) rotateY(0deg); | |
| } | |
| 50% { | |
| transform: translateY(-15px) rotateY(5deg); | |
| } | |
| 100% { | |
| transform: translateY(0px) rotateY(0deg); | |
| } | |
| } | |
| .luna-avatar img { | |
| width: 100%; | |
| height: 100%; | |
| object-fit: cover; | |
| object-position: center -10px; | |
| top: 0; | |
| left: 0; | |
| } | |
| .luna-avatar video { | |
| width: 100%; | |
| height: 100%; | |
| object-fit: cover; | |
| border-radius: 50%; | |
| } | |
| .hero-buttons { | |
| display: flex; | |
| justify-content: center; | |
| gap: 1.5rem; | |
| flex-wrap: wrap; | |
| transform: translateZ(15px); | |
| animation: fadeIn 1s ease-out 0.6s both; | |
| } | |
| .features { | |
| padding: 5rem 1rem; | |
| background-color: white; | |
| position: relative; | |
| z-index: 1; | |
| } | |
| .section-title { | |
| text-align: center; | |
| margin-bottom: 3rem; | |
| transform-style: preserve-3d; | |
| transition: transform 0.3s ease; | |
| } | |
| .section-title h2 { | |
| font-size: 2.5rem; | |
| color: var(--primary); | |
| margin-bottom: 1rem; | |
| position: relative; | |
| display: inline-block; | |
| } | |
| .section-title h2::after { | |
| content: ''; | |
| position: absolute; | |
| bottom: -10px; | |
| left: 50%; | |
| transform: translateX(-50%); | |
| width: 80px; | |
| height: 3px; | |
| background: linear-gradient(to right, var(--primary), var(--accent)); | |
| } | |
| .section-title p { | |
| max-width: 600px; | |
| margin: 0 auto; | |
| color: #666; | |
| } | |
| .features-grid { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); | |
| gap: 2rem; | |
| } | |
| .feature-card { | |
| background-color: white; | |
| border-radius: 10px; | |
| overflow: hidden; | |
| box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05); | |
| transition: all 0.5s ease; | |
| display: flex; | |
| flex-direction: column; | |
| height: 100%; | |
| transform-style: preserve-3d; | |
| perspective: 1000px; | |
| } | |
| .feature-card:hover { | |
| transform: translateY(-10px) rotateX(5deg); | |
| box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1); | |
| } | |
| .feature-icon { | |
| background: linear-gradient(135deg, rgba(67, 97, 238, 0.1), rgba(76, 201, 240, 0.1)); | |
| padding: 2rem; | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| font-size: 2.5rem; | |
| color: var(--primary); | |
| transition: all 0.3s ease; | |
| } | |
| .feature-card:hover .feature-icon { | |
| transform: translateZ(20px); | |
| color: var(--accent); | |
| } | |
| .feature-content { | |
| padding: 1.5rem; | |
| flex-grow: 1; | |
| transform: translateZ(0); | |
| transition: transform 0.3s ease; | |
| } | |
| .feature-card:hover .feature-content { | |
| transform: translateZ(10px); | |
| } | |
| .feature-content h3 { | |
| font-size : 1.5rem; | |
| margin-bottom: 1rem; | |
| color: var(--dark); | |
| position: relative; | |
| display: inline-block; | |
| } | |
| .feature-content h3::after { | |
| content: ''; | |
| position: absolute; | |
| bottom: -5px; | |
| left: 0; | |
| width: 40px; | |
| height: 2px; | |
| background: var(--primary); | |
| transition: width 0.3s ease; | |
| } | |
| .feature-card:hover .feature-content h3::after { | |
| width: 100%; | |
| } | |
| .content-section { | |
| padding: 5rem 1rem; | |
| background-color: white; | |
| min-height: 50vh; | |
| } | |
| .cta { | |
| background: linear-gradient(135deg, var(--secondary), var(--primary)); | |
| color: white; | |
| padding: 5rem 1rem; | |
| text-align: center; | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| .cta::before { | |
| content: ''; | |
| position: absolute; | |
| top: -50%; | |
| left: -50%; | |
| width: 200%; | |
| height: 200%; | |
| background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 60%); | |
| animation: rotate 20s linear infinite; | |
| z-index: 1; | |
| } | |
| .cta .container { | |
| position: relative; | |
| z-index: 2; | |
| } | |
| .cta h2 { | |
| font-size: 2.5rem; | |
| margin-bottom: 1.5rem; | |
| text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); | |
| } | |
| .cta p { | |
| max-width: 600px; | |
| margin: 0 auto 2rem; | |
| font-size: 1.2rem; | |
| } | |
| footer { | |
| background-color: var(--dark); | |
| color: white; | |
| padding: 3rem 1rem; | |
| } | |
| .footer-grid { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); | |
| gap: 2rem; | |
| } | |
| .footer-col h3 { | |
| font-size: 1.2rem; | |
| margin-bottom: 1.5rem; | |
| color: var(--accent); | |
| position: relative; | |
| display: inline-block; | |
| } | |
| .footer-col h3::after { | |
| content: ''; | |
| position: absolute; | |
| bottom: -8px; | |
| left: 0; | |
| width: 30px; | |
| height: 2px; | |
| background: var(--accent); | |
| } | |
| .social-links { | |
| display: flex; | |
| gap: 1rem; | |
| margin-top: 1rem; | |
| } | |
| .social-links a { | |
| color: white; | |
| background-color: rgba(255, 255, 255, 0.1); | |
| width: 40px; | |
| height: 40px; | |
| border-radius: 50%; | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| transition: all 0.3s ease; | |
| } | |
| .social-links a:hover { | |
| background-color: var(--accent); | |
| color: var(--dark); | |
| transform: translateY(-3px); | |
| } | |
| .copyright { | |
| margin-top: 2rem; | |
| border-top: 1px solid rgba(255, 255, 255, 0.1); | |
| padding-top: 1.5rem; | |
| text-align: center; | |
| color: #aaa; | |
| } | |
| .card { | |
| background-color: white; | |
| border-radius: 10px; | |
| overflow: hidden; | |
| box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05); | |
| transition: all 0.5s ease; | |
| margin-bottom: 2rem; | |
| } | |
| .card:hover { | |
| transform: translateY(-5px); | |
| box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1); | |
| } | |
| .card-header { | |
| background: linear-gradient(135deg, var(--primary), var(--secondary)); | |
| color: white; | |
| padding: 1.5rem; | |
| } | |
| .card-body { | |
| padding: 1.5rem; | |
| } | |
| .job-grid { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); | |
| gap: 2rem; | |
| } | |
| .job-card { | |
| background-color: white; | |
| border-radius: 10px; | |
| overflow: hidden; | |
| box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05); | |
| transition: all 0.5s ease; | |
| height: 100%; | |
| display: flex; | |
| flex-direction: column; | |
| } | |
| .job-card:hover { | |
| transform: translateY(-10px); | |
| box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1); | |
| } | |
| .job-header { | |
| background: linear-gradient(135deg, rgba(67, 97, 238, 0.9), rgba(58, 12, 163, 0.9)); | |
| color: white; | |
| padding: 1.5rem; | |
| } | |
| .job-header h3 { | |
| font-size: 1.5rem; | |
| } | |
| /* Additional content styling omitted for brevity */ | |
| /* | |
| * Flash message styling | |
| * | |
| * The flash message container appears just below the navigation bar and | |
| * above the page content. These rules provide a consistent look and | |
| * feel across different screen sizes without altering the underlying | |
| * layout. Messages stack vertically with gentle spacing and use | |
| * coloured left borders to indicate their severity (success, warning, | |
| * danger or info). We leverage the existing colour palette defined | |
| * in CSS variables (e.g. --success, --warning, --danger, --accent) | |
| * while keeping backgrounds light and text readable. | |
| */ | |
| .flash-messages { | |
| margin: 1rem 0; | |
| display: flex; | |
| flex-direction: column; | |
| gap: 0.75rem; | |
| } | |
| .flash-messages .alert { | |
| padding: 0.75rem 1rem; | |
| border-radius: 5px; | |
| font-weight: 500; | |
| box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); | |
| width: 100%; | |
| box-sizing: border-box; | |
| display: flex; | |
| align-items: center; | |
| } | |
| .alert-success { | |
| background-color: rgba(46, 204, 113, 0.15); | |
| color: var(--success); | |
| border-left: 4px solid var(--success); | |
| } | |
| .alert-warning { | |
| background-color: rgba(243, 156, 18, 0.15); | |
| color: var(--warning); | |
| border-left: 4px solid var(--warning); | |
| } | |
| .alert-danger { | |
| background-color: rgba(231, 76, 60, 0.15); | |
| color: var(--danger); | |
| border-left: 4px solid var(--danger); | |
| } | |
| .alert-info { | |
| background-color: rgba(76, 201, 240, 0.15); | |
| color: var(--accent); | |
| border-left: 4px solid var(--accent); | |
| } | |
| /* ------------------------------------------------------------------ | |
| * Layout improvements for job cards | |
| * | |
| * The following rules standardise spacing and alignment within each | |
| * job card. They ensure the header, body and footer areas align | |
| * consistently regardless of how much text is present. The body | |
| * uses flexbox to push the footer to the bottom of the card and | |
| * provide equal padding on all sides. On small screens the same | |
| * layout continues to work because the grid defined below flows | |
| * the cards into a single column. | |
| */ | |
| .job-card { | |
| display: flex; | |
| flex-direction: column; | |
| height: 100%; | |
| } | |
| .job-header { | |
| padding: 1rem 1.5rem; | |
| } | |
| .job-info { | |
| display: flex; | |
| justify-content: space-between; | |
| flex-wrap: wrap; | |
| font-size: 0.9rem; | |
| margin-top: 0.5rem; | |
| } | |
| .job-body { | |
| flex: 1; | |
| padding: 1rem 1.5rem; | |
| display: flex; | |
| flex-direction: column; | |
| justify-content: space-between; | |
| } | |
| .job-body .job-description { | |
| flex: 1; | |
| margin-bottom: 0.75rem; | |
| } | |
| .job-body .job-description p { | |
| margin: 0; | |
| line-height: 1.4; | |
| } | |
| .job-footer { | |
| padding: 1rem 1.5rem; | |
| text-align: right; | |
| } | |
| /* ------------------------------------------------------------------ | |
| * Enhanced chatbot styling | |
| * | |
| * Improve readability of the floating chatbot by adding padding, | |
| * setting overflow and styling the input area. Using box-sizing | |
| * ensures the input field fits within the container without | |
| * horizontal scrolling. The background colour of the messages | |
| * area is subtly different from white for better contrast. The | |
| * display property remains none by default and is toggled via | |
| * JavaScript. | |
| */ | |
| #chatbot-box { | |
| display: none; | |
| flex-direction: column; | |
| overflow: hidden; | |
| } | |
| #chatbot-box #chat-messages { | |
| flex: 1; | |
| padding: 1rem; | |
| overflow-y: auto; | |
| background-color: #fafafa; | |
| } | |
| #chatbot-box #chat-input { | |
| border: none; | |
| border-top: 1px solid #ddd; | |
| padding: 0.75rem 1rem; | |
| font-size: 1rem; | |
| width: calc(100% - 2rem); | |
| box-sizing: border-box; | |
| } | |
| #chatbot-box #chat-input:focus { | |
| outline: none; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <header> | |
| <div class="container nav-container"> | |
| <a href="{{ url_for('index') }}" class="logo"> | |
| <span class="logo-part1">Cod</span><span class="logo-part2">in</span><span class="logo-part3">go</span> | |
| </a> | |
| <div class="login-buttons"> | |
| {% if current_user.is_authenticated %} | |
| {# | |
| Display navigation options based on the authenticated user's role. | |
| Job seekers (role: "unemployed") can view available jobs and their own applications. | |
| Recruiters and admins can post new jobs, view the jobs list and access the recruiter dashboard. | |
| #} | |
| {% if current_user.role == 'unemployed' %} | |
| <a href="{{ url_for('jobs') }}" class="btn btn-outline">Jobs</a> | |
| <a href="{{ url_for('my_applications') }}" class="btn btn-outline">My Applications</a> | |
| {% elif current_user.role in ('recruiter', 'admin') %} | |
| <a href="{{ url_for('post_job') }}" class="btn btn-outline">Add Job</a> | |
| <a href="{{ url_for('jobs') }}" class="btn btn-outline">View Jobs</a> | |
| <a href="{{ url_for('dashboard') }}" class="btn btn-outline">Dashboard</a> | |
| {% endif %} | |
| <span class="welcome-message">Welcome, {{ current_user.username }}</span> | |
| <a href="{{ url_for('auth.logout') }}" class="btn btn-logout">Logout</a> | |
| {% else %} | |
| <a href="{{ url_for('auth.login') }}" class="btn btn-outline">Log In</a> | |
| <a href="{{ url_for('auth.signup') }}" class="btn btn-primary">Sign Up</a> | |
| {% endif %} | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Fixed chatbot button --> | |
| <div id="chatbot-nav" onclick="toggleChatbot()">💬</div> | |
| <!-- Chatbot box (hidden by default) --> | |
| <div id="chatbot-box"> | |
| <div id="chat-messages"></div> | |
| <input type="text" id="chat-input" onkeydown="sendChat(event)" placeholder="Type a message..."> | |
| </div> | |
| {% block hero %}{% endblock %} | |
| <main> | |
| <div class="container"> | |
| {% with messages = get_flashed_messages(with_categories=true) %} | |
| {% if messages %} | |
| <div class="flash-messages"> | |
| {% for category, message in messages %} | |
| <div class="alert alert-{{ category }}">{{ message }}</div> | |
| {% endfor %} | |
| </div> | |
| {% endif %} | |
| {% endwith %} | |
| {% block content %}{% endblock %} | |
| </div> | |
| <!-- Chatbot UI removed on the home page. --> | |
| </main> | |
| <footer> | |
| <div class="container"> | |
| <div class="footer-grid"> | |
| <div class="footer-col"> | |
| <h3>Codingo</h3> | |
| <p>AI-powered recruitment platform that revolutionizes how companies hire technical talent.</p> | |
| <div class="social-links"> | |
| <a href="#"><span>f</span></a> | |
| <a href="#"><span>t</span></a> | |
| <a href="#"><span>in</span></a> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="copyright"> | |
| <p>© 2025 Codingo. All rights reserved.</p> | |
| </div> | |
| </div> | |
| </footer> | |
| {# ------------------------------------------------------------------------- | |
| Chatbot UI scripts and styles | |
| The following script powers the floating chatbot widget located at the | |
| bottom right of every page. When the user clicks the 💬 button, the | |
| widget toggles visibility. Pressing Enter in the input box sends the | |
| message to the `/chatbot` endpoint defined in ``app.py``. Both user | |
| and bot messages are appended to the conversation pane with simple | |
| styling defined below. Jinja's ``url_for`` helper is used to | |
| dynamically generate the correct path to the endpoint at render time. | |
| #} | |
| <script type="text/javascript"> | |
| function toggleChatbot() { | |
| const box = document.getElementById('chatbot-box'); | |
| if (!box) return; | |
| // Toggle between flex (visible) and none (hidden) | |
| box.style.display = (box.style.display === 'flex') ? 'none' : 'flex'; | |
| } | |
| function sendChat(event) { | |
| if (event.key === 'Enter') { | |
| event.preventDefault(); | |
| const input = document.getElementById('chat-input'); | |
| const message = input.value.trim(); | |
| if (!message) return; | |
| appendChatMessage(message, 'user'); | |
| input.value = ''; | |
| fetch("{{ url_for('chatbot_endpoint') }}", { | |
| method: 'POST', | |
| headers: { 'Content-Type': 'application/json' }, | |
| body: JSON.stringify({ message: message }) | |
| }).then(response => response.json()) | |
| .then(data => { | |
| if (data.response) { | |
| appendChatMessage(data.response, 'bot'); | |
| } else { | |
| appendChatMessage(data.error || 'Error occurred.', 'bot'); | |
| } | |
| }).catch(() => { | |
| appendChatMessage('Network error.', 'bot'); | |
| }); | |
| } | |
| } | |
| function appendChatMessage(text, sender) { | |
| const container = document.getElementById('chat-messages'); | |
| if (!container) return; | |
| const wrapper = document.createElement('div'); | |
| wrapper.className = sender === 'user' ? 'user-message' : 'bot-message'; | |
| const bubble = document.createElement('div'); | |
| bubble.className = sender === 'user' ? 'user-bubble' : 'bot-bubble'; | |
| bubble.textContent = text; | |
| wrapper.appendChild(bubble); | |
| container.appendChild(wrapper); | |
| container.scrollTop = container.scrollHeight; | |
| } | |
| </script> | |
| <style> | |
| /* Chat message styling for user and bot */ | |
| #chat-messages .user-message { | |
| display: flex; | |
| justify-content: flex-end; | |
| margin-bottom: 8px; | |
| } | |
| #chat-messages .bot-message { | |
| display: flex; | |
| justify-content: flex-start; | |
| margin-bottom: 8px; | |
| } | |
| #chat-messages .user-bubble { | |
| background-color: #4caf50; | |
| color: #ffffff; | |
| padding: 8px 12px; | |
| border-radius: 12px; | |
| max-width: 80%; | |
| word-wrap: break-word; | |
| } | |
| #chat-messages .bot-bubble { | |
| background-color: #f1f0f0; | |
| color: #000000; | |
| padding: 8px 12px; | |
| border-radius: 12px; | |
| max-width: 80%; | |
| word-wrap: break-word; | |
| } | |
| </style> | |
| </body> | |
| </html> |