husseinelsaadi's picture
chatbot integrated
d8529bc
raw
history blame
26.2 kB
<!DOCTYPE html>
<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;
}
/* Style for the welcome message */
.welcome-message {
color: white;
font-weight: 500;
margin-right: 0.5rem;
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);
}
.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;
}
.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;
margin-bottom: 0.5rem;
}
.job-info {
display: flex;
justify-content: space-between;
font-size: 0.9rem;
opacity: 0.9;
}
.job-body {
padding: 1.5rem;
flex-grow: 1;
}
.job-description {
margin-bottom: 1.5rem;
}
.job-footer {
padding: 1rem 1.5rem;
background-color: rgba(0, 0, 0, 0.03);
display: flex;
justify-content: flex-end;
}
.form-group {
margin-bottom: 1.5rem;
}
.form-group label {
display: block;
margin-bottom: 0.5rem;
font-weight: 500;
}
.form-control {
width: 100%;
padding: 0.75rem;
border: 1px solid #ddd;
border-radius: 5px;
font-size: 1rem;
}
.form-control:focus {
border-color: var(--primary);
outline: none;
box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}
textarea.form-control {
min-height: 150px;
}
.flash-messages {
margin: 1rem 0;
}
.alert {
padding: 1rem;
border-radius: 5px;
margin-bottom: 1rem;
}
.alert-success {
background-color: rgba(46, 204, 113, 0.2);
border: 1px solid var(--success);
color: #27ae60;
}
.alert-danger {
background-color: rgba(231, 76, 60, 0.2);
border: 1px solid var(--danger);
color: #c0392b;
}
/* Breadcrumbs */
.breadcrumbs {
display: flex;
padding: 1rem 0;
margin-bottom: 1rem;
list-style: none;
}
.breadcrumbs li {
display: flex;
align-items: center;
}
.breadcrumbs li:not(:last-child)::after {
content: '/';
margin: 0 0.5rem;
color: #aaa;
}
.breadcrumbs a {
color: var(--primary);
text-decoration: none;
}
.breadcrumbs a:hover {
text-decoration: underline;
}
@media screen and (max-width: 768px) {
.nav-container {
flex-direction: row;
justify-content: space-between;
}
.luna-avatar-container {
width: 180px;
height: 180px;
}
.hero h1 {
font-size: 2rem;
}
.hero p {
font-size: 1rem;
}
.job-grid {
grid-template-columns: 1fr;
}
}
</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>
{% 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 START
<!-- Chatbot Toggle Button -->
<div id="chatbot-toggle" onclick="toggleChatbot()">💬 Chat</div>
<!-- Chatbox Popup -->
<div id="chatbot-box">
<div id="chat-header">LUNA AI</div>
<div id="chat-messages"></div>
<input id="chat-input" type="text" placeholder="Ask me anything..." onkeydown="sendChat(event)">
</div>
<style>
#chatbot-toggle {
position: fixed;
bottom: 20px;
right: 20px;
background-color: #4caf50;
color: white;
padding: 12px 15px;
border-radius: 30px;
cursor: pointer;
z-index: 1000;
}
#chatbot-box {
position: fixed;
bottom: 80px;
right: 20px;
width: 300px;
height: 400px;
background: white;
border: 2px solid #ccc;
border-radius: 10px;
display: none;
flex-direction: column;
z-index: 1000;
}
#chat-header {
background-color: #4caf50;
color: white;
padding: 10px;
text-align: center;
font-weight: bold;
}
#chat-messages {
flex: 1;
padding: 10px;
overflow-y: auto;
max-height: 300px;
}
#chat-input {
border: none;
border-top: 1px solid #ccc;
padding: 10px;
width: 100%;
box-sizing: border-box;
}
</style>
#CHATBOT END
</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>&copy; 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>