Spaces:
Sleeping
Sleeping
Update index.html
Browse files- index.html +50 -29
index.html
CHANGED
|
@@ -3896,21 +3896,21 @@
|
|
| 3896 |
Nexa AI
|
| 3897 |
</div>
|
| 3898 |
<nav class="landing-nav" id="landingNav">
|
| 3899 |
-
<a href="javascript:void(0)" class="nav-link" data-section="featuresSection"
|
| 3900 |
-
<a href="javascript:void(0)" class="nav-link" data-section="howItWorksSection"
|
| 3901 |
-
<a href="javascript:void(0)" class="nav-link" data-section="safetySection"
|
| 3902 |
-
<a href="javascript:void(0)" class="nav-link" data-section="pricingSection"
|
| 3903 |
-
<button class="btn-primary landing-cta" style="padding: 10px 20px; font-size: 14px;"
|
| 3904 |
</nav>
|
| 3905 |
</header>
|
| 3906 |
|
| 3907 |
<section class="hero-section">
|
| 3908 |
<div class="hero-badge">Chat Smarter, Create Faster</div>
|
| 3909 |
-
<h1 class="hero-title">Your <span id="typing-text"></span><span class="typing-cursor"></span><br>AI Assistant.</h1>
|
| 3910 |
<p class="hero-subtitle">Chat with Nexa AI to get answers, generate stunning images, and boost your productivity. Your personal AI assistant for work and creativity.</p>
|
| 3911 |
<div class="cta-container">
|
| 3912 |
-
<button class="btn-primary landing-cta"
|
| 3913 |
-
<button class="btn-secondary" data-section="featuresSection"
|
| 3914 |
</div>
|
| 3915 |
<div class="trust-badges">
|
| 3916 |
<div class="trust-badge"><i data-lucide="shield-check"></i> No credit card required</div>
|
|
@@ -5407,11 +5407,13 @@
|
|
| 5407 |
}
|
| 5408 |
|
| 5409 |
function setupEventListeners() {
|
| 5410 |
-
// SINGLE Global Delegation for EVERYTHING
|
| 5411 |
document.addEventListener('click', (e) => {
|
| 5412 |
const target = e.target;
|
| 5413 |
|
| 5414 |
-
//
|
|
|
|
|
|
|
| 5415 |
const navLink = target.closest('.nav-link[data-section]');
|
| 5416 |
if (navLink) {
|
| 5417 |
const sectionId = navLink.getAttribute('data-section');
|
|
@@ -5420,14 +5422,14 @@
|
|
| 5420 |
return;
|
| 5421 |
}
|
| 5422 |
|
| 5423 |
-
// 2. Landing CTA ("Try Nexa AI", "Start Chatting")
|
| 5424 |
if (target.closest('.landing-cta')) {
|
| 5425 |
enterApp();
|
| 5426 |
e.preventDefault();
|
| 5427 |
return;
|
| 5428 |
}
|
| 5429 |
|
| 5430 |
-
// 3. Landing "View Demo"
|
| 5431 |
const demoBtn = target.closest('.btn-secondary[data-section]');
|
| 5432 |
if (demoBtn) {
|
| 5433 |
const sectionId = demoBtn.getAttribute('data-section');
|
|
@@ -5436,8 +5438,20 @@
|
|
| 5436 |
return;
|
| 5437 |
}
|
| 5438 |
|
| 5439 |
-
//
|
| 5440 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5441 |
toggleSidebar();
|
| 5442 |
return;
|
| 5443 |
}
|
|
@@ -5448,15 +5462,18 @@
|
|
| 5448 |
return;
|
| 5449 |
}
|
| 5450 |
|
| 5451 |
-
// 6. Tool Actions (+ Menu)
|
| 5452 |
-
const toolBtn = target.closest('.tool-
|
| 5453 |
if (toolBtn) {
|
|
|
|
| 5454 |
let action = toolBtn.getAttribute('onclick')?.match(/'(.*)'/)?.[1];
|
| 5455 |
if (!action) {
|
| 5456 |
const text = toolBtn.textContent.toLowerCase();
|
| 5457 |
if (text.includes('image')) action = 'image';
|
| 5458 |
else if (text.includes('search')) action = 'search';
|
| 5459 |
else if (text.includes('video')) action = 'video';
|
|
|
|
|
|
|
| 5460 |
}
|
| 5461 |
if (action) {
|
| 5462 |
e.preventDefault();
|
|
@@ -5476,18 +5493,20 @@
|
|
| 5476 |
return;
|
| 5477 |
}
|
| 5478 |
|
| 5479 |
-
//
|
| 5480 |
-
|
| 5481 |
-
|
| 5482 |
-
const item = faqQuestion.parentElement;
|
| 5483 |
-
const wasActive = item.classList.contains('active');
|
| 5484 |
-
document.querySelectorAll('.faq-item').forEach(i => i.classList.remove('active'));
|
| 5485 |
-
if (!wasActive) item.classList.add('active');
|
| 5486 |
return;
|
| 5487 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5488 |
});
|
| 5489 |
|
| 5490 |
-
//
|
|
|
|
| 5491 |
messageInput = messageInput || document.getElementById('messageInput');
|
| 5492 |
sendBtn = sendBtn || document.getElementById('sendBtn');
|
| 5493 |
|
|
@@ -5500,11 +5519,12 @@
|
|
| 5500 |
});
|
| 5501 |
}
|
| 5502 |
|
|
|
|
| 5503 |
if (sendBtn) {
|
| 5504 |
-
sendBtn.
|
| 5505 |
e.preventDefault();
|
| 5506 |
sendMessage();
|
| 5507 |
-
};
|
| 5508 |
}
|
| 5509 |
}
|
| 5510 |
|
|
@@ -8116,8 +8136,8 @@
|
|
| 8116 |
// Typing Effect
|
| 8117 |
const words = ["Intelligent", "Smart", "Powerful", "Creative"];
|
| 8118 |
let wordIndex = 0;
|
| 8119 |
-
let charIndex = 0;
|
| 8120 |
-
let isDeleting =
|
| 8121 |
const typingText = document.getElementById("typing-text");
|
| 8122 |
const typingDelay = 150;
|
| 8123 |
const erasingDelay = 100;
|
|
@@ -8147,7 +8167,8 @@
|
|
| 8147 |
}
|
| 8148 |
}
|
| 8149 |
|
| 8150 |
-
|
|
|
|
| 8151 |
|
| 8152 |
// Lightning Flash Logic
|
| 8153 |
const lightningOverlay = document.getElementById("lightningOverlay");
|
|
|
|
| 3896 |
Nexa AI
|
| 3897 |
</div>
|
| 3898 |
<nav class="landing-nav" id="landingNav">
|
| 3899 |
+
<a href="javascript:void(0)" class="nav-link" data-section="featuresSection">Features</a>
|
| 3900 |
+
<a href="javascript:void(0)" class="nav-link" data-section="howItWorksSection">How It Works</a>
|
| 3901 |
+
<a href="javascript:void(0)" class="nav-link" data-section="safetySection">Safety</a>
|
| 3902 |
+
<a href="javascript:void(0)" class="nav-link" data-section="pricingSection">Pricing</a>
|
| 3903 |
+
<button class="btn-primary landing-cta" style="padding: 10px 20px; font-size: 14px;">Try Nexa AI</button>
|
| 3904 |
</nav>
|
| 3905 |
</header>
|
| 3906 |
|
| 3907 |
<section class="hero-section">
|
| 3908 |
<div class="hero-badge">Chat Smarter, Create Faster</div>
|
| 3909 |
+
<h1 class="hero-title">Your <span id="typing-text">Intelligent</span><span class="typing-cursor"></span><br>AI Assistant.</h1>
|
| 3910 |
<p class="hero-subtitle">Chat with Nexa AI to get answers, generate stunning images, and boost your productivity. Your personal AI assistant for work and creativity.</p>
|
| 3911 |
<div class="cta-container">
|
| 3912 |
+
<button class="btn-primary landing-cta">Start Chatting — Free Forever</button>
|
| 3913 |
+
<button class="btn-secondary" data-section="featuresSection">View Demo</button>
|
| 3914 |
</div>
|
| 3915 |
<div class="trust-badges">
|
| 3916 |
<div class="trust-badge"><i data-lucide="shield-check"></i> No credit card required</div>
|
|
|
|
| 5407 |
}
|
| 5408 |
|
| 5409 |
function setupEventListeners() {
|
| 5410 |
+
// SINGLE Global Delegation for EVERYTHING (Landing + App)
|
| 5411 |
document.addEventListener('click', (e) => {
|
| 5412 |
const target = e.target;
|
| 5413 |
|
| 5414 |
+
// --- LANDING PAGE HANDLERS ---
|
| 5415 |
+
|
| 5416 |
+
// 1. Landing Navigation Links (Features, Pricing, etc.)
|
| 5417 |
const navLink = target.closest('.nav-link[data-section]');
|
| 5418 |
if (navLink) {
|
| 5419 |
const sectionId = navLink.getAttribute('data-section');
|
|
|
|
| 5422 |
return;
|
| 5423 |
}
|
| 5424 |
|
| 5425 |
+
// 2. Landing CTA Buttons ("Try Nexa AI", "Start Chatting")
|
| 5426 |
if (target.closest('.landing-cta')) {
|
| 5427 |
enterApp();
|
| 5428 |
e.preventDefault();
|
| 5429 |
return;
|
| 5430 |
}
|
| 5431 |
|
| 5432 |
+
// 3. Landing "View Demo" Button
|
| 5433 |
const demoBtn = target.closest('.btn-secondary[data-section]');
|
| 5434 |
if (demoBtn) {
|
| 5435 |
const sectionId = demoBtn.getAttribute('data-section');
|
|
|
|
| 5438 |
return;
|
| 5439 |
}
|
| 5440 |
|
| 5441 |
+
// 8. FAQ Items
|
| 5442 |
+
const faqQuestion = target.closest('.faq-question');
|
| 5443 |
+
if (faqQuestion) {
|
| 5444 |
+
const item = faqQuestion.parentElement;
|
| 5445 |
+
const wasActive = item.classList.contains('active');
|
| 5446 |
+
document.querySelectorAll('.faq-item').forEach(i => i.classList.remove('active'));
|
| 5447 |
+
if (!wasActive) item.classList.add('active');
|
| 5448 |
+
return;
|
| 5449 |
+
}
|
| 5450 |
+
|
| 5451 |
+
// --- APP INTERFACE HANDLERS ---
|
| 5452 |
+
|
| 5453 |
+
// 4. App Sidebar Toggle (Hamburger or Close)
|
| 5454 |
+
if (target.closest('.hamburger-menu') || target.closest('.sidebar-close-btn') || target.closest('.sidebar-overlay')) {
|
| 5455 |
toggleSidebar();
|
| 5456 |
return;
|
| 5457 |
}
|
|
|
|
| 5462 |
return;
|
| 5463 |
}
|
| 5464 |
|
| 5465 |
+
// 6. Tool Actions (+ Menu items)
|
| 5466 |
+
const toolBtn = target.closest('.tool-btn');
|
| 5467 |
if (toolBtn) {
|
| 5468 |
+
// Try to find action from handleToolAction call or text
|
| 5469 |
let action = toolBtn.getAttribute('onclick')?.match(/'(.*)'/)?.[1];
|
| 5470 |
if (!action) {
|
| 5471 |
const text = toolBtn.textContent.toLowerCase();
|
| 5472 |
if (text.includes('image')) action = 'image';
|
| 5473 |
else if (text.includes('search')) action = 'search';
|
| 5474 |
else if (text.includes('video')) action = 'video';
|
| 5475 |
+
else if (text.includes('upload')) action = 'upload';
|
| 5476 |
+
else if (text.includes('voice')) action = 'voice';
|
| 5477 |
}
|
| 5478 |
if (action) {
|
| 5479 |
e.preventDefault();
|
|
|
|
| 5493 |
return;
|
| 5494 |
}
|
| 5495 |
|
| 5496 |
+
// 9. Account Dropdown Toggle
|
| 5497 |
+
if (target.closest('.account-btn')) {
|
| 5498 |
+
toggleAccountDropdown();
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5499 |
return;
|
| 5500 |
}
|
| 5501 |
+
|
| 5502 |
+
// 10. Close dropdowns when clicking outside
|
| 5503 |
+
if (!target.closest('.mode-dropdown') && !target.closest('.account-btn')) {
|
| 5504 |
+
document.querySelectorAll('.mode-dropdown, .account-dropdown').forEach(d => d.classList.remove('open', 'show'));
|
| 5505 |
+
}
|
| 5506 |
});
|
| 5507 |
|
| 5508 |
+
// --- FORM & INPUT LISTENERS ---
|
| 5509 |
+
|
| 5510 |
messageInput = messageInput || document.getElementById('messageInput');
|
| 5511 |
sendBtn = sendBtn || document.getElementById('sendBtn');
|
| 5512 |
|
|
|
|
| 5519 |
});
|
| 5520 |
}
|
| 5521 |
|
| 5522 |
+
// The send button might still have onclick in HTML, but we add listener just in case
|
| 5523 |
if (sendBtn) {
|
| 5524 |
+
sendBtn.addEventListener('click', (e) => {
|
| 5525 |
e.preventDefault();
|
| 5526 |
sendMessage();
|
| 5527 |
+
});
|
| 5528 |
}
|
| 5529 |
}
|
| 5530 |
|
|
|
|
| 8136 |
// Typing Effect
|
| 8137 |
const words = ["Intelligent", "Smart", "Powerful", "Creative"];
|
| 8138 |
let wordIndex = 0;
|
| 8139 |
+
let charIndex = words[0].length; // Start with "Intelligent" fully typed
|
| 8140 |
+
let isDeleting = true; // Start by deleting
|
| 8141 |
const typingText = document.getElementById("typing-text");
|
| 8142 |
const typingDelay = 150;
|
| 8143 |
const erasingDelay = 100;
|
|
|
|
| 8167 |
}
|
| 8168 |
}
|
| 8169 |
|
| 8170 |
+
// Initial wait before starting the backspacing effect
|
| 8171 |
+
if (typingText) setTimeout(typeEffect, 2000);
|
| 8172 |
|
| 8173 |
// Lightning Flash Logic
|
| 8174 |
const lightningOverlay = document.getElementById("lightningOverlay");
|