Spaces:
Running
You are tasked with generating a super modern, animated, highly detailed, and comprehensive AI chat website using TailwindCSS via CDN. The design must feel futuristic, cinematic, and immersive, optimized for both desktop and mobile.
Browse filesCore requirements:
- **Color scheme:** Dark mode only. Use `bg-zinc-950` and `bg-zinc-900` for layered backgrounds. Foreground elements (text, buttons, highlights) must use `text-white`, `bg-white`, or subtle gradients for contrast. Black background with white foreground is mandatory.
- **Typography:** Clean sans-serif fonts. Headings large and animated (fade-in, slide-up). Chat text highly readable with smooth spacing.
- **Layout:**
- Full-screen responsive container with flex/grid.
- Left sidebar for navigation (Home, Chat, Settings, About).
- Main chat window centered, with rounded corners, subtle shadows, glowing borders.
- Right sidebar for AI persona info, tips, or system status.
- **Animations:**
- Smooth transitions on hover (scale, glow, shadow).
- Chat bubbles animate in (slide + fade).
- Background gradient animations (slow pulse between `bg-zinc-950` and `bg-zinc-900`).
- Loading indicators with spinning dots or wave effects.
- **Chat UI:**
- User messages aligned right, AI messages aligned left.
- Rounded chat bubbles with subtle glow (`shadow-lg`, `hover:scale-105`).
- Timestamp and message status indicators.
- Input bar fixed at bottom with glowing border, animated send button.
- **Extra details:**
- Sticky header with site logo (minimalist white icon).
- Footer with links (Privacy, Terms, Contact).
- Support for markdown in chat (bold, italic, code blocks).
- Optional toggle for compact vs spacious chat mode.
- Smooth scroll with inertia effect.
- **Overall vibe:** A futuristic AI hub with cinematic feel. Black-and-white contrast, glowing accents, and fluid animations should make the site feel alive and premium.
Deliverable: A TailwindCSS-based HTML/CSS/JS structure that embodies this design philosophy. It must be visually stunning, highly interactive, and ready to expand into a full AI chat platform.
- README.md +8 -5
- components/footer.js +117 -0
- components/header.js +150 -0
- components/sidebar.js +271 -0
- index.html +251 -19
- script.js +322 -0
- style.css +130 -18
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title: Neural Nexus
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Neural Nexus AI π
|
| 3 |
+
colorFrom: purple
|
| 4 |
+
colorTo: blue
|
| 5 |
+
emoji: π³
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite-v3
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Welcome to your new DeepSite project!
|
| 13 |
+
This project was created with [DeepSite](https://huggingface.co/deepsite).
|
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomFooter extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
|
| 7 |
+
* { font-family: 'Inter', sans-serif; }
|
| 8 |
+
|
| 9 |
+
footer {
|
| 10 |
+
position: fixed;
|
| 11 |
+
bottom: 0;
|
| 12 |
+
left: 0;
|
| 13 |
+
right: 0;
|
| 14 |
+
background: rgba(9, 9, 11, 0.9);
|
| 15 |
+
backdrop-filter: blur(20px);
|
| 16 |
+
-webkit-backdrop-filter: blur(20px);
|
| 17 |
+
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
| 18 |
+
padding: 0.75rem 2rem;
|
| 19 |
+
z-index: 30;
|
| 20 |
+
display: flex;
|
| 21 |
+
align-items: center;
|
| 22 |
+
justify-content: space-between;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
.footer-links {
|
| 26 |
+
display: flex;
|
| 27 |
+
align-items: center;
|
| 28 |
+
gap: 2rem;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
.footer-link {
|
| 32 |
+
color: #71717a;
|
| 33 |
+
text-decoration: none;
|
| 34 |
+
font-size: 0.875rem;
|
| 35 |
+
transition: color 0.2s ease;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
.footer-link:hover {
|
| 39 |
+
color: #ffffff;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
.footer-info {
|
| 43 |
+
display: flex;
|
| 44 |
+
align-items: center;
|
| 45 |
+
gap: 2rem;
|
| 46 |
+
color: #71717a;
|
| 47 |
+
font-size: 0.75rem;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
.status-indicator {
|
| 51 |
+
display: flex;
|
| 52 |
+
align-items: center;
|
| 53 |
+
gap: 0.5rem;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
.status-dot {
|
| 57 |
+
width: 8px;
|
| 58 |
+
height: 8px;
|
| 59 |
+
border-radius: 50%;
|
| 60 |
+
background: #10b981;
|
| 61 |
+
animation: pulse 2s infinite;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
@keyframes pulse {
|
| 65 |
+
0%, 100% { opacity: 1; }
|
| 66 |
+
50% { opacity: 0.5; }
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
@media (max-width: 768px) {
|
| 70 |
+
footer {
|
| 71 |
+
padding: 0.75rem 1rem;
|
| 72 |
+
flex-direction: column;
|
| 73 |
+
gap: 0.5rem;
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
.footer-links {
|
| 77 |
+
gap: 1rem;
|
| 78 |
+
flex-wrap: wrap;
|
| 79 |
+
justify-content: center;
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
.footer-info {
|
| 83 |
+
gap: 1rem;
|
| 84 |
+
font-size: 0.625rem;
|
| 85 |
+
}
|
| 86 |
+
}
|
| 87 |
+
</style>
|
| 88 |
+
|
| 89 |
+
<footer>
|
| 90 |
+
<div class="footer-links">
|
| 91 |
+
<a href="/privacy" class="footer-link">Privacy Policy</a>
|
| 92 |
+
<a href="/terms" class="footer-link">Terms of Service</a>
|
| 93 |
+
<a href="/contact" class="footer-link">Contact Us</a>
|
| 94 |
+
<a href="/docs" class="footer-link">API Docs</a>
|
| 95 |
+
<a href="/blog" class="footer-link">Blog</a>
|
| 96 |
+
</div>
|
| 97 |
+
|
| 98 |
+
<div class="footer-info">
|
| 99 |
+
<div class="status-indicator">
|
| 100 |
+
<div class="status-dot"></div>
|
| 101 |
+
<span>All systems operational</span>
|
| 102 |
+
</div>
|
| 103 |
+
<span>Β© 2024 Neural Nexus AI</span>
|
| 104 |
+
<span>Version 2.0.1</span>
|
| 105 |
+
</div>
|
| 106 |
+
</footer>
|
| 107 |
+
`;
|
| 108 |
+
}
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
customElements.define('custom-footer', CustomFooter);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|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomHeader extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
|
| 7 |
+
* { font-family: 'Inter', sans-serif; }
|
| 8 |
+
|
| 9 |
+
.header-container {
|
| 10 |
+
height: 64px;
|
| 11 |
+
background: rgba(9, 9, 11, 0.8);
|
| 12 |
+
backdrop-filter: blur(20px);
|
| 13 |
+
-webkit-backdrop-filter: blur(20px);
|
| 14 |
+
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
| 15 |
+
display: flex;
|
| 16 |
+
align-items: center;
|
| 17 |
+
justify-content: space-between;
|
| 18 |
+
padding: 0 2rem;
|
| 19 |
+
position: fixed;
|
| 20 |
+
top: 0;
|
| 21 |
+
left: 0;
|
| 22 |
+
right: 0;
|
| 23 |
+
z-index: 50;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
.logo {
|
| 27 |
+
display: flex;
|
| 28 |
+
align-items: center;
|
| 29 |
+
space-x: 3;
|
| 30 |
+
cursor: pointer;
|
| 31 |
+
transition: transform 0.2s ease;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
.logo:hover {
|
| 35 |
+
transform: scale(1.05);
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
.logo-text {
|
| 39 |
+
font-size: 1.25rem;
|
| 40 |
+
font-weight: 700;
|
| 41 |
+
background: linear-gradient(135deg, #ffffff 0%, #9ca3af 100%);
|
| 42 |
+
-webkit-background-clip: text;
|
| 43 |
+
-webkit-text-fill-color: transparent;
|
| 44 |
+
background-clip: text;
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
.logo-icon {
|
| 48 |
+
width: 36px;
|
| 49 |
+
height: 36px;
|
| 50 |
+
border-radius: 12px;
|
| 51 |
+
background: linear-gradient(135deg, #ffffff 0%, #6b7280 100%);
|
| 52 |
+
display: flex;
|
| 53 |
+
align-items: center;
|
| 54 |
+
justify-content: center;
|
| 55 |
+
box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
.nav-actions {
|
| 59 |
+
display: flex;
|
| 60 |
+
align-items: center;
|
| 61 |
+
gap: 0.75rem;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
.icon-btn {
|
| 65 |
+
width: 40px;
|
| 66 |
+
height: 40px;
|
| 67 |
+
border-radius: 12px;
|
| 68 |
+
background: rgba(255, 255, 255, 0.05);
|
| 69 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
| 70 |
+
display: flex;
|
| 71 |
+
align-items: center;
|
| 72 |
+
justify-content: center;
|
| 73 |
+
cursor: pointer;
|
| 74 |
+
transition: all 0.2s ease;
|
| 75 |
+
color: #9ca3af;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
.icon-btn:hover {
|
| 79 |
+
background: rgba(255, 255, 255, 0.1);
|
| 80 |
+
color: #ffffff;
|
| 81 |
+
transform: translateY(-2px);
|
| 82 |
+
box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
.menu-toggle {
|
| 86 |
+
display: none;
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
@media (max-width: 768px) {
|
| 90 |
+
.header-container {
|
| 91 |
+
padding: 0 1rem;
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
.logo-text span {
|
| 95 |
+
display: none;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
.menu-toggle {
|
| 99 |
+
display: flex;
|
| 100 |
+
}
|
| 101 |
+
}
|
| 102 |
+
</style>
|
| 103 |
+
|
| 104 |
+
<header class="header-container">
|
| 105 |
+
<div onclick="location.href='/'" class="logo">
|
| 106 |
+
<div class="logo-icon">
|
| 107 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2">
|
| 108 |
+
<path d="M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
|
| 109 |
+
<path d="M12 2v6a2 2 0 002 2h6"/>
|
| 110 |
+
</svg>
|
| 111 |
+
</div>
|
| 112 |
+
<div class="logo-text text-white">
|
| 113 |
+
Neural <span>Nexus</span> AI
|
| 114 |
+
</div>
|
| 115 |
+
</div>
|
| 116 |
+
|
| 117 |
+
<div class="nav-actions">
|
| 118 |
+
<button onclick="toggleTheme()" class="icon-btn" data-tooltip="Toggle theme">
|
| 119 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
| 120 |
+
<circle cx="12" cy="12" r="5"/>
|
| 121 |
+
<path d="M12 1v2m0 18v2M4.22 4.22l1.42 1.42m12.72 12.72l1.42 1.42M1 12h2m18 0h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"/>
|
| 122 |
+
</svg>
|
| 123 |
+
</button>
|
| 124 |
+
|
| 125 |
+
<button onclick="showNotifications()" class="icon-btn" data-tooltip="Notifications">
|
| 126 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
| 127 |
+
<path d="M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9"/>
|
| 128 |
+
<path d="M13.73 21a2 2 0 01-3.46 0"/>
|
| 129 |
+
</svg>
|
| 130 |
+
</button>
|
| 131 |
+
|
| 132 |
+
<button onclick="showUserMenu()" class="icon-btn" data-tooltip="User menu">
|
| 133 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
| 134 |
+
<path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"/>
|
| 135 |
+
<circle cx="12" cy="7" r="4"/>
|
| 136 |
+
</svg>
|
| 137 |
+
</button>
|
| 138 |
+
|
| 139 |
+
<button onclick="toggleMobileSidebar()" class="icon-btn menu-toggle" data-tooltip="Menu">
|
| 140 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
| 141 |
+
<path d="M3 12h18M3 6h18M3 18h18"/>
|
| 142 |
+
</svg>
|
| 143 |
+
</button>
|
| 144 |
+
</div>
|
| 145 |
+
</header>
|
| 146 |
+
`;
|
| 147 |
+
}
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
customElements.define('custom-header', CustomHeader);
|
|
@@ -0,0 +1,271 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
|
| 7 |
+
* { font-family: 'Inter', sans-serif; }
|
| 8 |
+
|
| 9 |
+
.sidebar {
|
| 10 |
+
width: 256px;
|
| 11 |
+
background: rgba(17, 24, 39, 0.5);
|
| 12 |
+
backdrop-filter: blur(20px);
|
| 13 |
+
-webkit-backdrop-filter: blur(20px);
|
| 14 |
+
border-right: 1px solid rgba(255, 255, 255, 0.1);
|
| 15 |
+
padding: 1.5rem 0;
|
| 16 |
+
overflow-y: auto;
|
| 17 |
+
height: calc(100vh - 64px);
|
| 18 |
+
position: fixed;
|
| 19 |
+
left: 0;
|
| 20 |
+
top: 64px;
|
| 21 |
+
z-index: 40;
|
| 22 |
+
transition: transform 0.3s ease;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
.nav-section {
|
| 26 |
+
margin-bottom: 2rem;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
.nav-title {
|
| 30 |
+
font-size: 0.75rem;
|
| 31 |
+
font-weight: 600;
|
| 32 |
+
color: #71717a;
|
| 33 |
+
text-transform: uppercase;
|
| 34 |
+
letter-spacing: 0.05em;
|
| 35 |
+
padding: 0 1.5rem;
|
| 36 |
+
margin-bottom: 0.5rem;
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
.nav-item {
|
| 40 |
+
display: flex;
|
| 41 |
+
align-items: center;
|
| 42 |
+
gap: 0.75rem;
|
| 43 |
+
padding: 0.75rem 1.5rem;
|
| 44 |
+
color: #d1d5db;
|
| 45 |
+
text-decoration: none;
|
| 46 |
+
transition: all 0.2s ease;
|
| 47 |
+
position: relative;
|
| 48 |
+
cursor: pointer;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
.nav-item:hover {
|
| 52 |
+
background: rgba(255, 255, 255, 0.05);
|
| 53 |
+
color: #ffffff;
|
| 54 |
+
padding-left: 2rem;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
.nav-item.active {
|
| 58 |
+
background: rgba(255, 255, 255, 0.1);
|
| 59 |
+
color: #ffffff;
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
.nav-item.active::before {
|
| 63 |
+
content: '';
|
| 64 |
+
position: absolute;
|
| 65 |
+
left: 0;
|
| 66 |
+
top: 0;
|
| 67 |
+
bottom: 0;
|
| 68 |
+
width: 3px;
|
| 69 |
+
background: linear-gradient(135deg, #ffffff 0%, #9ca3af 100%);
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
.nav-icon {
|
| 73 |
+
width: 20px;
|
| 74 |
+
height: 20px;
|
| 75 |
+
transition: transform 0.2s ease;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
.nav-item:hover .nav-icon {
|
| 79 |
+
transform: scale(1.1);
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
.new-chat-btn {
|
| 83 |
+
margin: 0 1.5rem 1.5rem;
|
| 84 |
+
padding: 0.75rem 1.5rem;
|
| 85 |
+
background: linear-gradient(135deg, #ffffff 0%, #9ca3af 100%);
|
| 86 |
+
color: #111827;
|
| 87 |
+
border-radius: 12px;
|
| 88 |
+
font-weight: 600;
|
| 89 |
+
text-align: center;
|
| 90 |
+
cursor: pointer;
|
| 91 |
+
transition: all 0.2s ease;
|
| 92 |
+
border: none;
|
| 93 |
+
display: flex;
|
| 94 |
+
align-items: center;
|
| 95 |
+
justify-content: center;
|
| 96 |
+
gap: 0.5rem;
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
.new-chat-btn:hover {
|
| 100 |
+
transform: translateY(-2px);
|
| 101 |
+
box-shadow: 0 10px 20px rgba(255, 255, 255, 0.2);
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
.chat-history {
|
| 105 |
+
max-height: 300px;
|
| 106 |
+
overflow-y: auto;
|
| 107 |
+
margin-bottom: 1rem;
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
.history-item {
|
| 111 |
+
padding: 0.5rem 1.5rem;
|
| 112 |
+
color: #71717a;
|
| 113 |
+
font-size: 0.875rem;
|
| 114 |
+
cursor: pointer;
|
| 115 |
+
transition: all 0.2s ease;
|
| 116 |
+
overflow: hidden;
|
| 117 |
+
text-overflow: ellipsis;
|
| 118 |
+
white-space: nowrap;
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
.history-item:hover {
|
| 122 |
+
color: #d1d5db;
|
| 123 |
+
background: rgba(255, 255, 255, 0.03);
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
.divider {
|
| 127 |
+
height: 1px;
|
| 128 |
+
background: rgba(255, 255, 255, 0.1);
|
| 129 |
+
margin: 1rem 0;
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
@media (max-width: 768px) {
|
| 133 |
+
.sidebar {
|
| 134 |
+
transform: translateX(-100%);
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
.sidebar.active {
|
| 138 |
+
transform: translateX(0);
|
| 139 |
+
}
|
| 140 |
+
}
|
| 141 |
+
</style>
|
| 142 |
+
|
| 143 |
+
<nav class="sidebar">
|
| 144 |
+
<button onclick="startNewChat()" class="new-chat-btn">
|
| 145 |
+
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2">
|
| 146 |
+
<path d="M12 5v14m-7-7h14"/>
|
| 147 |
+
</svg>
|
| 148 |
+
New Chat
|
| 149 |
+
</button>
|
| 150 |
+
|
| 151 |
+
<div class="nav-section">
|
| 152 |
+
<div class="nav-title">Recent Chats</div>
|
| 153 |
+
<div class="chat-history" id="recentChats">
|
| 154 |
+
<div class="history-item">How to create a responsive design?</div>
|
| 155 |
+
<div class="history-item">JavaScript async patterns</div>
|
| 156 |
+
<div class="history-item">CSS Grid vs Flexbox</div>
|
| 157 |
+
<div class="history-item">React performance tips</div>
|
| 158 |
+
</div>
|
| 159 |
+
</div>
|
| 160 |
+
|
| 161 |
+
<div class="divider"></div>
|
| 162 |
+
|
| 163 |
+
<div class="nav-section">
|
| 164 |
+
<div class="nav-title">Main</div>
|
| 165 |
+
<a href="/" class="nav-item active">
|
| 166 |
+
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
| 167 |
+
<path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/>
|
| 168 |
+
<path d="M9 22V12h6v10"/>
|
| 169 |
+
</svg>
|
| 170 |
+
Home
|
| 171 |
+
</a>
|
| 172 |
+
<a href="/chat" class="nav-item">
|
| 173 |
+
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
| 174 |
+
<path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/>
|
| 175 |
+
</svg>
|
| 176 |
+
Chat
|
| 177 |
+
</a>
|
| 178 |
+
<a href="/files" class="nav-item">
|
| 179 |
+
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
| 180 |
+
<path d="M13 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V9z"/>
|
| 181 |
+
<path d="M13 2v7h7"/>
|
| 182 |
+
</svg>
|
| 183 |
+
Files
|
| 184 |
+
</a>
|
| 185 |
+
</div>
|
| 186 |
+
|
| 187 |
+
<div class="divider"></div>
|
| 188 |
+
|
| 189 |
+
<div class="nav-section">
|
| 190 |
+
<div class="nav-title">Settings</div>
|
| 191 |
+
<a href="/settings" class="nav-item">
|
| 192 |
+
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
| 193 |
+
<circle cx="12" cy="12" r="3"/>
|
| 194 |
+
<path d="M12 1v6m0 6v6m4.22-13.22l4.24 4.24M1.54 9.96l4.24 4.24m12.44 0l4.24 4.24M1.54 14.04l4.24-4.24"/>
|
| 195 |
+
</svg>
|
| 196 |
+
Settings
|
| 197 |
+
</a>
|
| 198 |
+
<a href="/about" class="nav-item">
|
| 199 |
+
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
| 200 |
+
<circle cx="12" cy="12" r="10"/>
|
| 201 |
+
<path d="M12 6v6l4 2"/>
|
| 202 |
+
</svg>
|
| 203 |
+
About
|
| 204 |
+
</svg>
|
| 205 |
+
</a>
|
| 206 |
+
</div>
|
| 207 |
+
|
| 208 |
+
<div class="divider"></div>
|
| 209 |
+
|
| 210 |
+
<div class="nav-section">
|
| 211 |
+
<a href="/upgrade" class="nav-item">
|
| 212 |
+
<svg class="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
| 213 |
+
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>
|
| 214 |
+
</svg>
|
| 215 |
+
Upgrade to Pro
|
| 216 |
+
</a>
|
| 217 |
+
</div>
|
| 218 |
+
</nav>
|
| 219 |
+
`;
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
// Add methods dynamically since shadow DOM doesn't allow direct access from parent
|
| 223 |
+
connectedCallback() {
|
| 224 |
+
setTimeout(() => {
|
| 225 |
+
const navItems = this.shadowRoot.querySelectorAll('.nav-item');
|
| 226 |
+
navItems.forEach(item => {
|
| 227 |
+
item.addEventListener('click', function(e) {
|
| 228 |
+
if (this.getAttribute('href').startsWith('/')) {
|
| 229 |
+
e.preventDefault();
|
| 230 |
+
// Navigate to new page (SPA style)
|
| 231 |
+
window.history.pushState({}, '', this.getAttribute('href'));
|
| 232 |
+
updateActiveNavItem(this);
|
| 233 |
+
}
|
| 234 |
+
});
|
| 235 |
+
});
|
| 236 |
+
|
| 237 |
+
const historyItems = this.shadowRoot.querySelectorAll('.history-item');
|
| 238 |
+
historyItems.forEach(item => {
|
| 239 |
+
item.addEventListener('click', function() {
|
| 240 |
+
loadChatHistory(this.textContent);
|
| 241 |
+
});
|
| 242 |
+
});
|
| 243 |
+
}, 0);
|
| 244 |
+
}
|
| 245 |
+
}
|
| 246 |
+
|
| 247 |
+
function updateActiveNavItem(activeItem) {
|
| 248 |
+
document.querySelectorAll('custom-sidebar').forEach(sidebar => {
|
| 249 |
+
const navItems = sidebar.shadowRoot.querySelectorAll('.nav-item');
|
| 250 |
+
navItems.forEach(item => item.classList.remove('active'));
|
| 251 |
+
});
|
| 252 |
+
activeItem.classList.add('active');
|
| 253 |
+
}
|
| 254 |
+
|
| 255 |
+
function startNewChat() {
|
| 256 |
+
clearChat();
|
| 257 |
+
}
|
| 258 |
+
|
| 259 |
+
function loadChatHistory(topic) {
|
| 260 |
+
// Load specific chat history
|
| 261 |
+
console.log('Loading chat history for:', topic);
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
function toggleMobileSidebar() {
|
| 265 |
+
const sidebar = document.querySelector('custom-sidebar');
|
| 266 |
+
if (sidebar) {
|
| 267 |
+
sidebar.shadowRoot.querySelector('.sidebar').classList.toggle('active');
|
| 268 |
+
}
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
+
customElements.define('custom-sidebar', CustomSidebar);
|
|
@@ -1,19 +1,251 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Neural Nexus AI - Futuristic Chat Platform</title>
|
| 7 |
+
<link rel="icon" type="image/x-icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>π€</text></svg>">
|
| 8 |
+
<link rel="stylesheet" href="style.css">
|
| 9 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 10 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 11 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 12 |
+
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
| 13 |
+
<style>
|
| 14 |
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
|
| 15 |
+
* { font-family: 'Inter', sans-serif; }
|
| 16 |
+
.gradient-shift { animation: gradientShift 8s ease-in-out infinite; }
|
| 17 |
+
@keyframes gradientShift {
|
| 18 |
+
0%, 100% { background: rgb(17, 24, 39); }
|
| 19 |
+
50% { background: rgb(9, 9, 11); }
|
| 20 |
+
}
|
| 21 |
+
.typing-indicator span { animation: typing 1.4s infinite; }
|
| 22 |
+
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
|
| 23 |
+
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
|
| 24 |
+
@keyframes typing {
|
| 25 |
+
0%, 60%, 100% { transform: translateY(0); opacity: 0.7; }
|
| 26 |
+
30% { transform: translateY(-10px); opacity: 1; }
|
| 27 |
+
}
|
| 28 |
+
.scroll-smooth { scroll-behavior: smooth; }
|
| 29 |
+
.noise {
|
| 30 |
+
position: fixed;
|
| 31 |
+
top: 0;
|
| 32 |
+
left: 0;
|
| 33 |
+
width: 100%;
|
| 34 |
+
height: 100%;
|
| 35 |
+
opacity: 0.02;
|
| 36 |
+
z-index: 1;
|
| 37 |
+
pointer-events: none;
|
| 38 |
+
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
|
| 39 |
+
}
|
| 40 |
+
.glow {
|
| 41 |
+
box-shadow: 0 0 20px rgba(255, 255, 255, 0.1),
|
| 42 |
+
0 0 40px rgba(255, 255, 255, 0.05),
|
| 43 |
+
0 0 60px rgba(255, 255, 255, 0.03);
|
| 44 |
+
}
|
| 45 |
+
.message-slide-in {
|
| 46 |
+
animation: slideInFade 0.3s ease-out;
|
| 47 |
+
}
|
| 48 |
+
@keyframes slideInFade {
|
| 49 |
+
from {
|
| 50 |
+
opacity: 0;
|
| 51 |
+
transform: translateY(20px);
|
| 52 |
+
}
|
| 53 |
+
to {
|
| 54 |
+
opacity: 1;
|
| 55 |
+
transform: translateY(0);
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
</style>
|
| 59 |
+
</head>
|
| 60 |
+
<body class="bg-zinc-950 text-white min-h-screen gradient-shift relative overflow-hidden">
|
| 61 |
+
<div class="noise"></div>
|
| 62 |
+
|
| 63 |
+
<!-- Header -->
|
| 64 |
+
<custom-header></custom-header>
|
| 65 |
+
|
| 66 |
+
<!-- Main Container -->
|
| 67 |
+
<div class="flex h-[calc(100vh-64px)] relative z-10">
|
| 68 |
+
|
| 69 |
+
<!-- Left Sidebar -->
|
| 70 |
+
<custom-sidebar class="w-64 bg-zinc-900/50 backdrop-blur-xl border-r border-zinc-800"></custom-sidebar>
|
| 71 |
+
|
| 72 |
+
<!-- Main Chat Area -->
|
| 73 |
+
<main class="flex-1 flex flex-col bg-zinc-950 relative">
|
| 74 |
+
<!-- Chat Header -->
|
| 75 |
+
<div class="bg-zinc-900/30 backdrop-blur-lg border-b border-zinc-800 p-4 flex items-center justify-between">
|
| 76 |
+
<div class="flex items-center space-x-3">
|
| 77 |
+
<div class="w-10 h-10 rounded-full bg-gradient-to-br from-white to-zinc-600 flex items-center justify-center glow">
|
| 78 |
+
<i data-feather="cpu" class="w-5 h-5 text-zinc-900"></i>
|
| 79 |
+
</div>
|
| 80 |
+
<div>
|
| 81 |
+
<h2 class="font-semibold text-white">Neural Assistant</h2>
|
| 82 |
+
<p class="text-xs text-zinc-400">Online β’ Powered by AI</p>
|
| 83 |
+
</div>
|
| 84 |
+
</div>
|
| 85 |
+
<button onclick="toggleChatMode()" class="p-2 hover:bg-zinc-800 rounded-lg transition-all duration-200 hover:scale-105">
|
| 86 |
+
<i data-feather="maximize-2" class="w-5 h-5 text-zinc-400"></i>
|
| 87 |
+
</button>
|
| 88 |
+
</div>
|
| 89 |
+
|
| 90 |
+
<!-- Messages Container -->
|
| 91 |
+
<div id="chatContainer" class="flex-1 overflow-y-auto scroll-smooth p-4 space-y-4" style="scrollbar-width: thin; scrollbar-color: #525252 #18181b;">
|
| 92 |
+
<!-- AI Welcome Message -->
|
| 93 |
+
<div class="flex items-start space-x-3 message-slide-in">
|
| 94 |
+
<div class="w-8 h-8 rounded-full bg-gradient-to-br from-white to-zinc-600 flex items-center justify-center flex-shrink-0">
|
| 95 |
+
<i data-feather="cpu" class="w-4 h-4 text-zinc-900"></i>
|
| 96 |
+
</div>
|
| 97 |
+
<div class="max-w-xl">
|
| 98 |
+
<div class="bg-zinc-900 rounded-2xl rounded-tl-sm p-4 glow hover:scale-[1.02] transition-all duration-200">
|
| 99 |
+
<p class="text-white leading-relaxed">Welcome to Neural Nexus AI π</p>
|
| 100 |
+
<p class="text-zinc-400 text-sm mt-2">I'm your advanced AI assistant. How can I help you today?</p>
|
| 101 |
+
</div>
|
| 102 |
+
<p class="text-xs text-zinc-500 mt-1">Just now</p>
|
| 103 |
+
</div>
|
| 104 |
+
</div>
|
| 105 |
+
|
| 106 |
+
<div id="typingIndicator" class="hidden flex items-center space-x-3">
|
| 107 |
+
<div class="w-8 h-8 rounded-full bg-gradient-to-br from-white to-zinc-600 flex items-center justify-center flex-shrink-0">
|
| 108 |
+
<i data-feather="cpu" class="w-4 h-4 text-zinc-900"></i>
|
| 109 |
+
</div>
|
| 110 |
+
<div class="bg-zinc-900 rounded-2xl rounded-tl-sm p-4">
|
| 111 |
+
<div class="typing-indicator flex space-x-1">
|
| 112 |
+
<span class="w-2 h-2 bg-white rounded-full"></span>
|
| 113 |
+
<span class="w-2 h-2 bg-white rounded-full"></span>
|
| 114 |
+
<span class="w-2 h-2 bg-white rounded-full"></span>
|
| 115 |
+
</div>
|
| 116 |
+
</div>
|
| 117 |
+
</div>
|
| 118 |
+
</div>
|
| 119 |
+
|
| 120 |
+
<!-- Input Area -->
|
| 121 |
+
<div class="bg-zinc-900/30 backdrop-blur-lg border-t border-zinc-800 p-4">
|
| 122 |
+
<div class="flex items-end space-x-3">
|
| 123 |
+
<button class="p-3 hover:bg-zinc-800 rounded-lg transition-all duration-200 hover:scale-105">
|
| 124 |
+
<i data-feather="paperclip" class="w-5 h-5 text-zinc-400"></i>
|
| 125 |
+
</button>
|
| 126 |
+
<div class="flex-1 relative">
|
| 127 |
+
<textarea
|
| 128 |
+
id="messageInput"
|
| 129 |
+
rows="1"
|
| 130 |
+
placeholder="Type your message..."
|
| 131 |
+
class="w-full bg-zinc-900 border border-zinc-800 rounded-xl px-4 py-3 pr-12 text-white placeholder-zinc-500 resize-none focus:outline-none focus:border-white focus:glow transition-all duration-200"
|
| 132 |
+
onkeypress="handleKeyPress(event)"
|
| 133 |
+
oninput="autoResize(this)"
|
| 134 |
+
></textarea>
|
| 135 |
+
<button class="absolute right-2 bottom-2 p-2 hover:bg-zinc-800 rounded-lg transition-all duration-200 hover:scale-105">
|
| 136 |
+
<i data-feather="smile" class="w-4 h-4 text-zinc-400"></i>
|
| 137 |
+
</button>
|
| 138 |
+
</div>
|
| 139 |
+
<button
|
| 140 |
+
onclick="sendMessage()"
|
| 141 |
+
class="p-3 bg-gradient-to-r from-white to-zinc-200 text-zinc-900 rounded-xl hover:scale-105 transition-all duration-200 hover:shadow-lg hover:shadow-white/20"
|
| 142 |
+
>
|
| 143 |
+
<i data-feather="send" class="w-5 h-5"></i>
|
| 144 |
+
</button>
|
| 145 |
+
</div>
|
| 146 |
+
<div class="flex items-center justify-between mt-2">
|
| 147 |
+
<p class="text-xs text-zinc-500">Press Enter to send, Shift+Enter for new line</p>
|
| 148 |
+
<div class="flex items-center space-x-2">
|
| 149 |
+
<button onclick="clearChat()" class="text-xs text-zinc-500 hover:text-white transition-colors">Clear chat</button>
|
| 150 |
+
<span class="text-zinc-700">β’</span>
|
| 151 |
+
<button onclick="exportChat()" class="text-xs text-zinc-500 hover:text-white transition-colors">Export</button>
|
| 152 |
+
</div>
|
| 153 |
+
</div>
|
| 154 |
+
</div>
|
| 155 |
+
</main>
|
| 156 |
+
|
| 157 |
+
<!-- Right Sidebar -->
|
| 158 |
+
<aside class="w-80 bg-zinc-900/50 backdrop-blur-xl border-l border-zinc-800 p-6 space-y-6">
|
| 159 |
+
<!-- AI Status -->
|
| 160 |
+
<div class="bg-zinc-800/50 rounded-xl p-4 glow">
|
| 161 |
+
<h3 class="font-semibold text-white mb-3 flex items-center">
|
| 162 |
+
<i data-feather="activity" class="w-4 h-4 mr-2"></i>
|
| 163 |
+
System Status
|
| 164 |
+
</h3>
|
| 165 |
+
<div class="space-y-2">
|
| 166 |
+
<div class="flex justify-between items-center">
|
| 167 |
+
<span class="text-sm text-zinc-400">Model</span>
|
| 168 |
+
<span class="text-sm text-white font-medium">GPT-4 Turbo</span>
|
| 169 |
+
</div>
|
| 170 |
+
<div class="flex justify-between items-center">
|
| 171 |
+
<span class="text-sm text-zinc-400">Response Time</span>
|
| 172 |
+
<span class="text-sm text-green-400 font-medium">~0.8s</span>
|
| 173 |
+
</div>
|
| 174 |
+
<div class="flex justify-between items-center">
|
| 175 |
+
<span class="text-sm text-zinc-400">Tokens Used</span>
|
| 176 |
+
<span class="text-sm text-white font-medium">1,247</span>
|
| 177 |
+
</div>
|
| 178 |
+
</div>
|
| 179 |
+
</div>
|
| 180 |
+
|
| 181 |
+
<!-- AI Capabilities -->
|
| 182 |
+
<div>
|
| 183 |
+
<h3 class="font-semibold text-white mb-3 flex items-center">
|
| 184 |
+
<i data-feather="zap" class="w-4 h-4 mr-2"></i>
|
| 185 |
+
Capabilities
|
| 186 |
+
</h3>
|
| 187 |
+
<div class="space-y-2">
|
| 188 |
+
<div class="flex items-center space-x-2 text-sm text-zinc-400">
|
| 189 |
+
<div class="w-2 h-2 bg-green-400 rounded-full"></div>
|
| 190 |
+
<span>Code Generation</span>
|
| 191 |
+
</div>
|
| 192 |
+
<div class="flex items-center space-x-2 text-sm text-zinc-400">
|
| 193 |
+
<div class="w-2 h-2 bg-green-400 rounded-full"></div>
|
| 194 |
+
<span>Data Analysis</span>
|
| 195 |
+
</div>
|
| 196 |
+
<div class="flex items-center space-x-2 text-sm text-zinc-400">
|
| 197 |
+
<div class="w-2 h-2 bg-green-400 rounded-full"></div>
|
| 198 |
+
<span>Creative Writing</span>
|
| 199 |
+
</div>
|
| 200 |
+
<div class="flex items-center space-x-2 text-sm text-zinc-400">
|
| 201 |
+
<div class="w-2 h-2 bg-green-400 rounded-full"></div>
|
| 202 |
+
<span>Problem Solving</span>
|
| 203 |
+
</div>
|
| 204 |
+
</div>
|
| 205 |
+
</div>
|
| 206 |
+
|
| 207 |
+
<!-- Tips -->
|
| 208 |
+
<div>
|
| 209 |
+
<h3 class="font-semibold text-white mb-3 flex items-center">
|
| 210 |
+
<i data-feather="info" class="w-4 h-4 mr-2"></i>
|
| 211 |
+
Pro Tips
|
| 212 |
+
</h3>
|
| 213 |
+
<ul class="space-y-2 text-sm text-zinc-400">
|
| 214 |
+
<li>β’ Use /help for quick commands</li>
|
| 215 |
+
<li>β’ Try markdown formatting</li>
|
| 216 |
+
<li>β’ Upload files for analysis</li>
|
| 217 |
+
<li>β’ Use @ to mention contexts</li>
|
| 218 |
+
</ul>
|
| 219 |
+
</div>
|
| 220 |
+
|
| 221 |
+
<!-- Memory Usage -->
|
| 222 |
+
<div>
|
| 223 |
+
<h3 class="font-semibold text-white mb-3 flex items-center">
|
| 224 |
+
<i data-feather="hard-drive" class="w-4 h-4 mr-2"></i>
|
| 225 |
+
Memory Context
|
| 226 |
+
</h3>
|
| 227 |
+
<div class="bg-zinc-800/50 rounded-xl p-3">
|
| 228 |
+
<div class="flex justify-between text-xs mb-2">
|
| 229 |
+
<span class="text-zinc-400">Used</span>
|
| 230 |
+
<span class="text-white">68%</span>
|
| 231 |
+
</div>
|
| 232 |
+
<div class="w-full bg-zinc-800 rounded-full h-2">
|
| 233 |
+
<div class="bg-gradient-to-r from-white to-zinc-400 h-2 rounded-full" style="width: 68%"></div>
|
| 234 |
+
</div>
|
| 235 |
+
<p class="text-xs text-zinc-500 mt-2">6,800 / 10,000 tokens</p>
|
| 236 |
+
</div>
|
| 237 |
+
</div>
|
| 238 |
+
</aside>
|
| 239 |
+
</div>
|
| 240 |
+
|
| 241 |
+
<!-- Footer -->
|
| 242 |
+
<custom-footer></custom-footer>
|
| 243 |
+
|
| 244 |
+
<script src="components/header.js"></script>
|
| 245 |
+
<script src="components/sidebar.js"></script>
|
| 246 |
+
<script src="components/footer.js"></script>
|
| 247 |
+
<script src="script.js"></script>
|
| 248 |
+
<script>feather.replace();</script>
|
| 249 |
+
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 250 |
+
</body>
|
| 251 |
+
</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|
| 6 |
+
// Initialize
|
| 7 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 8 |
+
initializeApp();
|
| 9 |
+
setupEventListeners();
|
| 10 |
+
});
|
| 11 |
+
|
| 12 |
+
function initializeApp() {
|
| 13 |
+
// Load chat history from localStorage
|
| 14 |
+
const savedHistory = localStorage.getItem('chatHistory');
|
| 15 |
+
if (savedHistory) {
|
| 16 |
+
chatHistory = JSON.parse(savedHistory);
|
| 17 |
+
renderChatHistory();
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
// Check connection status
|
| 21 |
+
checkConnectionStatus();
|
| 22 |
+
|
| 23 |
+
// Initialize tooltips and other UI elements
|
| 24 |
+
initializeTooltips();
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
function setupEventListeners() {
|
| 28 |
+
// Keyboard shortcuts
|
| 29 |
+
document.addEventListener('keydown', function(e) {
|
| 30 |
+
// Ctrl/Cmd + K for clear chat
|
| 31 |
+
if ((e.ctrlKey || e.metaKey) && e.key === 'k') {
|
| 32 |
+
e.preventDefault();
|
| 33 |
+
clearChat();
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
// Escape to close modals
|
| 37 |
+
if (e.key === 'Escape') {
|
| 38 |
+
closeAllModals();
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
// Ctrl/Cmd + / for help
|
| 42 |
+
if ((e.ctrlKey || e.metaKey) && e.key === '/') {
|
| 43 |
+
e.preventDefault();
|
| 44 |
+
showHelp();
|
| 45 |
+
}
|
| 46 |
+
});
|
| 47 |
+
|
| 48 |
+
// Auto-resize textarea
|
| 49 |
+
const messageInput = document.getElementById('messageInput');
|
| 50 |
+
messageInput.addEventListener('input', function() {
|
| 51 |
+
this.style.height = 'auto';
|
| 52 |
+
this.style.height = Math.min(this.scrollHeight, 120) + 'px';
|
| 53 |
+
});
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
functionsendMessage() {
|
| 57 |
+
const input = document.getElementById('messageInput');
|
| 58 |
+
const message = input.value.trim();
|
| 59 |
+
|
| 60 |
+
if (!message || !isConnected) return;
|
| 61 |
+
|
| 62 |
+
// Add user message
|
| 63 |
+
addMessage(message, 'user');
|
| 64 |
+
|
| 65 |
+
// Clear input
|
| 66 |
+
input.value = '';
|
| 67 |
+
input.style.height = 'auto';
|
| 68 |
+
|
| 69 |
+
// Show typing indicator
|
| 70 |
+
showTypingIndicator();
|
| 71 |
+
|
| 72 |
+
// Simulate AI response
|
| 73 |
+
setTimeout(() => {
|
| 74 |
+
hideTypingIndicator();
|
| 75 |
+
const response = generateAIResponse(message);
|
| 76 |
+
addMessage(response, 'ai');
|
| 77 |
+
}, 1000 + Math.random() * 1500);
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
function addMessage(content, sender) {
|
| 81 |
+
const chatContainer = document.getElementById('chatContainer');
|
| 82 |
+
const timestamp = new Date().toLocaleTimeString('en-US', {
|
| 83 |
+
hour: '2-digit',
|
| 84 |
+
minute: '2-digit'
|
| 85 |
+
});
|
| 86 |
+
|
| 87 |
+
const messageDiv = document.createElement('div');
|
| 88 |
+
messageDiv.className = `flex items-start space-x-3 message-slide-in ${sender === 'user' ? 'flex-row-reverse space-x-reverse' : ''}`;
|
| 89 |
+
|
| 90 |
+
if (sender === 'user') {
|
| 91 |
+
messageDiv.innerHTML = `
|
| 92 |
+
<div class="w-8 h-8 rounded-full bg-zinc-800 flex items-center justify-center flex-shrink-0">
|
| 93 |
+
<i data-feather="user" class="w-4 h-4 text-zinc-400"></i>
|
| 94 |
+
</div>
|
| 95 |
+
<div class="max-w-xl">
|
| 96 |
+
<div class="bg-gradient-to-r from-white to-zinc-100 text-zinc-900 rounded-2xl rounded-tr-sm p-4 hover:scale-[1.02] transition-all duration-200 shadow-lg">
|
| 97 |
+
<p class="leading-relaxed">${content}</p>
|
| 98 |
+
</div>
|
| 99 |
+
<p class="text-xs text-zinc-500 mt-1 text-right">${timestamp}</p>
|
| 100 |
+
</div>
|
| 101 |
+
`;
|
| 102 |
+
} else {
|
| 103 |
+
const processedContent = marked.parse(content);
|
| 104 |
+
messageDiv.innerHTML = `
|
| 105 |
+
<div class="w-8 h-8 rounded-full bg-gradient-to-br from-white to-zinc-600 flex items-center justify-center flex-shrink-0">
|
| 106 |
+
<i data-feather="cpu" class="w-4 h-4 text-zinc-900"></i>
|
| 107 |
+
</div>
|
| 108 |
+
<div class="max-w-xl">
|
| 109 |
+
<div class="bg-zinc-900 rounded-2xl rounded-tl-sm p-4 glow hover:scale-[1.02] transition-all duration-200">
|
| 110 |
+
<div class="markdown text-white">${processedContent}</div>
|
| 111 |
+
</div>
|
| 112 |
+
<p class="text-xs text-zinc-500 mt-1">${timestamp}</p>
|
| 113 |
+
</div>
|
| 114 |
+
`;
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
chatContainer.appendChild(messageDiv);
|
| 118 |
+
chatContainer.scrollTop = chatContainer.scrollHeight;
|
| 119 |
+
|
| 120 |
+
// Re-initialize feather icons for new elements
|
| 121 |
+
feather.replace();
|
| 122 |
+
|
| 123 |
+
// Save to history
|
| 124 |
+
chatHistory.push({ content, sender, timestamp });
|
| 125 |
+
saveChatHistory();
|
| 126 |
+
|
| 127 |
+
// Update token count
|
| 128 |
+
updateTokenCount();
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
function generateAIResponse(userMessage) {
|
| 132 |
+
const responses = [
|
| 133 |
+
"I understand you're asking about: \"" + userMessage + "\". Let me help you with that. Based on my analysis, this involves several key components that we should consider carefully.",
|
| 134 |
+
"That's an interesting question! Here's my take on it: " + userMessage + " deserves attention because it touches on important aspects of modern technology and its applications.",
|
| 135 |
+
"Great question! " + userMessage + " is a topic I can elaborate on. From my perspective, there are multiple approaches we can take to understand this better.",
|
| 136 |
+
"I appreciate you bringing this up. Regarding " + userMessage + ", I think we should explore the underlying principles and practical implications.",
|
| 137 |
+
"This is a fascinating topic! " + userMessage + " connects to broader concepts in technology and innovation. Let me share some insights that might help."
|
| 138 |
+
];
|
| 139 |
+
|
| 140 |
+
return responses[Math.floor(Math.random() * responses.length)];
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
function handleKeyPress(event) {
|
| 144 |
+
if (event.key === 'Enter' && !event.shiftKey) {
|
| 145 |
+
event.preventDefault();
|
| 146 |
+
sendMessage();
|
| 147 |
+
}
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
function autoResize(textarea) {
|
| 151 |
+
textarea.style.height = 'auto';
|
| 152 |
+
textarea.style.height = Math.min(textarea.scrollHeight, 120) + 'px';
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
function showTypingIndicator() {
|
| 156 |
+
document.getElementById('typingIndicator').classList.remove('hidden');
|
| 157 |
+
const chatContainer = document.getElementById('chatContainer');
|
| 158 |
+
chatContainer.scrollTop = chatContainer.scrollHeight;
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
function hideTypingIndicator() {
|
| 162 |
+
document.getElementById('typingIndicator').classList.add('hidden');
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
function toggleChatMode() {
|
| 166 |
+
isCompactMode = !isCompactMode;
|
| 167 |
+
const chatContainer = document.getElementById('chatContainer');
|
| 168 |
+
const messages = chatContainer.querySelectorAll('.flex');
|
| 169 |
+
|
| 170 |
+
if (isCompactMode) {
|
| 171 |
+
chatContainer.classList.add('compact');
|
| 172 |
+
messages.forEach(msg => {
|
| 173 |
+
msg.style.marginBottom = '0.5rem';
|
| 174 |
+
});
|
| 175 |
+
} else {
|
| 176 |
+
chatContainer.classList.remove('compact');
|
| 177 |
+
messages.forEach(msg => {
|
| 178 |
+
msg.style.marginBottom = '1rem';
|
| 179 |
+
});
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
localStorage.setItem('chatMode', isCompactMode ? 'compact' : 'spacious');
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
+
function clearChat() {
|
| 186 |
+
if (confirm('Are you sure you want to clear the entire chat history?')) {
|
| 187 |
+
const chatContainer = document.getElementById('chatContainer');
|
| 188 |
+
chatContainer.innerHTML = `
|
| 189 |
+
<div class="flex items-start space-x-3 message-slide-in">
|
| 190 |
+
<div class="w-8 h-8 rounded-full bg-gradient-to-br from-white to-zinc-600 flex items-center justify-center flex-shrink-0">
|
| 191 |
+
<i data-feather="cpu" class="w-4 h-4 text-zinc-900"></i>
|
| 192 |
+
</div>
|
| 193 |
+
<div class="max-w-xl">
|
| 194 |
+
<div class="bg-zinc-900 rounded-2xl rounded-tl-sm p-4 glow hover:scale-[1.02] transition-all duration-200">
|
| 195 |
+
<p class="text-white leading-relaxed">Welcome to Neural Nexus AI π</p>
|
| 196 |
+
<p class="text-zinc-400 text-sm mt-2">I'm your advanced AI assistant. How can I help you today?</p>
|
| 197 |
+
</div>
|
| 198 |
+
<p class="text-xs text-zinc-500 mt-1">Just now</p>
|
| 199 |
+
</div>
|
| 200 |
+
</div>
|
| 201 |
+
`;
|
| 202 |
+
chatHistory = [];
|
| 203 |
+
saveChatHistory();
|
| 204 |
+
feather.replace();
|
| 205 |
+
}
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
function exportChat() {
|
| 209 |
+
const chatText = chatHistory.map(msg =>
|
| 210 |
+
`[${msg.timestamp}] ${msg.sender === 'user' ? 'You' : 'AI'}: ${msg.content}`
|
| 211 |
+
).join('\n\n');
|
| 212 |
+
|
| 213 |
+
const blob = new Blob([chatText], { type: 'text/plain' });
|
| 214 |
+
const url = window.URL.createObjectURL(blob);
|
| 215 |
+
const a = document.createElement('a');
|
| 216 |
+
a.href = url;
|
| 217 |
+
a.download = `neural-nexus-chat-${new Date().toISOString().split('T')[0]}.txt`;
|
| 218 |
+
a.click();
|
| 219 |
+
window.URL.revokeObjectURL(url);
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
function saveChatHistory() {
|
| 223 |
+
localStorage.setItem('chatHistory', JSON.stringify(chatHistory));
|
| 224 |
+
}
|
| 225 |
+
|
| 226 |
+
function renderChatHistory() {
|
| 227 |
+
chatHistory.forEach(msg => {
|
| 228 |
+
addMessage(msg.content, msg.sender);
|
| 229 |
+
});
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
function updateTokenCount() {
|
| 233 |
+
const tokens = chatHistory.reduce((total, msg) =>
|
| 234 |
+
total + msg.content.split(' ').length, 0
|
| 235 |
+
);
|
| 236 |
+
|
| 237 |
+
const percentage = Math.min((tokens / 10000) * 100, 100);
|
| 238 |
+
const progressBar = document.querySelector('.bg-gradient-to-r');
|
| 239 |
+
if (progressBar) {
|
| 240 |
+
progressBar.style.width = percentage + '%';
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
const tokenText = document.querySelector('.text-xs.text-zinc-500');
|
| 244 |
+
if (tokenText) {
|
| 245 |
+
tokenText.textContent = `${tokens.toLocaleString()} / 10,000 tokens`;
|
| 246 |
+
}
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
+
function checkConnectionStatus() {
|
| 250 |
+
// Simulate connection check
|
| 251 |
+
fetch('https://api.openai.com/v1/models')
|
| 252 |
+
.then(() => {
|
| 253 |
+
isConnected = true;
|
| 254 |
+
updateConnectionStatus(true);
|
| 255 |
+
})
|
| 256 |
+
.catch(() => {
|
| 257 |
+
isConnected = false;
|
| 258 |
+
updateConnectionStatus(false);
|
| 259 |
+
});
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
function updateConnectionStatus(connected) {
|
| 263 |
+
const statusElements = document.querySelectorAll('[data-connection-status]');
|
| 264 |
+
statusElements.forEach(el => {
|
| 265 |
+
el.textContent = connected ? 'Online' : 'Offline';
|
| 266 |
+
el.className = connected ? 'text-green-400' : 'text-red-400';
|
| 267 |
+
});
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
function initializeTooltips() {
|
| 271 |
+
// Add hover tooltips for icons
|
| 272 |
+
const tooltipElements = document.querySelectorAll('[data-tooltip]');
|
| 273 |
+
tooltipElements.forEach(el => {
|
| 274 |
+
el.addEventListener('mouseenter', function(e) {
|
| 275 |
+
const tooltip = document.createElement('div');
|
| 276 |
+
tooltip.className = 'absolute bg-zinc-800 text-white text-xs rounded px-2 py-1 z-50';
|
| 277 |
+
tooltip.textContent = this.dataset.tooltip;
|
| 278 |
+
tooltip.style.top = (e.clientY - 30) + 'px';
|
| 279 |
+
tooltip.style.left = e.clientX + 'px';
|
| 280 |
+
document.body.appendChild(tooltip);
|
| 281 |
+
|
| 282 |
+
this.addEventListener('mouseleave', function() {
|
| 283 |
+
tooltip.remove();
|
| 284 |
+
}, { once: true });
|
| 285 |
+
});
|
| 286 |
+
});
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
function closeAllModals() {
|
| 290 |
+
// Close any open modals or dropdowns
|
| 291 |
+
const modals = document.querySelectorAll('.modal');
|
| 292 |
+
modals.forEach(modal => modal.classList.add('hidden'));
|
| 293 |
+
}
|
| 294 |
+
|
| 295 |
+
function showHelp() {
|
| 296 |
+
const helpContent = `
|
| 297 |
+
Available Commands:
|
| 298 |
+
/help - Show this help message
|
| 299 |
+
/clear - Clear chat history
|
| 300 |
+
/export - Export chat as text file
|
| 301 |
+
/compact - Toggle compact mode
|
| 302 |
+
|
| 303 |
+
Keyboard Shortcuts:
|
| 304 |
+
Ctrl+K - Clear chat
|
| 305 |
+
Ctrl+/ - Show help
|
| 306 |
+
Tab - Auto-complete
|
| 307 |
+
`;
|
| 308 |
+
|
| 309 |
+
addMessage(helpContent, 'ai');
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
// Simulate real-time updates
|
| 313 |
+
setInterval(() => {
|
| 314 |
+
// Update random metrics
|
| 315 |
+
const responseTime = (0.5 + Math.random() * 0.8).toFixed(1);
|
| 316 |
+
const responseElements = document.querySelectorAll('.text-green-400');
|
| 317 |
+
responseElements.forEach(el => {
|
| 318 |
+
if (el.textContent.includes('~')) {
|
| 319 |
+
el.textContent = `~${responseTime}s`;
|
| 320 |
+
}
|
| 321 |
+
});
|
| 322 |
+
}, 5000);
|
|
@@ -1,28 +1,140 @@
|
|
|
|
|
|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|
|
|
|
|
|
|
|
| 1 |
+
/* Global Styles */
|
| 2 |
body {
|
| 3 |
+
font-family: 'Inter', sans-serif;
|
| 4 |
+
-webkit-font-smoothing: antialiased;
|
| 5 |
+
-moz-osx-font-smoothing: grayscale;
|
| 6 |
}
|
| 7 |
|
| 8 |
+
/* Scrollbar Styling */
|
| 9 |
+
::-webkit-scrollbar {
|
| 10 |
+
width: 8px;
|
| 11 |
+
height: 8px;
|
| 12 |
}
|
| 13 |
|
| 14 |
+
::-webkit-scrollbar-track {
|
| 15 |
+
background: #18181b;
|
|
|
|
|
|
|
|
|
|
| 16 |
}
|
| 17 |
|
| 18 |
+
::-webkit-scrollbar-thumb {
|
| 19 |
+
background: #525252;
|
| 20 |
+
border-radius: 4px;
|
|
|
|
|
|
|
|
|
|
| 21 |
}
|
| 22 |
|
| 23 |
+
::-webkit-scrollbar-thumb:hover {
|
| 24 |
+
background: #71717a;
|
| 25 |
}
|
| 26 |
+
|
| 27 |
+
/* Glassmorphism Effects */
|
| 28 |
+
.glass {
|
| 29 |
+
background: rgba(17, 24, 39, 0.7);
|
| 30 |
+
backdrop-filter: blur(10px);
|
| 31 |
+
-webkit-backdrop-filter: blur(10px);
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
/* Hover Effects */
|
| 35 |
+
.hover-lift {
|
| 36 |
+
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
.hover-lift:hover {
|
| 40 |
+
transform: translateY(-2px);
|
| 41 |
+
box-shadow: 0 10px 40px rgba(255, 255, 255, 0.1);
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
/* Animations */
|
| 45 |
+
@keyframes pulse {
|
| 46 |
+
0%, 100% { opacity: 1; }
|
| 47 |
+
50% { opacity: 0.5; }
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
@keyframes float {
|
| 51 |
+
0%, 100% { transform: translateY(0px); }
|
| 52 |
+
50% { transform: translateY(-10px); }
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
@keyframes slideIn {
|
| 56 |
+
from {
|
| 57 |
+
opacity: 0;
|
| 58 |
+
transform: translateX(-20px);
|
| 59 |
+
}
|
| 60 |
+
to {
|
| 61 |
+
opacity: 1;
|
| 62 |
+
transform: translateX(0);
|
| 63 |
+
}
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
.pulse-animation {
|
| 67 |
+
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
.float-animation {
|
| 71 |
+
animation: float 3s ease-in-out infinite;
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
/* Markdown Styling */
|
| 75 |
+
.markdown h1 { @apply text-2xl font-bold text-white mb-4 mt-6; }
|
| 76 |
+
.markdown h2 { @apply text-xl font-semibold text-white mb-3 mt-5; }
|
| 77 |
+
.markdown h3 { @apply text-lg font-medium text-white mb-2 mt-4; }
|
| 78 |
+
.markdown p { @apply text-zinc-300 mb-4 leading-relaxed; }
|
| 79 |
+
.markdown code { @apply bg-zinc-800 px-1 py-0.5 rounded text-sm text-green-400; }
|
| 80 |
+
.markdown pre {
|
| 81 |
+
@apply bg-zinc-900 rounded-lg p-4 overflow-x-auto mb-4 border border-zinc-800;
|
| 82 |
+
font-family: 'Courier New', monospace;
|
| 83 |
+
}
|
| 84 |
+
.markdown pre code { @apply bg-transparent text-zinc-300; }
|
| 85 |
+
.markdown ul { @apply list-disc list-inside text-zinc-300 mb-4 space-y-1; }
|
| 86 |
+
.markdown ol { @apply list-decimal list-inside text-zinc-300 mb-4 space-y-1; }
|
| 87 |
+
.markdown blockquote {
|
| 88 |
+
@apply border-l-4 border-zinc-600 pl-4 italic text-zinc-400 mb-4;
|
| 89 |
+
}
|
| 90 |
+
.markdown a { @apply text-white underline underline-offset-2 hover:text-zinc-300; }
|
| 91 |
+
.markdown table {
|
| 92 |
+
@apply w-full border-collapse mb-4;
|
| 93 |
+
}
|
| 94 |
+
.markdown th {
|
| 95 |
+
@apply border border-zinc-700 px-4 py-2 bg-zinc-900 text-left font-semibold;
|
| 96 |
+
}
|
| 97 |
+
.markdown td {
|
| 98 |
+
@apply border border-zinc-700 px-4 py-2 text-zinc-300;
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
/* Transition Classes */
|
| 102 |
+
.transition-all {
|
| 103 |
+
transition-property: all;
|
| 104 |
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
| 105 |
+
transition-duration: 150ms;
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
/* Utility Classes */
|
| 109 |
+
.text-shadow {
|
| 110 |
+
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
.border-glow {
|
| 114 |
+
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1),
|
| 115 |
+
0 0 20px rgba(255, 255, 255, 0.05);
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
/* Mobile Responsive */
|
| 119 |
+
@media (max-width: 768px) {
|
| 120 |
+
.sidebar-mobile {
|
| 121 |
+
transform: translateX(-100%);
|
| 122 |
+
transition: transform 0.3s ease;
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
.sidebar-mobile.active {
|
| 126 |
+
transform: translateX(0);
|
| 127 |
+
}
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
/* Loading Skeleton */
|
| 131 |
+
.skeleton {
|
| 132 |
+
background: linear-gradient(90deg, #18181b 25%, #27272a 50%, #18181b 75%);
|
| 133 |
+
background-size: 200% 100%;
|
| 134 |
+
animation: loading 1.5s infinite;
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
@keyframes loading {
|
| 138 |
+
0% { background-position: 200% 0; }
|
| 139 |
+
100% { background-position: -200% 0; }
|
| 140 |
+
}
|