diff --git a/app/global.css b/app/global.css index 3b7f8b4..38f9f54 100644 --- a/app/global.css +++ b/app/global.css @@ -1,26 +1,5 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - @import 'nextra-theme-docs/dist/style.css' layer(nextra); -/* Reset: remove custom callout/code overrides to use Nextra defaults */ - /** * Custom styles * @@ -31,7 +10,9 @@ */ @layer overwrite { :root { - --x-color-nextra-bg: var(--mantine-color-body); + /* Force Nextra base background to pure black to match landing */ + --x-color-nextra-bg: #000; + --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji"; } :where(.dark) { @@ -42,416 +23,199 @@ font-size: var(--x-text-sm) !important; line-height: var(--tw-leading, var(--x-text-sm--line-height)) !important; } +} - /* Navbar and Footer Theme Alignment - More Specific */ - nav.nextra-nav-container, - .nextra-nav-container, - div[class*="nextra-nav-container"] { - background: linear-gradient(135deg, #1a1b23 0%, #25262b 50%, #1a1b23 100%) !important; - border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important; - } +@layer components, mantine, nextra, overwrite; - .nextra-nav-container-blur, - div[class*="nextra-nav-container-blur"] { - background: linear-gradient(135deg, rgba(26, 27, 35, 0.95) 0%, rgba(37, 38, 43, 0.95) 50%, rgba(26, 27, 35, 0.95) 100%) !important; - backdrop-filter: blur(10px) !important; +/* Global sleek styles */ +@layer overwrite { + html { + scroll-behavior: smooth; } - .nextra-sidebar-container, - aside[class*="nextra-sidebar"] { - background: linear-gradient(135deg, #1a1b23 0%, #25262b 50%, #1a1b23 100%) !important; - border-right: 1px solid rgba(255, 255, 255, 0.1) !important; + body { + color: var(--mantine-color-text); + font-family: var(--font-sans); + background: + radial-gradient(1200px 600px at 80% -10%, rgba(0, 102, 255, 0.12), transparent 100%), + radial-gradient(1000px 500px at -10% 10%, rgba(255, 0, 128, 0.09), transparent 100%), + linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.0)) !important; + /* background: #000000; */ } - footer.nextra-footer, - .nextra-footer, - div[class*="nextra-footer"] { - background: linear-gradient(135deg, #1a1b23 0%, #25262b 50%, #1a1b23 100%) !important; - border-top: 1px solid rgba(255, 255, 255, 0.1) !important; - color: rgba(255, 255, 255, 0.8) !important; + :where(.dark) body { + color: rgba(255, 255, 255, 0.92); } - - - /* Force override all Nextra backgrounds */ -[class*="nextra"] { - background-color: transparent !important; -} - -/* Additional aggressive overrides for docs pages */ -html body [class*="nextra"] { - background-color: transparent !important; -} - -html body [class*="nextra"] * { - background-color: transparent !important; -} - -/* Specific overrides for common Nextra classes - Light mode only */ -:global([data-mantine-color-scheme="light"]) html body .nextra-sidebar, -:global([data-mantine-color-scheme="light"]) html body [class*="nextra-sidebar"], -:global([data-mantine-color-scheme="light"]) html body .nextra-menu, -:global([data-mantine-color-scheme="light"]) html body [class*="nextra-menu"], -:global([data-mantine-color-scheme="light"]) html body .nextra-page-container, -:global([data-mantine-color-scheme="light"]) html body [class*="nextra-page-container"] { - background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 25%, #cbd5e1 50%, #e2e8f0 75%, #f8fafc 100%) !important; -} - - /* Specific navbar overrides */ - .nextra-nav-container *, - nav[class*="nextra"] * { - color: white !important; + h1, h2, h3, h4, h5, h6 { + color: inherit; + font-family: var(--font-sans); } -} - -@layer components, mantine, nextra, overwrite; - -.bg-grid-white\/\[0\.02\] { - background-image: radial-gradient(circle, rgba(255, 255, 255, 0.02) 1px, transparent 1px); -} - -/* Force override Nextra theme colors - Dark mode (default) */ -html body nav.nextra-nav-container, -html body .nextra-nav-container, -html body div[class*="nextra-nav-container"] { - background: linear-gradient(135deg, #1a1b23 0%, #25262b 50%, #1a1b23 100%) !important; - border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important; -} - -html body footer.nextra-footer, -html body .nextra-footer, -html body div[class*="nextra-footer"] { - background: linear-gradient(135deg, #1a1b23 0%, #25262b 50%, #1a1b23 100%) !important; - border-top: 1px solid rgba(255, 255, 255, 0.1) !important; - color: rgba(255, 255, 255, 0.8) !important; -} - -html body aside.nextra-sidebar-container, -html body .nextra-sidebar-container { - background: linear-gradient(135deg, #1a1b23 0%, #25262b 50%, #1a1b23 100%) !important; - border-right: 1px solid rgba(255, 255, 255, 0.1) !important; -} - -/* Light mode overrides */ -:global([data-mantine-color-scheme="light"]) html body nav.nextra-nav-container, -:global([data-mantine-color-scheme="light"]) html body .nextra-nav-container, -:global([data-mantine-color-scheme="light"]) html body div[class*="nextra-nav-container"] { - background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 25%, #cbd5e1 50%, #e2e8f0 75%, #f8fafc 100%) !important; - border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important; -} - -:global([data-mantine-color-scheme="light"]) html body footer.nextra-footer, -:global([data-mantine-color-scheme="light"]) html body .nextra-footer, -:global([data-mantine-color-scheme="light"]) html body div[class*="nextra-footer"] { - background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 25%, #cbd5e1 50%, #e2e8f0 75%, #f8fafc 100%) !important; - border-top: 1px solid rgba(0, 0, 0, 0.08) !important; - color: rgba(0, 0, 0, 0.7) !important; - box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05) !important; -} - -:global([data-mantine-color-scheme="light"]) html body aside.nextra-sidebar-container, -:global([data-mantine-color-scheme="light"]) html body .nextra-sidebar-container { - background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 25%, #cbd5e1 50%, #e2e8f0 75%, #f8fafc 100%) !important; - border-right: 1px solid rgba(0, 0, 0, 0.08) !important; - box-shadow: 1px 0 3px rgba(0, 0, 0, 0.05) !important; -} - -/* Sidebar navigation elements - Dark mode */ -html body .nextra-sidebar-container a, -html body aside[class*="nextra"] a { - color: rgba(255, 255, 255, 0.8) !important; - transition: all 0.2s ease !important; -} - -html body .nextra-sidebar-container a:hover, -html body aside[class*="nextra"] a:hover { - color: white !important; - background: rgba(255, 255, 255, 0.1) !important; -} - -html body .nextra-sidebar-container a[aria-current="page"], -html body aside[class*="nextra"] a[aria-current="page"] { - color: #f783ac !important; - background: rgba(247, 131, 172, 0.1) !important; -} - -/* Sidebar navigation elements - Light mode */ -:global([data-mantine-color-scheme="light"]) html body .nextra-sidebar-container a, -:global([data-mantine-color-scheme="light"]) html body aside[class*="nextra"] a { - color: #475057 !important; - transition: all 0.2s ease !important; -} - -:global([data-mantine-color-scheme="light"]) html body .nextra-sidebar-container a:hover, -:global([data-mantine-color-scheme="light"]) html body aside[class*="nextra"] a:hover { - color: #0f172a !important; - background: rgba(0, 0, 0, 0.05) !important; -} - -:global([data-mantine-color-scheme="light"]) html body .nextra-sidebar-container a[aria-current="page"], -:global([data-mantine-color-scheme="light"]) html body aside[class*="nextra"] a[aria-current="page"] { - color: #7c3aed !important; - background: rgba(124, 58, 237, 0.1) !important; -} - -/* Override Nextra main content area - Dark mode */ -html body .nextra-container, -html body main[class*="nextra"], -html body div[class*="nextra-container"], -html body .nextra-main, -html body [class*="nextra-container"], -html body [class*="nextra-main"], -html body .nextra-layout, -html body [class*="nextra-layout"] { - background: linear-gradient(135deg, #1a1b23 0%, #25262b 50%, #1a1b23 100%) !important; -} - -/* Override Nextra page content - Dark mode */ -html body .nextra-content, -html body div[class*="nextra-content"], -html body article[class*="nextra"], -html body [class*="nextra-content"], -html body .nextra-page, -html body [class*="nextra-page"], -html body .nextra-body, -html body [class*="nextra-body"] { - background: linear-gradient(135deg, #1a1b23 0%, #25262b 50%, #1a1b23 100%) !important; - color: white !important; -} - -/* Override Nextra body and html - Dark mode */ -html body { - background: linear-gradient(135deg, #1a1b23 0%, #25262b 50%, #1a1b23 100%) !important; -} - -html { - background: linear-gradient(135deg, #1a1b23 0%, #25262b 50%, #1a1b23 100%) !important; -} - -/* Light mode content overrides */ -:global([data-mantine-color-scheme="light"]) html body .nextra-container, -:global([data-mantine-color-scheme="light"]) html body main[class*="nextra"], -:global([data-mantine-color-scheme="light"]) html body div[class*="nextra-container"], -:global([data-mantine-color-scheme="light"]) html body .nextra-main, -:global([data-mantine-color-scheme="light"]) html body [class*="nextra-container"], -:global([data-mantine-color-scheme="light"]) html body [class*="nextra-main"], -:global([data-mantine-color-scheme="light"]) html body .nextra-layout, -:global([data-mantine-color-scheme="light"]) html body [class*="nextra-layout"] { - background: linear-gradient(135deg, #ffffff 0%, #f8fafc 25%, #f1f5f9 50%, #f8fafc 75%, #ffffff 100%) !important; -} - -:global([data-mantine-color-scheme="light"]) html body .nextra-content, -:global([data-mantine-color-scheme="light"]) html body div[class*="nextra-content"], -:global([data-mantine-color-scheme="light"]) html body article[class*="nextra"], -:global([data-mantine-color-scheme="light"]) html body [class*="nextra-content"], -:global([data-mantine-color-scheme="light"]) html body .nextra-page, -:global([data-mantine-color-scheme="light"]) html body [class*="nextra-page"], -:global([data-mantine-color-scheme="light"]) html body .nextra-body, -:global([data-mantine-color-scheme="light"]) html body [class*="nextra-body"] { - background: linear-gradient(135deg, #ffffff 0%, #f8fafc 25%, #f1f5f9 50%, #f8fafc 75%, #ffffff 100%) !important; - color: #1e293b !important; -} - -:global([data-mantine-color-scheme="light"]) html body { - background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 25%, #cbd5e1 50%, #e2e8f0 75%, #f8fafc 100%) !important; -} - -:global([data-mantine-color-scheme="light"]) html { - background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 25%, #cbd5e1 50%, #e2e8f0 75%, #f8fafc 100%) !important; -} - -/* Light mode specific overrides - only apply when light mode is active */ -:global([data-mantine-color-scheme="light"]) html body [class*="nextra"] { - background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 25%, #cbd5e1 50%, #e2e8f0 75%, #f8fafc 100%) !important; -} - -/* Fix specific elements that show light backgrounds in dark mode */ -html body .nextra-toc, -html body [class*="nextra-toc"], -html body .nextra-toc-content, -html body [class*="nextra-toc-content"], -html body .nextra-toc-container, -html body [class*="nextra-toc-container"] { - background: linear-gradient(135deg, #1a1b23 0%, #25262b 50%, #1a1b23 100%) !important; - color: rgba(255, 255, 255, 0.8) !important; -} - -html body .nextra-toc a, -html body [class*="nextra-toc"] a { - color: rgba(255, 255, 255, 0.8) !important; -} - -html body .nextra-toc a:hover, -html body [class*="nextra-toc"] a:hover { - color: white !important; - background: rgba(255, 255, 255, 0.1) !important; -} - -/* Fix GitHub stats box and other info boxes in dark mode */ -html body .nextra-content [class*="github"], -html body .nextra-content [class*="stats"], -html body .nextra-content [class*="info"] { - background: rgba(0, 0, 0, 0.3) !important; - color: rgba(255, 255, 255, 0.9) !important; - border: 1px solid rgba(255, 255, 255, 0.1) !important; -} - -/* Light mode versions of the above */ -:global([data-mantine-color-scheme="light"]) html body .nextra-toc, -:global([data-mantine-color-scheme="light"]) html body [class*="nextra-toc"], -:global([data-mantine-color-scheme="light"]) html body .nextra-toc-content, -:global([data-mantine-color-scheme="light"]) html body [class*="nextra-toc-content"], -:global([data-mantine-color-scheme="light"]) html body .nextra-toc-container, -:global([data-mantine-color-scheme="light"]) html body [class*="nextra-toc-container"] { - background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 25%, #cbd5e1 50%, #e2e8f0 75%, #f8fafc 100%) !important; - color: #334155 !important; -} - -:global([data-mantine-color-scheme="light"]) html body .nextra-toc a, -:global([data-mantine-color-scheme="light"]) html body [class*="nextra-toc"] a { - color: #475057 !important; -} - -:global([data-mantine-color-scheme="light"]) html body .nextra-toc a:hover, -:global([data-mantine-color-scheme="light"]) html body [class*="nextra-toc"] a:hover { - color: #0f172a !important; - background: rgba(0, 0, 0, 0.05) !important; -} - -:global([data-mantine-color-scheme="light"]) html body .nextra-content [class*="github"], -:global([data-mantine-color-scheme="light"]) html body .nextra-content [class*="stats"], -:global([data-mantine-color-scheme="light"]) html body .nextra-content [class*="info"] { - background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f8fafc 100%) !important; - color: #334155 !important; - border: 1px solid rgba(0, 0, 0, 0.08) !important; -} - -/* Override Nextra text colors - Dark mode */ -html body .nextra-content h1, -html body .nextra-content h2, -html body .nextra-content h3, -html body .nextra-content h4, -html body .nextra-content h5, -html body .nextra-content h6 { - color: white !important; -} - -html body .nextra-content p, -html body .nextra-content li, -html body .nextra-content div { - color: rgba(255, 255, 255, 0.9) !important; -} -/* Code block overrides removed to use Nextra defaults */ - -/* Override Nextra links - Dark mode */ -html body .nextra-content a { - color: #f783ac !important; - transition: color 0.2s ease !important; -} - -html body .nextra-content a:hover { - color: #f56565 !important; -} - -/* Light mode text colors */ -:global([data-mantine-color-scheme="light"]) html body .nextra-content h1, -:global([data-mantine-color-scheme="light"]) html body .nextra-content h2, -:global([data-mantine-color-scheme="light"]) html body .nextra-content h3, -:global([data-mantine-color-scheme="light"]) html body .nextra-content h4, -:global([data-mantine-color-scheme="light"]) html body .nextra-content h5, -:global([data-mantine-color-scheme="light"]) html body .nextra-content h6 { - color: #0f172a !important; - text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important; -} - -:global([data-mantine-color-scheme="light"]) html body .nextra-content p, -:global([data-mantine-color-scheme="light"]) html body .nextra-content li, -:global([data-mantine-color-scheme="light"]) html body .nextra-content div { - color: #334155 !important; -} - -/* Removed aggressive code block overrides: fall back to Nextra defaults */ - -/* Removed light mode aggressive code block overrides */ - -/* Light mode links */ -:global([data-mantine-color-scheme="light"]) html body .nextra-content a { - color: #7c3aed !important; - transition: all 0.2s ease !important; - text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important; -} - -:global([data-mantine-color-scheme="light"]) html body .nextra-content a:hover { - color: #6d28d9 !important; - text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important; -} + a { + color: #1f2937; + } + :where(.dark) a { + color: rgba(255, 255, 255, 0.92) !important; + } -/* Light mode carousel text colors */ -:global([data-mantine-color-scheme="light"]) .projectCard h3, -:global([data-mantine-color-scheme="light"]) .projectCard h4, -:global([data-mantine-color-scheme="light"]) .projectCard .mantine-Title-root { - color: #0f172a !important; -} + /* Stronger override for Nextra link styling in docs */ + :where(.dark) .nextra-content a, + :where(.dark) .nextra-content a:visited { + color: rgba(255, 255, 255, 0.92) !important; + } + .nextra-content a, + .nextra-content a:visited { + color: #1f2937 !important; + } -:global([data-mantine-color-scheme="light"]) .projectCard p, -:global([data-mantine-color-scheme="light"]) .projectCard .mantine-Text-root { - color: #334155 !important; -} + /* Ensure Nextra containers don’t paint a gray background */ + :where(.nextra-container, + .nextra-content, + .nextra-sidebar-container, + .nx-bg-neutral-900, + .nx-bg-gray-900, + .nx-bg-black, + .nx-bg-dark, + .nx-bg-zinc-900, + .nx-bg-slate-900) { + background-color: transparent !important; + } -/* Removed callout overrides to use Nextra defaults */ + /* Make sticky headers/footers transparent and remove borders/shadows */ + :where(.nx-sticky) { + background: transparent !important; + box-shadow: none !important; + border: none !important; + } + :where(.nextra-sidebar) header, + :where(.nextra-sidebar) footer, + :where(.nextra-container > header) { + background: transparent !important; + border: none !important; + box-shadow: none !important; + } -/* Specific styling for different types of callouts */ -html body .nextra-content [class*="info"] { - border-left-color: #3b82f6 !important; -} + /* Glassmorphism utility */ + .glass { + background: rgba(255, 255, 255, 0.06); + -webkit-backdrop-filter: saturate(120%) blur(10px); + backdrop-filter: saturate(120%) blur(10px); + border: 1px solid rgba(255, 255, 255, 0.08); + } -html body .nextra-content [class*="warning"] { - border-left-color: #f59e0b !important; -} + code, pre { + border-radius: 10px; + } -html body .nextra-content [class*="error"] { - border-left-color: #ef4444 !important; -} + /* Target article tag for markdown content font styling */ + article { + font-family: 'Inter', system-ui, -apple-system, sans-serif !important; + font-weight: 400; + line-height: 1.6; + } -html body .nextra-content [class*="tip"] { - border-left-color: #10b981 !important; -} + /* Specific styling for the main content article */ + article[data-pagefind-body="true"] { + font-family: 'Inter', system-ui, -apple-system, sans-serif !important; + font-size: 16px; + line-height: 1.7; + color: rgba(255, 255, 255, 0.9); + } -/* Removed table overrides */ + /* Override Nextra's default article styling */ + article.x\:w-full { + font-family: 'Inter', system-ui, -apple-system, sans-serif !important; + } -/* Removed table cell overrides */ + /* Sidebar footer background override */ + :where(.nextra-sidebar-footer) { + background: transparent !important; + border-top: none !important; + box-shadow: none !important; + } -/* Removed table header overrides */ + /* Lightweight parallax blob for landing */ + .parallax-blob { + position: absolute; + left: 0; + top: 0; + width: 55vmax; + height: 55vmax; + transform: translate(-50%, -50%) scale(0.9); + background: radial-gradient(closest-side, rgba(0, 102, 255, 0.18), transparent 72%); + pointer-events: none; + transition: transform 0.18s ease-out, opacity 300ms ease-out; + will-change: transform; + filter: blur(12px); + opacity: 0; + } -html body .nextra-content ul, -html body .nextra-content ol { - color: rgba(255, 255, 255, 0.9) !important; -} + /* Beacon of light effect */ + @keyframes beamPulse { + 0%, 100% { opacity: 0.45; transform: translateX(-50%) scaleX(1); } + 50% { opacity: 0.7; transform: translateX(-50%) scaleX(1.08); } + } + .beacon-beam { + position: absolute; + left: 50%; + top: -10vh; + height: 120vh; + width: 2px; + transform: translateX(-50%); + background: linear-gradient(180deg, + rgba(255,255,255,0) 0%, + rgba(0, 146, 255, 0.4) 40%, + rgba(0, 146, 255, 0.35) 60%, + rgba(255,255,255,0) 100%); + filter: blur(8px); + opacity: 0.55; + pointer-events: none; + animation: beamPulse 4s ease-in-out infinite; + } + .beacon-source { + position: absolute; + left: 50%; + bottom: 10vh; + width: 36vmin; + height: 12vmin; + transform: translateX(-50%); + background: radial-gradient(closest-side, rgba(0,146,255,0.28), rgba(0,146,255,0.08) 60%, transparent 70%); + filter: blur(14px); + opacity: 0.6; + pointer-events: none; + } -html body .nextra-content strong, -html body .nextra-content b { - color: white !important; -} + /* Distant beacon cone (perspective beam) */ + .beacon-cone { + position: absolute; + left: 50%; + bottom: -10vh; + transform: translateX(-50%) perspective(800px) rotateX(60deg); + width: 4px; + height: 130vh; + background: linear-gradient( + 180deg, + rgba(0, 146, 255, 0.0) 0%, + rgba(0, 146, 255, 0.28) 30%, + rgba(0, 146, 255, 0.18) 70%, + rgba(0, 146, 255, 0.0) 100% + ); + box-shadow: 0 0 40px 6px rgba(0,146,255,0.18), 0 0 120px 24px rgba(0,146,255,0.10); + filter: blur(2px); + pointer-events: none; + opacity: 0.55; + } -html body .nextra-content em, -html body .nextra-content i { - color: rgba(255, 255, 255, 0.8) !important; + /* Beacon outline (SVG stroke glow) */ + .beacon-outline { + position: absolute; + left: 50%; + bottom: 6vh; + transform: translateX(-50%); + width: clamp(120px, 22vmin, 220px); + height: auto; + opacity: 0.8; + pointer-events: none; + } } - -/* Removed light mode callout overrides */ - -/* Removed light mode callout accent overrides */ - -/* Removed light mode table overrides */ - -/* Removed light mode table cells overrides */ - -/* Removed light mode table header overrides */ - -/* Removed light mode list overrides */ - -/* Removed light mode strong/b overrides */ - -/* Removed light mode em/i overrides */ diff --git a/app/layout.tsx b/app/layout.tsx index cb30bc4..a7a6311 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -24,18 +24,20 @@ import '@gfazioli/mantine-text-animate/styles.layer.css'; import { ColorSchemeScript, mantineHtmlProps, MantineProvider } from '@mantine/core'; -import '@mantine/core/styles.layer.css'; - import { Layout } from 'nextra-theme-docs'; import { Banner, Head } from 'nextra/components'; import { getPageMap } from 'nextra/page-map'; import { theme } from '../theme'; +import { Inter } from 'next/font/google'; import './global.css'; import { FloatingAssistant } from '@/components/FloatingAssistant'; +import { PocketFlowChatbot } from '@/components/PocketFlowChatbot'; import { Providers } from './providers'; +const inter = Inter({ subsets: ['latin'], variable: '--font-sans' }); + export const metadata = { title: { default: 'Beacon - NextGen Docs for Nexres', @@ -82,10 +84,10 @@ export default async function RootLayout({ children }: { children: any }) { const pageMap = await getPageMap(); return ( - + - + - + - ✨ AI powered documentation for ResilientDB Ecosystem and Apps - - } + // banner={ + // + // ✨ AI powered documentation for ResilientDB Ecosystem and Apps + // + // } navbar={} pageMap={pageMap} docsRepositoryBase="https://github.com/shuding/nextra/tree/main/docs" footer={} - sidebar={{ defaultMenuCollapseLevel: 1 }} + sidebar={{ defaultMenuCollapseLevel: 1, toggleButton: true }} > {children} + {/* */} diff --git a/app/page.tsx b/app/page.tsx index f24b2af..e0a1e86 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,638 +1,17 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -'use client'; - -import { useState, useEffect, useRef } from 'react'; -import { - Container, - Title, - Text, - Button, - Card, - Badge, - Group, - Stack, - Box, - ActionIcon, - Flex -} from '@mantine/core'; -import { - IconExternalLink, - IconBrandGithub, - IconTerminal, - IconBolt, - IconDatabase, - IconCode, - IconWorld, - IconChevronLeft, - IconChevronRight -} from '@tabler/icons-react'; -import Link from "next/link"; -import classes from './page.module.css'; - -// Import actual package.json data -import pack from '../package.json'; - -// Ecosystem projects data -const ecosystemProjects = [ - { - name: "ResilientDB", - href: "https://github.com/apache/incubator-resilientdb", - description: "Core blockchain infrastructure for high-performance distributed systems", - icon: IconDatabase - }, - { - name: "ResilientDB GraphQL", - href: "https://github.com/apache/incubator-resilientdb-graphql", - description: "GraphQL interface for seamless blockchain data querying", - icon: IconWorld - }, - { - name: "Resilient-Python-Cache", - href: "https://github.com/apache/incubator-resilientdb-resilient-python-cache", - description: "High-performance Python caching solution for blockchain applications", - icon: IconBolt - }, - { - name: "ResLens", - href: "https://github.com/harish876/ResLens", - description: "Advanced analytics and monitoring tool for ResilientDB networks", - icon: IconTerminal - }, - { - name: "ResilientDB SDK", - href: "https://github.com/apache/incubator-resilientdb", - description: "Comprehensive software development kit for blockchain integration", - icon: IconCode - }, - { - name: "ResilientDB CLI", - href: "https://github.com/apache/incubator-resilientdb", - description: "Command line interface for blockchain network management", - icon: IconTerminal - } -]; - -export default function ResilientDBLanding() { - const [typewriterText, setTypewriterText] = useState(''); - const [currentLine, setCurrentLine] = useState(0); - const [currentIndex, setCurrentIndex] = useState(Math.floor((ecosystemProjects.length - 3) / 2)); - const terminalRef = useRef(null); - - const terminalLines = [ - 'πŸ”— ResilientDB Node Dependencies:', - ...Object.keys(pack.dependencies).map( - (key) => `β€’ ${key} : ${pack.dependencies[key as keyof typeof pack.dependencies]}` - ), - '', - 'Each dependency is a block in your development chain.', - 'Keep your stack resilient!' - ]; - - useEffect(() => { - if (currentLine < terminalLines.length) { - const timer = setTimeout(() => { - setTypewriterText(prev => prev + terminalLines[currentLine] + '\n'); - setCurrentLine(prev => prev + 1); - }, 200); - return () => clearTimeout(timer); - } - }, [currentLine, terminalLines]); - - // Auto-scroll to bottom when text updates - useEffect(() => { - if (terminalRef.current) { - terminalRef.current.scrollTop = terminalRef.current.scrollHeight; - } - }, [typewriterText]); - - const cardWidth = 320; - const canGoNext = currentIndex < ecosystemProjects.length - 3; - const canGoPrev = currentIndex > 0; - - const nextSlide = () => { - if (canGoNext) { - setCurrentIndex((prev) => prev + 1); - } - }; - - const prevSlide = () => { - if (canGoPrev) { - setCurrentIndex((prev) => prev - 1); - } - }; - - const getCardStyle = (index: number) => { - const relativePos = index - currentIndex; - - let scale = 1; - let opacity = 1; - let blur = 0; - let zIndex = 5; - - if (relativePos >= 0 && relativePos <= 2) { - scale = 1; - opacity = 1; - blur = 0; - zIndex = 10; - } - else if (relativePos === -1) { - if (canGoPrev) { - scale = 0.75; - opacity = 0.5; - blur = 2; - zIndex = 5; - } else { - scale = 0; - opacity = 0; - blur = 0; - zIndex = 1; - } - } - else if (relativePos === 3) { - if (canGoNext) { - scale = 0.75; - opacity = 0.5; - blur = 2; - zIndex = 5; - } else { - scale = 0; - opacity = 0; - blur = 0; - zIndex = 1; - } - } - else { - scale = 0; - opacity = 0; - blur = 0; - zIndex = 1; - } - - return { - transform: `scale(${scale})`, - opacity, - filter: `blur(${blur}px)`, - zIndex - }; - }; +import { Container } from '@mantine/core'; +import ShaderBackground from '@/components/landing/ShaderBackground'; +import PulsingCircle from '@/components/landing/PulsingCircle'; +import HeroContent from '@/components/landing/HeroContent'; +import Header from '@/components/landing/Header'; +export default function HomePage() { return ( - - {/* Hero Section */} - - - - - - - - Next Gen Docs for - - - <Text - component="span" - className={classes.animatedGradient} - style={{ - fontSize: 'inherit', - fontWeight: 'inherit' - }} - > - ResilientDB - </Text> - - - - - } - > - High Performance - - } - > - Blockchain - - } - > - Developer Friendly - - - - - - Find all documentation related to ResilientDB, its applications, and ecosystem tools - supported by the ResilientDB team. This site is your gateway to high-performance blockchain - infrastructure, developer guides, and integration resources. To learn more about - ResilientDB, visit{' '} - { - e.currentTarget.style.color = '#40c057'; - e.currentTarget.style.textShadow = '0 1px 2px rgba(81, 207, 102, 0.3)'; - }} - onMouseLeave={(e) => { - e.currentTarget.style.color = '#51cf66'; - e.currentTarget.style.textShadow = 'none'; - }} - > - the official website - . - - - - - - - - - - - - {/* Terminal Section */} - - - - - - Dependencies - - - - - - - - - - {typewriterText} - - - - - {/* Ecosystem Section */} - - - - - Explore Apps and Ecosystem - - - Discover the tools and applications built on ResilientDB - - { - e.currentTarget.style.background = 'rgba(81, 207, 102, 0.2)'; - e.currentTarget.style.borderColor = 'rgba(81, 207, 102, 0.4)'; - e.currentTarget.style.transform = 'translateY(-1px)'; - }} - onMouseLeave={(e) => { - e.currentTarget.style.background = 'rgba(81, 207, 102, 0.1)'; - e.currentTarget.style.borderColor = 'rgba(81, 207, 102, 0.2)'; - e.currentTarget.style.transform = 'translateY(0)'; - }} - > - Visit the ResilientDB Hub for more projects - - - - - {/* Carousel */} - - {/* Left Arrow */} - - - - - {/* Right Arrow */} - - - - - {/* Cards Container */} - - - {ecosystemProjects.map((project, index) => { - const IconComponent = project.icon; - return ( - - - - - - - - - - {project.name} - - - {project.description} - - - - - - - - - ); - })} - - - - {/* Dots Indicator */} - - {Array.from({ length: ecosystemProjects.length - 2 }, (_, index) => ( - setCurrentIndex(index)} - style={{ - width: index === currentIndex ? '32px' : '8px', - height: '8px', - borderRadius: index === currentIndex ? '4px' : '50%', - background: index === currentIndex ? '#f783ac' : '#868e96', - border: 'none', - cursor: 'pointer', - transition: 'all 0.3s ease' - }} - /> - ))} - - - + + +
+ + + - ); -} \ No newline at end of file +} diff --git a/components/FloatingAssistant.tsx b/components/FloatingAssistant.tsx index 66d5f52..b14d72d 100644 --- a/components/FloatingAssistant.tsx +++ b/components/FloatingAssistant.tsx @@ -19,8 +19,8 @@ 'use client'; -import { ActionIcon, Tooltip, Paper, Text, Group, Box, Modal, Textarea, Button, Stack, Divider, Avatar } from '@mantine/core'; -import { IconBrain, IconSend, IconRobot, IconUser } from '@tabler/icons-react'; +import { ActionIcon, Tooltip, Paper, Text, Group, Box, Modal, Textarea, Button, Stack, Divider, Avatar, Switch, Badge } from '@mantine/core'; +import { IconBrain, IconSend, IconRobot, IconUser, IconHighlight, IconSettings } from '@tabler/icons-react'; import { useState, useEffect, ReactNode, useCallback } from 'react'; import ReactMarkdown from 'react-markdown'; import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; @@ -47,6 +47,8 @@ export function FloatingAssistant() { const [isAskingQuestion, setIsAskingQuestion] = useState(false); const [debounceTimer, setDebounceTimer] = useState(null); const [lastSelection, setLastSelection] = useState(''); + const [highlightMode, setHighlightMode] = useState(true); + const [showSettings, setShowSettings] = useState(false); // Function to check if element is within a code editor const isWithinCodeEditor = (element: Element | null): boolean => { @@ -66,6 +68,9 @@ export function FloatingAssistant() { // Debounced text selection handler const handleTextSelection = useCallback(() => { + // Only handle text selection if highlight mode is enabled + if (!highlightMode) return; + // Clear any existing timer if (debounceTimer) { clearTimeout(debounceTimer); @@ -93,7 +98,7 @@ export function FloatingAssistant() { }, 300); // 300ms debounce delay setDebounceTimer(timer); - }, [debounceTimer, lastSelection]); + }, [debounceTimer, lastSelection, highlightMode]); // Cleanup timer on unmount useEffect(() => { @@ -182,25 +187,200 @@ Please: return ( <> - - + {/* Settings Toggle */} + setIsOpen(true)} > - + setShowSettings(!showSettings)} + onMouseEnter={(e) => { + e.currentTarget.style.background = 'rgba(0, 191, 255, 0.1)'; + e.currentTarget.style.borderColor = 'rgba(0, 191, 255, 0.3)'; + e.currentTarget.style.color = '#00bfff'; + }} + onMouseLeave={(e) => { + e.currentTarget.style.background = 'rgba(255,255,255,0.05)'; + e.currentTarget.style.borderColor = 'rgba(255,255,255,0.1)'; + e.currentTarget.style.color = 'rgba(255,255,255,0.7)'; + }} + > + + {/* Settings Panel */} + {showSettings && ( +
+
+ + + + + + Highlight Mode + + + setHighlightMode(event.currentTarget.checked)} + size="sm" + styles={{ + track: { + backgroundColor: highlightMode ? 'rgba(0, 191, 255, 0.3)' : 'rgba(255,255,255,0.1)', + borderColor: highlightMode ? 'rgba(0, 191, 255, 0.5)' : 'rgba(255,255,255,0.2)', + }, + thumb: { + backgroundColor: highlightMode ? '#00bfff' : 'rgba(255,255,255,0.6)', + }, + }} + /> + + + {highlightMode + ? "Select text to automatically get explanations" + : "Click the AI button to ask questions manually"} + + {highlightMode && ( + + Active + + )} + +
+ )} + + {/* Main AI Assistant Button */} + + setIsOpen(true)} + onMouseEnter={(e) => { + e.currentTarget.style.background = 'rgba(0, 191, 255, 0.2)'; + e.currentTarget.style.borderColor = 'rgba(0, 191, 255, 0.4)'; + e.currentTarget.style.transform = 'translateY(-2px)'; + e.currentTarget.style.boxShadow = '0 8px 20px rgba(0, 191, 255, 0.3)'; + }} + onMouseLeave={(e) => { + e.currentTarget.style.background = 'rgba(0, 191, 255, 0.1)'; + e.currentTarget.style.borderColor = 'rgba(0, 191, 255, 0.2)'; + e.currentTarget.style.transform = 'translateY(0)'; + e.currentTarget.style.boxShadow = 'none'; + }} + > +
+ + {highlightMode && ( +
+ )} + + +
+ - - - - - AI Assistant + +
+ +
+
+ + AI Assistant + + + {highlightMode ? "Highlight mode enabled" : "Manual mode"} + +
{selectedText && ( - +
+ Selected: "{selectedText.length > 50 ? selectedText.substring(0, 50) + '...' : selectedText}" +
)}
} > {selectedText && ( - - - - - - - Selected Text - {selectedText} +
+ +
+ +
+ + + Selected Text + + + {selectedText} +
- +
)} {isLoading ? ( - - - - - - Generating response... - + +
+ +
+
+ + Generating response... + +
) : explanation ? ( - - - - - + +
+ +
+
( - + {children} ), @@ -315,67 +593,91 @@ Please: ), li: ({ children }: MarkdownComponentProps) => ( - + {children} ), h1: ({ children }: MarkdownComponentProps) => ( - + {children} ), h2: ({ children }: MarkdownComponentProps) => ( - + {children} ), h3: ({ children }: MarkdownComponentProps) => ( - + {children} ), blockquote: ({ children }: MarkdownComponentProps) => ( - {children} - +
), }} > {explanation} -
+
) : ( - - - - - - + +
+ +
+
+ {selectedText ? "Select text to get an explanation" : "Ask any question or select text to get an explanation"} - +
)} -
- +