Spaces:
Paused
Paused
Commit ·
d8804ab
1
Parent(s): 72790d4
feat(design-system): implement absolute inversion principle, typographic audits, waitlist interactive features & WCAG 2.1 compliance
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitignore +6 -0
- PROJECT_STATUS.md +51 -0
- README.md +44 -33
- app/fonts/FastHand.otf +0 -0
- app/globals.css +483 -14
- app/layout.tsx +96 -12
- app/page.tsx +111 -57
- audit-scanner.mjs +326 -0
- components.json +25 -0
- components/AgentParticleCanvas.tsx +394 -0
- components/CyberTicketModal.tsx +295 -0
- components/DottedMap.tsx +338 -0
- components/FeatureJourneyMap.tsx +260 -0
- components/HubLiveTerminal.tsx +285 -0
- components/HubPulseMetrics.tsx +26 -0
- components/LLMProviderIconCloud.tsx +124 -0
- components/MapContainer.tsx +7 -0
- components/StatsDisplay.tsx +446 -0
- components/ThemeToggle.tsx +111 -0
- components/WaitlistSocialProofTicker.tsx +91 -0
- components/comparison-table.tsx +110 -0
- components/faq-accordion.tsx +111 -0
- components/footer.tsx +116 -0
- components/header.tsx +44 -0
- components/hero-section.tsx +358 -0
- components/social-proof.tsx +101 -0
- components/theme-provider.tsx +11 -0
- components/ui/bento-grid.tsx +108 -0
- components/ui/button.tsx +67 -0
- components/ui/card.tsx +103 -0
- components/ui/dia-text-reveal.tsx +271 -0
- components/ui/flickering-grid.tsx +198 -0
- components/ui/hexagon-pattern.tsx +302 -0
- components/ui/icon-cloud.tsx +544 -0
- components/ui/input.tsx +19 -0
- components/ui/label.tsx +24 -0
- components/ui/marquee.tsx +74 -0
- components/ui/number-ticker.tsx +74 -0
- components/ui/particles.tsx +346 -0
- components/ui/shimmer-button.tsx +88 -0
- components/ui/shine-border.tsx +63 -0
- components/ui/split-flap-text.tsx +310 -0
- components/ui/terminal.tsx +301 -0
- components/waitlist-form.tsx +107 -0
- data/cities-data.json +4419 -0
- data/country-data.ts +101 -0
- data/dotted-map-data.json +0 -0
- data/llm-provider-icons.ts +162 -0
- icons_list.txt +0 -0
- lib/utils.ts +6 -0
.gitignore
CHANGED
|
@@ -39,3 +39,9 @@ yarn-error.log*
|
|
| 39 |
# typescript
|
| 40 |
*.tsbuildinfo
|
| 41 |
next-env.d.ts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
# typescript
|
| 40 |
*.tsbuildinfo
|
| 41 |
next-env.d.ts
|
| 42 |
+
|
| 43 |
+
# temp files & assets
|
| 44 |
+
/temp_lobe_icons/
|
| 45 |
+
/icons_list.txt
|
| 46 |
+
/*.tgz
|
| 47 |
+
|
PROJECT_STATUS.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Project Status & Workspace Context (للأجهزة والمطورين // For Developers & AI Agents)
|
| 2 |
+
|
| 3 |
+
This file outlines the current phase, purpose, and audience of the **HubAPI** workspace. Please read this before modifying, planning, or auditing the codebase.
|
| 4 |
+
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
## 🏗️ Current Project Status // حالة المشروع الحالية
|
| 8 |
+
* **Status**: Under Construction / Pre-Launch Phase (تحت الإنشاء / مرحلة ما قبل الإطلاق).
|
| 9 |
+
* **Current Core**: This repository contains the marketing **Landing Page & Waitlist Queue** (صفحة هبوط تسويقية ونظام تسجيل قائمة الانتظار).
|
| 10 |
+
* **Backend Status**: The core neural gateway routing engine, backend microservices, and databases are currently under development in separate environments. The metrics, server health status, and live connection logs shown on this page are highly optimized front-end simulations designed for presentation and high-fidelity preview.
|
| 11 |
+
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
## 🚀 Core Project Goals // أهداف المشروع الأساسية
|
| 15 |
+
This project aims to build a unified ecosystem with two key offerings:
|
| 16 |
+
1. **LLM Provider API Key & Subscription Marketplace (منصة بيع مفاتيح وحسابات واشتراكات مزودي الذكاء الاصطناعي)**:
|
| 17 |
+
* A platform to purchase, manage, and subscribe to API keys, developer accounts, and premium rate-limit access for top-tier LLM providers (e.g., OpenAI, Anthropic, Google Gemini, Cohere, etc.).
|
| 18 |
+
2. **Agentic OS (برنامج نظام التشغيل الموجه للوكلاء الذكيين)**:
|
| 19 |
+
* Building a comprehensive agent-based operating system designed to run, coordinate, audit, and orchestrate autonomous AI agents seamlessly across computing environments.
|
| 20 |
+
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
## 🎯 Target Audience // الفئات المستهدفة
|
| 24 |
+
This landing page is designed to market HubAPI to:
|
| 25 |
+
1. **Enterprises & Corporations (الشركات والمؤسسات)**: Seeking to cut LLM latency and costs by 40% using dynamic, automated model routing.
|
| 26 |
+
2. **Developers & Teams (المطورون وفرق العمل)**: Needing a single API endpoint with fallback capabilities, automatic retry policies, and zero code changes.
|
| 27 |
+
3. **Individuals & Enthusiasts (الأفراد والمهتمين)**: Wanting to access state-of-the-art model orchestration.
|
| 28 |
+
|
| 29 |
+
---
|
| 30 |
+
|
| 31 |
+
## 🤖 Instructions for AI Agents & Developers // تعليمات للمطورين والوكلاء الذكيين
|
| 32 |
+
If you are an LLM Agent (such as Claude, GPT, or Gemini) or a developer onboarding this repository:
|
| 33 |
+
|
| 34 |
+
1. **Design Integrity**:
|
| 35 |
+
* This project uses a premium dark-theme cybernetic layout (Gold/Orange `#ffaa40` accents, Cyber-glass frames, and dynamic blur glows).
|
| 36 |
+
* Do not introduce bright, generic colors or violate the existing typography systems.
|
| 37 |
+
2. **Performance Constraints**:
|
| 38 |
+
* The **Dotted World Map** is custom-translated and memoized to render efficiently. Do NOT reintroduce standard GeoJSON packages or heavy rendering libraries. Keep map hover latency under `1ms`.
|
| 39 |
+
* Keep state updates in check (e.g., stats counter ticks should be limited to 4–6 times per second to prevent high CPU utilization).
|
| 40 |
+
3. **Clean Console Goal**:
|
| 41 |
+
* Keep the browser DevTools Console completely free of warnings and errors (0 console warnings). Ensure Framer Motion components have defined `initial` states to avoid interpolation warnings.
|
| 42 |
+
4. **Robot Placement**:
|
| 43 |
+
* The flying robot (`/final-robot.png`) has pre-rendered thruster nozzles on its thighs. Its dynamic cyan/blue plasma flames, falling sparks, and masked color-dodge body reflections are positioned at the thigh-level (`bottom-[33.5%]`) for physics-aligned logic. Do not shift them to the boots/feet.
|
| 44 |
+
|
| 45 |
+
---
|
| 46 |
+
|
| 47 |
+
## 📁 Key Directories // هيكل المجلدات الرئيسي
|
| 48 |
+
* `components/`: Contains UI elements (e.g., `hero-section.tsx`, `DottedMap.tsx`, `logo.tsx`).
|
| 49 |
+
* `app/`: Next.js App Router (standard page routes).
|
| 50 |
+
* `data/`: Core static configurations (e.g., `llm-provider-icons.ts` for the 3D tag cloud).
|
| 51 |
+
* `public/`: Static assets (images, fonts, pre-rendered models).
|
README.md
CHANGED
|
@@ -1,36 +1,47 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
```
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
| 20 |
-
|
| 21 |
-
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
|
| 22 |
-
|
| 23 |
-
## Learn More
|
| 24 |
-
|
| 25 |
-
To learn more about Next.js, take a look at the following resources:
|
| 26 |
-
|
| 27 |
-
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
| 28 |
-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
| 29 |
-
|
| 30 |
-
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
|
| 31 |
-
|
| 32 |
-
## Deploy on Vercel
|
| 33 |
-
|
| 34 |
-
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
| 35 |
|
| 36 |
-
|
|
|
|
|
|
| 1 |
+
# HubAPI
|
| 2 |
+
|
| 3 |
+
> [!IMPORTANT]
|
| 4 |
+
> **Project Status Notice**: This project is currently **under construction**. The repository contains the pre-launch marketing **Landing Page & Waitlist Queue** targeting enterprises, institutions, developers, and individuals.
|
| 5 |
+
>
|
| 6 |
+
> The core goals of this project are:
|
| 7 |
+
> 1. **LLM Provider API Key & Subscription Marketplace**: A marketplace to buy and manage developer accounts, API keys, and premium subscriptions of AI LLM providers.
|
| 8 |
+
> 2. **Agentic OS**: Building a state-of-the-art operating system program designed to deploy, orchestrate, and coordinate autonomous AI agents.
|
| 9 |
+
>
|
| 10 |
+
> For onboarding context, detailed design guidelines, and codebase architecture for developers and AI agents, please read [PROJECT_STATUS.md](file:///d:/Prelunch-ui/hubapi/PROJECT_STATUS.md).
|
| 11 |
+
|
| 12 |
+
Welcome to the HubAPI project! This landing page serves as the entry point for HubAPI and showcases the vast ecosystem of LLM providers we support using a dynamic 3D Icon Cloud.
|
| 13 |
+
|
| 14 |
+
## Adding New LLM Providers
|
| 15 |
+
|
| 16 |
+
The 3D Icon Cloud draws its data from a central configuration file. To add new LLM providers to the cloud, you need to update `data/llm-provider-icons.ts`.
|
| 17 |
+
|
| 18 |
+
### 1. Locate the Data File
|
| 19 |
+
Open `data/llm-provider-icons.ts` in your editor.
|
| 20 |
+
|
| 21 |
+
### 2. Identify the Provider's Slug
|
| 22 |
+
We use high-quality SVG icons from the [Lobe Hub icons repository](https://github.com/lobehub/lobe-icons/tree/master/packages/static-svg/icons).
|
| 23 |
+
The `slug` you use must perfectly match the filename of the SVG in that repository (excluding the `.svg` extension).
|
| 24 |
+
|
| 25 |
+
For example, if the Lobe Hub URL is `https://unpkg.com/@lobehub/icons-static-svg@latest/icons/openai.svg`, the slug is `"openai"`.
|
| 26 |
+
|
| 27 |
+
### 3. Add the Slug to the Desired Group
|
| 28 |
+
In `llm-provider-icons.ts`, find the `llmProviderGroups` array. It looks like this:
|
| 29 |
+
|
| 30 |
+
```typescript
|
| 31 |
+
export const llmProviderGroups: LLMProviderGroup[] = [
|
| 32 |
+
{
|
| 33 |
+
title: "Proprietary Giants",
|
| 34 |
+
slugs: ["openai", "anthropic", "google", /* ... */],
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
title: "Open Source Leaders",
|
| 38 |
+
slugs: ["meta", "mistral", "cohere", /* ... */],
|
| 39 |
+
},
|
| 40 |
+
// ...
|
| 41 |
+
];
|
| 42 |
```
|
| 43 |
|
| 44 |
+
Simply add your new slug to the appropriate group's `slugs` array. If the provider is very prominent, you might also want to add it to the `featuredLLMProviderSlugs` array near the top of the file so it shows up in the default "Featured" view.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
+
### 4. Verify
|
| 47 |
+
Start the development server (`npm run dev`) and navigate to the landing page. Click on the corresponding tab to verify that the new icon renders correctly in the 3D cloud. If the icon shows up as a fallback circle or broken image, double-check that the slug matches the Lobe Hub SVG filename exactly.
|
app/fonts/FastHand.otf
ADDED
|
Binary file (29 kB). View file
|
|
|
app/globals.css
CHANGED
|
@@ -1,26 +1,495 @@
|
|
| 1 |
@import "tailwindcss";
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
:
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
}
|
| 7 |
|
| 8 |
@theme inline {
|
| 9 |
-
--
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
--color-foreground: var(--foreground);
|
| 11 |
-
--
|
| 12 |
-
--
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
@import "tailwindcss";
|
| 2 |
+
@import "tw-animate-css";
|
| 3 |
+
@import "shadcn/tailwind.css";
|
| 4 |
|
| 5 |
+
@custom-variant dark (&:is(.dark *));
|
| 6 |
+
|
| 7 |
+
@theme {
|
| 8 |
+
--color-primary: var(--primary);
|
| 9 |
+
--color-accent: var(--accent);
|
| 10 |
+
--color-brand-gold: var(--brand-gold);
|
| 11 |
+
--color-brand-rose: var(--brand-rose);
|
| 12 |
+
--color-brand-purple: var(--brand-purple);
|
| 13 |
+
|
| 14 |
+
--font-sans: var(--font-sans);
|
| 15 |
+
--font-mono: var(--font-geist-mono);
|
| 16 |
+
--font-bebas: var(--font-bebas-neue);
|
| 17 |
+
--font-display: var(--font-display);
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
body {
|
| 21 |
+
background: var(--color-background);
|
| 22 |
+
color: var(--color-foreground);
|
| 23 |
+
font-family: var(--font-sans);
|
| 24 |
+
-webkit-font-smoothing: antialiased;
|
| 25 |
+
-moz-osx-font-smoothing: grayscale;
|
| 26 |
}
|
| 27 |
|
| 28 |
@theme inline {
|
| 29 |
+
--font-heading: var(--font-sans);
|
| 30 |
+
--font-sans: var(--font-sans);
|
| 31 |
+
--color-sidebar-ring: var(--sidebar-ring);
|
| 32 |
+
--color-sidebar-border: var(--sidebar-border);
|
| 33 |
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
| 34 |
+
--color-sidebar-accent: var(--sidebar-accent);
|
| 35 |
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
| 36 |
+
--color-sidebar-primary: var(--sidebar-primary);
|
| 37 |
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
| 38 |
+
--color-sidebar: var(--sidebar);
|
| 39 |
+
--color-chart-5: var(--chart-5);
|
| 40 |
+
--color-chart-4: var(--chart-4);
|
| 41 |
+
--color-chart-3: var(--chart-3);
|
| 42 |
+
--color-chart-2: var(--chart-2);
|
| 43 |
+
--color-chart-1: var(--chart-1);
|
| 44 |
+
--color-ring: var(--ring);
|
| 45 |
+
--color-input: var(--input);
|
| 46 |
+
--color-border: var(--border);
|
| 47 |
+
--color-destructive: var(--destructive);
|
| 48 |
+
--color-accent-foreground: var(--accent-foreground);
|
| 49 |
+
--color-accent: var(--accent);
|
| 50 |
+
--color-muted-foreground: var(--muted-foreground);
|
| 51 |
+
--color-muted: var(--muted);
|
| 52 |
+
--color-secondary-foreground: var(--secondary-foreground);
|
| 53 |
+
--color-secondary: var(--secondary);
|
| 54 |
+
--color-primary-foreground: var(--primary-foreground);
|
| 55 |
+
--color-primary: var(--primary);
|
| 56 |
+
--color-popover-foreground: var(--popover-foreground);
|
| 57 |
+
--color-popover: var(--popover);
|
| 58 |
+
--color-card-foreground: var(--card-foreground);
|
| 59 |
+
--color-card: var(--card);
|
| 60 |
--color-foreground: var(--foreground);
|
| 61 |
+
--color-background: var(--background);
|
| 62 |
+
--radius-sm: calc(var(--radius) * 0.6);
|
| 63 |
+
--radius-md: calc(var(--radius) * 0.8);
|
| 64 |
+
--radius-lg: var(--radius);
|
| 65 |
+
--radius-xl: calc(var(--radius) * 1.4);
|
| 66 |
+
--radius-2xl: calc(var(--radius) * 1.8);
|
| 67 |
+
--radius-3xl: calc(var(--radius) * 2.2);
|
| 68 |
+
--radius-4xl: calc(var(--radius) * 2.6);
|
| 69 |
+
--animate-marquee: marquee var(--duration) infinite linear;
|
| 70 |
+
--animate-marquee-vertical: marquee-vertical var(--duration) linear infinite;
|
| 71 |
+
@keyframes marquee {
|
| 72 |
+
from {
|
| 73 |
+
transform: translateX(0);
|
| 74 |
+
}
|
| 75 |
+
to {
|
| 76 |
+
transform: translateX(calc(-100% - var(--gap)));
|
| 77 |
+
}
|
| 78 |
+
}
|
| 79 |
+
@keyframes marquee-vertical {
|
| 80 |
+
from {
|
| 81 |
+
transform: translateY(0);
|
| 82 |
+
}
|
| 83 |
+
to {
|
| 84 |
+
transform: translateY(calc(-100% - var(--gap)));
|
| 85 |
+
}
|
| 86 |
+
}
|
| 87 |
+
--animate-shine: shine var(--duration) infinite linear;
|
| 88 |
+
--animate-shimmer-slide: shimmer-slide var(--speed) ease-in-out infinite alternate;
|
| 89 |
+
--animate-spin-around: spin-around calc(var(--speed) * 2) infinite linear;
|
| 90 |
+
|
| 91 |
+
@keyframes shine {
|
| 92 |
+
0% {
|
| 93 |
+
background-position: 0% 0%;
|
| 94 |
+
}
|
| 95 |
+
50% {
|
| 96 |
+
background-position: 100% 100%;
|
| 97 |
+
}
|
| 98 |
+
to {
|
| 99 |
+
background-position: 0% 0%;
|
| 100 |
+
}
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
@keyframes shimmer-slide {
|
| 104 |
+
to {
|
| 105 |
+
transform: translate(calc(100cqw - 100%), 0);
|
| 106 |
+
}
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
@keyframes spin-around {
|
| 110 |
+
0% {
|
| 111 |
+
transform: translateZ(0) rotate(0);
|
| 112 |
+
}
|
| 113 |
+
15%, 35% {
|
| 114 |
+
transform: translateZ(0) rotate(90deg);
|
| 115 |
+
}
|
| 116 |
+
65%, 85% {
|
| 117 |
+
transform: translateZ(0) rotate(270deg);
|
| 118 |
+
}
|
| 119 |
+
100% {
|
| 120 |
+
transform: translateZ(0) rotate(360deg);
|
| 121 |
+
}
|
| 122 |
+
}
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
:root {
|
| 126 |
+
--background: oklch(0.985 0.006 85); /* Premium warm champagne mist */
|
| 127 |
+
--foreground: oklch(0.12 0.01 85); /* Rich Espresso Obsidian */
|
| 128 |
+
|
| 129 |
+
/* Absolute Inversion Principle: Card backgrounds are dark space obsidian in Light Mode */
|
| 130 |
+
--card: oklch(0.11 0.01 250);
|
| 131 |
+
--card-foreground: oklch(0.98 0.005 85); /* Champagne Silver (light text) */
|
| 132 |
+
--card-muted-foreground: oklch(0.72 0.005 85); /* High-contrast champagne muted text */
|
| 133 |
+
--card-muted: oklch(0.08 0.008 250 / 80%);
|
| 134 |
+
--card-border: oklch(0.98 0.005 85 / 15%);
|
| 135 |
+
|
| 136 |
+
--popover: oklch(0.11 0.01 250);
|
| 137 |
+
--popover-foreground: oklch(0.98 0.005 85);
|
| 138 |
+
--primary: oklch(0.35 0.12 65); /* Deep Rich Luxury Gold (Light Mode outside cards) */
|
| 139 |
+
--primary-foreground: oklch(0.985 0.006 85);
|
| 140 |
+
--secondary: oklch(0.95 0.006 85);
|
| 141 |
+
--secondary-foreground: oklch(0.12 0.01 85);
|
| 142 |
+
--muted: oklch(0.94 0.006 85);
|
| 143 |
+
--muted-foreground: oklch(0.42 0.01 85); /* Increased contrast */
|
| 144 |
+
--accent: oklch(0.35 0.12 65);
|
| 145 |
+
--accent-foreground: oklch(0.985 0.006 85);
|
| 146 |
+
--destructive: oklch(0.577 0.245 27.325);
|
| 147 |
+
--border: oklch(0.12 0.01 85 / 14%); /* Soft, technical high-contrast border */
|
| 148 |
+
--input: oklch(0.12 0.01 85 / 12%);
|
| 149 |
+
--ring: oklch(0.35 0.12 65 / 35%);
|
| 150 |
+
--chart-1: oklch(0.87 0 0);
|
| 151 |
+
--chart-2: oklch(0.556 0 0);
|
| 152 |
+
--chart-3: oklch(0.439 0 0);
|
| 153 |
+
--chart-4: oklch(0.371 0 0);
|
| 154 |
+
--chart-5: oklch(0.269 0 0);
|
| 155 |
+
--radius: 0.625rem;
|
| 156 |
+
--sidebar: oklch(0.985 0 0);
|
| 157 |
+
--sidebar-foreground: oklch(0.145 0 0);
|
| 158 |
+
--sidebar-primary: oklch(0.205 0 0);
|
| 159 |
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
| 160 |
+
--sidebar-accent: oklch(0.97 0 0);
|
| 161 |
+
--sidebar-accent-foreground: oklch(0.205 0 0);
|
| 162 |
+
--sidebar-border: oklch(0.922 0 0);
|
| 163 |
+
--sidebar-ring: oklch(0.708 0 0);
|
| 164 |
+
|
| 165 |
+
/* Theme-consistent secondary variables */
|
| 166 |
+
--brand-gold: oklch(0.35 0.12 65);
|
| 167 |
+
--brand-rose: oklch(0.58 0.18 10);
|
| 168 |
+
--brand-purple: oklch(0.52 0.18 290);
|
| 169 |
+
|
| 170 |
+
--primary-glow: oklch(0.35 0.12 65 / 18%);
|
| 171 |
+
--color-grid-line: rgba(0, 0, 0, 0.022);
|
| 172 |
+
|
| 173 |
+
/* Absolute Inversion Elements: solid high-contrast dark buttons in Light Mode */
|
| 174 |
+
--button-bg: oklch(0.12 0.01 85); /* Rich Espresso Obsidian */
|
| 175 |
+
--button-text: oklch(0.985 0.006 85); /* Premium warm champagne mist (light text) */
|
| 176 |
+
--button-border: oklch(0.12 0.01 85 / 15%);
|
| 177 |
+
--button-shimmer: oklch(0.35 0.12 65); /* Elegant Bronze Gold shimmer */
|
| 178 |
+
|
| 179 |
+
--card-contrast-border: oklch(0.98 0.005 85 / 15%);
|
| 180 |
+
--menu-contrast-border: oklch(0.98 0.005 85 / 18%);
|
| 181 |
+
--menu-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
|
| 182 |
}
|
| 183 |
|
| 184 |
+
.dark {
|
| 185 |
+
--background: oklch(0.06 0.008 250); /* Space Obsidian Navy (Deep Indigo-Black) */
|
| 186 |
+
--foreground: oklch(0.98 0.005 85); /* Champagne Silver */
|
| 187 |
+
|
| 188 |
+
/* Absolute Inversion Principle: Card backgrounds are warm champagne light in Dark Mode */
|
| 189 |
+
--card: oklch(0.96 0.008 85);
|
| 190 |
+
--card-foreground: oklch(0.12 0.01 85); /* Rich Espresso Obsidian (dark text) */
|
| 191 |
+
--card-muted-foreground: oklch(0.42 0.01 85); /* Medium Espresso Dark Muted Text */
|
| 192 |
+
--card-muted: oklch(0.94 0.006 85 / 80%);
|
| 193 |
+
--card-border: oklch(0.12 0.01 85 / 10%);
|
| 194 |
+
|
| 195 |
+
--popover: oklch(0.96 0.008 85);
|
| 196 |
+
--popover-foreground: oklch(0.12 0.01 85);
|
| 197 |
+
--primary: oklch(0.82 0.12 85); /* Radiant Glowing Champagne Gold (Dark Mode outside cards) */
|
| 198 |
+
--primary-foreground: oklch(0.06 0.008 250);
|
| 199 |
+
--secondary: oklch(0.12 0.008 250);
|
| 200 |
+
--secondary-foreground: oklch(0.98 0.005 85);
|
| 201 |
+
--muted: oklch(0.09 0.008 250);
|
| 202 |
+
--muted-foreground: oklch(0.72 0.005 85); /* Increased contrast */
|
| 203 |
+
--accent: oklch(0.82 0.12 85);
|
| 204 |
+
--accent-foreground: oklch(0.06 0.008 250);
|
| 205 |
+
--destructive: oklch(0.704 0.191 22.216);
|
| 206 |
+
--border: oklch(1 0 0 / 12%); /* Slightly more defined */
|
| 207 |
+
--input: oklch(1 0 0 / 12%);
|
| 208 |
+
--ring: oklch(0.82 0.12 85 / 35%);
|
| 209 |
+
--chart-1: oklch(0.87 0 0);
|
| 210 |
+
--chart-2: oklch(0.556 0 0);
|
| 211 |
+
--chart-3: oklch(0.439 0 0);
|
| 212 |
+
--chart-4: oklch(0.371 0 0);
|
| 213 |
+
--chart-5: oklch(0.269 0 0);
|
| 214 |
+
--sidebar: oklch(0.05 0 0);
|
| 215 |
+
--sidebar-foreground: oklch(0.985 0 0);
|
| 216 |
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
| 217 |
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
| 218 |
+
--sidebar-accent: oklch(0.08 0 0);
|
| 219 |
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
| 220 |
+
--sidebar-border: oklch(1 0 0 / 8%);
|
| 221 |
+
--sidebar-ring: oklch(0.556 0 0);
|
| 222 |
+
|
| 223 |
+
/* Theme-consistent secondary variables */
|
| 224 |
+
--brand-gold: oklch(0.82 0.12 85);
|
| 225 |
+
--brand-rose: oklch(0.78 0.14 15);
|
| 226 |
+
--brand-purple: oklch(0.75 0.15 285);
|
| 227 |
+
|
| 228 |
+
--primary-glow: oklch(0.82 0.12 85 / 38%);
|
| 229 |
+
--color-grid-line: rgba(255, 255, 255, 0.02);
|
| 230 |
+
|
| 231 |
+
/* Absolute Inversion Elements: solid glowing light gold buttons in Dark Mode */
|
| 232 |
+
--button-bg: oklch(0.82 0.12 85); /* Radiant Glowing Champagne Gold */
|
| 233 |
+
--button-text: oklch(0.06 0.008 250); /* Space Obsidian Navy (dark text) */
|
| 234 |
+
--button-border: oklch(0.82 0.12 85 / 40%);
|
| 235 |
+
--button-shimmer: #ffffff; /* Radiant white shimmer */
|
| 236 |
+
|
| 237 |
+
--card-contrast-border: oklch(0.12 0.01 85 / 15%);
|
| 238 |
+
--menu-contrast-border: oklch(0.12 0.01 85 / 12%);
|
| 239 |
+
--menu-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
@layer base {
|
| 243 |
+
* {
|
| 244 |
+
@apply border-border outline-ring/50;
|
| 245 |
+
}
|
| 246 |
+
body {
|
| 247 |
+
@apply bg-background text-foreground;
|
| 248 |
+
}
|
| 249 |
+
html {
|
| 250 |
+
@apply font-sans;
|
| 251 |
+
scrollbar-width: thin;
|
| 252 |
+
scrollbar-color: rgba(255, 170, 64, 0.3) rgba(0, 0, 0, 0.1);
|
| 253 |
+
}
|
| 254 |
+
|
| 255 |
+
/* Webkit custom scrollbars with primary orange hue */
|
| 256 |
+
::-webkit-scrollbar {
|
| 257 |
+
width: 8px;
|
| 258 |
+
height: 8px;
|
| 259 |
+
}
|
| 260 |
+
::-webkit-scrollbar-track {
|
| 261 |
+
background: var(--background);
|
| 262 |
+
}
|
| 263 |
+
::-webkit-scrollbar-thumb {
|
| 264 |
+
background: rgba(255, 170, 64, 0.25);
|
| 265 |
+
border-radius: 4px;
|
| 266 |
+
border: 2px solid var(--background);
|
| 267 |
+
}
|
| 268 |
+
::-webkit-scrollbar-thumb:hover {
|
| 269 |
+
background: rgba(255, 170, 64, 0.45);
|
| 270 |
}
|
| 271 |
}
|
| 272 |
|
| 273 |
+
@layer utilities {
|
| 274 |
+
.font-fast-hand {
|
| 275 |
+
font-family: var(--font-fast-hand), sans-serif;
|
| 276 |
+
}
|
| 277 |
+
}
|
| 278 |
+
|
| 279 |
+
:root {
|
| 280 |
+
/* Vercel Design System Colors */
|
| 281 |
+
--ds-background-100: #ffffff;
|
| 282 |
+
--ds-background-200: #fafafa;
|
| 283 |
+
--ds-gray-100: #f5f5f5;
|
| 284 |
+
--ds-gray-200: #e5e5e5;
|
| 285 |
+
--ds-gray-300: #d4d4d4;
|
| 286 |
+
--ds-gray-400: #a3a3a3;
|
| 287 |
+
--ds-gray-500: #737373;
|
| 288 |
+
--ds-gray-600: #525252;
|
| 289 |
+
--ds-gray-700: #404040;
|
| 290 |
+
--ds-gray-800: #262626;
|
| 291 |
+
--ds-gray-900: #737373;
|
| 292 |
+
--ds-gray-1000: #0a0a0a;
|
| 293 |
+
--ds-gray-alpha-100: rgba(0, 0, 0, 0.05);
|
| 294 |
+
--ds-gray-alpha-200: rgba(0, 0, 0, 0.1);
|
| 295 |
+
--ds-gray-alpha-400: rgba(0, 0, 0, 0.2);
|
| 296 |
+
--ds-gray-alpha-600: rgba(0, 0, 0, 0.4);
|
| 297 |
+
}
|
| 298 |
+
|
| 299 |
+
.dark {
|
| 300 |
+
--ds-background-100: #000000;
|
| 301 |
+
--ds-background-200: #171717;
|
| 302 |
+
--ds-gray-100: #262626;
|
| 303 |
+
--ds-gray-200: #333333;
|
| 304 |
+
--ds-gray-300: #404040;
|
| 305 |
+
--ds-gray-400: #525252;
|
| 306 |
+
--ds-gray-500: #737373;
|
| 307 |
+
--ds-gray-600: #a3a3a3;
|
| 308 |
+
--ds-gray-700: #d4d4d4;
|
| 309 |
+
--ds-gray-800: #e5e5e5;
|
| 310 |
+
--ds-gray-900: #a1a1aa;
|
| 311 |
+
--ds-gray-1000: #fafafa;
|
| 312 |
+
--ds-gray-alpha-100: rgba(255, 255, 255, 0.05);
|
| 313 |
+
--ds-gray-alpha-200: rgba(255, 255, 255, 0.1);
|
| 314 |
+
--ds-gray-alpha-400: rgba(255, 255, 255, 0.2);
|
| 315 |
+
--ds-gray-alpha-600: rgba(255, 255, 255, 0.4);
|
| 316 |
}
|
| 317 |
+
|
| 318 |
+
.bg-gray-alpha-100 {
|
| 319 |
+
background-color: var(--ds-gray-alpha-100);
|
| 320 |
+
}
|
| 321 |
+
|
| 322 |
+
.text-gray-900 {
|
| 323 |
+
color: var(--ds-gray-900);
|
| 324 |
+
}
|
| 325 |
+
|
| 326 |
+
.text-gray-1000 {
|
| 327 |
+
color: var(--ds-gray-1000);
|
| 328 |
+
}
|
| 329 |
+
|
| 330 |
+
.rsm-svg {
|
| 331 |
+
width: 100%;
|
| 332 |
+
height: auto;
|
| 333 |
+
}
|
| 334 |
+
|
| 335 |
+
.rsm-geographies path {
|
| 336 |
+
transition: fill 0.15s ease;
|
| 337 |
+
}
|
| 338 |
+
|
| 339 |
+
.tabular-nums {
|
| 340 |
+
font-variant-numeric: tabular-nums;
|
| 341 |
+
}
|
| 342 |
+
|
| 343 |
+
/* Premium Neo-Futuristic Visual Utilities */
|
| 344 |
+
@keyframes cyber-pulse-glow {
|
| 345 |
+
0%, 100% {
|
| 346 |
+
opacity: 0.15;
|
| 347 |
+
filter: blur(80px) scale(1);
|
| 348 |
+
}
|
| 349 |
+
50% {
|
| 350 |
+
opacity: 0.25;
|
| 351 |
+
filter: blur(100px) scale(1.1);
|
| 352 |
+
}
|
| 353 |
+
}
|
| 354 |
+
|
| 355 |
+
/* Premium Dark Grain Overlay */
|
| 356 |
+
.noise-grain {
|
| 357 |
+
position: fixed;
|
| 358 |
+
inset: 0;
|
| 359 |
+
z-index: -30;
|
| 360 |
+
opacity: 0.035;
|
| 361 |
+
pointer-events: none;
|
| 362 |
+
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.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
|
| 363 |
+
}
|
| 364 |
+
|
| 365 |
+
/* Subtle micro-glows & typography */
|
| 366 |
+
.text-glow {
|
| 367 |
+
text-shadow: 0 0 12px rgba(255, 170, 64, 0.2);
|
| 368 |
+
}
|
| 369 |
+
|
| 370 |
+
.text-glow-accent {
|
| 371 |
+
text-shadow: 0 0 12px rgba(255, 170, 64, 0.35);
|
| 372 |
+
}
|
| 373 |
+
|
| 374 |
+
/* Premium card hover borders */
|
| 375 |
+
.premium-glow-card {
|
| 376 |
+
position: relative;
|
| 377 |
+
transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
| 378 |
+
border: 1px solid var(--card-border);
|
| 379 |
+
background-color: var(--card);
|
| 380 |
+
color: var(--card-foreground);
|
| 381 |
+
--foreground: var(--card-foreground);
|
| 382 |
+
--muted-foreground: var(--card-muted-foreground);
|
| 383 |
+
--muted: var(--card-muted);
|
| 384 |
+
--border: var(--card-border);
|
| 385 |
+
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
|
| 386 |
+
}
|
| 387 |
+
|
| 388 |
+
.dark .premium-glow-card {
|
| 389 |
+
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
|
| 390 |
+
}
|
| 391 |
+
|
| 392 |
+
.premium-glow-card:hover {
|
| 393 |
+
border-color: rgba(255, 170, 64, 0.2);
|
| 394 |
+
box-shadow: 0 10px 40px rgba(255, 170, 64, 0.03), 0 0 0 1px rgba(255, 170, 64, 0.1);
|
| 395 |
+
}
|
| 396 |
+
|
| 397 |
+
/* Sci-fi Corner Brackets */
|
| 398 |
+
.corner-bracket {
|
| 399 |
+
position: relative;
|
| 400 |
+
}
|
| 401 |
+
.corner-bracket::before,
|
| 402 |
+
.corner-bracket::after,
|
| 403 |
+
.corner-bracket-inner::before,
|
| 404 |
+
.corner-bracket-inner::after {
|
| 405 |
+
content: "";
|
| 406 |
+
position: absolute;
|
| 407 |
+
width: 8px;
|
| 408 |
+
height: 8px;
|
| 409 |
+
border-color: rgba(255, 170, 64, 0.4);
|
| 410 |
+
border-style: solid;
|
| 411 |
+
pointer-events: none;
|
| 412 |
+
z-index: 10;
|
| 413 |
+
transition: border-color 0.3s ease;
|
| 414 |
+
}
|
| 415 |
+
.dark .corner-bracket::before,
|
| 416 |
+
.dark .corner-bracket::after,
|
| 417 |
+
.dark .corner-bracket-inner::before,
|
| 418 |
+
.dark .corner-bracket-inner::after {
|
| 419 |
+
border-color: rgba(255, 170, 64, 0.6);
|
| 420 |
+
}
|
| 421 |
+
|
| 422 |
+
/* Top-Left */
|
| 423 |
+
.corner-bracket::before {
|
| 424 |
+
top: 0;
|
| 425 |
+
left: 0;
|
| 426 |
+
border-width: 1.5px 0 0 1.5px;
|
| 427 |
+
}
|
| 428 |
+
/* Top-Right */
|
| 429 |
+
.corner-bracket::after {
|
| 430 |
+
top: 0;
|
| 431 |
+
right: 0;
|
| 432 |
+
border-width: 1.5px 1.5px 0 0;
|
| 433 |
+
}
|
| 434 |
+
/* Bottom-Left */
|
| 435 |
+
.corner-bracket-inner::before {
|
| 436 |
+
bottom: 0;
|
| 437 |
+
left: 0;
|
| 438 |
+
border-width: 0 0 1.5px 1.5px;
|
| 439 |
+
}
|
| 440 |
+
/* Bottom-Right */
|
| 441 |
+
.corner-bracket-inner::after {
|
| 442 |
+
bottom: 0;
|
| 443 |
+
right: 0;
|
| 444 |
+
border-width: 0 1.5px 1.5px 0;
|
| 445 |
+
}
|
| 446 |
+
|
| 447 |
+
|
| 448 |
+
|
| 449 |
+
/* Premium Glassmorphic responsive cards */
|
| 450 |
+
.premium-glass-card {
|
| 451 |
+
position: relative;
|
| 452 |
+
transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
| 453 |
+
border: 1px solid var(--card-border);
|
| 454 |
+
background-color: var(--card);
|
| 455 |
+
color: var(--card-foreground);
|
| 456 |
+
--foreground: var(--card-foreground);
|
| 457 |
+
--muted-foreground: var(--card-muted-foreground);
|
| 458 |
+
--muted: var(--card-muted);
|
| 459 |
+
--border: var(--card-border);
|
| 460 |
+
backdrop-filter: blur(16px) saturate(120%);
|
| 461 |
+
-webkit-backdrop-filter: blur(16px) saturate(120%);
|
| 462 |
+
}
|
| 463 |
+
|
| 464 |
+
.premium-glass-card:hover {
|
| 465 |
+
border-color: var(--primary);
|
| 466 |
+
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.04), 0 0 0 1px var(--primary);
|
| 467 |
+
}
|
| 468 |
+
|
| 469 |
+
.dark .premium-glass-card:hover {
|
| 470 |
+
box-shadow: 0 15px 40px rgba(255, 170, 64, 0.03), 0 0 0 1px rgba(255, 170, 64, 0.15);
|
| 471 |
+
}
|
| 472 |
+
|
| 473 |
+
/* Inverted Card Local Scoping Utility */
|
| 474 |
+
.inverted-card {
|
| 475 |
+
background-color: var(--card) !important;
|
| 476 |
+
color: var(--card-foreground) !important;
|
| 477 |
+
--foreground: var(--card-foreground);
|
| 478 |
+
--muted-foreground: var(--card-muted-foreground);
|
| 479 |
+
--muted: var(--card-muted);
|
| 480 |
+
--border: var(--card-border);
|
| 481 |
+
border-color: var(--card-border) !important;
|
| 482 |
+
}
|
| 483 |
+
|
| 484 |
+
/* Dynamic Local Primary Scoping for Inverted Containers */
|
| 485 |
+
.inverted-card, .premium-glass-card, .premium-glow-card {
|
| 486 |
+
--primary: oklch(0.82 0.12 85); /* Radiant Glowing Champagne Gold inside dark cards */
|
| 487 |
+
--primary-foreground: oklch(0.06 0.008 250); /* Dark text on light gold button inside dark cards */
|
| 488 |
+
--primary-glow: oklch(0.82 0.12 85 / 35%);
|
| 489 |
+
}
|
| 490 |
+
|
| 491 |
+
.dark .inverted-card, .dark .premium-glass-card, .dark .premium-glow-card {
|
| 492 |
+
--primary: oklch(0.35 0.12 65); /* Deep Rich Luxury Gold inside light cards */
|
| 493 |
+
--primary-foreground: oklch(0.985 0.006 85); /* Light text on dark gold button inside light cards */
|
| 494 |
+
--primary-glow: oklch(0.35 0.12 65 / 18%);
|
| 495 |
+
}
|
app/layout.tsx
CHANGED
|
@@ -1,33 +1,117 @@
|
|
| 1 |
import type { Metadata } from "next";
|
| 2 |
-
import { Geist,
|
|
|
|
| 3 |
import "./globals.css";
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
const
|
| 6 |
-
variable: "--font-geist-sans",
|
| 7 |
-
subsets: ["latin"],
|
| 8 |
-
});
|
| 9 |
|
| 10 |
const geistMono = Geist_Mono({
|
| 11 |
variable: "--font-geist-mono",
|
| 12 |
subsets: ["latin"],
|
| 13 |
});
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
export const metadata: Metadata = {
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
};
|
| 19 |
|
|
|
|
|
|
|
|
|
|
| 20 |
export default function RootLayout({
|
| 21 |
children,
|
| 22 |
}: Readonly<{
|
| 23 |
children: React.ReactNode;
|
| 24 |
}>) {
|
| 25 |
return (
|
| 26 |
-
<html
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
</html>
|
| 32 |
);
|
| 33 |
}
|
|
|
|
| 1 |
import type { Metadata } from "next";
|
| 2 |
+
import { Geist_Mono, Geist, Instrument_Serif } from "next/font/google";
|
| 3 |
+
import localFont from "next/font/local";
|
| 4 |
import "./globals.css";
|
| 5 |
+
import { Header } from "@/components/header";
|
| 6 |
+
import { Footer } from "@/components/footer";
|
| 7 |
+
import { cn } from "@/lib/utils";
|
| 8 |
+
import { ThemeProvider } from "@/components/theme-provider";
|
| 9 |
|
| 10 |
+
const geist = Geist({subsets:['latin'],variable:'--font-sans'});
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
const geistMono = Geist_Mono({
|
| 13 |
variable: "--font-geist-mono",
|
| 14 |
subsets: ["latin"],
|
| 15 |
});
|
| 16 |
|
| 17 |
+
const instrumentSerif = Instrument_Serif({
|
| 18 |
+
variable: "--font-display",
|
| 19 |
+
subsets: ["latin"],
|
| 20 |
+
weight: "400",
|
| 21 |
+
});
|
| 22 |
+
|
| 23 |
+
const fastHand = localFont({
|
| 24 |
+
src: "./fonts/FastHand.otf",
|
| 25 |
+
variable: "--font-fast-hand",
|
| 26 |
+
});
|
| 27 |
+
|
| 28 |
export const metadata: Metadata = {
|
| 29 |
+
metadataBase: new URL("https://hubapi.dev"),
|
| 30 |
+
title: "HUBAPI — Pre-launch | API Automation Platform",
|
| 31 |
+
description: "Join the HUBAPI waitlist for early access to the API automation platform. Secure agent routing, scoped access keys, and observable workflows.",
|
| 32 |
+
openGraph: {
|
| 33 |
+
title: "HUBAPI — The Neural API Gateway",
|
| 34 |
+
description: "One gateway. Every model. Full control. Cut your AI costs by 40% with zero code changes.",
|
| 35 |
+
url: "https://hubapi.dev",
|
| 36 |
+
siteName: "HUBAPI",
|
| 37 |
+
images: [
|
| 38 |
+
{
|
| 39 |
+
url: "/og-image.png",
|
| 40 |
+
width: 1200,
|
| 41 |
+
height: 630,
|
| 42 |
+
alt: "HUBAPI — The Neural API Gateway",
|
| 43 |
+
},
|
| 44 |
+
],
|
| 45 |
+
type: "website",
|
| 46 |
+
},
|
| 47 |
+
twitter: {
|
| 48 |
+
card: "summary_large_image",
|
| 49 |
+
title: "HUBAPI — The Neural API Gateway",
|
| 50 |
+
description: "One gateway. Every model. Full control. Cut your AI costs by 40% with zero code changes.",
|
| 51 |
+
images: ["/og-image.png"],
|
| 52 |
+
},
|
| 53 |
};
|
| 54 |
|
| 55 |
+
import { SplitFlapAudioProvider } from "@/components/ui/split-flap-text";
|
| 56 |
+
import { WaitlistSocialProofTicker } from "@/components/WaitlistSocialProofTicker";
|
| 57 |
+
|
| 58 |
export default function RootLayout({
|
| 59 |
children,
|
| 60 |
}: Readonly<{
|
| 61 |
children: React.ReactNode;
|
| 62 |
}>) {
|
| 63 |
return (
|
| 64 |
+
<html lang="en" className={cn("font-sans", geist.variable)} suppressHydrationWarning>
|
| 65 |
+
<body
|
| 66 |
+
className={`${geistMono.variable} ${fastHand.variable} ${instrumentSerif.variable} font-sans antialiased bg-background`}
|
| 67 |
+
>
|
| 68 |
+
<ThemeProvider
|
| 69 |
+
attribute="class"
|
| 70 |
+
defaultTheme="dark"
|
| 71 |
+
enableSystem
|
| 72 |
+
disableTransitionOnChange
|
| 73 |
+
>
|
| 74 |
+
<SplitFlapAudioProvider>
|
| 75 |
+
{/* JSON-LD Organization Schema for SEO */}
|
| 76 |
+
<script
|
| 77 |
+
type="application/ld+json"
|
| 78 |
+
dangerouslySetInnerHTML={{
|
| 79 |
+
__html: JSON.stringify({
|
| 80 |
+
"@context": "https://schema.org",
|
| 81 |
+
"@type": "Organization",
|
| 82 |
+
"name": "HUBAPI",
|
| 83 |
+
"url": "https://hubapi.dev",
|
| 84 |
+
"logo": "https://hubapi.dev/logo.png",
|
| 85 |
+
"description": "HUBAPI is a premium, neural API gateway and automation platform offering smart routing, cost optimization, and security shield for LLMs.",
|
| 86 |
+
"sameAs": [
|
| 87 |
+
"https://github.com/hubapi",
|
| 88 |
+
"https://twitter.com/hubapi"
|
| 89 |
+
]
|
| 90 |
+
})
|
| 91 |
+
}}
|
| 92 |
+
/>
|
| 93 |
+
{/* Viewport Elegant Top Border */}
|
| 94 |
+
<div className="fixed top-0 left-0 right-0 h-[1px] bg-gradient-to-r from-transparent via-primary/20 dark:via-primary/35 to-transparent pointer-events-none z-50" aria-hidden="true" />
|
| 95 |
+
|
| 96 |
+
{/* Symmetrical Vertical Guides (Thin elegant lines) */}
|
| 97 |
+
<div className="fixed inset-y-0 left-[8%] w-[1px] bg-gradient-to-b from-transparent via-primary/3 dark:via-primary/6 to-transparent pointer-events-none -z-40" aria-hidden="true" />
|
| 98 |
+
<div className="fixed inset-y-0 right-[8%] w-[1px] bg-gradient-to-b from-transparent via-primary/3 dark:via-primary/6 to-transparent pointer-events-none -z-40" aria-hidden="true" />
|
| 99 |
+
|
| 100 |
+
{/* Premium Dark Grain Background Overlay */}
|
| 101 |
+
<div className="noise-grain" aria-hidden="true" />
|
| 102 |
+
|
| 103 |
+
{/* Soft Ambient Spotlight Glow (Linear/Vercel style top-centered light) */}
|
| 104 |
+
<div className="fixed top-0 left-1/2 -translate-x-1/2 w-[1200px] h-[600px] bg-gradient-to-b from-primary/6 dark:from-primary/12 via-primary/2 dark:via-primary/4 to-transparent blur-[160px] rounded-full -z-40 pointer-events-none opacity-70 dark:opacity-85" aria-hidden="true" />
|
| 105 |
+
|
| 106 |
+
{/* Subtle cool indigo glow near bottom to anchor scrolling */}
|
| 107 |
+
<div className="fixed bottom-0 left-1/2 -translate-x-1/2 w-[1000px] h-[500px] bg-indigo-500/[0.015] dark:bg-indigo-500/[0.01] blur-[150px] rounded-full -z-40 pointer-events-none" aria-hidden="true" />
|
| 108 |
+
<Header />
|
| 109 |
+
{children}
|
| 110 |
+
<Footer />
|
| 111 |
+
<WaitlistSocialProofTicker />
|
| 112 |
+
</SplitFlapAudioProvider>
|
| 113 |
+
</ThemeProvider>
|
| 114 |
+
</body>
|
| 115 |
</html>
|
| 116 |
);
|
| 117 |
}
|
app/page.tsx
CHANGED
|
@@ -1,65 +1,119 @@
|
|
| 1 |
-
import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
export default function Home() {
|
| 4 |
return (
|
| 5 |
-
<
|
| 6 |
-
<
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
</
|
| 19 |
-
<
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
>
|
| 25 |
-
Templates
|
| 26 |
-
</a>{" "}
|
| 27 |
-
or the{" "}
|
| 28 |
-
<a
|
| 29 |
-
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
| 30 |
-
className="font-medium text-zinc-950 dark:text-zinc-50"
|
| 31 |
-
>
|
| 32 |
-
Learning
|
| 33 |
-
</a>{" "}
|
| 34 |
-
center.
|
| 35 |
</p>
|
| 36 |
</div>
|
| 37 |
-
<
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
<
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
</div>
|
| 62 |
-
</
|
| 63 |
-
|
|
|
|
|
|
|
|
|
|
| 64 |
);
|
| 65 |
}
|
|
|
|
|
|
| 1 |
+
import { HeroSection } from "@/components/hero-section";
|
| 2 |
+
import { FeatureJourneyMap } from "@/components/FeatureJourneyMap";
|
| 3 |
+
import { LLMProviderIconCloud } from "@/components/LLMProviderIconCloud";
|
| 4 |
+
import { HubPulseMetrics } from "@/components/HubPulseMetrics";
|
| 5 |
+
import { HubLiveTerminal } from "@/components/HubLiveTerminal";
|
| 6 |
+
import MapContainer from "@/components/MapContainer";
|
| 7 |
+
import { SocialProof } from "@/components/social-proof";
|
| 8 |
+
import { ComparisonTable } from "@/components/comparison-table";
|
| 9 |
+
import { FAQAccordion } from "@/components/faq-accordion";
|
| 10 |
+
import {
|
| 11 |
+
TotalRequests,
|
| 12 |
+
TopCountries,
|
| 13 |
+
RegionCount,
|
| 14 |
+
StatsGrid,
|
| 15 |
+
} from "@/components/StatsDisplay";
|
| 16 |
|
| 17 |
export default function Home() {
|
| 18 |
return (
|
| 19 |
+
<main className="relative min-h-screen text-foreground overflow-x-hidden flex flex-col items-center">
|
| 20 |
+
<HeroSection />
|
| 21 |
+
<SocialProof />
|
| 22 |
+
|
| 23 |
+
{/* Terminal Command Center — elevated to prime visibility */}
|
| 24 |
+
<section className="relative z-10 w-full max-w-5xl mx-auto px-4 md:px-6 py-20 md:py-28">
|
| 25 |
+
<div className="text-center space-y-5 mb-10">
|
| 26 |
+
<div className="inline-flex items-center rounded-full border border-primary/20 bg-primary/5 px-4 py-1.5 text-sm font-medium text-primary backdrop-blur-sm shadow-sm">
|
| 27 |
+
<span className="relative flex h-2 w-2 mr-2.5">
|
| 28 |
+
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"></span>
|
| 29 |
+
<span className="relative inline-flex rounded-full h-2 w-2 bg-primary"></span>
|
| 30 |
+
</span>
|
| 31 |
+
Live Command Center
|
| 32 |
+
</div>
|
| 33 |
+
<h2 className="text-3xl font-extrabold tracking-tight sm:text-5xl bg-clip-text text-transparent bg-gradient-to-br from-foreground via-foreground/90 to-muted-foreground pb-1">
|
| 34 |
+
Try the Neural Gateway CLI
|
| 35 |
+
</h2>
|
| 36 |
+
<p className="max-w-2xl mx-auto text-base text-muted-foreground font-mono">
|
| 37 |
+
Run diagnostics, benchmark models, and simulate intelligent routing — all from the terminal.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
</p>
|
| 39 |
</div>
|
| 40 |
+
<HubLiveTerminal />
|
| 41 |
+
</section>
|
| 42 |
+
|
| 43 |
+
{/* Trust Metrics */}
|
| 44 |
+
<section className="relative z-10 w-full px-4 md:px-6">
|
| 45 |
+
<HubPulseMetrics />
|
| 46 |
+
</section>
|
| 47 |
+
|
| 48 |
+
{/* Core Features - Interactive Journey Map */}
|
| 49 |
+
<FeatureJourneyMap />
|
| 50 |
+
<ComparisonTable />
|
| 51 |
+
|
| 52 |
+
{/* Global Routing Mesh Map Section */}
|
| 53 |
+
<section className="relative z-10 w-full max-w-7xl mx-auto px-4 md:px-6 py-24 overflow-hidden">
|
| 54 |
+
<div className="font-mono max-w-[min(100vw,1600px)] mx-auto relative overflow-hidden md:rounded-md flex flex-col md:block px-6 pt-12 md:pt-16">
|
| 55 |
+
<div className="w-full max-w-[1600px] space-y-1.5 mx-auto mt-1 mb-12">
|
| 56 |
+
|
| 57 |
+
{/* Mobile View */}
|
| 58 |
+
<div className="flex flex-col min-[961px]:hidden">
|
| 59 |
+
<header className="flex flex-col items-start font-mono text-sm uppercase gap-2 mb-6">
|
| 60 |
+
<p className="text-foreground font-mono my-0 whitespace-nowrap">
|
| 61 |
+
Neural Gateway Mesh{" "}
|
| 62 |
+
<span className="block font-mono text-muted-foreground">
|
| 63 |
+
[Live Network Status]
|
| 64 |
+
</span>
|
| 65 |
+
</p>
|
| 66 |
+
</header>
|
| 67 |
+
|
| 68 |
+
<section className="pb-6 w-full">
|
| 69 |
+
<div className="flex flex-col gap-y-6">
|
| 70 |
+
<TotalRequests />
|
| 71 |
+
<TopCountries />
|
| 72 |
+
</div>
|
| 73 |
+
<RegionCount />
|
| 74 |
+
</section>
|
| 75 |
+
|
| 76 |
+
<div className="w-full flex justify-center pointer-events-none">
|
| 77 |
+
<MapContainer />
|
| 78 |
+
</div>
|
| 79 |
+
</div>
|
| 80 |
+
|
| 81 |
+
{/* Desktop View */}
|
| 82 |
+
<div className="relative hidden min-[961px]:flex flex-row max-lg:items-end lg:items-center lg:justify-between">
|
| 83 |
+
<header className="flex flex-col items-start font-mono text-sm xl:text-base uppercase gap-2 max-lg:mb-8 mb-auto">
|
| 84 |
+
<p className="text-foreground font-mono my-0 whitespace-nowrap">
|
| 85 |
+
Neural Gateway Mesh{" "}
|
| 86 |
+
<span className="block font-mono text-muted-foreground">
|
| 87 |
+
[Live Network Status]
|
| 88 |
+
</span>
|
| 89 |
+
</p>
|
| 90 |
+
</header>
|
| 91 |
+
|
| 92 |
+
<section className="lg:absolute lg:bottom-0 pb-6 w-fit z-10 relative">
|
| 93 |
+
<div className="flex flex-col gap-y-8">
|
| 94 |
+
<TotalRequests />
|
| 95 |
+
<TopCountries />
|
| 96 |
+
</div>
|
| 97 |
+
<RegionCount />
|
| 98 |
+
</section>
|
| 99 |
+
|
| 100 |
+
<div className="w-full h-full pointer-events-none max-lg:scale-[1.5] max-lg:-translate-y-16 max-lg:translate-x-[-20%]">
|
| 101 |
+
<MapContainer />
|
| 102 |
+
</div>
|
| 103 |
+
</div>
|
| 104 |
+
|
| 105 |
+
{/* Stats Grid */}
|
| 106 |
+
<section className="mt-8">
|
| 107 |
+
<StatsGrid />
|
| 108 |
+
</section>
|
| 109 |
+
|
| 110 |
+
</div>
|
| 111 |
</div>
|
| 112 |
+
</section>
|
| 113 |
+
|
| 114 |
+
<FAQAccordion />
|
| 115 |
+
<LLMProviderIconCloud />
|
| 116 |
+
</main>
|
| 117 |
);
|
| 118 |
}
|
| 119 |
+
|
audit-scanner.mjs
ADDED
|
@@ -0,0 +1,326 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import http from 'http';
|
| 2 |
+
|
| 3 |
+
// Helper to fetch HTML content from the local server
|
| 4 |
+
function fetchHtml(url) {
|
| 5 |
+
return new Promise((resolve, reject) => {
|
| 6 |
+
http.get(url, (res) => {
|
| 7 |
+
const { statusCode } = res;
|
| 8 |
+
if (statusCode !== 200) {
|
| 9 |
+
reject(new Error(`Failed to fetch page. Status Code: ${statusCode}`));
|
| 10 |
+
return;
|
| 11 |
+
}
|
| 12 |
+
res.setEncoding('utf8');
|
| 13 |
+
let rawData = '';
|
| 14 |
+
res.on('data', (chunk) => { rawData += chunk; });
|
| 15 |
+
res.on('end', () => {
|
| 16 |
+
resolve(rawData);
|
| 17 |
+
});
|
| 18 |
+
}).on('error', (e) => {
|
| 19 |
+
reject(new Error(`Error fetching URL: ${e.message}`));
|
| 20 |
+
});
|
| 21 |
+
});
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
// Custom parser to extract tags, attributes, and text
|
| 25 |
+
function parseHtml(html) {
|
| 26 |
+
const tags = [];
|
| 27 |
+
const tagRegExp = /<([a-z0-9-]+)(?:\s+([^>]*))?>/gi;
|
| 28 |
+
const attrRegExp = /([a-z0-9-]+)(?:=(?:"([^"]*)"|'([^']*)'|([^>\s]+)))?/gi;
|
| 29 |
+
|
| 30 |
+
let match;
|
| 31 |
+
while ((match = tagRegExp.exec(html)) !== null) {
|
| 32 |
+
const tagName = match[1].toLowerCase();
|
| 33 |
+
const attrString = match[2] || '';
|
| 34 |
+
const attrs = {};
|
| 35 |
+
|
| 36 |
+
let attrMatch;
|
| 37 |
+
while ((attrMatch = attrRegExp.exec(attrString)) !== null) {
|
| 38 |
+
const attrName = attrMatch[1].toLowerCase();
|
| 39 |
+
const attrValue = attrMatch[2] || attrMatch[3] || attrMatch[4] || '';
|
| 40 |
+
attrs[attrName] = attrValue;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
// Attempt to extract text content after this tag until next tag
|
| 44 |
+
const startIndex = match.index + match[0].length;
|
| 45 |
+
const nextTagIndex = html.indexOf('<', startIndex);
|
| 46 |
+
const textContent = nextTagIndex > startIndex ? html.slice(startIndex, nextTagIndex).trim() : '';
|
| 47 |
+
|
| 48 |
+
tags.push({
|
| 49 |
+
name: tagName,
|
| 50 |
+
attrs,
|
| 51 |
+
text: textContent,
|
| 52 |
+
outerHtml: match[0],
|
| 53 |
+
index: match.index
|
| 54 |
+
});
|
| 55 |
+
}
|
| 56 |
+
return tags;
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
async function runAudit() {
|
| 60 |
+
const url = process.env.AUDIT_URL || 'http://localhost:3001';
|
| 61 |
+
console.log(`\n======================================================`);
|
| 62 |
+
console.log(`🔍 HUBAPI AUTOMATED STATIC CODE & ACCESSIBILITY AUDIT`);
|
| 63 |
+
console.log(`======================================================`);
|
| 64 |
+
console.log(`📡 Connecting to local server: ${url}...`);
|
| 65 |
+
|
| 66 |
+
let html;
|
| 67 |
+
try {
|
| 68 |
+
html = await fetchHtml(url);
|
| 69 |
+
console.log(`✅ Connection established successfully. Pages HTML loaded (${html.length} bytes).`);
|
| 70 |
+
} catch (error) {
|
| 71 |
+
console.error(`❌ Connection failed: ${error.message}`);
|
| 72 |
+
console.log(`💡 Ensure Next.js dev server is running on http://localhost:3000`);
|
| 73 |
+
process.exit(1);
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
const tags = parseHtml(html);
|
| 77 |
+
|
| 78 |
+
let passed = 0;
|
| 79 |
+
let failed = 0;
|
| 80 |
+
const warnings = [];
|
| 81 |
+
const successes = [];
|
| 82 |
+
|
| 83 |
+
// 1. HTML lang attribute
|
| 84 |
+
const htmlTag = tags.find(t => t.name === 'html');
|
| 85 |
+
if (htmlTag && htmlTag.attrs.lang) {
|
| 86 |
+
successes.push(`SEO/a11y: <html> tag specifies valid lang attribute ("${htmlTag.attrs.lang}")`);
|
| 87 |
+
passed++;
|
| 88 |
+
} else {
|
| 89 |
+
warnings.push(`a11y: <html> tag does not specify a "lang" attribute (critical for screen readers).`);
|
| 90 |
+
failed++;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
// 2. Page Title
|
| 94 |
+
const titleTag = tags.find(t => t.name === 'title');
|
| 95 |
+
if (titleTag && titleTag.text) {
|
| 96 |
+
successes.push(`SEO: Title tag found: "${titleTag.text}"`);
|
| 97 |
+
passed++;
|
| 98 |
+
} else {
|
| 99 |
+
warnings.push(`SEO: Page <title> tag is missing or empty.`);
|
| 100 |
+
failed++;
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
// 3. Viewport Meta
|
| 104 |
+
const metaTags = tags.filter(t => t.name === 'meta');
|
| 105 |
+
const viewportMeta = metaTags.find(t => t.attrs.name === 'viewport');
|
| 106 |
+
if (viewportMeta) {
|
| 107 |
+
successes.push(`SEO: Viewport meta tag found for responsive layouts.`);
|
| 108 |
+
passed++;
|
| 109 |
+
} else {
|
| 110 |
+
warnings.push(`SEO: Responsive meta viewport tag is missing.`);
|
| 111 |
+
failed++;
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
// 4. Meta Description
|
| 115 |
+
const descMeta = metaTags.find(t => t.attrs.name === 'description');
|
| 116 |
+
if (descMeta && descMeta.attrs.content) {
|
| 117 |
+
successes.push(`SEO: Meta description found: "${descMeta.attrs.content}"`);
|
| 118 |
+
passed++;
|
| 119 |
+
} else {
|
| 120 |
+
warnings.push(`SEO: Meta description is missing (important for search previews).`);
|
| 121 |
+
failed++;
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
// 5. Semantic Landmarks
|
| 125 |
+
const mainTag = tags.find(t => t.name === 'main');
|
| 126 |
+
const headerTag = tags.find(t => t.name === 'header');
|
| 127 |
+
const footerTag = tags.find(t => t.name === 'footer');
|
| 128 |
+
const navTag = tags.find(t => t.name === 'nav');
|
| 129 |
+
|
| 130 |
+
if (mainTag) { successes.push(`Semantics: <main> landmark tag is correctly implemented.`); passed++; }
|
| 131 |
+
else { warnings.push(`Semantics: Missing <main> landmark tag.`); failed++; }
|
| 132 |
+
|
| 133 |
+
if (headerTag) { successes.push(`Semantics: <header> landmark tag is correctly implemented.`); passed++; }
|
| 134 |
+
else { warnings.push(`Semantics: Missing <header> landmark tag.`); failed++; }
|
| 135 |
+
|
| 136 |
+
if (footerTag) { successes.push(`Semantics: <footer> landmark tag is correctly implemented.`); passed++; }
|
| 137 |
+
else { warnings.push(`Semantics: Missing <footer> landmark tag.`); failed++; }
|
| 138 |
+
|
| 139 |
+
if (navTag) { successes.push(`Semantics: <nav> navigation landmark tag is correctly implemented.`); passed++; }
|
| 140 |
+
else { warnings.push(`Semantics: No <nav> tag found. Navigation links should be wrapped in <nav>.`); failed++; }
|
| 141 |
+
|
| 142 |
+
// 6. Heading Hierarchy
|
| 143 |
+
const headings = tags.filter(t => ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(t.name));
|
| 144 |
+
const h1Count = headings.filter(h => h.name === 'h1').length;
|
| 145 |
+
if (h1Count === 1) {
|
| 146 |
+
successes.push(`SEO/Semantics: Found exactly 1 <h1> tag.`);
|
| 147 |
+
passed++;
|
| 148 |
+
} else if (h1Count > 1) {
|
| 149 |
+
warnings.push(`SEO: Multiple <h1> tags found (${h1Count}). Standard practice recommends a single primary heading.`);
|
| 150 |
+
failed++;
|
| 151 |
+
} else {
|
| 152 |
+
warnings.push(`SEO: No <h1> tag found on the page.`);
|
| 153 |
+
failed++;
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
// Check for skip levels (e.g. H1 followed by H3)
|
| 157 |
+
let prevLevel = 0;
|
| 158 |
+
let skippedHeading = false;
|
| 159 |
+
for (const h of headings) {
|
| 160 |
+
const currentLevel = parseInt(h.name[1]);
|
| 161 |
+
if (prevLevel > 0 && currentLevel - prevLevel > 1) {
|
| 162 |
+
warnings.push(`Semantics: Heading hierarchy skip: H${prevLevel} to H${currentLevel} ("${h.text || h.outerHtml}")`);
|
| 163 |
+
skippedHeading = true;
|
| 164 |
+
}
|
| 165 |
+
prevLevel = currentLevel;
|
| 166 |
+
}
|
| 167 |
+
if (!skippedHeading && headings.length > 0) {
|
| 168 |
+
successes.push(`Semantics: Heading hierarchy levels are correctly ordered.`);
|
| 169 |
+
passed++;
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
// 7. Accessibility - Images alt
|
| 173 |
+
const images = tags.filter(t => t.name === 'img');
|
| 174 |
+
let missingAlt = 0;
|
| 175 |
+
images.forEach(img => {
|
| 176 |
+
if (img.attrs.alt === undefined) {
|
| 177 |
+
missingAlt++;
|
| 178 |
+
}
|
| 179 |
+
});
|
| 180 |
+
if (missingAlt === 0) {
|
| 181 |
+
successes.push(`a11y: All <img> tags (${images.length}) specify an alt attribute.`);
|
| 182 |
+
passed++;
|
| 183 |
+
} else {
|
| 184 |
+
warnings.push(`a11y: ${missingAlt} <img> tag(s) missing alt attribute(s).`);
|
| 185 |
+
failed++;
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
// 8. Accessibility - Button labels
|
| 189 |
+
const buttonRegex = /<button\s*([^>]*?)>([\s\S]*?)<\/button>/gi;
|
| 190 |
+
let unlabelledButtons = 0;
|
| 191 |
+
const failingButtonsList = [];
|
| 192 |
+
let btnMatch;
|
| 193 |
+
let totalButtonsCount = 0;
|
| 194 |
+
|
| 195 |
+
while ((btnMatch = buttonRegex.exec(html)) !== null) {
|
| 196 |
+
totalButtonsCount++;
|
| 197 |
+
const attrString = btnMatch[1];
|
| 198 |
+
const innerHtml = btnMatch[2];
|
| 199 |
+
|
| 200 |
+
// Parse attributes
|
| 201 |
+
const attrs = {};
|
| 202 |
+
const attrRegExp = /([a-z0-9-]+)(?:=(?:"([^"]*)"|'([^']*)'|([^>\s]+)))?/gi;
|
| 203 |
+
let attrM;
|
| 204 |
+
while ((attrM = attrRegExp.exec(attrString)) !== null) {
|
| 205 |
+
attrs[attrM[1].toLowerCase()] = attrM[2] || attrM[3] || attrM[4] || '';
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
// Strip HTML tags from innerHtml to get text
|
| 209 |
+
const textContent = innerHtml.replace(/<[^>]*>/g, '').trim();
|
| 210 |
+
const hasLabel = attrs['aria-label'] || attrs['aria-labelledby'] || attrs.title || textContent;
|
| 211 |
+
|
| 212 |
+
if (!hasLabel) {
|
| 213 |
+
unlabelledButtons++;
|
| 214 |
+
failingButtonsList.push(btnMatch[0].slice(0, 150) + '...');
|
| 215 |
+
}
|
| 216 |
+
}
|
| 217 |
+
|
| 218 |
+
if (unlabelledButtons === 0) {
|
| 219 |
+
successes.push(`a11y: All <button> elements (${totalButtonsCount}) are fully accessible/labeled.`);
|
| 220 |
+
passed++;
|
| 221 |
+
} else {
|
| 222 |
+
warnings.push(`a11y: ${unlabelledButtons} of ${totalButtonsCount} <button> element(s) missing descriptive text, title, or aria-label: \n ${failingButtonsList.join('\n ')}`);
|
| 223 |
+
failed++;
|
| 224 |
+
}
|
| 225 |
+
|
| 226 |
+
// 9. Accessibility - Interactive element focus & keyboard readiness
|
| 227 |
+
const linkRegex = /<a\s*([^>]*?)>([\s\S]*?)<\/a>/gi;
|
| 228 |
+
let emptyLinks = 0;
|
| 229 |
+
const failingLinksList = [];
|
| 230 |
+
let linkMatch;
|
| 231 |
+
let totalLinksCount = 0;
|
| 232 |
+
|
| 233 |
+
while ((linkMatch = linkRegex.exec(html)) !== null) {
|
| 234 |
+
totalLinksCount++;
|
| 235 |
+
const attrString = linkMatch[1];
|
| 236 |
+
const innerHtml = linkMatch[2];
|
| 237 |
+
|
| 238 |
+
// Parse attributes
|
| 239 |
+
const attrs = {};
|
| 240 |
+
const attrRegExp = /([a-z0-9-]+)(?:=(?:"([^"]*)"|'([^']*)'|([^>\s]+)))?/gi;
|
| 241 |
+
let attrM;
|
| 242 |
+
while ((attrM = attrRegExp.exec(attrString)) !== null) {
|
| 243 |
+
attrs[attrM[1].toLowerCase()] = attrM[2] || attrM[3] || attrM[4] || '';
|
| 244 |
+
}
|
| 245 |
+
|
| 246 |
+
// Strip HTML tags from innerHtml to get text
|
| 247 |
+
const textContent = innerHtml.replace(/<[^>]*>/g, '').trim();
|
| 248 |
+
const hasText = textContent || attrs['aria-label'] || attrs.title;
|
| 249 |
+
|
| 250 |
+
if (!hasText) {
|
| 251 |
+
emptyLinks++;
|
| 252 |
+
failingLinksList.push(linkMatch[0].slice(0, 150) + '...');
|
| 253 |
+
}
|
| 254 |
+
}
|
| 255 |
+
|
| 256 |
+
if (emptyLinks === 0) {
|
| 257 |
+
successes.push(`a11y: All <a> anchor links (${totalLinksCount}) contain inner content or ARIA descriptors.`);
|
| 258 |
+
passed++;
|
| 259 |
+
} else {
|
| 260 |
+
warnings.push(`a11y: ${emptyLinks} of ${totalLinksCount} anchor link(s) are empty or missing accessible labels: \n ${failingLinksList.slice(0, 10).join('\n ')}${failingLinksList.length > 10 ? `\n ...and ${failingLinksList.length - 10} more` : ''}`);
|
| 261 |
+
failed++;
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
// 10. Forms and Labels
|
| 265 |
+
const inputs = tags.filter(t => t.name === 'input');
|
| 266 |
+
let missingInputLabel = 0;
|
| 267 |
+
inputs.forEach(input => {
|
| 268 |
+
if (input.attrs.type === 'hidden') return;
|
| 269 |
+
const hasLabel = input.attrs.id && tags.some(t => t.name === 'label' && t.attrs.for === input.attrs.id);
|
| 270 |
+
const hasAria = input.attrs['aria-label'] || input.attrs['aria-labelledby'] || input.attrs.placeholder;
|
| 271 |
+
if (!hasLabel && !hasAria) {
|
| 272 |
+
missingInputLabel++;
|
| 273 |
+
}
|
| 274 |
+
});
|
| 275 |
+
if (missingInputLabel === 0) {
|
| 276 |
+
successes.push(`a11y: All input fields specify accessible labels, aria-labels, or context placeholders.`);
|
| 277 |
+
passed++;
|
| 278 |
+
} else {
|
| 279 |
+
warnings.push(`a11y: ${missingInputLabel} input field(s) have no linked <label> or ARIA description.`);
|
| 280 |
+
failed++;
|
| 281 |
+
}
|
| 282 |
+
|
| 283 |
+
// 11. Unique IDs
|
| 284 |
+
const idCounts = {};
|
| 285 |
+
tags.forEach(t => {
|
| 286 |
+
if (t.attrs.id) {
|
| 287 |
+
idCounts[t.attrs.id] = (idCounts[t.attrs.id] || 0) + 1;
|
| 288 |
+
}
|
| 289 |
+
});
|
| 290 |
+
const duplicateIds = Object.keys(idCounts).filter(id => idCounts[id] > 1);
|
| 291 |
+
if (duplicateIds.length === 0) {
|
| 292 |
+
successes.push(`HTML: Standard unique ID compliance passed. Zero duplicate element IDs found.`);
|
| 293 |
+
passed++;
|
| 294 |
+
} else {
|
| 295 |
+
warnings.push(`HTML: Duplicate IDs found: ${duplicateIds.join(', ')}`);
|
| 296 |
+
failed++;
|
| 297 |
+
}
|
| 298 |
+
|
| 299 |
+
// Calculate scores
|
| 300 |
+
const total = passed + failed;
|
| 301 |
+
const score = Math.round((passed / total) * 100);
|
| 302 |
+
|
| 303 |
+
console.log(`\n======================================================`);
|
| 304 |
+
console.log(`📊 AUDIT METRICS & SUMMARY`);
|
| 305 |
+
console.log(`======================================================`);
|
| 306 |
+
console.log(`⭐ Overall Score: ${score}/100`);
|
| 307 |
+
console.log(`✅ Passed Checks: ${passed}`);
|
| 308 |
+
console.log(`⚠️ Warnings/Fixes needed: ${failed}`);
|
| 309 |
+
console.log(`------------------------------------------------------`);
|
| 310 |
+
|
| 311 |
+
if (successes.length > 0) {
|
| 312 |
+
console.log(`\n🟢 SUCCESSES:`);
|
| 313 |
+
successes.forEach(s => console.log(` ✔️ ${s}`));
|
| 314 |
+
}
|
| 315 |
+
|
| 316 |
+
if (warnings.length > 0) {
|
| 317 |
+
console.log(`\n🟡 CRITICAL OBSERVATIONS / IMPROVEMENTS:`);
|
| 318 |
+
warnings.forEach(w => console.log(` ⚠️ ${w}`));
|
| 319 |
+
} else {
|
| 320 |
+
console.log(`\n🎉 PERFECT CODE COMPLIANCE! No accessibility, SEO, or structural flaws detected.`);
|
| 321 |
+
}
|
| 322 |
+
|
| 323 |
+
console.log(`\n======================================================\n`);
|
| 324 |
+
}
|
| 325 |
+
|
| 326 |
+
runAudit();
|
components.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"$schema": "https://ui.shadcn.com/schema.json",
|
| 3 |
+
"style": "radix-nova",
|
| 4 |
+
"rsc": true,
|
| 5 |
+
"tsx": true,
|
| 6 |
+
"tailwind": {
|
| 7 |
+
"config": "",
|
| 8 |
+
"css": "app/globals.css",
|
| 9 |
+
"baseColor": "neutral",
|
| 10 |
+
"cssVariables": true,
|
| 11 |
+
"prefix": ""
|
| 12 |
+
},
|
| 13 |
+
"iconLibrary": "lucide",
|
| 14 |
+
"rtl": false,
|
| 15 |
+
"aliases": {
|
| 16 |
+
"components": "@/components",
|
| 17 |
+
"utils": "@/lib/utils",
|
| 18 |
+
"ui": "@/components/ui",
|
| 19 |
+
"lib": "@/lib",
|
| 20 |
+
"hooks":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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
import { useEffect, useRef } from "react";
|
| 4 |
+
|
| 5 |
+
interface Particle {
|
| 6 |
+
x: number;
|
| 7 |
+
y: number;
|
| 8 |
+
vx: number;
|
| 9 |
+
vy: number;
|
| 10 |
+
radius: number;
|
| 11 |
+
baseAlpha: number;
|
| 12 |
+
pulseOffset: number;
|
| 13 |
+
type: "node" | "relay" | "hub";
|
| 14 |
+
color: string;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
interface Spark {
|
| 18 |
+
x: number;
|
| 19 |
+
y: number;
|
| 20 |
+
vx: number;
|
| 21 |
+
vy: number;
|
| 22 |
+
radius: number;
|
| 23 |
+
color: string;
|
| 24 |
+
alpha: number;
|
| 25 |
+
decay: number;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
interface Shockwave {
|
| 29 |
+
x: number;
|
| 30 |
+
y: number;
|
| 31 |
+
radius: number;
|
| 32 |
+
maxRadius: number;
|
| 33 |
+
speed: number;
|
| 34 |
+
active: boolean;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
// HUBAPI Theme Design System consistent colors (Hex: #FFBE7B, #FE8FB5, #A07EFB)
|
| 38 |
+
const COLOR_AMBER = "255, 190, 123"; // #FFBE7B (Amber / Gold)
|
| 39 |
+
const COLOR_ROSE = "254, 143, 181"; // #FE8FB5 (Rose / Pink)
|
| 40 |
+
const COLOR_PURPLE = "160, 126, 251"; // #A07EFB (Purple / Violet)
|
| 41 |
+
const COLOR_CYAN = "34, 211, 238"; // #22D3EE (Cyan Plasma)
|
| 42 |
+
const COLOR_BLUE = "59, 130, 246"; // #3B82F6 (Blue Glow)
|
| 43 |
+
const COLOR_WHITE = "242, 237, 230";
|
| 44 |
+
|
| 45 |
+
interface AgentParticleCanvasProps {
|
| 46 |
+
className?: string;
|
| 47 |
+
mouseX?: number;
|
| 48 |
+
mouseY?: number;
|
| 49 |
+
isHovered?: boolean;
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
export function AgentParticleCanvas({
|
| 53 |
+
className,
|
| 54 |
+
mouseX = 0,
|
| 55 |
+
mouseY = 0,
|
| 56 |
+
isHovered = false,
|
| 57 |
+
}: AgentParticleCanvasProps) {
|
| 58 |
+
const canvasRef = useRef<HTMLCanvasElement>(null);
|
| 59 |
+
|
| 60 |
+
// High-performance refs to pass real-time interaction states into canvas loop without recreation
|
| 61 |
+
const mouseRef = useRef({ x: mouseX, y: mouseY });
|
| 62 |
+
const hoverRef = useRef(isHovered);
|
| 63 |
+
const triggerShockwaveRef = useRef(false);
|
| 64 |
+
const prevHoveredRef = useRef(isHovered);
|
| 65 |
+
|
| 66 |
+
// Sync refs instantly with fresh prop changes
|
| 67 |
+
useEffect(() => {
|
| 68 |
+
mouseRef.current = { x: mouseX, y: mouseY };
|
| 69 |
+
if (isHovered && !prevHoveredRef.current) {
|
| 70 |
+
triggerShockwaveRef.current = true;
|
| 71 |
+
}
|
| 72 |
+
hoverRef.current = isHovered;
|
| 73 |
+
prevHoveredRef.current = isHovered;
|
| 74 |
+
}, [mouseX, mouseY, isHovered]);
|
| 75 |
+
|
| 76 |
+
useEffect(() => {
|
| 77 |
+
const canvas = canvasRef.current;
|
| 78 |
+
if (!canvas) return;
|
| 79 |
+
const ctx = canvas.getContext("2d");
|
| 80 |
+
if (!ctx) return;
|
| 81 |
+
|
| 82 |
+
let animId: number;
|
| 83 |
+
let W = 0, H = 0;
|
| 84 |
+
let particles: Particle[] = [];
|
| 85 |
+
let sparks: Spark[] = [];
|
| 86 |
+
let shockwaves: Shockwave[] = [];
|
| 87 |
+
|
| 88 |
+
const resize = () => {
|
| 89 |
+
W = canvas.offsetWidth;
|
| 90 |
+
H = canvas.offsetHeight;
|
| 91 |
+
canvas.width = W * window.devicePixelRatio;
|
| 92 |
+
canvas.height = H * window.devicePixelRatio;
|
| 93 |
+
ctx.scale(window.devicePixelRatio, window.devicePixelRatio);
|
| 94 |
+
init();
|
| 95 |
+
};
|
| 96 |
+
|
| 97 |
+
const init = () => {
|
| 98 |
+
const COUNT = Math.max(40, Math.floor((W * H) / 4500));
|
| 99 |
+
particles = Array.from({ length: COUNT }, () => {
|
| 100 |
+
const roll = Math.random();
|
| 101 |
+
const type: Particle["type"] = roll < 0.08 ? "hub" : roll < 0.28 ? "relay" : "node";
|
| 102 |
+
|
| 103 |
+
let color = COLOR_AMBER;
|
| 104 |
+
if (type === "hub") {
|
| 105 |
+
color = COLOR_AMBER;
|
| 106 |
+
} else if (type === "relay") {
|
| 107 |
+
color = COLOR_ROSE;
|
| 108 |
+
} else {
|
| 109 |
+
const colorRoll = Math.random();
|
| 110 |
+
if (colorRoll < 0.45) {
|
| 111 |
+
color = COLOR_AMBER;
|
| 112 |
+
} else if (colorRoll < 0.75) {
|
| 113 |
+
color = COLOR_PURPLE;
|
| 114 |
+
} else {
|
| 115 |
+
color = COLOR_ROSE;
|
| 116 |
+
}
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
return {
|
| 120 |
+
x: Math.random() * W,
|
| 121 |
+
y: Math.random() * H,
|
| 122 |
+
vx: (Math.random() - 0.5) * (type === "hub" ? 0.15 : 0.4),
|
| 123 |
+
vy: (Math.random() - 0.5) * (type === "hub" ? 0.15 : 0.4),
|
| 124 |
+
radius: type === "hub" ? 5 : type === "relay" ? 3.5 : 2.2,
|
| 125 |
+
baseAlpha: type === "hub" ? 0.9 : type === "relay" ? 0.75 : 0.5 + Math.random() * 0.3,
|
| 126 |
+
pulseOffset: Math.random() * Math.PI * 2,
|
| 127 |
+
type,
|
| 128 |
+
color,
|
| 129 |
+
};
|
| 130 |
+
});
|
| 131 |
+
sparks = [];
|
| 132 |
+
shockwaves = [];
|
| 133 |
+
};
|
| 134 |
+
|
| 135 |
+
let t = 0;
|
| 136 |
+
let sparkSpawnTimer = 0;
|
| 137 |
+
|
| 138 |
+
const draw = () => {
|
| 139 |
+
ctx.clearRect(0, 0, W, H);
|
| 140 |
+
t += 0.014;
|
| 141 |
+
|
| 142 |
+
// 1. Calculate dynamic robot center in pixels
|
| 143 |
+
const isDesktop = W >= 768; // Matching CSS responsive breakpoint
|
| 144 |
+
let rx = W * 0.5;
|
| 145 |
+
let ry = H * 0.5;
|
| 146 |
+
|
| 147 |
+
if (isDesktop) {
|
| 148 |
+
// Center of right side interactive grid area
|
| 149 |
+
rx = W * 0.5;
|
| 150 |
+
ry = H * 0.5;
|
| 151 |
+
// Parallax offset
|
| 152 |
+
rx += mouseRef.current.x * 60;
|
| 153 |
+
ry += mouseRef.current.y * 60;
|
| 154 |
+
} else {
|
| 155 |
+
// Centered on mobile
|
| 156 |
+
rx = W * 0.5;
|
| 157 |
+
ry = H * 0.4;
|
| 158 |
+
// Float offset to match robot's animation in CSS
|
| 159 |
+
ry += Math.sin(t * 1.5) * 12;
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
// 2. Spawn thruster sparks periodically (Option 2)
|
| 163 |
+
sparkSpawnTimer++;
|
| 164 |
+
if (sparkSpawnTimer % 4 === 0) {
|
| 165 |
+
// Spawns sparks directly below left and right hip thruster nozzle positions
|
| 166 |
+
const thrusterY = ry + 80;
|
| 167 |
+
const leftThrusterX = rx - 35;
|
| 168 |
+
const rightThrusterX = rx + 35;
|
| 169 |
+
|
| 170 |
+
// Left Nozzle Spark
|
| 171 |
+
sparks.push({
|
| 172 |
+
x: leftThrusterX + (Math.random() - 0.5) * 6,
|
| 173 |
+
y: thrusterY,
|
| 174 |
+
vx: (Math.random() - 0.5) * 1.4,
|
| 175 |
+
vy: 2 + Math.random() * 2,
|
| 176 |
+
radius: 1.5 + Math.random() * 1.5,
|
| 177 |
+
color: Math.random() > 0.5 ? COLOR_CYAN : COLOR_BLUE,
|
| 178 |
+
alpha: 0.9,
|
| 179 |
+
decay: 0.02 + Math.random() * 0.015,
|
| 180 |
+
});
|
| 181 |
+
|
| 182 |
+
// Right Nozzle Spark
|
| 183 |
+
sparks.push({
|
| 184 |
+
x: rightThrusterX + (Math.random() - 0.5) * 6,
|
| 185 |
+
y: thrusterY,
|
| 186 |
+
vx: (Math.random() - 0.5) * 1.4,
|
| 187 |
+
vy: 2 + Math.random() * 2,
|
| 188 |
+
radius: 1.5 + Math.random() * 1.5,
|
| 189 |
+
color: Math.random() > 0.5 ? COLOR_CYAN : COLOR_BLUE,
|
| 190 |
+
alpha: 0.9,
|
| 191 |
+
decay: 0.02 + Math.random() * 0.015,
|
| 192 |
+
});
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
// 3. Handle shockwaves trigger (Option 3)
|
| 196 |
+
if (triggerShockwaveRef.current) {
|
| 197 |
+
shockwaves.push({
|
| 198 |
+
x: rx,
|
| 199 |
+
y: ry,
|
| 200 |
+
radius: 0,
|
| 201 |
+
maxRadius: Math.max(W, H) * 0.9,
|
| 202 |
+
speed: 6.5,
|
| 203 |
+
active: true,
|
| 204 |
+
});
|
| 205 |
+
triggerShockwaveRef.current = false;
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
// 4. Draw & update expanding shockwaves
|
| 209 |
+
for (const sw of shockwaves) {
|
| 210 |
+
if (!sw.active) continue;
|
| 211 |
+
sw.radius += sw.speed;
|
| 212 |
+
if (sw.radius > sw.maxRadius) {
|
| 213 |
+
sw.active = false;
|
| 214 |
+
continue;
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
ctx.beginPath();
|
| 218 |
+
ctx.arc(sw.x, sw.y, sw.radius, 0, Math.PI * 2);
|
| 219 |
+
ctx.strokeStyle = `rgba(${COLOR_AMBER}, ${0.12 * (1 - sw.radius / sw.maxRadius)})`;
|
| 220 |
+
ctx.lineWidth = 1.8;
|
| 221 |
+
ctx.stroke();
|
| 222 |
+
}
|
| 223 |
+
shockwaves = shockwaves.filter(sw => sw.active);
|
| 224 |
+
|
| 225 |
+
// 5. Draw & update thruster sparks
|
| 226 |
+
for (const s of sparks) {
|
| 227 |
+
s.x += s.vx;
|
| 228 |
+
s.y += s.vy;
|
| 229 |
+
s.alpha -= s.decay;
|
| 230 |
+
|
| 231 |
+
ctx.beginPath();
|
| 232 |
+
ctx.arc(s.x, s.y, s.radius, 0, Math.PI * 2);
|
| 233 |
+
ctx.fillStyle = `rgba(${s.color}, ${s.alpha})`;
|
| 234 |
+
ctx.fill();
|
| 235 |
+
}
|
| 236 |
+
sparks = sparks.filter(s => s.alpha > 0);
|
| 237 |
+
|
| 238 |
+
/* ── EDGES ── */
|
| 239 |
+
for (let i = 0; i < particles.length; i++) {
|
| 240 |
+
for (let j = i + 1; j < particles.length; j++) {
|
| 241 |
+
const a = particles[i];
|
| 242 |
+
const b = particles[j];
|
| 243 |
+
const dx = a.x - b.x;
|
| 244 |
+
const dy = a.y - b.y;
|
| 245 |
+
const dist = Math.sqrt(dx * dx + dy * dy);
|
| 246 |
+
const MAX = a.type === "hub" || b.type === "hub" ? 200 : 130;
|
| 247 |
+
|
| 248 |
+
if (dist < MAX) {
|
| 249 |
+
const t01 = 1 - dist / MAX;
|
| 250 |
+
const isHot = a.type !== "node" || b.type !== "node";
|
| 251 |
+
let alpha = isHot ? t01 * 0.45 : t01 * 0.18;
|
| 252 |
+
|
| 253 |
+
// Edges match the design system color of the nodes
|
| 254 |
+
const edgeColor = isHot
|
| 255 |
+
? (a.type === "hub" || b.type === "hub" ? COLOR_AMBER : COLOR_ROSE)
|
| 256 |
+
: a.color;
|
| 257 |
+
|
| 258 |
+
// Highlight connections close to shockwave
|
| 259 |
+
for (const sw of shockwaves) {
|
| 260 |
+
if (sw.active) {
|
| 261 |
+
const distA = Math.sqrt((a.x - sw.x)**2 + (a.y - sw.y)**2);
|
| 262 |
+
if (Math.abs(distA - sw.radius) < 40) {
|
| 263 |
+
alpha *= 2.2;
|
| 264 |
+
}
|
| 265 |
+
}
|
| 266 |
+
}
|
| 267 |
+
|
| 268 |
+
ctx.beginPath();
|
| 269 |
+
ctx.moveTo(a.x, a.y);
|
| 270 |
+
ctx.lineTo(b.x, b.y);
|
| 271 |
+
ctx.strokeStyle = `rgba(${edgeColor}, ${Math.min(alpha, 0.9)})`;
|
| 272 |
+
ctx.lineWidth = isHot ? 0.8 : 0.4;
|
| 273 |
+
ctx.stroke();
|
| 274 |
+
|
| 275 |
+
/* travelling data-dot on hot edges */
|
| 276 |
+
if (isHot && dist < MAX * 0.8) {
|
| 277 |
+
const phase = ((t * 0.5 + i * 0.37 + j * 0.19) % 1);
|
| 278 |
+
const px = a.x + (b.x - a.x) * phase;
|
| 279 |
+
const py = a.y + (b.y - a.y) * phase;
|
| 280 |
+
ctx.beginPath();
|
| 281 |
+
ctx.arc(px, py, 1.8, 0, Math.PI * 2);
|
| 282 |
+
ctx.fillStyle = `rgba(${edgeColor}, 0.85)`;
|
| 283 |
+
ctx.fill();
|
| 284 |
+
}
|
| 285 |
+
}
|
| 286 |
+
}
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
/* ── NODES ── */
|
| 290 |
+
for (const p of particles) {
|
| 291 |
+
// move + wrap
|
| 292 |
+
p.x += p.vx; if (p.x < -10) p.x = W + 10; if (p.x > W + 10) p.x = -10;
|
| 293 |
+
p.y += p.vy; if (p.y < -10) p.y = H + 10; if (p.y > H + 10) p.y = -10;
|
| 294 |
+
|
| 295 |
+
// Apply repulsion force from robot chassis position (Option 1)
|
| 296 |
+
const dxRobot = p.x - rx;
|
| 297 |
+
const dyRobot = p.y - ry;
|
| 298 |
+
const distRobot = Math.sqrt(dxRobot * dxRobot + dyRobot * dyRobot);
|
| 299 |
+
|
| 300 |
+
if (distRobot < 190) {
|
| 301 |
+
const force = (190 - distRobot) / 190;
|
| 302 |
+
// Pushes away gently (repulsion shield)
|
| 303 |
+
p.x += (dxRobot / distRobot) * force * 1.8;
|
| 304 |
+
p.y += (dyRobot / distRobot) * force * 1.8;
|
| 305 |
+
|
| 306 |
+
// Slight orbital rotational drag to wrap the grid nodes around robot boundaries smoothly
|
| 307 |
+
p.x += (-dyRobot / distRobot) * force * 0.7;
|
| 308 |
+
p.y += (dxRobot / distRobot) * force * 0.7;
|
| 309 |
+
}
|
| 310 |
+
|
| 311 |
+
const pulse = 0.75 + 0.25 * Math.sin(t * 1.6 + p.pulseOffset);
|
| 312 |
+
let r = p.radius * pulse;
|
| 313 |
+
let alpha = p.baseAlpha * pulse;
|
| 314 |
+
|
| 315 |
+
// Shockwave react (Option 3): Nodes glow and expand as shockwave sweeps through
|
| 316 |
+
for (const sw of shockwaves) {
|
| 317 |
+
if (sw.active) {
|
| 318 |
+
const distSW = Math.sqrt((p.x - sw.x)**2 + (p.y - sw.y)**2);
|
| 319 |
+
if (Math.abs(distSW - sw.radius) < 30) {
|
| 320 |
+
const proximity = 1 - Math.abs(distSW - sw.radius) / 30;
|
| 321 |
+
alpha = Math.min(alpha + proximity * 0.65, 1.0);
|
| 322 |
+
r = r * (1 + proximity * 0.4);
|
| 323 |
+
}
|
| 324 |
+
}
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
if (p.type === "hub") {
|
| 328 |
+
/* outer glow ring */
|
| 329 |
+
const grd = ctx.createRadialGradient(p.x, p.y, r, p.x, p.y, r + 15);
|
| 330 |
+
grd.addColorStop(0, `rgba(${COLOR_AMBER}, 0.3)`);
|
| 331 |
+
grd.addColorStop(1, `rgba(${COLOR_AMBER}, 0)`);
|
| 332 |
+
ctx.beginPath();
|
| 333 |
+
ctx.arc(p.x, p.y, r + 15, 0, Math.PI * 2);
|
| 334 |
+
ctx.fillStyle = grd;
|
| 335 |
+
ctx.fill();
|
| 336 |
+
|
| 337 |
+
/* ring stroke */
|
| 338 |
+
ctx.beginPath();
|
| 339 |
+
ctx.arc(p.x, p.y, r + 6, 0, Math.PI * 2);
|
| 340 |
+
ctx.strokeStyle = `rgba(${COLOR_AMBER}, ${alpha * 0.4})`;
|
| 341 |
+
ctx.lineWidth = 0.8;
|
| 342 |
+
ctx.stroke();
|
| 343 |
+
|
| 344 |
+
/* core */
|
| 345 |
+
ctx.beginPath();
|
| 346 |
+
ctx.arc(p.x, p.y, r, 0, Math.PI * 2);
|
| 347 |
+
ctx.fillStyle = `rgba(${COLOR_WHITE}, ${alpha})`;
|
| 348 |
+
ctx.fill();
|
| 349 |
+
|
| 350 |
+
} else if (p.type === "relay") {
|
| 351 |
+
/* outer ring */
|
| 352 |
+
ctx.beginPath();
|
| 353 |
+
ctx.arc(p.x, p.y, r + 4, 0, Math.PI * 2);
|
| 354 |
+
ctx.strokeStyle = `rgba(${COLOR_ROSE}, ${alpha * 0.4})`;
|
| 355 |
+
ctx.lineWidth = 0.8;
|
| 356 |
+
ctx.stroke();
|
| 357 |
+
|
| 358 |
+
/* core */
|
| 359 |
+
ctx.beginPath();
|
| 360 |
+
ctx.arc(p.x, p.y, r, 0, Math.PI * 2);
|
| 361 |
+
ctx.fillStyle = `rgba(${COLOR_ROSE}, ${alpha})`;
|
| 362 |
+
ctx.fill();
|
| 363 |
+
|
| 364 |
+
} else {
|
| 365 |
+
/* plain node — colored using design system colors */
|
| 366 |
+
ctx.beginPath();
|
| 367 |
+
ctx.arc(p.x, p.y, r, 0, Math.PI * 2);
|
| 368 |
+
ctx.fillStyle = `rgba(${p.color}, ${alpha})`;
|
| 369 |
+
ctx.fill();
|
| 370 |
+
}
|
| 371 |
+
}
|
| 372 |
+
|
| 373 |
+
animId = requestAnimationFrame(draw);
|
| 374 |
+
};
|
| 375 |
+
|
| 376 |
+
resize();
|
| 377 |
+
draw();
|
| 378 |
+
|
| 379 |
+
const ro = new ResizeObserver(resize);
|
| 380 |
+
ro.observe(canvas);
|
| 381 |
+
return () => {
|
| 382 |
+
cancelAnimationFrame(animId);
|
| 383 |
+
ro.disconnect();
|
| 384 |
+
};
|
| 385 |
+
}, []);
|
| 386 |
+
|
| 387 |
+
return (
|
| 388 |
+
<canvas
|
| 389 |
+
ref={canvasRef}
|
| 390 |
+
className={className}
|
| 391 |
+
style={{ display: "block", width: "100%", height: "100%" }}
|
| 392 |
+
/>
|
| 393 |
+
);
|
| 394 |
+
}
|
components/CyberTicketModal.tsx
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
import React, { useState, useEffect, useMemo } from "react";
|
| 4 |
+
import { motion, AnimatePresence } from "framer-motion";
|
| 5 |
+
import { X, Copy, Check, Shield, Cpu, Activity } from "lucide-react";
|
| 6 |
+
|
| 7 |
+
interface CyberTicketModalProps {
|
| 8 |
+
isOpen: boolean;
|
| 9 |
+
onClose: () => void;
|
| 10 |
+
email: string;
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
export function CyberTicketModal({ isOpen, onClose, email }: CyberTicketModalProps) {
|
| 14 |
+
const [copied, setCopied] = useState(false);
|
| 15 |
+
|
| 16 |
+
// Card tilt states for the 3D Holographic effect
|
| 17 |
+
const [rotateX, setRotateX] = useState(0);
|
| 18 |
+
const [rotateY, setRotateY] = useState(0);
|
| 19 |
+
const [glareX, setGlareX] = useState(50);
|
| 20 |
+
const [glareY, setGlareY] = useState(50);
|
| 21 |
+
|
| 22 |
+
// Generate a reproducible/stable ticket number purely based on email
|
| 23 |
+
const ticketNumber = useMemo(() => {
|
| 24 |
+
if (!email) return "";
|
| 25 |
+
let hash = 0;
|
| 26 |
+
for (let i = 0; i < email.length; i++) {
|
| 27 |
+
hash = email.charCodeAt(i) + ((hash << 5) - hash);
|
| 28 |
+
}
|
| 29 |
+
const number = Math.abs(hash % 90000) + 10000; // Generate a 5-digit number
|
| 30 |
+
return `00${number}`.slice(-6).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
| 31 |
+
}, [email]);
|
| 32 |
+
|
| 33 |
+
useEffect(() => {
|
| 34 |
+
if (isOpen) {
|
| 35 |
+
// Simple futuristic terminal beep on render
|
| 36 |
+
try {
|
| 37 |
+
const audioCtx = new (window.AudioContext || (window as unknown as { webkitAudioContext: typeof AudioContext }).webkitAudioContext)();
|
| 38 |
+
// Beep 1
|
| 39 |
+
const osc1 = audioCtx.createOscillator();
|
| 40 |
+
const gain1 = audioCtx.createGain();
|
| 41 |
+
osc1.type = "sine";
|
| 42 |
+
osc1.frequency.setValueAtTime(880, audioCtx.currentTime); // A5 note
|
| 43 |
+
gain1.gain.setValueAtTime(0.04, audioCtx.currentTime);
|
| 44 |
+
gain1.gain.exponentialRampToValueAtTime(0.0001, audioCtx.currentTime + 0.15);
|
| 45 |
+
osc1.connect(gain1);
|
| 46 |
+
gain1.connect(audioCtx.destination);
|
| 47 |
+
osc1.start();
|
| 48 |
+
osc1.stop(audioCtx.currentTime + 0.15);
|
| 49 |
+
|
| 50 |
+
// Beep 2 (quick delay)
|
| 51 |
+
setTimeout(() => {
|
| 52 |
+
const osc2 = audioCtx.createOscillator();
|
| 53 |
+
const gain2 = audioCtx.createGain();
|
| 54 |
+
osc2.type = "sine";
|
| 55 |
+
osc2.frequency.setValueAtTime(1320, audioCtx.currentTime); // E6 note
|
| 56 |
+
gain2.gain.setValueAtTime(0.03, audioCtx.currentTime);
|
| 57 |
+
gain2.gain.exponentialRampToValueAtTime(0.0001, audioCtx.currentTime + 0.25);
|
| 58 |
+
osc2.connect(gain2);
|
| 59 |
+
gain2.connect(audioCtx.destination);
|
| 60 |
+
osc2.start();
|
| 61 |
+
osc2.stop(audioCtx.currentTime + 0.25);
|
| 62 |
+
}, 80);
|
| 63 |
+
} catch {
|
| 64 |
+
// AudioContext blocked or not supported
|
| 65 |
+
}
|
| 66 |
+
}
|
| 67 |
+
}, [isOpen, email]);
|
| 68 |
+
|
| 69 |
+
const handleMouseMove = (e: React.MouseEvent<HTMLDivElement>) => {
|
| 70 |
+
const card = e.currentTarget;
|
| 71 |
+
const rect = card.getBoundingClientRect();
|
| 72 |
+
const x = e.clientX - rect.left;
|
| 73 |
+
const y = e.clientY - rect.top;
|
| 74 |
+
const px = x / rect.width;
|
| 75 |
+
const py = y / rect.height;
|
| 76 |
+
|
| 77 |
+
// Tilt calculations (-15 to 15 degrees)
|
| 78 |
+
const rx = (py - 0.5) * -22;
|
| 79 |
+
const ry = (px - 0.5) * 22;
|
| 80 |
+
|
| 81 |
+
setRotateX(rx);
|
| 82 |
+
setRotateY(ry);
|
| 83 |
+
setGlareX(px * 100);
|
| 84 |
+
setGlareY(py * 100);
|
| 85 |
+
};
|
| 86 |
+
|
| 87 |
+
const handleMouseLeave = () => {
|
| 88 |
+
setRotateX(0);
|
| 89 |
+
setRotateY(0);
|
| 90 |
+
setGlareX(50);
|
| 91 |
+
setGlareY(50);
|
| 92 |
+
};
|
| 93 |
+
|
| 94 |
+
const handleCopyCode = () => {
|
| 95 |
+
const accessCode = `HUBAPI-ACC-${ticketNumber.replace(",", "")}-${email.split("@")[0].toUpperCase()}`;
|
| 96 |
+
navigator.clipboard.writeText(accessCode);
|
| 97 |
+
setCopied(true);
|
| 98 |
+
setTimeout(() => setCopied(false), 2000);
|
| 99 |
+
};
|
| 100 |
+
|
| 101 |
+
const shareText = `I just secured early access to @HUBAPI — the Neural API Gateway & AI Automation Mesh! 🚀\n\nClaimed Ticket: #${ticketNumber}\n\nJoin the pre-launch waitlist here:`;
|
| 102 |
+
const shareUrl = "https://hubapi.dev"; // Pre-launch URL
|
| 103 |
+
const xShareLink = `https://twitter.com/intent/tweet?text=${encodeURIComponent(shareText)}&url=${encodeURIComponent(shareUrl)}`;
|
| 104 |
+
|
| 105 |
+
// Mask email for aesthetics, e.g. u***r@domain.com
|
| 106 |
+
const getMaskedEmail = () => {
|
| 107 |
+
const parts = email.split("@");
|
| 108 |
+
if (parts.length !== 2) return email;
|
| 109 |
+
const name = parts[0];
|
| 110 |
+
const domain = parts[1];
|
| 111 |
+
if (name.length <= 2) return `${name}***@${domain}`;
|
| 112 |
+
return `${name.charAt(0)}***${name.charAt(name.length - 1)}@${domain}`;
|
| 113 |
+
};
|
| 114 |
+
|
| 115 |
+
return (
|
| 116 |
+
<AnimatePresence>
|
| 117 |
+
{isOpen && (
|
| 118 |
+
<div className="fixed inset-0 z-50 flex items-center justify-center p-4">
|
| 119 |
+
{/* Backdrop Blur */}
|
| 120 |
+
<motion.div
|
| 121 |
+
initial={{ opacity: 0 }}
|
| 122 |
+
animate={{ opacity: 1 }}
|
| 123 |
+
exit={{ opacity: 0 }}
|
| 124 |
+
onClick={onClose}
|
| 125 |
+
className="absolute inset-0 bg-black/80 backdrop-blur-md cursor-pointer"
|
| 126 |
+
aria-hidden="true"
|
| 127 |
+
/>
|
| 128 |
+
|
| 129 |
+
{/* Modal Container */}
|
| 130 |
+
<motion.div
|
| 131 |
+
initial={{ opacity: 0, scale: 0.9, y: 20 }}
|
| 132 |
+
animate={{ opacity: 1, scale: 1, y: 0 }}
|
| 133 |
+
exit={{ opacity: 0, scale: 0.9, y: 20 }}
|
| 134 |
+
transition={{ type: "spring", damping: 25, stiffness: 200 }}
|
| 135 |
+
className="relative w-full max-w-lg bg-black/90 border border-primary/20 p-6 md:p-8 rounded-lg shadow-[0_0_50px_rgba(255,170,64,0.1)] z-10 overflow-hidden font-mono"
|
| 136 |
+
role="dialog"
|
| 137 |
+
aria-labelledby="ticket-modal-title"
|
| 138 |
+
>
|
| 139 |
+
{/* Ambient Background Glow */}
|
| 140 |
+
<div className="absolute -top-32 -left-32 w-64 h-64 bg-primary/10 rounded-full blur-3xl pointer-events-none" />
|
| 141 |
+
<div className="absolute -bottom-32 -right-32 w-64 h-64 bg-indigo-500/10 rounded-full blur-3xl pointer-events-none" />
|
| 142 |
+
|
| 143 |
+
{/* Corner Bracket Borders */}
|
| 144 |
+
<div className="absolute top-0 left-0 w-8 h-8 border-t-2 border-l-2 border-primary/30" />
|
| 145 |
+
<div className="absolute top-0 right-0 w-8 h-8 border-t-2 border-r-2 border-primary/30" />
|
| 146 |
+
<div className="absolute bottom-0 left-0 w-8 h-8 border-b-2 border-l-2 border-primary/30" />
|
| 147 |
+
<div className="absolute bottom-0 right-0 w-8 h-8 border-b-2 border-r-2 border-primary/30" />
|
| 148 |
+
|
| 149 |
+
{/* Header */}
|
| 150 |
+
<div className="flex justify-between items-center mb-6">
|
| 151 |
+
<span id="ticket-modal-title" className="text-xs text-amber-400 tracking-widest uppercase flex items-center gap-2">
|
| 152 |
+
<span className="w-1.5 h-1.5 bg-amber-400 rounded-full animate-ping" />
|
| 153 |
+
Waitlist // Registration Successful
|
| 154 |
+
</span>
|
| 155 |
+
<button
|
| 156 |
+
onClick={onClose}
|
| 157 |
+
className="text-zinc-400 hover:text-white transition-colors p-1 bg-white/5 border border-white/10 rounded-none cursor-pointer focus:outline-none focus:ring-1 focus:ring-amber-500"
|
| 158 |
+
aria-label="Close modal"
|
| 159 |
+
>
|
| 160 |
+
<X className="w-4 h-4" />
|
| 161 |
+
</button>
|
| 162 |
+
</div>
|
| 163 |
+
|
| 164 |
+
<div className="text-center space-y-2 mb-8">
|
| 165 |
+
<h2 className="text-xl md:text-2xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-amber-400 via-zinc-100 to-indigo-400">
|
| 166 |
+
ACCESS PASS SECURED
|
| 167 |
+
</h2>
|
| 168 |
+
<p className="text-xs text-zinc-400 max-w-sm mx-auto">
|
| 169 |
+
Your neural gateway access signature is active. Share your ticket on social channels to get prioritized early beta invites.
|
| 170 |
+
</p>
|
| 171 |
+
</div>
|
| 172 |
+
|
| 173 |
+
{/* 3D Holographic Card Box */}
|
| 174 |
+
<div className="flex justify-center py-4 mb-6" style={{ perspective: "1000px" }}>
|
| 175 |
+
<motion.div
|
| 176 |
+
onMouseMove={handleMouseMove}
|
| 177 |
+
onMouseLeave={handleMouseLeave}
|
| 178 |
+
animate={{
|
| 179 |
+
rotateX,
|
| 180 |
+
rotateY,
|
| 181 |
+
}}
|
| 182 |
+
transition={{ type: "tween", ease: "easeOut", duration: 0.15 }}
|
| 183 |
+
className="relative w-full max-w-[340px] h-[210px] rounded-xl border border-white/20 bg-gradient-to-br from-zinc-900/90 via-black to-zinc-950/90 shadow-2xl cursor-grab active:cursor-grabbing select-none overflow-hidden [transform-style:preserve-3d]"
|
| 184 |
+
>
|
| 185 |
+
{/* Holographic Glare Shifting Effect */}
|
| 186 |
+
<div
|
| 187 |
+
className="absolute inset-0 pointer-events-none mix-blend-color-dodge transition-opacity duration-300 opacity-60"
|
| 188 |
+
style={{
|
| 189 |
+
background: `radial-gradient(circle at ${glareX}% ${glareY}%, rgba(255, 180, 100, 0.25) 0%, rgba(130, 80, 250, 0.1) 45%, transparent 70%), linear-gradient(${135 + (glareX - 50) * 0.4}deg, transparent ${glareX - 20}%, rgba(255, 255, 255, 0.05) ${glareX - 5}%, rgba(255, 255, 255, 0.15) ${glareX}%, rgba(255, 255, 255, 0.05) ${glareX + 5}%, transparent ${glareX + 20}%)`,
|
| 190 |
+
}}
|
| 191 |
+
/>
|
| 192 |
+
|
| 193 |
+
{/* Subtle Grid Pattern Overlay */}
|
| 194 |
+
<div className="absolute inset-0 pointer-events-none opacity-20 bg-[linear-gradient(rgba(255,255,255,0.05)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.05)_1px,transparent_1px)] bg-[size:10px_10px]" />
|
| 195 |
+
|
| 196 |
+
{/* Cyber Card Inner HUD Data */}
|
| 197 |
+
<div className="absolute inset-0 p-4 flex flex-col justify-between [transform:translateZ(30px)]">
|
| 198 |
+
{/* Top Row: Brand & Security Badge */}
|
| 199 |
+
<div className="flex justify-between items-start">
|
| 200 |
+
<div className="space-y-0.5">
|
| 201 |
+
<span className="text-[14px] font-bold tracking-widest text-amber-400 flex items-center gap-1.5">
|
| 202 |
+
<Cpu className="w-3.5 h-3.5 text-amber-400" />
|
| 203 |
+
HUBAPI
|
| 204 |
+
</span>
|
| 205 |
+
<span className="text-[6px] text-white/40 tracking-widest block uppercase">NEURAL GATEWAY MESH ACCESS</span>
|
| 206 |
+
</div>
|
| 207 |
+
<div className="flex items-center gap-1 bg-amber-500/10 border border-amber-500/20 px-2 py-0.5 text-[8px] text-amber-400">
|
| 208 |
+
<Shield className="w-2.5 h-2.5" />
|
| 209 |
+
<span>SECURE // LINK</span>
|
| 210 |
+
</div>
|
| 211 |
+
</div>
|
| 212 |
+
|
| 213 |
+
{/* Middle Area: Ticket Number */}
|
| 214 |
+
<div className="space-y-1">
|
| 215 |
+
<span className="text-[8px] text-zinc-500 uppercase tracking-widest block">Access Pass Identification</span>
|
| 216 |
+
<div className="text-[28px] font-extrabold tracking-widest text-white font-mono tabular-nums leading-none flex items-baseline">
|
| 217 |
+
<span className="text-amber-500/40 text-[16px] mr-1">#</span>
|
| 218 |
+
{ticketNumber}
|
| 219 |
+
</div>
|
| 220 |
+
</div>
|
| 221 |
+
|
| 222 |
+
{/* Bottom Area: Barcode & Email Signature */}
|
| 223 |
+
<div className="flex justify-between items-end">
|
| 224 |
+
<div className="space-y-1 text-left">
|
| 225 |
+
<div className="text-[8px] text-zinc-500 uppercase tracking-wider block">Authorized Signatory</div>
|
| 226 |
+
<div className="text-[9px] text-amber-400 font-semibold font-mono tracking-tight max-w-[170px] truncate">
|
| 227 |
+
{getMaskedEmail()}
|
| 228 |
+
</div>
|
| 229 |
+
<div className="text-[6px] text-white/30">ISSUED_AT // {new Date().toISOString().substring(0, 10)}</div>
|
| 230 |
+
</div>
|
| 231 |
+
|
| 232 |
+
{/* Highly authentic responsive Barcode */}
|
| 233 |
+
<div className="flex flex-col items-center gap-0.5 opacity-80 shrink-0">
|
| 234 |
+
<div className="flex items-end h-8 gap-[1px]">
|
| 235 |
+
{[2, 1, 3, 1, 2, 4, 1, 2, 1, 3, 2, 1, 4, 1, 2, 3, 1].map((weight, idx) => (
|
| 236 |
+
<div
|
| 237 |
+
key={idx}
|
| 238 |
+
style={{ width: `${weight}px` }}
|
| 239 |
+
className="h-full bg-white/90"
|
| 240 |
+
/>
|
| 241 |
+
))}
|
| 242 |
+
</div>
|
| 243 |
+
<span className="text-[5px] text-white/30 tracking-wider">HUBAPI_{ticketNumber.replace(",", "")}</span>
|
| 244 |
+
</div>
|
| 245 |
+
</div>
|
| 246 |
+
</div>
|
| 247 |
+
|
| 248 |
+
{/* Subdued Diagonal Glowing Edge Strip */}
|
| 249 |
+
<div className="absolute top-0 right-0 w-[40px] h-[3px] bg-gradient-to-r from-amber-400 to-indigo-500 blur-[1px]" />
|
| 250 |
+
<div className="absolute bottom-0 left-0 w-[40px] h-[3px] bg-gradient-to-r from-indigo-500 to-amber-400 blur-[1px]" />
|
| 251 |
+
</motion.div>
|
| 252 |
+
</div>
|
| 253 |
+
|
| 254 |
+
{/* Action Buttons */}
|
| 255 |
+
<div className="flex flex-col sm:flex-row gap-3">
|
| 256 |
+
<a
|
| 257 |
+
href={xShareLink}
|
| 258 |
+
target="_blank"
|
| 259 |
+
rel="noopener noreferrer"
|
| 260 |
+
className="flex-1 flex items-center justify-center gap-2 h-12 bg-white text-black hover:bg-white/90 transition-colors uppercase font-bold text-xs tracking-wider cursor-pointer border-none [clip-path:polygon(8px_0,100%_0,100%_calc(100%_-_8px),calc(100%_-_8px)_100%,0_100%,0_8px)]"
|
| 261 |
+
>
|
| 262 |
+
<svg className="w-4 h-4 fill-current" viewBox="0 0 24 24" aria-hidden="true">
|
| 263 |
+
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" />
|
| 264 |
+
</svg>
|
| 265 |
+
<span>Share Ticket on X</span>
|
| 266 |
+
</a>
|
| 267 |
+
|
| 268 |
+
<button
|
| 269 |
+
onClick={handleCopyCode}
|
| 270 |
+
className="flex-1 flex items-center justify-center gap-2 h-12 bg-transparent text-amber-400 hover:bg-amber-500/10 border border-amber-500/50 transition-colors uppercase font-bold text-xs tracking-wider cursor-pointer [clip-path:polygon(8px_0,100%_0,100%_calc(100%_-_8px),calc(100%_-_8px)_100%,0_100%,0_8px)]"
|
| 271 |
+
>
|
| 272 |
+
{copied ? (
|
| 273 |
+
<>
|
| 274 |
+
<Check className="w-4 h-4 text-emerald-500" />
|
| 275 |
+
<span className="text-emerald-500">Access Key Copied</span>
|
| 276 |
+
</>
|
| 277 |
+
) : (
|
| 278 |
+
<>
|
| 279 |
+
<Copy className="w-4 h-4" />
|
| 280 |
+
<span>Copy Access Code</span>
|
| 281 |
+
</>
|
| 282 |
+
)}
|
| 283 |
+
</button>
|
| 284 |
+
</div>
|
| 285 |
+
|
| 286 |
+
<div className="mt-6 flex items-center justify-center gap-2 text-[9px] text-white/35 text-center select-none">
|
| 287 |
+
<Activity className="w-3.5 h-3.5 text-amber-500/40" />
|
| 288 |
+
<span>SYS_ENCRYPT // ACC_TOKEN SHA256 VALIDATED BY HUBAPI GATEWAYS</span>
|
| 289 |
+
</div>
|
| 290 |
+
</motion.div>
|
| 291 |
+
</div>
|
| 292 |
+
)}
|
| 293 |
+
</AnimatePresence>
|
| 294 |
+
);
|
| 295 |
+
}
|
components/DottedMap.tsx
ADDED
|
@@ -0,0 +1,338 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
import { useMemo, memo, useState } from "react";
|
| 4 |
+
import { motion, AnimatePresence } from "framer-motion";
|
| 5 |
+
import { geoMercator } from "d3-geo";
|
| 6 |
+
import dottedMapData from "../data/dotted-map-data.json";
|
| 7 |
+
import { regionMarkers, topCountries, countryRequests } from "../data/country-data";
|
| 8 |
+
|
| 9 |
+
const countryColors: Record<string, string> = {
|
| 10 |
+
US: "#1e40af",
|
| 11 |
+
DE: "#FFCE00",
|
| 12 |
+
GB: "#2563eb",
|
| 13 |
+
IN: "#f59e0b",
|
| 14 |
+
BR: "#FF0000",
|
| 15 |
+
SG: "#f59e0b",
|
| 16 |
+
JP: "#dc143c",
|
| 17 |
+
FR: "#1d4ed8",
|
| 18 |
+
CA: "#b91c1c",
|
| 19 |
+
SE: "#2563eb",
|
| 20 |
+
AU: "#3b82f6",
|
| 21 |
+
KR: "#3b82f6",
|
| 22 |
+
NL: "#ea580c",
|
| 23 |
+
CN: "#991b1b",
|
| 24 |
+
RU: "#FF0000",
|
| 25 |
+
MX: "#15803d",
|
| 26 |
+
ES: "#b91c1c",
|
| 27 |
+
IT: "#15803d",
|
| 28 |
+
PL: "#dc2626",
|
| 29 |
+
TR: "#b91c1c",
|
| 30 |
+
ID: "#1e40af",
|
| 31 |
+
TH: "#15803d",
|
| 32 |
+
VN: "#991b1b",
|
| 33 |
+
PH: "#15803d",
|
| 34 |
+
EG: "#1e40af",
|
| 35 |
+
NG: "#2563eb",
|
| 36 |
+
PK: "#FFCE00",
|
| 37 |
+
BD: "#991b1b",
|
| 38 |
+
AR: "#f59e0b",
|
| 39 |
+
CO: "#FF0000",
|
| 40 |
+
ZA: "#15803d",
|
| 41 |
+
SA: "#FFCE00",
|
| 42 |
+
MY: "#991b1b",
|
| 43 |
+
CL: "#991b1b",
|
| 44 |
+
PE: "#1e40af",
|
| 45 |
+
AE: "#f59e0b",
|
| 46 |
+
};
|
| 47 |
+
|
| 48 |
+
const getCountryColor = (iso2: string): string => {
|
| 49 |
+
return countryColors[iso2] || "#666666";
|
| 50 |
+
};
|
| 51 |
+
|
| 52 |
+
const top10Countries = new Set(
|
| 53 |
+
topCountries.slice(0, 10).map((c) => c.code)
|
| 54 |
+
);
|
| 55 |
+
|
| 56 |
+
const getDotsToShow = (iso2: string): number => {
|
| 57 |
+
const data = countryRequests[iso2];
|
| 58 |
+
if (!data) return 2;
|
| 59 |
+
|
| 60 |
+
const rate = (data.value / 260000) * 1000;
|
| 61 |
+
|
| 62 |
+
if (rate < 400) return 2;
|
| 63 |
+
if (rate < 1000) return 4;
|
| 64 |
+
if (rate < 5000) return 8;
|
| 65 |
+
if (rate < 10000) return 15;
|
| 66 |
+
if (rate < 50000) return 25;
|
| 67 |
+
return 35;
|
| 68 |
+
};
|
| 69 |
+
|
| 70 |
+
const StaticPixel = memo(({ x, y }: { x: number; y: number }) => (
|
| 71 |
+
<rect x={x} y={y} width={3} height={3} fill="var(--ds-gray-400)" fillOpacity={0.5} />
|
| 72 |
+
));
|
| 73 |
+
StaticPixel.displayName = "StaticPixel";
|
| 74 |
+
|
| 75 |
+
const AnimatedPixel = memo(
|
| 76 |
+
({
|
| 77 |
+
x,
|
| 78 |
+
y,
|
| 79 |
+
color,
|
| 80 |
+
canPulse,
|
| 81 |
+
cityDistanceRank,
|
| 82 |
+
}: {
|
| 83 |
+
x: number;
|
| 84 |
+
y: number;
|
| 85 |
+
color: string;
|
| 86 |
+
canPulse: boolean;
|
| 87 |
+
cityDistanceRank: number;
|
| 88 |
+
}) => {
|
| 89 |
+
const delay = useMemo(() => cityDistanceRank * 0.1, [cityDistanceRank]);
|
| 90 |
+
|
| 91 |
+
const animate = canPulse
|
| 92 |
+
? {
|
| 93 |
+
scale: [1, 1.8, 1],
|
| 94 |
+
opacity: [0.8, 1, 0.8],
|
| 95 |
+
}
|
| 96 |
+
: { scale: 1, opacity: 1 };
|
| 97 |
+
|
| 98 |
+
const transition = canPulse
|
| 99 |
+
? {
|
| 100 |
+
opacity: {
|
| 101 |
+
duration: 1,
|
| 102 |
+
repeat: Infinity,
|
| 103 |
+
ease: "easeInOut" as const,
|
| 104 |
+
delay,
|
| 105 |
+
repeatDelay: delay,
|
| 106 |
+
},
|
| 107 |
+
scale: {
|
| 108 |
+
duration: 1.5,
|
| 109 |
+
repeat: Infinity,
|
| 110 |
+
ease: "easeInOut" as const,
|
| 111 |
+
delay,
|
| 112 |
+
repeatDelay: delay,
|
| 113 |
+
},
|
| 114 |
+
}
|
| 115 |
+
: { type: "spring" as const, stiffness: 260, damping: 20 };
|
| 116 |
+
|
| 117 |
+
return (
|
| 118 |
+
<motion.rect
|
| 119 |
+
x={x}
|
| 120 |
+
y={y}
|
| 121 |
+
width={3}
|
| 122 |
+
height={3}
|
| 123 |
+
fill={color}
|
| 124 |
+
initial={{ scale: 0, opacity: 0 }}
|
| 125 |
+
animate={animate}
|
| 126 |
+
transition={transition}
|
| 127 |
+
style={{
|
| 128 |
+
willChange: canPulse && cityDistanceRank < 10 ? "transform, opacity" : undefined,
|
| 129 |
+
}}
|
| 130 |
+
/>
|
| 131 |
+
);
|
| 132 |
+
}
|
| 133 |
+
);
|
| 134 |
+
AnimatedPixel.displayName = "AnimatedPixel";
|
| 135 |
+
|
| 136 |
+
// Memoized group rendering components to prevent React virtual DOM diffing overhead for 2,000+ nodes on state updates
|
| 137 |
+
const StaticPixelsGroup = memo(({ pixels }: { pixels: Array<{ key: string; x: number; y: number }> }) => (
|
| 138 |
+
<g>
|
| 139 |
+
{pixels.map((p) => (
|
| 140 |
+
<StaticPixel key={p.key} x={p.x} y={p.y} />
|
| 141 |
+
))}
|
| 142 |
+
</g>
|
| 143 |
+
));
|
| 144 |
+
StaticPixelsGroup.displayName = "StaticPixelsGroup";
|
| 145 |
+
|
| 146 |
+
const AnimatedPixelsGroup = memo(({ pixels }: { pixels: Array<{ key: string; x: number; y: number; color: string; canPulse: boolean; cityDistanceRank: number }> }) => (
|
| 147 |
+
<g>
|
| 148 |
+
{pixels.map((p) => (
|
| 149 |
+
<AnimatedPixel
|
| 150 |
+
key={p.key}
|
| 151 |
+
x={p.x}
|
| 152 |
+
y={p.y}
|
| 153 |
+
color={p.color}
|
| 154 |
+
canPulse={p.canPulse}
|
| 155 |
+
cityDistanceRank={p.cityDistanceRank}
|
| 156 |
+
/>
|
| 157 |
+
))}
|
| 158 |
+
</g>
|
| 159 |
+
));
|
| 160 |
+
AnimatedPixelsGroup.displayName = "AnimatedPixelsGroup";
|
| 161 |
+
|
| 162 |
+
const MapMarkers = memo(({
|
| 163 |
+
markers,
|
| 164 |
+
delays,
|
| 165 |
+
projection,
|
| 166 |
+
onHover
|
| 167 |
+
}: {
|
| 168 |
+
markers: typeof regionMarkers;
|
| 169 |
+
delays: number[];
|
| 170 |
+
projection: (coords: [number, number]) => [number, number] | null;
|
| 171 |
+
onHover: (marker: (typeof regionMarkers)[0] | null) => void;
|
| 172 |
+
}) => (
|
| 173 |
+
<g className="pointer-events-auto">
|
| 174 |
+
{markers.map((marker, index) => {
|
| 175 |
+
const coords = projection(marker.coordinates);
|
| 176 |
+
if (!coords) return null;
|
| 177 |
+
const [x, y] = coords;
|
| 178 |
+
return (
|
| 179 |
+
<g
|
| 180 |
+
key={marker.id}
|
| 181 |
+
transform={`translate(${x}, ${y})`}
|
| 182 |
+
>
|
| 183 |
+
<motion.g
|
| 184 |
+
initial={{ scale: 0, opacity: 0 }}
|
| 185 |
+
animate={{ scale: 1.5, opacity: 1 }}
|
| 186 |
+
transition={{
|
| 187 |
+
type: "spring",
|
| 188 |
+
stiffness: 260,
|
| 189 |
+
damping: 20,
|
| 190 |
+
delay: delays[index],
|
| 191 |
+
}}
|
| 192 |
+
onMouseEnter={() => onHover(marker)}
|
| 193 |
+
onMouseLeave={() => onHover(null)}
|
| 194 |
+
style={{ cursor: "pointer", pointerEvents: "auto" }}
|
| 195 |
+
>
|
| 196 |
+
<polygon
|
| 197 |
+
data-edge={marker.id}
|
| 198 |
+
data-lat={marker.coordinates[1]}
|
| 199 |
+
data-lng={marker.coordinates[0]}
|
| 200 |
+
fill="var(--ds-gray-1000)"
|
| 201 |
+
stroke="var(--background)"
|
| 202 |
+
strokeWidth={1}
|
| 203 |
+
strokeOpacity={0.5}
|
| 204 |
+
style={{ paintOrder: "stroke" }}
|
| 205 |
+
points="0,-2.3 -2,1.2 2,1.2"
|
| 206 |
+
/>
|
| 207 |
+
</motion.g>
|
| 208 |
+
</g>
|
| 209 |
+
);
|
| 210 |
+
})}
|
| 211 |
+
</g>
|
| 212 |
+
));
|
| 213 |
+
MapMarkers.displayName = "MapMarkers";
|
| 214 |
+
|
| 215 |
+
interface DottedMapProps {
|
| 216 |
+
width?: number;
|
| 217 |
+
height?: number;
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
export default function DottedMap({ width = 1000, height = 560 }: DottedMapProps) {
|
| 221 |
+
const [hoveredMarker, setHoveredMarker] = useState<(typeof regionMarkers)[0] | null>(null);
|
| 222 |
+
|
| 223 |
+
const handleMarkerHover = (marker: (typeof regionMarkers)[0] | null) => {
|
| 224 |
+
setHoveredMarker(marker);
|
| 225 |
+
};
|
| 226 |
+
|
| 227 |
+
const projection = useMemo(
|
| 228 |
+
() =>
|
| 229 |
+
geoMercator()
|
| 230 |
+
.scale(140)
|
| 231 |
+
.center([15, 25])
|
| 232 |
+
.rotate([0, 0, 0])
|
| 233 |
+
.translate([width / 2, height / 2]),
|
| 234 |
+
[width, height]
|
| 235 |
+
);
|
| 236 |
+
|
| 237 |
+
const { staticPixels, animatedPixels } = useMemo(() => {
|
| 238 |
+
const staticArr: Array<{ key: string; x: number; y: number }> = [];
|
| 239 |
+
const animatedArr: Array<{
|
| 240 |
+
key: string;
|
| 241 |
+
x: number;
|
| 242 |
+
y: number;
|
| 243 |
+
color: string;
|
| 244 |
+
canPulse: boolean;
|
| 245 |
+
cityDistanceRank: number;
|
| 246 |
+
}> = [];
|
| 247 |
+
|
| 248 |
+
Object.entries(dottedMapData as Record<string, Array<{ lon: number; lat: number; cityDistanceRank: number }>>).forEach(
|
| 249 |
+
([countryCode, cities]) => {
|
| 250 |
+
const dotsToShow = getDotsToShow(countryCode);
|
| 251 |
+
const color = getCountryColor(countryCode);
|
| 252 |
+
const isTop10 = top10Countries.has(countryCode);
|
| 253 |
+
|
| 254 |
+
cities.forEach((city) => {
|
| 255 |
+
const coords = projection([city.lon, city.lat]);
|
| 256 |
+
if (!coords) return;
|
| 257 |
+
|
| 258 |
+
const [x, y] = coords;
|
| 259 |
+
if (x < 0 || x > width || y < 0 || y > height) return;
|
| 260 |
+
|
| 261 |
+
const key = `${countryCode}-${city.cityDistanceRank}`;
|
| 262 |
+
const isAnimated = city.cityDistanceRank < dotsToShow;
|
| 263 |
+
|
| 264 |
+
if (isAnimated) {
|
| 265 |
+
animatedArr.push({
|
| 266 |
+
key,
|
| 267 |
+
x,
|
| 268 |
+
y,
|
| 269 |
+
color,
|
| 270 |
+
canPulse: isTop10 && city.cityDistanceRank < 5,
|
| 271 |
+
cityDistanceRank: city.cityDistanceRank,
|
| 272 |
+
});
|
| 273 |
+
} else {
|
| 274 |
+
staticArr.push({ key, x, y });
|
| 275 |
+
}
|
| 276 |
+
});
|
| 277 |
+
}
|
| 278 |
+
);
|
| 279 |
+
|
| 280 |
+
return { staticPixels: staticArr, animatedPixels: animatedArr };
|
| 281 |
+
}, [projection, width, height]);
|
| 282 |
+
|
| 283 |
+
const markerDelays = useMemo(
|
| 284 |
+
() => regionMarkers.map((_, i) => (i * 0.05) % 1),
|
| 285 |
+
[]
|
| 286 |
+
);
|
| 287 |
+
|
| 288 |
+
return (
|
| 289 |
+
<div className="relative w-full">
|
| 290 |
+
<svg
|
| 291 |
+
viewBox={`0 0 ${width} ${height}`}
|
| 292 |
+
className="w-full h-auto bg-transparent"
|
| 293 |
+
>
|
| 294 |
+
{/* Render static pixels inside a memoized group */}
|
| 295 |
+
<StaticPixelsGroup pixels={staticPixels} />
|
| 296 |
+
|
| 297 |
+
{/* Render animated pulsing pixels inside a memoized group */}
|
| 298 |
+
<AnimatedPixelsGroup pixels={animatedPixels} />
|
| 299 |
+
|
| 300 |
+
{/* Render interactive markers directly inside the same SVG for maximum performance (no world-atlas json network fetch!) */}
|
| 301 |
+
<MapMarkers
|
| 302 |
+
markers={regionMarkers}
|
| 303 |
+
delays={markerDelays}
|
| 304 |
+
projection={projection}
|
| 305 |
+
onHover={handleMarkerHover}
|
| 306 |
+
/>
|
| 307 |
+
</svg>
|
| 308 |
+
|
| 309 |
+
<AnimatePresence>
|
| 310 |
+
{hoveredMarker && (() => {
|
| 311 |
+
const coords = projection(hoveredMarker.coordinates);
|
| 312 |
+
if (!coords) return null;
|
| 313 |
+
return (
|
| 314 |
+
<motion.div
|
| 315 |
+
initial={{ opacity: 0, y: 5 }}
|
| 316 |
+
animate={{ opacity: 1, y: 0 }}
|
| 317 |
+
exit={{ opacity: 0, y: 5 }}
|
| 318 |
+
transition={{ duration: 0.15 }}
|
| 319 |
+
className="absolute pointer-events-none z-10 bg-[var(--ds-background-200)] border border-[var(--ds-gray-200)] rounded px-2.5 py-1.5 text-xs font-mono shadow-lg whitespace-nowrap"
|
| 320 |
+
style={{
|
| 321 |
+
left: `${(coords[0] / width) * 100}%`,
|
| 322 |
+
top: `${(coords[1] / height) * 100}%`,
|
| 323 |
+
transform: "translate(-50%, -140%)",
|
| 324 |
+
}}
|
| 325 |
+
>
|
| 326 |
+
<div className="flex items-center gap-1.5">
|
| 327 |
+
<span className="text-[var(--ds-gray-1000)]">▲</span>
|
| 328 |
+
<span className="text-[var(--ds-gray-1000)] font-medium">{hoveredMarker.id}</span>
|
| 329 |
+
<span className="text-[var(--ds-gray-500)]">·</span>
|
| 330 |
+
<span className="text-[var(--ds-gray-900)]">{hoveredMarker.name}</span>
|
| 331 |
+
</div>
|
| 332 |
+
</motion.div>
|
| 333 |
+
);
|
| 334 |
+
})()}
|
| 335 |
+
</AnimatePresence>
|
| 336 |
+
</div>
|
| 337 |
+
);
|
| 338 |
+
}
|
components/FeatureJourneyMap.tsx
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
import { useEffect, useState, useRef } from "react";
|
| 4 |
+
import { motion, useInView } from "framer-motion";
|
| 5 |
+
import { Cpu, ShieldAlert, Globe, BarChart3 } from "lucide-react";
|
| 6 |
+
import { cn } from "@/lib/utils";
|
| 7 |
+
|
| 8 |
+
// Custom Interactive Animated Metric Component
|
| 9 |
+
function AnimatedMetric({
|
| 10 |
+
value,
|
| 11 |
+
decimalPlaces = 0,
|
| 12 |
+
prefix = "",
|
| 13 |
+
suffix = "",
|
| 14 |
+
delay = 0
|
| 15 |
+
}: {
|
| 16 |
+
value: number;
|
| 17 |
+
decimalPlaces?: number;
|
| 18 |
+
prefix?: string;
|
| 19 |
+
suffix?: string;
|
| 20 |
+
delay?: number;
|
| 21 |
+
}) {
|
| 22 |
+
const [current, setCurrent] = useState(0);
|
| 23 |
+
const ref = useRef<HTMLSpanElement>(null);
|
| 24 |
+
const isInView = useInView(ref, { once: true, margin: "-80px" });
|
| 25 |
+
|
| 26 |
+
useEffect(() => {
|
| 27 |
+
if (!isInView) return;
|
| 28 |
+
|
| 29 |
+
let startTimestamp: number | null = null;
|
| 30 |
+
const duration = 1800; // Animation duration in ms
|
| 31 |
+
|
| 32 |
+
const step = (timestamp: number) => {
|
| 33 |
+
if (!startTimestamp) startTimestamp = timestamp;
|
| 34 |
+
const progress = Math.min((timestamp - startTimestamp) / duration, 1);
|
| 35 |
+
|
| 36 |
+
// Easing: easeOutQuad
|
| 37 |
+
const ease = progress * (2 - progress);
|
| 38 |
+
const currentVal = ease * value;
|
| 39 |
+
|
| 40 |
+
setCurrent(currentVal);
|
| 41 |
+
|
| 42 |
+
if (progress < 1) {
|
| 43 |
+
window.requestAnimationFrame(step);
|
| 44 |
+
}
|
| 45 |
+
};
|
| 46 |
+
|
| 47 |
+
const timer = setTimeout(() => {
|
| 48 |
+
window.requestAnimationFrame(step);
|
| 49 |
+
}, delay * 1000);
|
| 50 |
+
|
| 51 |
+
return () => clearTimeout(timer);
|
| 52 |
+
}, [isInView, value, delay]);
|
| 53 |
+
|
| 54 |
+
return (
|
| 55 |
+
<span ref={ref} className="font-bebas font-extrabold tracking-wider tabular-nums bg-clip-text text-transparent bg-gradient-to-r from-[var(--brand-gold)] via-[var(--brand-rose)] to-[var(--brand-purple)]">
|
| 56 |
+
{prefix}
|
| 57 |
+
{current.toFixed(decimalPlaces)}
|
| 58 |
+
{suffix}
|
| 59 |
+
</span>
|
| 60 |
+
);
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
// Station Data Interface
|
| 64 |
+
interface JourneyNode {
|
| 65 |
+
title: string;
|
| 66 |
+
titleEn: string;
|
| 67 |
+
icon: React.ComponentType<{ className?: string; style?: React.CSSProperties }>;
|
| 68 |
+
metric: React.ReactNode;
|
| 69 |
+
b2bDesc: string;
|
| 70 |
+
investorThesis: string;
|
| 71 |
+
accentColor: string;
|
| 72 |
+
glowClass: string;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
export function FeatureJourneyMap() {
|
| 76 |
+
const nodes: JourneyNode[] = [
|
| 77 |
+
{
|
| 78 |
+
title: "Intelligent Routing & Cost Slash",
|
| 79 |
+
titleEn: "AUTOMATED COST OPTIMIZATION",
|
| 80 |
+
icon: Cpu,
|
| 81 |
+
metric: <AnimatedMetric value={40} suffix="%" prefix="↓ " />,
|
| 82 |
+
b2bDesc: "Our intelligent gateway automatically routes every API call to the most efficient LLM based on real-time cost, latency, and quality benchmarks. Advanced semantic caching immediately reduces your overall AI bills.",
|
| 83 |
+
investorThesis: "Proprietary routing engine creates an uncopyable tech moat. Immediate 40% cost reduction guarantees high adoption and 95%+ B2B customer retention.",
|
| 84 |
+
accentColor: "var(--brand-gold)",
|
| 85 |
+
glowClass: "shadow-[var(--brand-gold)]/10 border-[var(--brand-gold)]/20 hover:border-[var(--brand-gold)]/50"
|
| 86 |
+
},
|
| 87 |
+
{
|
| 88 |
+
title: "Zero-Trust Security & Compliance",
|
| 89 |
+
titleEn: "ENTERPRISE PRIVACY SHIELD",
|
| 90 |
+
icon: ShieldAlert,
|
| 91 |
+
metric: (
|
| 92 |
+
<span className="font-bebas font-extrabold tracking-wider bg-clip-text text-transparent bg-gradient-to-r from-[var(--brand-rose)] to-[var(--brand-purple)] flex items-center gap-2">
|
| 93 |
+
🛡️ Enterprise
|
| 94 |
+
</span>
|
| 95 |
+
),
|
| 96 |
+
b2bDesc: "Instant defense against prompt injections, automated PII redaction, and strict output moderation. HUBAPI is fully GDPR and HIPAA ready, guaranteeing bulletproof enterprise-grade data privacy in production.",
|
| 97 |
+
investorThesis: "Unlocks highly lucrative Fortune 500 and government contracts. Transitioning AI from high-risk sandbox to compliant production drives exponential enterprise ARR expansion.",
|
| 98 |
+
accentColor: "var(--brand-rose)",
|
| 99 |
+
glowClass: "shadow-[var(--brand-rose)]/10 border-[var(--brand-rose)]/20 hover:border-[var(--brand-rose)]/50"
|
| 100 |
+
},
|
| 101 |
+
{
|
| 102 |
+
title: "Global Scale & High Availability",
|
| 103 |
+
titleEn: "ELASTIC NETWORK ARCHITECTURE",
|
| 104 |
+
icon: Globe,
|
| 105 |
+
metric: <AnimatedMetric value={99.99} decimalPlaces={2} suffix="%" />,
|
| 106 |
+
b2bDesc: "Geo-distributed smart load balancing across multi-cloud clusters ensures a 99.99% uptime guarantee with zero single points of failure. Engineered to seamlessly handle billions of monthly queries.",
|
| 107 |
+
investorThesis: "Highly elastic multi-tenant infrastructure. Gross margins expand rapidly under usage-based billing models while maintaining near-zero incremental operational cost.",
|
| 108 |
+
accentColor: "var(--brand-purple)",
|
| 109 |
+
glowClass: "shadow-[var(--brand-purple)]/10 border-[var(--brand-purple)]/20 hover:border-[var(--brand-purple)]/50"
|
| 110 |
+
},
|
| 111 |
+
{
|
| 112 |
+
title: "Real-Time AI Command Center",
|
| 113 |
+
titleEn: "DATA GOVERNANCE & BUSINESS INTELLIGENCE",
|
| 114 |
+
icon: BarChart3,
|
| 115 |
+
metric: (
|
| 116 |
+
<span className="font-bebas font-extrabold tracking-wider bg-clip-text text-transparent bg-gradient-to-r from-[var(--brand-gold)] to-[var(--brand-rose)] flex items-center gap-2">
|
| 117 |
+
<span className="h-2.5 w-2.5 rounded-full bg-emerald-500 animate-pulse inline-block" /> Live
|
| 118 |
+
</span>
|
| 119 |
+
),
|
| 120 |
+
b2bDesc: "Gain full visibility into your AI operations with comprehensive usage diagnostics, department-level cost tracking, and audited, C-suite ready ROI reporting that proves tangible business value.",
|
| 121 |
+
investorThesis: "Deep data network effects. As enterprise integration deepens, switching costs become insurmountable, locking in industry-leading Net Revenue Retention (NRR >130%).",
|
| 122 |
+
accentColor: "var(--brand-gold)",
|
| 123 |
+
glowClass: "shadow-[var(--brand-gold)]/10 border-[var(--brand-gold)]/20 hover:border-[var(--brand-gold)]/50"
|
| 124 |
+
}
|
| 125 |
+
];
|
| 126 |
+
|
| 127 |
+
return (
|
| 128 |
+
<section className="relative w-full max-w-7xl mx-auto py-32 px-4 overflow-hidden">
|
| 129 |
+
{/* Laser Pulse Path Animation keyframes */}
|
| 130 |
+
<style jsx global>{`
|
| 131 |
+
@keyframes pulse-travel {
|
| 132 |
+
0% {
|
| 133 |
+
top: 0%;
|
| 134 |
+
opacity: 0;
|
| 135 |
+
}
|
| 136 |
+
5% {
|
| 137 |
+
opacity: 1;
|
| 138 |
+
}
|
| 139 |
+
95% {
|
| 140 |
+
opacity: 1;
|
| 141 |
+
}
|
| 142 |
+
100% {
|
| 143 |
+
top: 100%;
|
| 144 |
+
opacity: 0;
|
| 145 |
+
}
|
| 146 |
+
}
|
| 147 |
+
.animate-pulse-travel {
|
| 148 |
+
animation: pulse-travel 12s linear infinite;
|
| 149 |
+
}
|
| 150 |
+
`}</style>
|
| 151 |
+
|
| 152 |
+
{/* Section Header */}
|
| 153 |
+
<div className="text-center space-y-6 mb-28 z-10 relative">
|
| 154 |
+
<div className="inline-flex items-center gap-2 rounded-full border border-primary/20 bg-primary/5 px-4 py-1.5 text-xs md:text-sm font-medium text-primary backdrop-blur-md shadow-lg font-mono tracking-widest uppercase">
|
| 155 |
+
<span className="w-1.5 h-1.5 rounded-full bg-primary animate-pulse shadow-[0_0_8px_var(--primary-glow)]" />
|
| 156 |
+
{"// Enterprise ROI & Investor Journey"}
|
| 157 |
+
</div>
|
| 158 |
+
<h2 className="text-4xl font-extrabold tracking-tight sm:text-6xl text-foreground leading-none">
|
| 159 |
+
Your AI Costs Are Bleeding.<br className="hidden md:inline" />
|
| 160 |
+
<span className="bg-clip-text text-transparent bg-gradient-to-r from-[var(--brand-gold)] via-[var(--brand-rose)] to-[var(--brand-purple)]">
|
| 161 |
+
We Stop It.
|
| 162 |
+
</span>
|
| 163 |
+
</h2>
|
| 164 |
+
<p className="max-w-2xl mx-auto text-base md:text-lg text-muted-foreground leading-relaxed font-mono">
|
| 165 |
+
[ One gateway. Every model. Full control. See how HUBAPI transforms AI infrastructure into a high-margin enterprise engine. ]
|
| 166 |
+
</p>
|
| 167 |
+
</div>
|
| 168 |
+
|
| 169 |
+
{/* Interactive Journey Map Container */}
|
| 170 |
+
<div className="relative w-full max-w-5xl mx-auto">
|
| 171 |
+
{/* Central Vertical Glowing Line */}
|
| 172 |
+
<div className="absolute left-[24px] md:left-1/2 top-0 bottom-0 w-[2px] -translate-x-1/2 bg-gradient-to-b from-[var(--brand-gold)] via-[var(--brand-rose)] to-[var(--brand-purple)] opacity-20" />
|
| 173 |
+
|
| 174 |
+
{/* Animated Laser Pulse (Data Packet) */}
|
| 175 |
+
<div className="absolute left-[24px] md:left-1/2 top-0 -translate-x-1/2 w-[6px] h-32 bg-gradient-to-b from-transparent via-[var(--brand-rose)] to-[var(--brand-gold)] rounded-full blur-[1px] opacity-0 animate-pulse-travel pointer-events-none">
|
| 176 |
+
<div className="absolute bottom-0 left-1/2 -translate-x-1/2 w-4 h-4 rounded-full bg-[var(--brand-gold)] shadow-[0_0_15px_var(--brand-gold),0_0_30px_var(--brand-rose)] animate-ping" />
|
| 177 |
+
</div>
|
| 178 |
+
|
| 179 |
+
{/* Journey Nodes */}
|
| 180 |
+
<div className="space-y-20 relative">
|
| 181 |
+
{nodes.map((node, index) => {
|
| 182 |
+
const IconComponent = node.icon;
|
| 183 |
+
const isEven = index % 2 === 0;
|
| 184 |
+
|
| 185 |
+
return (
|
| 186 |
+
<div
|
| 187 |
+
key={index}
|
| 188 |
+
className={cn(
|
| 189 |
+
"flex flex-col md:flex-row items-start w-full relative",
|
| 190 |
+
isEven ? "md:flex-row-reverse" : ""
|
| 191 |
+
)}
|
| 192 |
+
>
|
| 193 |
+
{/* Node Icon on Timeline */}
|
| 194 |
+
<div className="absolute left-[24px] md:left-1/2 top-4 md:top-8 -translate-x-1/2 z-20 flex h-12 w-12 items-center justify-center rounded-full border border-border bg-card shadow-xl transition-[border-color,box-shadow,transform] duration-500 hover:scale-110">
|
| 195 |
+
<div className="absolute inset-0 rounded-full opacity-0 hover:opacity-100 transition-opacity duration-300 blur-[6px]" style={{ backgroundColor: node.accentColor }} />
|
| 196 |
+
<IconComponent className="h-5 w-5 relative z-10" style={{ color: node.accentColor }} />
|
| 197 |
+
</div>
|
| 198 |
+
|
| 199 |
+
{/* Cyber-Glass Card Container */}
|
| 200 |
+
<div className="w-full md:w-[calc(50%-40px)] pl-16 md:pl-0 md:px-0">
|
| 201 |
+
<motion.div
|
| 202 |
+
initial={{ opacity: 0, x: isEven ? -40 : 40, y: 30 }}
|
| 203 |
+
whileInView={{ opacity: 1, x: 0, y: 0 }}
|
| 204 |
+
viewport={{ once: true, margin: "-100px" }}
|
| 205 |
+
transition={{ duration: 0.6, ease: "easeOut", delay: index * 0.1 }}
|
| 206 |
+
className={cn(
|
| 207 |
+
"group relative rounded-xl premium-glass-card p-6 md:p-8 transition-[border-color,box-shadow,transform] duration-500 hover:-translate-y-1 shadow-2xl corner-bracket",
|
| 208 |
+
node.glowClass
|
| 209 |
+
)}
|
| 210 |
+
>
|
| 211 |
+
<div className="corner-bracket-inner" />
|
| 212 |
+
|
| 213 |
+
{/* Futuristic Background overlay */}
|
| 214 |
+
<div className="absolute inset-0 bg-gradient-to-br from-foreground/[0.015] to-transparent pointer-events-none rounded-xl" />
|
| 215 |
+
<div className="absolute top-0 right-0 w-24 h-24 bg-radial-gradient from-foreground/[0.03] to-transparent pointer-events-none rounded-tr-xl" />
|
| 216 |
+
|
| 217 |
+
{/* Shock Metrics & Badge */}
|
| 218 |
+
<div className="flex justify-between items-start mb-6">
|
| 219 |
+
<div className="text-3xl md:text-4xl font-bebas font-extrabold tracking-wider leading-none">
|
| 220 |
+
{node.metric}
|
| 221 |
+
</div>
|
| 222 |
+
<span className="text-[10px] font-mono text-primary/60 group-hover:text-primary transition-colors duration-300 uppercase tracking-widest">
|
| 223 |
+
{"// NODE_0"}{index + 1}
|
| 224 |
+
</span>
|
| 225 |
+
</div>
|
| 226 |
+
|
| 227 |
+
{/* Titles */}
|
| 228 |
+
<div className="space-y-1 mb-4">
|
| 229 |
+
<h3 className="text-xl md:text-2xl font-bold tracking-tight text-foreground group-hover:text-primary transition-colors duration-300">
|
| 230 |
+
{node.title}
|
| 231 |
+
</h3>
|
| 232 |
+
<p className="text-xs font-mono uppercase tracking-wider text-muted-foreground/60 group-hover:text-muted-foreground transition-colors duration-300">
|
| 233 |
+
{node.titleEn}
|
| 234 |
+
</p>
|
| 235 |
+
</div>
|
| 236 |
+
|
| 237 |
+
{/* B2B Message (Now left border and left text alignment) */}
|
| 238 |
+
<p className="text-sm md:text-base text-muted-foreground leading-relaxed text-left md:text-justify mb-6 border-l-2 border-primary/30 pl-3 font-sans font-medium">
|
| 239 |
+
{node.b2bDesc}
|
| 240 |
+
</p>
|
| 241 |
+
|
| 242 |
+
{/* Investor Thesis */}
|
| 243 |
+
<div className="relative mt-6 pt-5 border-t border-border font-mono text-xs md:text-sm text-left">
|
| 244 |
+
<div className="absolute -top-[9px] left-4 bg-card px-2 text-[9px] uppercase tracking-widest text-primary font-bold">
|
| 245 |
+
[ Investor Thesis ]
|
| 246 |
+
</div>
|
| 247 |
+
<p className="italic text-muted-foreground leading-relaxed font-mono">
|
| 248 |
+
“{node.investorThesis}”
|
| 249 |
+
</p>
|
| 250 |
+
</div>
|
| 251 |
+
</motion.div>
|
| 252 |
+
</div>
|
| 253 |
+
</div>
|
| 254 |
+
);
|
| 255 |
+
})}
|
| 256 |
+
</div>
|
| 257 |
+
</div>
|
| 258 |
+
</section>
|
| 259 |
+
);
|
| 260 |
+
}
|
components/HubLiveTerminal.tsx
ADDED
|
@@ -0,0 +1,285 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
import React, { useState, useEffect, useRef } from "react";
|
| 4 |
+
import {
|
| 5 |
+
Terminal as TerminalIcon,
|
| 6 |
+
Activity,
|
| 7 |
+
Cpu,
|
| 8 |
+
Sparkles,
|
| 9 |
+
HelpCircle,
|
| 10 |
+
Play
|
| 11 |
+
} from "lucide-react";
|
| 12 |
+
|
| 13 |
+
interface TerminalLine {
|
| 14 |
+
type: "input" | "output" | "error" | "success" | "info" | "system";
|
| 15 |
+
text: string;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
const presets = [
|
| 19 |
+
{ label: "⚡ Diagnostics", cmd: "status", icon: Activity },
|
| 20 |
+
{ label: "📊 Benchmarks", cmd: "benchmark", icon: Cpu },
|
| 21 |
+
{ label: "🧠 Route Query", cmd: "route", icon: Sparkles },
|
| 22 |
+
{ label: "❓ CLI Help", cmd: "help", icon: HelpCircle },
|
| 23 |
+
];
|
| 24 |
+
|
| 25 |
+
export function HubLiveTerminal() {
|
| 26 |
+
const [history, setHistory] = useState<TerminalLine[]>([]);
|
| 27 |
+
const [inputValue, setInputValue] = useState("");
|
| 28 |
+
const [isProcessing, setIsProcessing] = useState(false);
|
| 29 |
+
const consoleContainerRef = useRef<HTMLDivElement>(null);
|
| 30 |
+
|
| 31 |
+
// Helper to append lines to the terminal history
|
| 32 |
+
const appendLine = (type: TerminalLine["type"], text: string) => {
|
| 33 |
+
setHistory((prev) => [...prev, { type, text }]);
|
| 34 |
+
};
|
| 35 |
+
|
| 36 |
+
// Scroll to bottom of terminal container whenever history updates
|
| 37 |
+
useEffect(() => {
|
| 38 |
+
if (consoleContainerRef.current) {
|
| 39 |
+
consoleContainerRef.current.scrollTop = consoleContainerRef.current.scrollHeight;
|
| 40 |
+
}
|
| 41 |
+
}, [history]);
|
| 42 |
+
|
| 43 |
+
// Initial simulated boot sequence
|
| 44 |
+
useEffect(() => {
|
| 45 |
+
const runBootSequence = async () => {
|
| 46 |
+
setIsProcessing(true);
|
| 47 |
+
await new Promise((r) => setTimeout(r, 400));
|
| 48 |
+
appendLine("output", "HubAPI Neural Gateway Client CLI [v1.0.0]");
|
| 49 |
+
await new Promise((r) => setTimeout(r, 300));
|
| 50 |
+
appendLine("info", "Syncing connections with global model registries…");
|
| 51 |
+
await new Promise((r) => setTimeout(r, 500));
|
| 52 |
+
appendLine("success", "✔ Connection established with gateway node US-East-1");
|
| 53 |
+
appendLine("success", "✔ Model router mesh status: ONLINE");
|
| 54 |
+
await new Promise((r) => setTimeout(r, 300));
|
| 55 |
+
appendLine("output", "Ready for execution. Type a command or click a quick action above.");
|
| 56 |
+
setIsProcessing(false);
|
| 57 |
+
};
|
| 58 |
+
runBootSequence();
|
| 59 |
+
}, []);
|
| 60 |
+
|
| 61 |
+
// Simulates character-by-character typing for quick presets
|
| 62 |
+
const simulateTyping = (cmdText: string) => {
|
| 63 |
+
if (isProcessing) return;
|
| 64 |
+
setIsProcessing(true);
|
| 65 |
+
setInputValue("");
|
| 66 |
+
let idx = 0;
|
| 67 |
+
|
| 68 |
+
const timer = setInterval(() => {
|
| 69 |
+
setInputValue(cmdText.slice(0, idx + 1));
|
| 70 |
+
idx++;
|
| 71 |
+
if (idx >= cmdText.length) {
|
| 72 |
+
clearInterval(timer);
|
| 73 |
+
setTimeout(() => {
|
| 74 |
+
setInputValue("");
|
| 75 |
+
processCommand(cmdText);
|
| 76 |
+
}, 200);
|
| 77 |
+
}
|
| 78 |
+
}, 50);
|
| 79 |
+
};
|
| 80 |
+
|
| 81 |
+
// Parse and process command scripts
|
| 82 |
+
const processCommand = async (cmd: string) => {
|
| 83 |
+
setIsProcessing(true);
|
| 84 |
+
appendLine("input", `> ${cmd}`);
|
| 85 |
+
|
| 86 |
+
const cleanCmd = cmd.trim().toLowerCase();
|
| 87 |
+
const args = cleanCmd.split(" ");
|
| 88 |
+
const primary = args[0];
|
| 89 |
+
|
| 90 |
+
// Wait a brief delay to simulate network latency
|
| 91 |
+
await new Promise((r) => setTimeout(r, 400));
|
| 92 |
+
|
| 93 |
+
switch (primary) {
|
| 94 |
+
case "help":
|
| 95 |
+
appendLine("system", "HUBAPI CLI COMMAND DIRECTORY");
|
| 96 |
+
appendLine("info", " status - Check active node routing latency & system loads");
|
| 97 |
+
appendLine("info", " benchmark - Run latency and cost tests across primary LLM nodes");
|
| 98 |
+
appendLine("info", " route - Run intelligent query routing simulation");
|
| 99 |
+
appendLine("info", " clear - Clear the screen buffer logs");
|
| 100 |
+
appendLine("info", " help - Display this menu guide");
|
| 101 |
+
break;
|
| 102 |
+
|
| 103 |
+
case "clear":
|
| 104 |
+
setHistory([]);
|
| 105 |
+
break;
|
| 106 |
+
|
| 107 |
+
case "status":
|
| 108 |
+
appendLine("output", "Broadcasting health status query across model registry…");
|
| 109 |
+
await new Promise((r) => setTimeout(r, 450));
|
| 110 |
+
appendLine("success", "✔ Primary Gateway: US-East-1 Node (Virginia) - Active [14ms]");
|
| 111 |
+
appendLine("success", "✔ Secondary Node: EU-West-3 Node (Paris) - Active [76ms]");
|
| 112 |
+
await new Promise((r) => setTimeout(r, 300));
|
| 113 |
+
appendLine("info", "Connected Model Providers: OpenAI, Anthropic, Google, Mistral, Meta");
|
| 114 |
+
appendLine("output", "System Status: HEALTHY | Current load: 12.8% | Nodes online: 142/142");
|
| 115 |
+
break;
|
| 116 |
+
|
| 117 |
+
case "benchmark":
|
| 118 |
+
appendLine("output", "Starting model speed/cost benchmark (10KB prompt payload)…");
|
| 119 |
+
await new Promise((r) => setTimeout(r, 600));
|
| 120 |
+
appendLine("system", "MODEL LATENCY COST/1M TOK ROUTING SCORE");
|
| 121 |
+
appendLine("system", "---------------------------------------------------------------");
|
| 122 |
+
await new Promise((r) => setTimeout(r, 200));
|
| 123 |
+
appendLine("info", "Claude 3.5 Sonnet 270ms $3.00 98.5/100 (Optimum)");
|
| 124 |
+
await new Promise((r) => setTimeout(r, 150));
|
| 125 |
+
appendLine("output", "GPT-4o 310ms $5.00 97.0/100");
|
| 126 |
+
await new Promise((r) => setTimeout(r, 150));
|
| 127 |
+
appendLine("output", "Gemini 1.5 Pro 430ms $7.00 94.8/100");
|
| 128 |
+
await new Promise((r) => setTimeout(r, 150));
|
| 129 |
+
appendLine("output", "Mistral Large 2 480ms $4.00 91.5/100");
|
| 130 |
+
await new Promise((r) => setTimeout(r, 300));
|
| 131 |
+
appendLine("success", "🏆 Recommendation: Route to Claude 3.5 Sonnet (Optimizes cost/speed ratio)");
|
| 132 |
+
break;
|
| 133 |
+
|
| 134 |
+
case "route":
|
| 135 |
+
appendLine("output", "Simulating dynamic query routing…");
|
| 136 |
+
await new Promise((r) => setTimeout(r, 400));
|
| 137 |
+
appendLine("info", "[ROUTER] Ingress query: ‘Analyze scanned legal document (2.4M tokens)’");
|
| 138 |
+
await new Promise((r) => setTimeout(r, 450));
|
| 139 |
+
appendLine("info", "[ROUTER] Checking constraints: Context size > 2M, Cost budget < $20");
|
| 140 |
+
await new Promise((r) => setTimeout(r, 450));
|
| 141 |
+
appendLine("info", "[ROUTER] Checking candidates: Claude 3 Opus (budget fail), GPT-4o (context limit fail)");
|
| 142 |
+
await new Promise((r) => setTimeout(r, 500));
|
| 143 |
+
appendLine("success", "✔ Route mapped: Google Gemini 1.5 Pro (2M context limit native)");
|
| 144 |
+
await new Promise((r) => setTimeout(r, 300));
|
| 145 |
+
appendLine("success", "✔ Query processed. Execution: 1.62s. Transaction Cost: $14.40");
|
| 146 |
+
break;
|
| 147 |
+
|
| 148 |
+
case "":
|
| 149 |
+
break;
|
| 150 |
+
|
| 151 |
+
default:
|
| 152 |
+
appendLine("error", `Command not found: '${cmd}'. Type 'help' to see available commands.`);
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
setIsProcessing(false);
|
| 156 |
+
};
|
| 157 |
+
|
| 158 |
+
const handleCommandSubmit = (e: React.FormEvent) => {
|
| 159 |
+
e.preventDefault();
|
| 160 |
+
if (isProcessing || !inputValue.trim()) return;
|
| 161 |
+
const cmd = inputValue;
|
| 162 |
+
setInputValue("");
|
| 163 |
+
processCommand(cmd);
|
| 164 |
+
};
|
| 165 |
+
|
| 166 |
+
const [cpuLoad, setCpuLoad] = useState(12.8);
|
| 167 |
+
|
| 168 |
+
useEffect(() => {
|
| 169 |
+
const interval = setInterval(() => {
|
| 170 |
+
setCpuLoad(Number((10 + Math.random() * 5).toFixed(1)));
|
| 171 |
+
}, 3000);
|
| 172 |
+
return () => clearInterval(interval);
|
| 173 |
+
}, []);
|
| 174 |
+
|
| 175 |
+
return (
|
| 176 |
+
<div className="w-full max-w-3xl mx-auto my-8 md:my-16 px-4 relative">
|
| 177 |
+
{/* Decorative background grid and vectors */}
|
| 178 |
+
<div className="absolute -inset-10 pointer-events-none bg-radial from-primary/5 via-transparent to-transparent blur-2xl -z-10" />
|
| 179 |
+
|
| 180 |
+
{/* Preset Command Buttons (Futuristic clip buttons) */}
|
| 181 |
+
<div className="flex flex-wrap items-center justify-center gap-2 mb-6">
|
| 182 |
+
{presets.map((preset, idx) => {
|
| 183 |
+
const Icon = preset.icon;
|
| 184 |
+
return (
|
| 185 |
+
<button
|
| 186 |
+
key={idx}
|
| 187 |
+
onClick={() => simulateTyping(preset.cmd)}
|
| 188 |
+
disabled={isProcessing}
|
| 189 |
+
className="inverted-card flex items-center gap-1.5 px-4 py-2 text-[10px] md:text-xs font-mono border hover:bg-primary/10 hover:border-primary hover:text-primary hover:shadow-[0_0_15px_var(--primary-glow)] text-muted-foreground transition-[background-color,border-color,color,box-shadow,transform] duration-300 active:scale-95 disabled:opacity-50 disabled:pointer-events-none focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary clip-cyber-button"
|
| 190 |
+
>
|
| 191 |
+
<Icon className="w-3.5 h-3.5 text-primary" />
|
| 192 |
+
<span>{preset.label}</span>
|
| 193 |
+
</button>
|
| 194 |
+
);
|
| 195 |
+
})}
|
| 196 |
+
</div>
|
| 197 |
+
|
| 198 |
+
{/* Terminal Shell Window (Cyber Glass with Corner Brackets) */}
|
| 199 |
+
<div className="w-full shadow-2xl overflow-hidden border border-border dark:border-primary/30 relative z-10 bg-card/95 dark:bg-card/95 backdrop-blur-xl transition-colors duration-300 corner-bracket p-0.5 rounded-none">
|
| 200 |
+
<div className="corner-bracket-inner" />
|
| 201 |
+
|
| 202 |
+
{/* Terminal Header */}
|
| 203 |
+
<div className="flex items-center justify-between px-4 py-2.5 border-b border-primary/20 bg-primary/[0.04] dark:bg-primary/[0.02]">
|
| 204 |
+
<div className="flex items-center gap-2">
|
| 205 |
+
<div className="w-2 h-2 rounded-full bg-red-500/80 animate-pulse shadow-[0_0_6px_#ef4444]" />
|
| 206 |
+
<div className="w-2 h-2 rounded-full bg-yellow-500/80 shadow-[0_0_6px_#eab308]" />
|
| 207 |
+
<div className="w-2 h-2 rounded-full bg-green-500/80 shadow-[0_0_6px_#22c55e]" />
|
| 208 |
+
</div>
|
| 209 |
+
|
| 210 |
+
<div className="text-[10px] md:text-xs font-mono text-primary/80 uppercase tracking-widest flex items-center gap-1.5 font-bold">
|
| 211 |
+
<TerminalIcon className="w-3.5 h-3.5 text-primary animate-pulse" />
|
| 212 |
+
<span>HUBAPI Network Shell</span>
|
| 213 |
+
</div>
|
| 214 |
+
|
| 215 |
+
<div className="flex items-center gap-3">
|
| 216 |
+
{/* Live CPU Telemetry Meter */}
|
| 217 |
+
<div className="flex items-center gap-1.5 border-l border-primary/20 pl-3">
|
| 218 |
+
<Cpu className="w-3 h-3 text-primary/60" />
|
| 219 |
+
<span className="text-[9px] font-mono text-primary/70 hidden sm:block">CPU: {cpuLoad}%</span>
|
| 220 |
+
<div className="w-8 h-1 bg-primary/10 border border-primary/20 rounded-full overflow-hidden hidden sm:block">
|
| 221 |
+
<div className="h-full bg-primary transition-all duration-500" style={{ width: `${(cpuLoad / 20) * 100}%` }} />
|
| 222 |
+
</div>
|
| 223 |
+
</div>
|
| 224 |
+
|
| 225 |
+
<div className="flex items-center gap-1.5">
|
| 226 |
+
<span className="relative flex h-1.5 w-1.5">
|
| 227 |
+
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"></span>
|
| 228 |
+
<span className="relative inline-flex rounded-full h-1.5 w-1.5 bg-emerald-500"></span>
|
| 229 |
+
</span>
|
| 230 |
+
<span className="text-[8px] font-mono text-emerald-500 tracking-wider">ONLINE</span>
|
| 231 |
+
</div>
|
| 232 |
+
</div>
|
| 233 |
+
</div>
|
| 234 |
+
|
| 235 |
+
{/* CRT Scanline Console Box */}
|
| 236 |
+
<div className="relative w-full scanline">
|
| 237 |
+
<div
|
| 238 |
+
ref={consoleContainerRef}
|
| 239 |
+
className="p-4 h-[300px] overflow-y-auto flex flex-col gap-1.5 font-mono text-[11px] md:text-xs text-left scrollbar-thin scrollbar-thumb-primary/10 select-text bg-black/90 text-primary/90"
|
| 240 |
+
>
|
| 241 |
+
{history.map((line, idx) => {
|
| 242 |
+
let colorClass = "text-primary/80";
|
| 243 |
+
if (line.type === "input") colorClass = "text-primary font-bold shadow-[0_0_8px_rgba(255,170,64,0.3)]";
|
| 244 |
+
if (line.type === "error") colorClass = "text-destructive font-semibold";
|
| 245 |
+
if (line.type === "success") colorClass = "text-emerald-400 font-semibold shadow-[0_0_8px_rgba(52,211,153,0.2)]";
|
| 246 |
+
if (line.type === "info") colorClass = "text-blue-400";
|
| 247 |
+
if (line.type === "system") colorClass = "text-amber-500 font-bold shadow-[0_0_8px_rgba(245,158,11,0.2)]";
|
| 248 |
+
if (line.type === "output") colorClass = "text-primary/70";
|
| 249 |
+
|
| 250 |
+
return (
|
| 251 |
+
<div key={idx} className={`leading-relaxed whitespace-pre-wrap ${colorClass}`}>
|
| 252 |
+
{line.text}
|
| 253 |
+
</div>
|
| 254 |
+
);
|
| 255 |
+
})}
|
| 256 |
+
</div>
|
| 257 |
+
</div>
|
| 258 |
+
|
| 259 |
+
{/* Command Interactive Prompt Form (Glowing Neon input) */}
|
| 260 |
+
<form
|
| 261 |
+
onSubmit={handleCommandSubmit}
|
| 262 |
+
className="flex items-center gap-2 p-3 border-t border-primary/20 bg-primary/[0.02] font-mono text-xs md:text-sm relative"
|
| 263 |
+
>
|
| 264 |
+
<span className="text-primary font-bold ml-1 select-none animate-pulse">></span>
|
| 265 |
+
<input
|
| 266 |
+
type="text"
|
| 267 |
+
value={inputValue}
|
| 268 |
+
onChange={(e) => setInputValue(e.target.value)}
|
| 269 |
+
disabled={isProcessing}
|
| 270 |
+
placeholder={isProcessing ? "Executing command sequence…" : "Type command (e.g. status, benchmark) and hit Enter…"}
|
| 271 |
+
className="flex-1 bg-transparent border-none outline-none text-primary placeholder:text-primary/30 select-text focus:ring-0 focus:outline-none"
|
| 272 |
+
/>
|
| 273 |
+
<button
|
| 274 |
+
type="submit"
|
| 275 |
+
disabled={isProcessing || !inputValue.trim()}
|
| 276 |
+
className="flex items-center gap-1.5 px-4 py-1.5 rounded-none bg-primary/10 text-primary border border-primary/40 text-[10px] font-mono hover:bg-primary/25 hover:shadow-[0_0_10px_rgba(255,170,64,0.2)] transition-[background-color,border-color,box-shadow,transform] duration-200 uppercase tracking-wider disabled:opacity-30 disabled:pointer-events-none active:scale-95 clip-cyber-button"
|
| 277 |
+
>
|
| 278 |
+
<Play className="w-3 h-3 fill-current" aria-hidden="true" />
|
| 279 |
+
<span>Run</span>
|
| 280 |
+
</button>
|
| 281 |
+
</form>
|
| 282 |
+
</div>
|
| 283 |
+
</div>
|
| 284 |
+
);
|
| 285 |
+
}
|
components/HubPulseMetrics.tsx
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { NumberTicker } from "@/components/ui/number-ticker";
|
| 2 |
+
|
| 3 |
+
export function HubPulseMetrics() {
|
| 4 |
+
return (
|
| 5 |
+
<div className="grid grid-cols-1 md:grid-cols-3 gap-10 md:gap-8 py-8 md:py-12 px-4 md:px-6 border-y border-border/10 bg-background/5 backdrop-blur-md w-full max-w-5xl mx-auto my-8 md:my-16 rounded-3xl shadow-sm relative z-10">
|
| 6 |
+
<div className="flex flex-col items-center justify-center space-y-2 text-center">
|
| 7 |
+
<span className="text-4xl md:text-5xl font-extrabold text-foreground flex items-center">
|
| 8 |
+
<NumberTicker value={140} />+
|
| 9 |
+
</span>
|
| 10 |
+
<span className="text-xs md:text-sm font-semibold text-muted-foreground uppercase tracking-widest">Supported Models</span>
|
| 11 |
+
</div>
|
| 12 |
+
<div className="flex flex-col items-center justify-center space-y-2 text-center">
|
| 13 |
+
<span className="text-4xl md:text-5xl font-extrabold text-primary flex items-center">
|
| 14 |
+
<NumberTicker value={99.99} decimalPlaces={2} />%
|
| 15 |
+
</span>
|
| 16 |
+
<span className="text-xs md:text-sm font-semibold text-muted-foreground uppercase tracking-widest">Uptime SLA</span>
|
| 17 |
+
</div>
|
| 18 |
+
<div className="flex flex-col items-center justify-center space-y-2 text-center">
|
| 19 |
+
<span className="text-4xl md:text-5xl font-extrabold text-foreground flex items-center">
|
| 20 |
+
<NumberTicker value={40} />%
|
| 21 |
+
</span>
|
| 22 |
+
<span className="text-xs md:text-sm font-semibold text-muted-foreground uppercase tracking-widest">Avg Cost Reduction</span>
|
| 23 |
+
</div>
|
| 24 |
+
</div>
|
| 25 |
+
);
|
| 26 |
+
}
|
components/LLMProviderIconCloud.tsx
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
import { Marquee } from "@/components/ui/marquee";
|
| 4 |
+
import {
|
| 5 |
+
firstRowFeaturedSlugs,
|
| 6 |
+
secondRowFeaturedSlugs,
|
| 7 |
+
toLobeSvgUrl,
|
| 8 |
+
formatProviderName,
|
| 9 |
+
providerUrls,
|
| 10 |
+
} from "@/data/llm-provider-icons";
|
| 11 |
+
|
| 12 |
+
const ProviderCard = ({ slug }: { slug: string }) => {
|
| 13 |
+
const url = providerUrls[slug] || `https://www.google.com/search?q=${slug}+AI`;
|
| 14 |
+
const title = formatProviderName(slug);
|
| 15 |
+
const imgUrl = toLobeSvgUrl(slug);
|
| 16 |
+
|
| 17 |
+
// Certain static Lobe SVGs are solid dark/black and become invisible in dark mode.
|
| 18 |
+
// We apply dark:invert to ensure high-contrast white rendering.
|
| 19 |
+
const isMonochrome = [
|
| 20 |
+
"openai",
|
| 21 |
+
"anthropic",
|
| 22 |
+
"apple",
|
| 23 |
+
"grok",
|
| 24 |
+
"xai",
|
| 25 |
+
"zai",
|
| 26 |
+
"moonshot",
|
| 27 |
+
"ibm",
|
| 28 |
+
"replicate",
|
| 29 |
+
"groq",
|
| 30 |
+
"ollama",
|
| 31 |
+
"github",
|
| 32 |
+
].includes(slug);
|
| 33 |
+
|
| 34 |
+
return (
|
| 35 |
+
<a
|
| 36 |
+
href={url}
|
| 37 |
+
target="_blank"
|
| 38 |
+
rel="noopener noreferrer"
|
| 39 |
+
className="group relative flex w-[210px] sm:w-[220px] h-[72px] shrink-0 cursor-pointer items-center gap-4 rounded-xl border border-[var(--card-border)] bg-card/90 dark:bg-card/80 px-5 py-3.5 backdrop-blur-md transition-all duration-300 hover:-translate-y-1 hover:border-primary/60 dark:hover:border-primary/50 hover:bg-card/95 dark:hover:bg-primary/[0.02] hover:shadow-[0_8px_30px_rgba(255,170,64,0.06)] dark:hover:shadow-[0_0_20px_rgba(255,170,64,0.08)] group-hover/track:opacity-40 hover:!opacity-100 hover:!scale-[1.03] z-0 hover:!z-10 overflow-hidden focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary"
|
| 40 |
+
>
|
| 41 |
+
<div className="relative flex h-10 w-10 shrink-0 items-center justify-center transition-transform duration-300 group-hover:scale-105 z-10 p-1.5 bg-black/[0.02] dark:bg-white/5 border border-black/5 dark:border-white/10 rounded-lg shadow-sm">
|
| 42 |
+
{/* eslint-disable-next-line @next/next/no-img-element */}
|
| 43 |
+
<img
|
| 44 |
+
src={imgUrl}
|
| 45 |
+
alt=""
|
| 46 |
+
aria-hidden="true"
|
| 47 |
+
className={`h-full w-full object-contain filter ${
|
| 48 |
+
isMonochrome ? "invert dark:invert-0" : ""
|
| 49 |
+
}`}
|
| 50 |
+
loading="lazy"
|
| 51 |
+
decoding="async"
|
| 52 |
+
/>
|
| 53 |
+
</div>
|
| 54 |
+
<div className="relative flex flex-col z-10 select-none">
|
| 55 |
+
<span className="font-mono text-[11px] font-bold tracking-wider text-[var(--card-foreground)] group-hover:text-primary transition-colors truncate max-w-[120px]">
|
| 56 |
+
{title}
|
| 57 |
+
</span>
|
| 58 |
+
<span className="font-mono text-[8px] text-[var(--card-muted-foreground)]/50 uppercase tracking-widest" aria-hidden="true">
|
| 59 |
+
CHIP // OK
|
| 60 |
+
</span>
|
| 61 |
+
</div>
|
| 62 |
+
</a>
|
| 63 |
+
);
|
| 64 |
+
};
|
| 65 |
+
|
| 66 |
+
export function LLMProviderIconCloud() {
|
| 67 |
+
return (
|
| 68 |
+
<section className="relative mx-auto flex w-full max-w-7xl flex-col items-center gap-14 py-24 overflow-hidden">
|
| 69 |
+
<div className="text-center space-y-6 px-4 z-10 relative">
|
| 70 |
+
<div className="inline-flex items-center rounded-full border border-primary/20 bg-primary/5 px-4 py-1.5 text-sm font-medium text-primary backdrop-blur-md shadow-sm transition-colors hover:bg-primary/10">
|
| 71 |
+
<span className="relative flex h-2 w-2 mr-2.5">
|
| 72 |
+
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"></span>
|
| 73 |
+
<span className="relative inline-flex rounded-full h-2 w-2 bg-primary"></span>
|
| 74 |
+
</span>
|
| 75 |
+
Ecosystem Integration
|
| 76 |
+
</div>
|
| 77 |
+
<h2 className="text-4xl font-extrabold tracking-tight sm:text-6xl bg-clip-text text-transparent bg-gradient-to-br from-foreground via-foreground/90 to-foreground/40 pb-2 animate-in fade-in slide-in-from-bottom-4 duration-1000">
|
| 78 |
+
Powered by the World’s Best
|
| 79 |
+
</h2>
|
| 80 |
+
<p className="max-w-3xl mx-auto text-lg sm:text-xl text-muted-foreground animate-in fade-in slide-in-from-bottom-4 duration-1000 delay-150 font-mono">
|
| 81 |
+
HUBAPI integrates seamlessly with leading innovators, robust infrastructure providers, the dynamic Asian ecosystem, and specialized AI tools to deliver unparalleled capabilities.
|
| 82 |
+
</p>
|
| 83 |
+
</div>
|
| 84 |
+
|
| 85 |
+
<div className="relative flex w-full flex-col items-center justify-center overflow-hidden bg-card/45 border border-border shadow-[0_12px_40px_rgba(0,0,0,0.04)] dark:shadow-[0_0_50px_rgba(255,170,64,0.04)] backdrop-blur-2xl p-6 sm:p-10 z-10 rounded-2xl">
|
| 86 |
+
|
| 87 |
+
{/* Inner shadow overlay for depth */}
|
| 88 |
+
<div className="absolute inset-0 shadow-[inset_0_0_80px_rgba(255,255,255,0.01)] dark:shadow-[inset_0_0_80px_rgba(255,255,255,0.02)] pointer-events-none" />
|
| 89 |
+
|
| 90 |
+
{/* Subtle top highlight for glass edge */}
|
| 91 |
+
<div className="absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-primary/20 to-transparent" />
|
| 92 |
+
|
| 93 |
+
<div className="w-full flex flex-col gap-8 py-4">
|
| 94 |
+
{/* Row 1 */}
|
| 95 |
+
<div className="w-full flex flex-col relative group/row">
|
| 96 |
+
<div className="group/track flex w-full">
|
| 97 |
+
<Marquee pauseOnHover className="[--duration:45s]" repeat={2}>
|
| 98 |
+
{firstRowFeaturedSlugs.map((slug) => (
|
| 99 |
+
<ProviderCard key={slug} slug={slug} />
|
| 100 |
+
))}
|
| 101 |
+
</Marquee>
|
| 102 |
+
</div>
|
| 103 |
+
</div>
|
| 104 |
+
|
| 105 |
+
{/* Row 2 */}
|
| 106 |
+
<div className="w-full flex flex-col relative group/row">
|
| 107 |
+
<div className="group/track flex w-full">
|
| 108 |
+
<Marquee reverse pauseOnHover className="[--duration:45s]" repeat={2}>
|
| 109 |
+
{secondRowFeaturedSlugs.map((slug) => (
|
| 110 |
+
<ProviderCard key={slug} slug={slug} />
|
| 111 |
+
))}
|
| 112 |
+
</Marquee>
|
| 113 |
+
</div>
|
| 114 |
+
</div>
|
| 115 |
+
</div>
|
| 116 |
+
|
| 117 |
+
{/* Enhanced Smooth Fade Edges matching the dark glassmorphic look */}
|
| 118 |
+
<div className="pointer-events-none absolute inset-y-0 left-0 w-1/4 bg-gradient-to-r from-background via-background/80 to-transparent"></div>
|
| 119 |
+
<div className="pointer-events-none absolute inset-y-0 right-0 w-1/4 bg-gradient-to-l from-background via-background/80 to-transparent"></div>
|
| 120 |
+
</div>
|
| 121 |
+
</section>
|
| 122 |
+
);
|
| 123 |
+
}
|
| 124 |
+
|
components/MapContainer.tsx
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
import DottedMap from "./DottedMap";
|
| 4 |
+
|
| 5 |
+
export default function MapContainer() {
|
| 6 |
+
return <DottedMap />;
|
| 7 |
+
}
|
components/StatsDisplay.tsx
ADDED
|
@@ -0,0 +1,446 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
import { useState, useEffect, useMemo, useRef } from "react";
|
| 4 |
+
import { motion, AnimatePresence } from "framer-motion";
|
| 5 |
+
import { stats, formatNumber, topCountries } from "../data/country-data";
|
| 6 |
+
|
| 7 |
+
function useAnimatedNumber(baseValue: number, incrementRatePerSecond: number) {
|
| 8 |
+
const [value, setValue] = useState(baseValue);
|
| 9 |
+
const [displayRate, setDisplayRate] = useState(incrementRatePerSecond);
|
| 10 |
+
|
| 11 |
+
useEffect(() => {
|
| 12 |
+
const updatesPerSecond = 4;
|
| 13 |
+
const baseIncrement = incrementRatePerSecond / updatesPerSecond;
|
| 14 |
+
|
| 15 |
+
const interval = setInterval(() => {
|
| 16 |
+
const variation = 0.7 + Math.random() * 0.6;
|
| 17 |
+
const increment = Math.max(1, Math.floor(baseIncrement * variation));
|
| 18 |
+
setValue((v) => v + increment);
|
| 19 |
+
|
| 20 |
+
const rateVariation = 0.85 + Math.random() * 0.3;
|
| 21 |
+
setDisplayRate(Math.floor(incrementRatePerSecond * rateVariation));
|
| 22 |
+
}, 1000 / updatesPerSecond);
|
| 23 |
+
|
| 24 |
+
return () => clearInterval(interval);
|
| 25 |
+
}, [incrementRatePerSecond]);
|
| 26 |
+
|
| 27 |
+
return { value, rate: displayRate };
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
function InfoIcon() {
|
| 31 |
+
return (
|
| 32 |
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
| 33 |
+
<circle cx="8" cy="8" r="7" stroke="currentColor" strokeWidth="1.5" />
|
| 34 |
+
<path d="M8 7V11" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" />
|
| 35 |
+
<circle cx="8" cy="5" r="0.75" fill="currentColor" />
|
| 36 |
+
</svg>
|
| 37 |
+
);
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
function getDeterministicRandom(seed: number): number {
|
| 41 |
+
const x = Math.sin(seed) * 10000;
|
| 42 |
+
return x - Math.floor(x);
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
function PixelGridTransition({
|
| 46 |
+
firstContent,
|
| 47 |
+
secondContent,
|
| 48 |
+
isActive,
|
| 49 |
+
gridSize = 30,
|
| 50 |
+
animationStepDuration = 0.3,
|
| 51 |
+
className,
|
| 52 |
+
}: {
|
| 53 |
+
firstContent: React.ReactNode;
|
| 54 |
+
secondContent: React.ReactNode;
|
| 55 |
+
isActive: boolean;
|
| 56 |
+
gridSize?: number;
|
| 57 |
+
animationStepDuration?: number;
|
| 58 |
+
className?: string;
|
| 59 |
+
}) {
|
| 60 |
+
const [showPixels, setShowPixels] = useState(false);
|
| 61 |
+
const [animState, setAnimState] = useState<"idle" | "growing" | "shrinking">("idle");
|
| 62 |
+
const hasActivatedRef = useRef(false);
|
| 63 |
+
|
| 64 |
+
const pixels = useMemo(() => {
|
| 65 |
+
const total = gridSize * gridSize;
|
| 66 |
+
const result = [];
|
| 67 |
+
for (let n = 0; n < total; n++) {
|
| 68 |
+
const row = Math.floor(n / gridSize);
|
| 69 |
+
const col = n % gridSize;
|
| 70 |
+
const color = getDeterministicRandom(n) > 0.85 ? "var(--primary)" : "var(--border)";
|
| 71 |
+
result.push({ id: n, row, col, color });
|
| 72 |
+
}
|
| 73 |
+
return result;
|
| 74 |
+
}, [gridSize]);
|
| 75 |
+
|
| 76 |
+
const [shuffledOrder, setShuffledOrder] = useState<number[]>([]);
|
| 77 |
+
|
| 78 |
+
useEffect(() => {
|
| 79 |
+
if (!hasActivatedRef.current && !isActive) return;
|
| 80 |
+
if (isActive) hasActivatedRef.current = true;
|
| 81 |
+
|
| 82 |
+
const indices = pixels.map((_, i) => i);
|
| 83 |
+
for (let i = indices.length - 1; i > 0; i--) {
|
| 84 |
+
const j = Math.floor(Math.random() * (i + 1));
|
| 85 |
+
[indices[i], indices[j]] = [indices[j], indices[i]];
|
| 86 |
+
}
|
| 87 |
+
setShuffledOrder(indices);
|
| 88 |
+
|
| 89 |
+
setShowPixels(true);
|
| 90 |
+
setAnimState("growing");
|
| 91 |
+
|
| 92 |
+
const shrinkTimer = setTimeout(() => setAnimState("shrinking"), animationStepDuration * 1000);
|
| 93 |
+
const hideTimer = setTimeout(() => {
|
| 94 |
+
setShowPixels(false);
|
| 95 |
+
setAnimState("idle");
|
| 96 |
+
}, animationStepDuration * 2000);
|
| 97 |
+
|
| 98 |
+
return () => {
|
| 99 |
+
clearTimeout(shrinkTimer);
|
| 100 |
+
clearTimeout(hideTimer);
|
| 101 |
+
};
|
| 102 |
+
}, [isActive, animationStepDuration, pixels]);
|
| 103 |
+
|
| 104 |
+
const delayPerPixel = useMemo(() => animationStepDuration / pixels.length, [animationStepDuration, pixels.length]);
|
| 105 |
+
const orderMap = useMemo(() => {
|
| 106 |
+
const map = new Map<number, number>();
|
| 107 |
+
shuffledOrder.forEach((idx, order) => map.set(idx, order));
|
| 108 |
+
return map;
|
| 109 |
+
}, [shuffledOrder]);
|
| 110 |
+
|
| 111 |
+
return (
|
| 112 |
+
<div className={`w-full overflow-hidden max-w-full relative ${className || ""}`}>
|
| 113 |
+
<motion.div
|
| 114 |
+
className="h-full"
|
| 115 |
+
aria-hidden={isActive}
|
| 116 |
+
initial={{ opacity: 1 }}
|
| 117 |
+
animate={{ opacity: isActive ? 0 : 1 }}
|
| 118 |
+
transition={{ duration: 0, delay: animationStepDuration }}
|
| 119 |
+
>
|
| 120 |
+
{firstContent}
|
| 121 |
+
</motion.div>
|
| 122 |
+
|
| 123 |
+
<motion.div
|
| 124 |
+
className="absolute inset-0 w-full h-full z-[2] overflow-hidden"
|
| 125 |
+
initial={{ opacity: 0 }}
|
| 126 |
+
animate={{ opacity: isActive ? 1 : 0 }}
|
| 127 |
+
transition={{ duration: 0, delay: animationStepDuration }}
|
| 128 |
+
style={{ pointerEvents: isActive ? "auto" : "none" }}
|
| 129 |
+
aria-hidden={!isActive}
|
| 130 |
+
>
|
| 131 |
+
{secondContent}
|
| 132 |
+
</motion.div>
|
| 133 |
+
|
| 134 |
+
<div
|
| 135 |
+
className="absolute inset-0 w-full h-full pointer-events-none z-[3]"
|
| 136 |
+
style={{
|
| 137 |
+
display: "grid",
|
| 138 |
+
gridTemplateColumns: `repeat(${gridSize}, 1fr)`,
|
| 139 |
+
}}
|
| 140 |
+
>
|
| 141 |
+
<AnimatePresence>
|
| 142 |
+
{showPixels &&
|
| 143 |
+
pixels.map((pixel) => {
|
| 144 |
+
const order = orderMap.get(pixel.id) ?? 0;
|
| 145 |
+
return (
|
| 146 |
+
<motion.div
|
| 147 |
+
key={pixel.id}
|
| 148 |
+
style={{
|
| 149 |
+
backgroundColor: pixel.color,
|
| 150 |
+
aspectRatio: "1 / 1",
|
| 151 |
+
gridArea: `${pixel.row + 1} / ${pixel.col + 1}`,
|
| 152 |
+
}}
|
| 153 |
+
initial={{ opacity: 0, scale: 0 }}
|
| 154 |
+
animate={{
|
| 155 |
+
opacity: animState === "growing" ? 1 : 0,
|
| 156 |
+
scale: animState === "growing" ? 1 : 0,
|
| 157 |
+
}}
|
| 158 |
+
transition={{ duration: 0.01, delay: order * delayPerPixel }}
|
| 159 |
+
/>
|
| 160 |
+
);
|
| 161 |
+
})}
|
| 162 |
+
</AnimatePresence>
|
| 163 |
+
</div>
|
| 164 |
+
</div>
|
| 165 |
+
);
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
function StatCard({
|
| 169 |
+
title,
|
| 170 |
+
baseValue,
|
| 171 |
+
incrementRate,
|
| 172 |
+
children,
|
| 173 |
+
infoContent,
|
| 174 |
+
href,
|
| 175 |
+
className,
|
| 176 |
+
}: {
|
| 177 |
+
title: string;
|
| 178 |
+
baseValue?: number;
|
| 179 |
+
incrementRate?: number;
|
| 180 |
+
children?: React.ReactNode;
|
| 181 |
+
infoContent?: string;
|
| 182 |
+
href?: string;
|
| 183 |
+
className?: string;
|
| 184 |
+
}) {
|
| 185 |
+
const [showInfo, setShowInfo] = useState(false);
|
| 186 |
+
const { value } = useAnimatedNumber(baseValue || 0, incrementRate || 0);
|
| 187 |
+
|
| 188 |
+
const statsContent = (
|
| 189 |
+
<div className="premium-glass-card p-5 md:p-6 w-full min-h-[130px] h-full transition-colors duration-300 shadow-sm dark:shadow-none clip-cyber-card corner-bracket relative group">
|
| 190 |
+
<div className="corner-bracket-inner" aria-hidden="true" />
|
| 191 |
+
<div className="space-y-2 relative z-10">
|
| 192 |
+
<h2 className="my-0 font-mono font-bold text-xs tracking-tight uppercase text-muted-foreground group-hover:text-primary pr-6 transition-colors">
|
| 193 |
+
{title}
|
| 194 |
+
</h2>
|
| 195 |
+
{baseValue !== undefined && (
|
| 196 |
+
<div className="text-3xl md:text-4xl tracking-normal font-mono font-bold text-foreground tabular-nums drop-shadow-[0_0_8px_var(--primary-glow)]">
|
| 197 |
+
{formatNumber(value)}
|
| 198 |
+
</div>
|
| 199 |
+
)}
|
| 200 |
+
{children}
|
| 201 |
+
</div>
|
| 202 |
+
</div>
|
| 203 |
+
);
|
| 204 |
+
|
| 205 |
+
const infoContentView = (
|
| 206 |
+
<div className="premium-glass-card bg-card p-5 md:p-6 w-full h-full overflow-y-auto flex flex-col gap-y-2 shadow-md dark:shadow-none clip-cyber-card corner-bracket relative">
|
| 207 |
+
<div className="corner-bracket-inner" aria-hidden="true" />
|
| 208 |
+
<div className="relative z-10 flex flex-col gap-2 h-full justify-between">
|
| 209 |
+
<div>
|
| 210 |
+
{href ? (
|
| 211 |
+
<a
|
| 212 |
+
href={href}
|
| 213 |
+
tabIndex={showInfo ? 0 : -1}
|
| 214 |
+
className="my-0 font-mono font-bold text-xs tracking-tight uppercase text-primary hover:underline underline-offset-2 inline-flex gap-x-0.5 items-center w-fit shrink-0 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary"
|
| 215 |
+
>
|
| 216 |
+
{title}
|
| 217 |
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
|
| 218 |
+
<path fillRule="evenodd" clipRule="evenodd" d="M6.75011 4H6.00011V5.5H6.75011H9.43945L5.46978 9.46967L4.93945 10L6.00011 11.0607L6.53044 10.5303L10.499 6.56182V9.25V10H11.999V9.25V5C11.999 4.44772 11.5512 4 10.999 4H6.75011Z" />
|
| 219 |
+
</svg>
|
| 220 |
+
</a>
|
| 221 |
+
) : (
|
| 222 |
+
<span className="my-0 font-mono font-bold text-xs tracking-tight uppercase text-primary shrink-0">
|
| 223 |
+
{title}
|
| 224 |
+
</span>
|
| 225 |
+
)}
|
| 226 |
+
<p className="mt-2 tracking-tight text-xs text-muted-foreground leading-relaxed">
|
| 227 |
+
{infoContent}
|
| 228 |
+
</p>
|
| 229 |
+
</div>
|
| 230 |
+
</div>
|
| 231 |
+
</div>
|
| 232 |
+
);
|
| 233 |
+
|
| 234 |
+
return (
|
| 235 |
+
<div className={`relative group overflow-hidden ${className || ""}`}>
|
| 236 |
+
<PixelGridTransition
|
| 237 |
+
firstContent={statsContent}
|
| 238 |
+
secondContent={infoContentView}
|
| 239 |
+
isActive={showInfo}
|
| 240 |
+
gridSize={30}
|
| 241 |
+
animationStepDuration={0.3}
|
| 242 |
+
className="h-full"
|
| 243 |
+
/>
|
| 244 |
+
{infoContent && (
|
| 245 |
+
<div className={`absolute top-4 right-4 transition-opacity duration-150 z-[20] isolate ${showInfo ? "opacity-100" : "opacity-100 md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100"}`}>
|
| 246 |
+
<button
|
| 247 |
+
aria-label={`Learn more about ${title}`}
|
| 248 |
+
type="button"
|
| 249 |
+
onClick={() => setShowInfo(!showInfo)}
|
| 250 |
+
className="p-1 m-0 bg-transparent text-primary/70 hover:text-primary border border-primary/20 hover:border-primary/50 transition-colors duration-150 flex items-center justify-center outline-none focus-visible:ring cursor-pointer rounded-none clip-cyber-button"
|
| 251 |
+
>
|
| 252 |
+
<InfoIcon />
|
| 253 |
+
</button>
|
| 254 |
+
</div>
|
| 255 |
+
)}
|
| 256 |
+
</div>
|
| 257 |
+
);
|
| 258 |
+
}
|
| 259 |
+
|
| 260 |
+
function MetricRow({ label, baseValue, incrementRate, showRate = false }: { label: string; baseValue: number; incrementRate: number; showRate?: boolean }) {
|
| 261 |
+
const { value, rate } = useAnimatedNumber(baseValue, incrementRate);
|
| 262 |
+
|
| 263 |
+
return (
|
| 264 |
+
<li className="flex items-center justify-between gap-x-3 w-full my-1">
|
| 265 |
+
<h3 className="m-0 font-mono font-normal text-xs text-primary/70 uppercase">
|
| 266 |
+
{label}
|
| 267 |
+
</h3>
|
| 268 |
+
<div className="flex-1 border-b border-dashed border-primary/15 mx-2" aria-hidden="true" />
|
| 269 |
+
<div className="flex items-center gap-3 text-right">
|
| 270 |
+
<div className="text-foreground font-mono tabular-nums text-xs font-bold">
|
| 271 |
+
{formatNumber(value)}
|
| 272 |
+
</div>
|
| 273 |
+
{showRate && (
|
| 274 |
+
<div className="w-16 text-primary/85 text-right text-[10px] font-mono tabular-nums">
|
| 275 |
+
<span>{formatNumber(rate)}</span>
|
| 276 |
+
<span className="lowercase">/s</span>
|
| 277 |
+
</div>
|
| 278 |
+
)}
|
| 279 |
+
</div>
|
| 280 |
+
</li>
|
| 281 |
+
);
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
export function TotalRequests() {
|
| 285 |
+
const { value, rate } = useAnimatedNumber(stats.totalRequests, 450000);
|
| 286 |
+
|
| 287 |
+
return (
|
| 288 |
+
<div className="space-y-2">
|
| 289 |
+
<h2 className="my-0 font-mono font-medium text-sm tracking-tight uppercase text-muted-foreground">
|
| 290 |
+
Total routed API requests
|
| 291 |
+
</h2>
|
| 292 |
+
<div className="text-4xl md:text-5xl tracking-normal font-mono tabular-nums">
|
| 293 |
+
{formatNumber(value)}
|
| 294 |
+
</div>
|
| 295 |
+
<div className="text-sm text-muted-foreground font-mono tabular-nums">
|
| 296 |
+
{formatNumber(rate)}/s
|
| 297 |
+
</div>
|
| 298 |
+
</div>
|
| 299 |
+
);
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
function CountryRow({ country, incrementRate }: { country: typeof topCountries[0]; incrementRate: number }) {
|
| 303 |
+
const { value, rate } = useAnimatedNumber(country.requests, incrementRate);
|
| 304 |
+
|
| 305 |
+
return (
|
| 306 |
+
<li className="flex items-center w-full md:w-fit justify-between md:justify-start gap-x-2">
|
| 307 |
+
<span aria-hidden="true" className="inline-block translate-y-[-1px]">
|
| 308 |
+
<span style={{ color: country.color }} className="text-sm">■</span>
|
| 309 |
+
</span>
|
| 310 |
+
<div className="text-left">
|
| 311 |
+
<h3 className="inline-block my-0 font-medium text-[16px] text-foreground">
|
| 312 |
+
{country.code}
|
| 313 |
+
</h3>
|
| 314 |
+
</div>
|
| 315 |
+
<div className="w-[16ch] text-right">
|
| 316 |
+
<span className="inline-flex tabular-nums text-foreground">{formatNumber(value)}</span>
|
| 317 |
+
</div>
|
| 318 |
+
<div className="w-[10ch] ml-auto text-right text-muted-foreground/90">
|
| 319 |
+
<span>{formatNumber(rate)}</span>
|
| 320 |
+
<span className="lowercase" aria-label="per second">/s</span>
|
| 321 |
+
</div>
|
| 322 |
+
</li>
|
| 323 |
+
);
|
| 324 |
+
}
|
| 325 |
+
|
| 326 |
+
export function TopCountries() {
|
| 327 |
+
const incrementRates = [160000, 24000, 19000, 17000, 15000, 15000, 14000];
|
| 328 |
+
|
| 329 |
+
return (
|
| 330 |
+
<div className="space-y-2">
|
| 331 |
+
<h2 className="my-0 font-mono font-medium text-sm tracking-tight uppercase text-muted-foreground">
|
| 332 |
+
Top countries by API traffic
|
| 333 |
+
</h2>
|
| 334 |
+
<ul className="list-none pl-0 space-y-1">
|
| 335 |
+
{topCountries.map((country, index) => (
|
| 336 |
+
<CountryRow
|
| 337 |
+
key={country.code}
|
| 338 |
+
country={country}
|
| 339 |
+
incrementRate={incrementRates[index] || 10000}
|
| 340 |
+
/>
|
| 341 |
+
))}
|
| 342 |
+
</ul>
|
| 343 |
+
</div>
|
| 344 |
+
);
|
| 345 |
+
}
|
| 346 |
+
|
| 347 |
+
export function RegionCount() {
|
| 348 |
+
return (
|
| 349 |
+
<div className="flex items-center w-full md:w-fit justify-between md:justify-start mt-2">
|
| 350 |
+
<span aria-hidden="true" className="inline-block translate-y-[-2px] translate-x-[2px]">
|
| 351 |
+
<span className="text-[10px]">▲</span>
|
| 352 |
+
</span>
|
| 353 |
+
<div className="text-left">
|
| 354 |
+
<span className="inline-block my-0 font-medium text-[16px]"> 19</span>
|
| 355 |
+
<span className="font-medium text-[16px] text-muted-foreground tracking-tight"> Active Neural Gateways</span>
|
| 356 |
+
</div>
|
| 357 |
+
</div>
|
| 358 |
+
);
|
| 359 |
+
}
|
| 360 |
+
|
| 361 |
+
export function StatsGrid() {
|
| 362 |
+
return (
|
| 363 |
+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-1.5">
|
| 364 |
+
<div className="flex flex-col gap-1.5">
|
| 365 |
+
<StatCard
|
| 366 |
+
title="Active Agent Pipelines"
|
| 367 |
+
baseValue={stats.totalDeployments}
|
| 368 |
+
incrementRate={24}
|
| 369 |
+
infoContent="The total number of active automated agent workflows and API routes deployed and managed across the HUBAPI neural edge network."
|
| 370 |
+
href="#features"
|
| 371 |
+
className="flex-1"
|
| 372 |
+
/>
|
| 373 |
+
<StatCard
|
| 374 |
+
title="Neural AI Gateway"
|
| 375 |
+
infoContent="A unified intelligent routing layer that handles API caching, prompt safety, key rotation, and rate-limiting at < 5ms latency."
|
| 376 |
+
href="#features"
|
| 377 |
+
className="flex-1"
|
| 378 |
+
>
|
| 379 |
+
<ul className="space-y-1 list-none pl-0 mt-2">
|
| 380 |
+
<MetricRow label="Routed AI Tokens" baseValue={stats.aiGatewayRequests} incrementRate={95} />
|
| 381 |
+
</ul>
|
| 382 |
+
</StatCard>
|
| 383 |
+
</div>
|
| 384 |
+
|
| 385 |
+
<div className="flex flex-col gap-1.5">
|
| 386 |
+
<StatCard
|
| 387 |
+
title="AI Guardrail Interventions"
|
| 388 |
+
baseValue={stats.firewallActions.total}
|
| 389 |
+
incrementRate={29000}
|
| 390 |
+
infoContent="The HUBAPI Neural Shield monitors and blocks prompt injections, data leak vectors, and malicious API exploitation attempts at the gateway."
|
| 391 |
+
href="#security"
|
| 392 |
+
className="flex-1"
|
| 393 |
+
>
|
| 394 |
+
<ul className="space-y-1 list-none pl-0 mt-4">
|
| 395 |
+
<MetricRow
|
| 396 |
+
label="Prompt injection blocks"
|
| 397 |
+
baseValue={stats.firewallActions.systemBlocks}
|
| 398 |
+
incrementRate={5400}
|
| 399 |
+
showRate
|
| 400 |
+
/>
|
| 401 |
+
<MetricRow
|
| 402 |
+
label="PII challenges"
|
| 403 |
+
baseValue={stats.firewallActions.systemChallenges}
|
| 404 |
+
incrementRate={12300}
|
| 405 |
+
showRate
|
| 406 |
+
/>
|
| 407 |
+
<MetricRow
|
| 408 |
+
label="Custom policy actions"
|
| 409 |
+
baseValue={stats.firewallActions.customWafBlocks}
|
| 410 |
+
incrementRate={1270}
|
| 411 |
+
showRate
|
| 412 |
+
/>
|
| 413 |
+
</ul>
|
| 414 |
+
</StatCard>
|
| 415 |
+
</div>
|
| 416 |
+
|
| 417 |
+
<div className="flex flex-col gap-1.5">
|
| 418 |
+
<StatCard
|
| 419 |
+
title="Abuse Prevention Shield"
|
| 420 |
+
infoContent="Access control layers that automatically identify, rate-limit, and quarantine compromised API keys and abusive automated clients."
|
| 421 |
+
href="#security"
|
| 422 |
+
className="flex-1"
|
| 423 |
+
>
|
| 424 |
+
<ul className="space-y-1 list-none pl-0 mt-2">
|
| 425 |
+
<MetricRow label="Keys Quarantined" baseValue={stats.botManagement.botsBlocked} incrementRate={1600} />
|
| 426 |
+
<MetricRow
|
| 427 |
+
label="Requests Verified"
|
| 428 |
+
baseValue={stats.botManagement.humansVerified}
|
| 429 |
+
incrementRate={9300}
|
| 430 |
+
/>
|
| 431 |
+
</ul>
|
| 432 |
+
</StatCard>
|
| 433 |
+
<StatCard
|
| 434 |
+
title="Neural Prompt Cache"
|
| 435 |
+
baseValue={stats.cacheHits}
|
| 436 |
+
incrementRate={305000}
|
| 437 |
+
infoContent="Cache hits represent LLM prompt responses and embeddings served directly from edge memory, saving token execution fees and speeding up workflows."
|
| 438 |
+
href="#features"
|
| 439 |
+
className="flex-1"
|
| 440 |
+
>
|
| 441 |
+
<p className="text-muted-foreground text-sm font-mono mt-1">Cached API calls served</p>
|
| 442 |
+
</StatCard>
|
| 443 |
+
</div>
|
| 444 |
+
</div>
|
| 445 |
+
);
|
| 446 |
+
}
|
components/ThemeToggle.tsx
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
import { useTheme } from "next-themes";
|
| 4 |
+
import { useEffect, useState } from "react";
|
| 5 |
+
import { motion } from "framer-motion";
|
| 6 |
+
import { Sun, Moon } from "lucide-react";
|
| 7 |
+
import { useSplitFlapAudio } from "@/components/ui/split-flap-text";
|
| 8 |
+
import { cn } from "@/lib/utils";
|
| 9 |
+
|
| 10 |
+
export function ThemeToggle() {
|
| 11 |
+
const { resolvedTheme, setTheme } = useTheme();
|
| 12 |
+
const [mounted, setMounted] = useState(false);
|
| 13 |
+
const audio = useSplitFlapAudio();
|
| 14 |
+
|
| 15 |
+
// Prevent hydration mismatch
|
| 16 |
+
useEffect(() => {
|
| 17 |
+
const frame = requestAnimationFrame(() => {
|
| 18 |
+
setMounted(true);
|
| 19 |
+
});
|
| 20 |
+
return () => cancelAnimationFrame(frame);
|
| 21 |
+
}, []);
|
| 22 |
+
|
| 23 |
+
if (!mounted) {
|
| 24 |
+
return (
|
| 25 |
+
<div className="w-[68px] h-7 rounded-full border border-black/5 dark:border-white/10 bg-white/10 dark:bg-black/20 backdrop-blur-md opacity-40" />
|
| 26 |
+
);
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
const isDark = resolvedTheme === "dark";
|
| 30 |
+
|
| 31 |
+
const handleToggle = (targetTheme: "light" | "dark") => {
|
| 32 |
+
if (resolvedTheme === targetTheme) return;
|
| 33 |
+
|
| 34 |
+
// Play satisfying mechanical click sound
|
| 35 |
+
if (audio && !audio.isMuted) {
|
| 36 |
+
audio.playClick();
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
setTheme(targetTheme);
|
| 40 |
+
};
|
| 41 |
+
|
| 42 |
+
return (
|
| 43 |
+
<div
|
| 44 |
+
className="relative flex items-center p-0.5 rounded-full border border-black/10 dark:border-white/10 bg-secondary dark:bg-secondary/40 backdrop-blur-md shadow-[0_4px_20px_rgba(0,0,0,0.05)] dark:shadow-[0_4px_20px_rgba(0,0,0,0.3)] w-[68px] h-7 select-none overflow-hidden"
|
| 45 |
+
>
|
| 46 |
+
{/* Sliding background container (GPU accelerated via x transform) */}
|
| 47 |
+
<motion.div
|
| 48 |
+
className="absolute top-0.5 left-0.5 w-[31px] h-[22px] rounded-full bg-primary shadow-[0_2px_6px_rgba(0,0,0,0.12)] dark:shadow-[0_2px_6px_rgba(0,0,0,0.6)] border border-black/5 dark:border-white/5"
|
| 49 |
+
initial={false}
|
| 50 |
+
animate={{
|
| 51 |
+
x: isDark ? 31 : 0,
|
| 52 |
+
}}
|
| 53 |
+
transition={{ type: "spring", stiffness: 350, damping: 26 }}
|
| 54 |
+
/>
|
| 55 |
+
|
| 56 |
+
{/* Light Mode Button */}
|
| 57 |
+
<button
|
| 58 |
+
onClick={() => handleToggle("light")}
|
| 59 |
+
className={cn(
|
| 60 |
+
"relative z-10 flex items-center justify-center w-1/2 h-full rounded-full transition-colors duration-300 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/50 focus-visible:ring-offset-0 focus-visible:z-20",
|
| 61 |
+
!isDark ? "text-primary-foreground" : "text-muted-foreground hover:text-foreground"
|
| 62 |
+
)}
|
| 63 |
+
aria-label="Light mode"
|
| 64 |
+
>
|
| 65 |
+
<motion.div
|
| 66 |
+
animate={{ rotate: isDark ? 45 : 0, scale: !isDark ? 1.05 : 0.95 }}
|
| 67 |
+
transition={{ type: "spring", stiffness: 200, damping: 15 }}
|
| 68 |
+
className="relative"
|
| 69 |
+
>
|
| 70 |
+
<Sun className="w-3.5 h-3.5 fill-current" aria-hidden="true" />
|
| 71 |
+
|
| 72 |
+
{/* Subtle warm halo glow in light mode */}
|
| 73 |
+
{!isDark && (
|
| 74 |
+
<motion.span
|
| 75 |
+
layoutId="glowingHalo"
|
| 76 |
+
className="absolute -inset-1.5 rounded-full bg-primary/20 blur-[3px] -z-10"
|
| 77 |
+
transition={{ type: "spring", stiffness: 300, damping: 20 }}
|
| 78 |
+
/>
|
| 79 |
+
)}
|
| 80 |
+
</motion.div>
|
| 81 |
+
</button>
|
| 82 |
+
|
| 83 |
+
{/* Dark Mode Button */}
|
| 84 |
+
<button
|
| 85 |
+
onClick={() => handleToggle("dark")}
|
| 86 |
+
className={cn(
|
| 87 |
+
"relative z-10 flex items-center justify-center w-1/2 h-full rounded-full transition-colors duration-300 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/50 focus-visible:ring-offset-0 focus-visible:z-20",
|
| 88 |
+
isDark ? "text-primary-foreground" : "text-muted-foreground hover:text-foreground"
|
| 89 |
+
)}
|
| 90 |
+
aria-label="Dark mode"
|
| 91 |
+
>
|
| 92 |
+
<motion.div
|
| 93 |
+
animate={{ rotate: isDark ? 0 : -45, scale: isDark ? 1.05 : 0.95 }}
|
| 94 |
+
transition={{ type: "spring", stiffness: 200, damping: 15 }}
|
| 95 |
+
className="relative"
|
| 96 |
+
>
|
| 97 |
+
<Moon className="w-3.5 h-3.5 fill-current" aria-hidden="true" />
|
| 98 |
+
|
| 99 |
+
{/* Subtle cool halo glow in dark mode */}
|
| 100 |
+
{isDark && (
|
| 101 |
+
<motion.span
|
| 102 |
+
layoutId="glowingHalo"
|
| 103 |
+
className="absolute -inset-1.5 rounded-full bg-primary/30 blur-[3px] -z-10"
|
| 104 |
+
transition={{ type: "spring", stiffness: 300, damping: 20 }}
|
| 105 |
+
/>
|
| 106 |
+
)}
|
| 107 |
+
</motion.div>
|
| 108 |
+
</button>
|
| 109 |
+
</div>
|
| 110 |
+
);
|
| 111 |
+
}
|
components/WaitlistSocialProofTicker.tsx
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
import React, { useState, useEffect } from "react";
|
| 4 |
+
import { motion, AnimatePresence } from "framer-motion";
|
| 5 |
+
import { X, ArrowRight } from "lucide-react";
|
| 6 |
+
|
| 7 |
+
export function WaitlistSocialProofTicker() {
|
| 8 |
+
const [isVisible, setIsVisible] = useState(false);
|
| 9 |
+
const [isDismissed, setIsDismissed] = useState(false);
|
| 10 |
+
const [queueCount, setQueueCount] = useState(2147);
|
| 11 |
+
|
| 12 |
+
useEffect(() => {
|
| 13 |
+
if (isDismissed) return;
|
| 14 |
+
|
| 15 |
+
// Show initial notification after a brief delay
|
| 16 |
+
const initialDelay = setTimeout(() => {
|
| 17 |
+
setIsVisible(true);
|
| 18 |
+
}, 2000);
|
| 19 |
+
|
| 20 |
+
// Simulate occasional live queue increments
|
| 21 |
+
const interval = setInterval(() => {
|
| 22 |
+
if (Math.random() > 0.5) {
|
| 23 |
+
setQueueCount((prev) => prev + Math.floor(Math.random() * 3) + 1);
|
| 24 |
+
}
|
| 25 |
+
}, 8500);
|
| 26 |
+
|
| 27 |
+
return () => {
|
| 28 |
+
clearTimeout(initialDelay);
|
| 29 |
+
clearInterval(interval);
|
| 30 |
+
};
|
| 31 |
+
}, [isDismissed]);
|
| 32 |
+
|
| 33 |
+
if (isDismissed) return null;
|
| 34 |
+
|
| 35 |
+
return (
|
| 36 |
+
<AnimatePresence>
|
| 37 |
+
{isVisible && (
|
| 38 |
+
<motion.div
|
| 39 |
+
initial={{ opacity: 0, y: 50, scale: 0.95 }}
|
| 40 |
+
animate={{ opacity: 1, y: 0, scale: 1 }}
|
| 41 |
+
exit={{ opacity: 0, y: 30, scale: 0.95 }}
|
| 42 |
+
transition={{ duration: 0.5, ease: "easeOut" }}
|
| 43 |
+
className="group fixed bottom-6 left-1/2 -translate-x-1/2 z-50 w-max max-w-[calc(100vw-3rem)] bg-black/90 dark:bg-black/95 backdrop-blur-md border border-primary/20 px-4 sm:px-5 py-3 shadow-[0_10px_30px_rgba(255,170,64,0.06)] flex items-center gap-3 sm:gap-4 text-left font-mono text-[10px] sm:text-xs select-none rounded-full cursor-pointer hover:border-primary/40 hover:bg-black transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 focus-visible:ring-offset-black"
|
| 44 |
+
role="status"
|
| 45 |
+
aria-live="polite"
|
| 46 |
+
onClick={() => {
|
| 47 |
+
// Focus on waitlist form or scroll to it
|
| 48 |
+
document.getElementById('email-input')?.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
| 49 |
+
setTimeout(() => {
|
| 50 |
+
document.getElementById('email-input')?.focus();
|
| 51 |
+
}, 500);
|
| 52 |
+
}}
|
| 53 |
+
>
|
| 54 |
+
{/* Glowing Green Signal Pulse */}
|
| 55 |
+
<div className="shrink-0 flex items-center justify-center">
|
| 56 |
+
<span className="relative flex h-2 w-2">
|
| 57 |
+
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"></span>
|
| 58 |
+
<span className="relative inline-flex rounded-full h-2 w-2 bg-emerald-500"></span>
|
| 59 |
+
</span>
|
| 60 |
+
</div>
|
| 61 |
+
|
| 62 |
+
{/* Event Content */}
|
| 63 |
+
<div className="flex items-center gap-2 sm:gap-3 overflow-hidden text-ellipsis whitespace-nowrap">
|
| 64 |
+
<span className="text-amber-400 font-bold uppercase tracking-widest text-[9px] sm:text-[10px]">LIVE</span>
|
| 65 |
+
<span className="text-white/45">•</span>
|
| 66 |
+
<span className="text-zinc-300 font-medium">
|
| 67 |
+
<span className="font-bold text-white">{queueCount.toLocaleString()}</span> developers currently in the beta queue
|
| 68 |
+
</span>
|
| 69 |
+
<span className="hidden sm:inline text-white/45">•</span>
|
| 70 |
+
<span className="hidden sm:flex items-center gap-1.5 text-amber-400/80 font-semibold group-hover:text-amber-400 transition-colors">
|
| 71 |
+
Claim your spot <ArrowRight className="w-3 h-3 transition-transform group-hover:translate-x-0.5" />
|
| 72 |
+
</span>
|
| 73 |
+
</div>
|
| 74 |
+
|
| 75 |
+
{/* Close Action */}
|
| 76 |
+
<button
|
| 77 |
+
onClick={(e) => {
|
| 78 |
+
e.stopPropagation();
|
| 79 |
+
setIsVisible(false);
|
| 80 |
+
setTimeout(() => setIsDismissed(true), 500);
|
| 81 |
+
}}
|
| 82 |
+
className="ml-auto text-zinc-500 hover:text-white transition-colors p-1 rounded-full cursor-pointer focus:outline-none focus:ring-1 focus:ring-amber-500 shrink-0"
|
| 83 |
+
aria-label="Dismiss status"
|
| 84 |
+
>
|
| 85 |
+
<X className="w-3.5 h-3.5" />
|
| 86 |
+
</button>
|
| 87 |
+
</motion.div>
|
| 88 |
+
)}
|
| 89 |
+
</AnimatePresence>
|
| 90 |
+
);
|
| 91 |
+
}
|
components/comparison-table.tsx
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
import { Check, X } from "lucide-react";
|
| 4 |
+
|
| 5 |
+
interface ComparisonRow {
|
| 6 |
+
feature: string;
|
| 7 |
+
directApi: {
|
| 8 |
+
text: string;
|
| 9 |
+
supported: boolean;
|
| 10 |
+
};
|
| 11 |
+
hubApi: {
|
| 12 |
+
text: string;
|
| 13 |
+
supported: boolean;
|
| 14 |
+
};
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
const COMPARISON_DATA: ComparisonRow[] = [
|
| 18 |
+
{
|
| 19 |
+
feature: "Multi-Model Intelligent Routing",
|
| 20 |
+
directApi: { text: "Manual switch logic", supported: false },
|
| 21 |
+
hubApi: { text: "AI-driven automatic optimal routing", supported: true },
|
| 22 |
+
},
|
| 23 |
+
{
|
| 24 |
+
feature: "LLM Cost Savings",
|
| 25 |
+
directApi: { text: "0% (pay standard provider rates)", supported: false },
|
| 26 |
+
hubApi: { text: "Average 40% savings via compression & routing", supported: true },
|
| 27 |
+
},
|
| 28 |
+
{
|
| 29 |
+
feature: "Failover & Fallback Redundancy",
|
| 30 |
+
directApi: { text: "Manual try-catch (minutes of downtime)", supported: false },
|
| 31 |
+
hubApi: { text: "Sub-millisecond secure cross-provider routing", supported: true },
|
| 32 |
+
},
|
| 33 |
+
{
|
| 34 |
+
feature: "PII & Compliance Redaction",
|
| 35 |
+
directApi: { text: "Self-built regex/API layers", supported: false },
|
| 36 |
+
hubApi: { text: "Zero-trust built-in PII shield & audit compliance", supported: true },
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
feature: "Observability & Latency Audits",
|
| 40 |
+
directApi: { text: "Fragmented logs across interfaces", supported: false },
|
| 41 |
+
hubApi: { text: "Visual timeline, token counts, & cost breakdowns", supported: true },
|
| 42 |
+
},
|
| 43 |
+
{
|
| 44 |
+
feature: "Security & Fine-Grained API Keys",
|
| 45 |
+
directApi: { text: "Root developer keys shared", supported: false },
|
| 46 |
+
hubApi: { text: "Scoped keys with budget caps & time limits", supported: true },
|
| 47 |
+
},
|
| 48 |
+
];
|
| 49 |
+
|
| 50 |
+
export function ComparisonTable() {
|
| 51 |
+
return (
|
| 52 |
+
<section className="relative z-10 w-full max-w-5xl mx-auto px-4 md:px-6 py-20 md:py-28">
|
| 53 |
+
{/* Decorative top grid */}
|
| 54 |
+
<div className="absolute top-0 left-1/2 -translate-x-1/2 w-full h-px bg-gradient-to-r from-transparent via-primary/20 to-transparent" />
|
| 55 |
+
|
| 56 |
+
<div className="text-center space-y-5 mb-14">
|
| 57 |
+
<div className="inline-flex items-center rounded-full border border-primary/20 bg-primary/5 px-4 py-1.5 text-sm font-medium text-primary backdrop-blur-sm shadow-sm">
|
| 58 |
+
<span className="relative flex h-2 w-2 mr-2.5">
|
| 59 |
+
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"></span>
|
| 60 |
+
<span className="relative inline-flex rounded-full h-2 w-2 bg-primary"></span>
|
| 61 |
+
</span>
|
| 62 |
+
Technical Breakdown
|
| 63 |
+
</div>
|
| 64 |
+
<h2 className="text-3xl font-normal tracking-tight sm:text-5xl bg-clip-text text-transparent bg-gradient-to-br from-foreground via-foreground/90 to-muted-foreground pb-1">
|
| 65 |
+
HUBAPI vs. <span className="font-display italic text-primary text-glow">Direct Provider Access</span>
|
| 66 |
+
</h2>
|
| 67 |
+
<p className="max-w-2xl mx-auto text-base text-muted-foreground font-mono text-sm">
|
| 68 |
+
Why leading engineering teams transition from direct LLM API access to an intelligent gateway.
|
| 69 |
+
</p>
|
| 70 |
+
</div>
|
| 71 |
+
|
| 72 |
+
{/* Comparison Grid Table */}
|
| 73 |
+
<div className="inverted-card w-full overflow-hidden border border-[var(--card-contrast-border)] rounded-2xl backdrop-blur-md shadow-[var(--menu-shadow)] transition-all duration-300">
|
| 74 |
+
<div className="w-full overflow-x-auto">
|
| 75 |
+
<table className="w-full border-collapse text-left font-mono text-xs md:text-sm">
|
| 76 |
+
<thead>
|
| 77 |
+
<tr className="border-b border-border bg-muted/50">
|
| 78 |
+
<th className="py-5 px-6 font-bold text-foreground uppercase tracking-wider">Features</th>
|
| 79 |
+
<th className="py-5 px-6 font-bold text-muted-foreground uppercase tracking-wider w-1/3">Direct LLM Calls</th>
|
| 80 |
+
<th className="py-5 px-6 font-bold text-primary uppercase tracking-wider w-1/3 bg-primary/10">HUBAPI Gateway</th>
|
| 81 |
+
</tr>
|
| 82 |
+
</thead>
|
| 83 |
+
<tbody>
|
| 84 |
+
{COMPARISON_DATA.map((row, idx) => (
|
| 85 |
+
<tr
|
| 86 |
+
key={idx}
|
| 87 |
+
className="border-b border-border hover:bg-primary/[0.03] transition-colors duration-200 group"
|
| 88 |
+
>
|
| 89 |
+
<td className="py-5 px-6 font-medium text-foreground group-hover:text-primary transition-colors duration-200">{row.feature}</td>
|
| 90 |
+
<td className="py-5 px-6 text-muted-foreground tabular-nums">
|
| 91 |
+
<div className="flex items-center gap-2">
|
| 92 |
+
<X className="h-4 w-4 text-rose-500/80 filter drop-shadow-[0_0_3px_rgba(244,63,94,0.4)] shrink-0" />
|
| 93 |
+
<span>{row.directApi.text}</span>
|
| 94 |
+
</div>
|
| 95 |
+
</td>
|
| 96 |
+
<td className="py-5 px-6 text-foreground font-semibold bg-primary/[0.01] tabular-nums">
|
| 97 |
+
<div className="flex items-center gap-2">
|
| 98 |
+
<Check className="h-4 w-4 text-primary shrink-0 filter drop-shadow-[0_0_6px_var(--primary-glow)]" />
|
| 99 |
+
<span className="text-foreground">{row.hubApi.text}</span>
|
| 100 |
+
</div>
|
| 101 |
+
</td>
|
| 102 |
+
</tr>
|
| 103 |
+
))}
|
| 104 |
+
</tbody>
|
| 105 |
+
</table>
|
| 106 |
+
</div>
|
| 107 |
+
</div>
|
| 108 |
+
</section>
|
| 109 |
+
);
|
| 110 |
+
}
|
components/faq-accordion.tsx
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
import { useState } from "react";
|
| 4 |
+
import { motion, AnimatePresence } from "framer-motion";
|
| 5 |
+
import { ChevronDown } from "lucide-react";
|
| 6 |
+
|
| 7 |
+
interface FaqItem {
|
| 8 |
+
question: string;
|
| 9 |
+
answer: string;
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
const FAQS: FaqItem[] = [
|
| 13 |
+
{
|
| 14 |
+
question: "How does HUBAPI intelligent routing actually work?",
|
| 15 |
+
answer: "Our neural core dynamically routes every API call. It benchmarks models in real-time, evaluating their semantic difficulty, target latency, and cost guidelines. Lightweight questions route to faster, highly efficient models, while complex logical requests route to advanced intelligence grids—saving costs without reducing quality.",
|
| 16 |
+
},
|
| 17 |
+
{
|
| 18 |
+
question: "Is my API key and corporate prompt data secure?",
|
| 19 |
+
answer: "Completely. Your primary model keys are fully encrypted at rest inside secure, dedicated Hardware Security Modules (HSMs). HUBAPI enforces a strict zero-retention policy: inputs and outputs are piped securely to providers and never stored on our servers unless explicitly requested by your compliance configuration.",
|
| 20 |
+
},
|
| 21 |
+
{
|
| 22 |
+
question: "Does routing through a gateway add network latency?",
|
| 23 |
+
answer: "No. Our global gateway mesh is deployed across multi-region edge centers. Total network overhead is under 12ms—a cost that is heavily offset by the intelligent routing, which regularly selects models that respond hundreds of milliseconds faster than standard defaults.",
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
question: "What happens if a primary provider goes offline?",
|
| 27 |
+
answer: "HUBAPI includes instantaneous automatic failover routing. If a provider experiences an outage, routes are immediately shifted within sub-milliseconds to secondary models of matching caliber (e.g., swapping to a sibling model or secondary region) to guarantee 100% uptime.",
|
| 28 |
+
},
|
| 29 |
+
{
|
| 30 |
+
question: "Can we self-host the gateway inside our custom VPC?",
|
| 31 |
+
answer: "Yes. Enterprise customers can deploy containerized instances of the HUBAPI gateway directly within their private AWS, GCP, or Azure environments, ensuring all data boundaries remain strictly inside your sovereign secure network.",
|
| 32 |
+
},
|
| 33 |
+
{
|
| 34 |
+
question: "How long does it take to integrate HUBAPI?",
|
| 35 |
+
answer: "Under five minutes. Integration requires changing only two lines of code: redirecting your SDK base URL to the HUBAPI gateway and authenticating with your newly issued scoped key. No major code refactoring is needed.",
|
| 36 |
+
},
|
| 37 |
+
];
|
| 38 |
+
|
| 39 |
+
export function FAQAccordion() {
|
| 40 |
+
const [activeIndex, setActiveIndex] = useState<number | null>(null);
|
| 41 |
+
|
| 42 |
+
const toggleIndex = (idx: number) => {
|
| 43 |
+
setActiveIndex(activeIndex === idx ? null : idx);
|
| 44 |
+
};
|
| 45 |
+
|
| 46 |
+
return (
|
| 47 |
+
<section className="relative z-10 w-full max-w-4xl mx-auto px-4 md:px-6 py-20 md:py-28">
|
| 48 |
+
<div className="text-center space-y-5 mb-16">
|
| 49 |
+
<div className="inline-flex items-center rounded-full border border-primary/20 bg-primary/5 px-4 py-1.5 text-sm font-medium text-primary backdrop-blur-sm shadow-sm">
|
| 50 |
+
<span className="relative flex h-2 w-2 mr-2.5">
|
| 51 |
+
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"></span>
|
| 52 |
+
<span className="relative inline-flex rounded-full h-2 w-2 bg-primary"></span>
|
| 53 |
+
</span>
|
| 54 |
+
Information Center
|
| 55 |
+
</div>
|
| 56 |
+
<h2 className="text-3xl font-normal tracking-tight sm:text-5xl bg-clip-text text-transparent bg-gradient-to-br from-foreground via-foreground/90 to-muted-foreground pb-1">
|
| 57 |
+
Frequently <span className="font-display italic text-primary text-glow">Answered Questions</span>
|
| 58 |
+
</h2>
|
| 59 |
+
<p className="max-w-2xl mx-auto text-base text-muted-foreground font-mono text-sm">
|
| 60 |
+
Everything you need to know about security, network latency, deployment, and system capabilities.
|
| 61 |
+
</p>
|
| 62 |
+
</div>
|
| 63 |
+
|
| 64 |
+
{/* Accordion List */}
|
| 65 |
+
<div className="space-y-4">
|
| 66 |
+
{FAQS.map((faq, idx) => {
|
| 67 |
+
const isOpen = activeIndex === idx;
|
| 68 |
+
return (
|
| 69 |
+
<div
|
| 70 |
+
key={idx}
|
| 71 |
+
className={`inverted-card rounded-xl border transition-all duration-300 ${
|
| 72 |
+
isOpen
|
| 73 |
+
? "border-primary shadow-[0_10px_35px_var(--primary-glow)]"
|
| 74 |
+
: "border-[var(--card-contrast-border)] hover:border-primary/45"
|
| 75 |
+
}`}
|
| 76 |
+
>
|
| 77 |
+
<button
|
| 78 |
+
type="button"
|
| 79 |
+
onClick={() => toggleIndex(idx)}
|
| 80 |
+
className="w-full flex items-center justify-between text-left p-6 font-sans text-sm md:text-base text-foreground hover:text-primary transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 rounded-xl select-none"
|
| 81 |
+
>
|
| 82 |
+
<span className="font-medium tracking-tight">{faq.question}</span>
|
| 83 |
+
<ChevronDown
|
| 84 |
+
className={`h-4 w-4 text-muted-foreground shrink-0 transition-transform duration-300 ${
|
| 85 |
+
isOpen ? "rotate-180 text-primary" : ""
|
| 86 |
+
}`}
|
| 87 |
+
/>
|
| 88 |
+
</button>
|
| 89 |
+
|
| 90 |
+
<AnimatePresence initial={false}>
|
| 91 |
+
{isOpen && (
|
| 92 |
+
<motion.div
|
| 93 |
+
initial={{ height: 0, opacity: 0 }}
|
| 94 |
+
animate={{ height: "auto", opacity: 1 }}
|
| 95 |
+
exit={{ height: 0, opacity: 0 }}
|
| 96 |
+
transition={{ duration: 0.3, ease: "easeInOut" }}
|
| 97 |
+
className="overflow-hidden"
|
| 98 |
+
>
|
| 99 |
+
<div className="px-6 pb-6 pt-0 font-sans text-sm text-muted-foreground leading-relaxed">
|
| 100 |
+
<p>{faq.answer}</p>
|
| 101 |
+
</div>
|
| 102 |
+
</motion.div>
|
| 103 |
+
)}
|
| 104 |
+
</AnimatePresence>
|
| 105 |
+
</div>
|
| 106 |
+
);
|
| 107 |
+
})}
|
| 108 |
+
</div>
|
| 109 |
+
</section>
|
| 110 |
+
);
|
| 111 |
+
}
|
components/footer.tsx
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
import Link from "next/link";
|
| 4 |
+
|
| 5 |
+
export function Footer() {
|
| 6 |
+
return (
|
| 7 |
+
<footer className="relative w-full bg-transparent py-16 md:py-24 z-10 overflow-hidden">
|
| 8 |
+
{/* Premium Top Gradient Border */}
|
| 9 |
+
<div className="absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-primary/30 to-transparent" />
|
| 10 |
+
|
| 11 |
+
<div className="max-w-7xl mx-auto px-6 md:px-12">
|
| 12 |
+
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-12 md:gap-8 mb-16">
|
| 13 |
+
{/* Column 1: Brand & Colophon */}
|
| 14 |
+
<div className="space-y-6">
|
| 15 |
+
<Link
|
| 16 |
+
href="/"
|
| 17 |
+
className="flex items-center gap-3 cursor-pointer group focus-visible:outline-none"
|
| 18 |
+
aria-label="HUBAPI home"
|
| 19 |
+
>
|
| 20 |
+
<div className="relative w-6 h-6 flex items-center justify-center transition-transform group-hover:scale-105 duration-300">
|
| 21 |
+
<div className="absolute inset-0 border border-border rounded-sm opacity-60"></div>
|
| 22 |
+
<div className="absolute w-2 h-2 bg-primary rounded-full top-1 left-1 shadow-[0_0_10px_var(--primary-glow)]"></div>
|
| 23 |
+
<div className="absolute w-1 h-1 bg-muted-foreground/40 rounded-full top-1 right-1"></div>
|
| 24 |
+
<div className="absolute w-1 h-1 bg-muted-foreground/40 rounded-full bottom-1 left-1"></div>
|
| 25 |
+
<div className="absolute w-2 h-0.5 bg-muted-foreground/40 bottom-1 right-1"></div>
|
| 26 |
+
</div>
|
| 27 |
+
<span className="font-fast-hand tracking-wider text-2xl text-foreground mt-0.5">HUBAPI</span>
|
| 28 |
+
</Link>
|
| 29 |
+
<p className="font-mono text-xs text-muted-foreground leading-relaxed">
|
| 30 |
+
The neural API gateway routing agent payloads to optimal intelligence configurations in sub-milliseconds. Cut costs by 40% with zero friction.
|
| 31 |
+
</p>
|
| 32 |
+
{/* Social Icons */}
|
| 33 |
+
<div className="flex items-center gap-4">
|
| 34 |
+
<a
|
| 35 |
+
href="https://x.com"
|
| 36 |
+
target="_blank"
|
| 37 |
+
rel="noreferrer"
|
| 38 |
+
className="h-8 w-8 rounded-lg border border-border flex items-center justify-center text-muted-foreground hover:text-primary hover:border-primary/30 transition-all duration-200"
|
| 39 |
+
aria-label="Twitter X"
|
| 40 |
+
>
|
| 41 |
+
<svg className="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z" /></svg>
|
| 42 |
+
</a>
|
| 43 |
+
<a
|
| 44 |
+
href="https://github.com"
|
| 45 |
+
target="_blank"
|
| 46 |
+
rel="noreferrer"
|
| 47 |
+
className="h-8 w-8 rounded-lg border border-border flex items-center justify-center text-muted-foreground hover:text-primary hover:border-primary/30 transition-all duration-200"
|
| 48 |
+
aria-label="GitHub"
|
| 49 |
+
>
|
| 50 |
+
<svg className="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4" /><path d="M9 18c-4.51 2-5-2-7-2" /></svg>
|
| 51 |
+
</a>
|
| 52 |
+
<a
|
| 53 |
+
href="https://linkedin.com"
|
| 54 |
+
target="_blank"
|
| 55 |
+
rel="noreferrer"
|
| 56 |
+
className="h-8 w-8 rounded-lg border border-border flex items-center justify-center text-muted-foreground hover:text-primary hover:border-primary/30 transition-all duration-200"
|
| 57 |
+
aria-label="LinkedIn"
|
| 58 |
+
>
|
| 59 |
+
<svg className="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z" /><rect width="4" height="12" x="2" y="9" /><circle cx="4" cy="4" r="2" /></svg>
|
| 60 |
+
</a>
|
| 61 |
+
</div>
|
| 62 |
+
</div>
|
| 63 |
+
|
| 64 |
+
{/* Column 2: Platform */}
|
| 65 |
+
<div className="space-y-4 font-mono text-xs">
|
| 66 |
+
<h3 className="font-semibold text-foreground uppercase tracking-widest text-[10px] text-primary/80">{"// Platform"}</h3>
|
| 67 |
+
<ul className="space-y-3 text-muted-foreground">
|
| 68 |
+
<li><Link href="#" className="hover:text-foreground transition-colors">Neural CLI</Link></li>
|
| 69 |
+
<li><Link href="#" className="hover:text-foreground transition-colors">Global Routing Mesh</Link></li>
|
| 70 |
+
<li><Link href="#" className="hover:text-foreground transition-colors">Access Controls</Link></li>
|
| 71 |
+
<li><Link href="#" className="hover:text-foreground transition-colors">Secure Sandbox</Link></li>
|
| 72 |
+
</ul>
|
| 73 |
+
</div>
|
| 74 |
+
|
| 75 |
+
{/* Column 3: Resources */}
|
| 76 |
+
<div className="space-y-4 font-mono text-xs">
|
| 77 |
+
<h3 className="font-semibold text-foreground uppercase tracking-widest text-[10px] text-primary/80">{"// Resources"}</h3>
|
| 78 |
+
<ul className="space-y-3 text-muted-foreground">
|
| 79 |
+
<li><Link href="#" className="hover:text-foreground transition-colors">Documentation</Link></li>
|
| 80 |
+
<li><Link href="#" className="hover:text-foreground transition-colors">System Status</Link></li>
|
| 81 |
+
<li><Link href="#" className="hover:text-foreground transition-colors">API Reference</Link></li>
|
| 82 |
+
<li><Link href="#" className="hover:text-foreground transition-colors">Pre-launch FAQ</Link></li>
|
| 83 |
+
</ul>
|
| 84 |
+
</div>
|
| 85 |
+
|
| 86 |
+
{/* Column 4: Security & Compliance */}
|
| 87 |
+
<div className="space-y-4 font-mono text-xs">
|
| 88 |
+
<h3 className="font-semibold text-foreground uppercase tracking-widest text-[10px] text-primary/80">{"// Security"}</h3>
|
| 89 |
+
<ul className="space-y-3 text-muted-foreground">
|
| 90 |
+
<li><Link href="#" className="hover:text-foreground transition-colors">SOC 2 Compliance</Link></li>
|
| 91 |
+
<li><Link href="#" className="hover:text-foreground transition-colors">PII Redaction Shield</Link></li>
|
| 92 |
+
<li><Link href="#" className="hover:text-foreground transition-colors">Vulnerability Program</Link></li>
|
| 93 |
+
<li><Link href="#" className="hover:text-foreground transition-colors">Data Residency</Link></li>
|
| 94 |
+
</ul>
|
| 95 |
+
</div>
|
| 96 |
+
</div>
|
| 97 |
+
|
| 98 |
+
{/* Divider line */}
|
| 99 |
+
<div className="h-px w-full bg-border mb-8" />
|
| 100 |
+
|
| 101 |
+
{/* Bottom Bar */}
|
| 102 |
+
<div className="flex flex-col md:flex-row items-center justify-between gap-4 font-mono text-[10px] text-muted-foreground">
|
| 103 |
+
<div className="flex items-center gap-6">
|
| 104 |
+
<span>© {new Date().getFullYear()} HUBAPI Inc. All rights reserved.</span>
|
| 105 |
+
<Link href="#" className="hover:text-foreground transition-colors">Privacy Policy</Link>
|
| 106 |
+
<Link href="#" className="hover:text-foreground transition-colors">Terms of Service</Link>
|
| 107 |
+
</div>
|
| 108 |
+
<div className="flex items-center gap-2 border border-primary/20 bg-primary/5 px-2.5 py-1 rounded-full text-primary">
|
| 109 |
+
<span className="w-1.5 h-1.5 bg-primary rounded-full animate-pulse shadow-[0_0_8px_var(--primary-glow)]" />
|
| 110 |
+
<span className="font-bold tracking-wider uppercase">GATEWAY CONNECTED // SECURE</span>
|
| 111 |
+
</div>
|
| 112 |
+
</div>
|
| 113 |
+
</div>
|
| 114 |
+
</footer>
|
| 115 |
+
);
|
| 116 |
+
}
|
components/header.tsx
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
import { motion } from "framer-motion";
|
| 4 |
+
import Link from "next/link";
|
| 5 |
+
import { ThemeToggle } from "@/components/ThemeToggle";
|
| 6 |
+
|
| 7 |
+
export function Header() {
|
| 8 |
+
return (
|
| 9 |
+
<motion.header
|
| 10 |
+
initial={{ y: -100, opacity: 0, x: "-50%" }}
|
| 11 |
+
animate={{ y: 0, opacity: 1, x: "-50%" }}
|
| 12 |
+
transition={{ duration: 0.8, ease: "easeOut", delay: 0.2 }}
|
| 13 |
+
className="inverted-card fixed top-6 left-1/2 z-50 flex flex-col items-center pl-6 pr-6 py-2.5 backdrop-blur-md rounded-full border border-[var(--menu-contrast-border)] w-[calc(100%-2rem)] sm:w-auto shadow-[var(--menu-shadow)] transition-all duration-300"
|
| 14 |
+
>
|
| 15 |
+
<nav className="flex items-center justify-between w-full gap-x-6 sm:gap-x-12" aria-label="Global Navigation">
|
| 16 |
+
{/* Logo/Icon Area (Semantic & accessible keyboard navigation) */}
|
| 17 |
+
<Link
|
| 18 |
+
href="/"
|
| 19 |
+
className="flex items-center gap-3 cursor-pointer group rounded-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/50 focus-visible:ring-offset-2"
|
| 20 |
+
aria-label="HUBAPI home"
|
| 21 |
+
>
|
| 22 |
+
<div className="relative w-6 h-6 flex items-center justify-center transition-transform group-hover:scale-105 duration-300">
|
| 23 |
+
<div className="absolute inset-0 border border-border rounded-sm opacity-60"></div>
|
| 24 |
+
<div className="absolute w-2 h-2 bg-primary rounded-full top-1 left-1 shadow-[0_0_10px_var(--primary-glow)]"></div>
|
| 25 |
+
<div className="absolute w-1 h-1 bg-muted-foreground/40 rounded-full top-1 right-1"></div>
|
| 26 |
+
<div className="absolute w-1 h-1 bg-muted-foreground/40 rounded-full bottom-1 left-1"></div>
|
| 27 |
+
<div className="absolute w-2 h-0.5 bg-muted-foreground/40 bottom-1 right-1"></div>
|
| 28 |
+
</div>
|
| 29 |
+
<span className="font-fast-hand tracking-wider text-2xl text-foreground mt-0.5">HUBAPI</span>
|
| 30 |
+
</Link>
|
| 31 |
+
|
| 32 |
+
{/* Status Area */}
|
| 33 |
+
<div className="flex items-center gap-3 text-xs font-mono">
|
| 34 |
+
<span className="hidden sm:inline-block text-muted-foreground tracking-widest uppercase">Pre-launch</span>
|
| 35 |
+
<div className="flex items-center justify-center h-5 px-2 rounded-full border border-primary/30 bg-primary/10">
|
| 36 |
+
<span className="w-1.5 h-1.5 bg-primary rounded-full animate-pulse mr-2 shadow-[0_0_8px_var(--primary-glow)]"></span>
|
| 37 |
+
<span className="text-primary text-[10px] tracking-wider uppercase font-bold">Online</span>
|
| 38 |
+
</div>
|
| 39 |
+
<ThemeToggle />
|
| 40 |
+
</div>
|
| 41 |
+
</nav>
|
| 42 |
+
</motion.header>
|
| 43 |
+
);
|
| 44 |
+
}
|
components/hero-section.tsx
ADDED
|
@@ -0,0 +1,358 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
import { useState, useEffect } from "react";
|
| 4 |
+
import { motion, useMotionValue, useTransform, useSpring, useReducedMotion } from "framer-motion";
|
| 5 |
+
import Image from "next/image";
|
| 6 |
+
import { WaitlistForm } from "./waitlist-form";
|
| 7 |
+
import { DiaTextReveal } from "./ui/dia-text-reveal";
|
| 8 |
+
import { AgentParticleCanvas } from "./AgentParticleCanvas";
|
| 9 |
+
|
| 10 |
+
export function HeroSection() {
|
| 11 |
+
const reducedMotion = useReducedMotion();
|
| 12 |
+
const [isDesktop, setIsDesktop] = useState(false);
|
| 13 |
+
const [mounted, setMounted] = useState(false);
|
| 14 |
+
const [timeStr, setTimeStr] = useState("");
|
| 15 |
+
const [robotHovered, setRobotHovered] = useState(false);
|
| 16 |
+
const [rawMouse, setRawMouse] = useState({ x: 0, y: 0 });
|
| 17 |
+
|
| 18 |
+
// Check viewport for applying interactive parallax vs mobile float
|
| 19 |
+
useEffect(() => {
|
| 20 |
+
const checkViewport = () => {
|
| 21 |
+
setIsDesktop(window.innerWidth >= 1024);
|
| 22 |
+
};
|
| 23 |
+
checkViewport();
|
| 24 |
+
window.addEventListener("resize", checkViewport);
|
| 25 |
+
return () => window.removeEventListener("resize", checkViewport);
|
| 26 |
+
}, []);
|
| 27 |
+
|
| 28 |
+
// Update ticking clock on client only to prevent hydration mismatch
|
| 29 |
+
useEffect(() => {
|
| 30 |
+
const frame = requestAnimationFrame(() => {
|
| 31 |
+
setMounted(true);
|
| 32 |
+
});
|
| 33 |
+
const updateClock = () => {
|
| 34 |
+
setTimeStr(new Date().toISOString().substring(11, 19));
|
| 35 |
+
};
|
| 36 |
+
updateClock();
|
| 37 |
+
const interval = setInterval(updateClock, 1000);
|
| 38 |
+
return () => {
|
| 39 |
+
cancelAnimationFrame(frame);
|
| 40 |
+
clearInterval(interval);
|
| 41 |
+
};
|
| 42 |
+
}, []);
|
| 43 |
+
|
| 44 |
+
// Parallax motion values
|
| 45 |
+
const mouseX = useMotionValue(0);
|
| 46 |
+
const mouseY = useMotionValue(0);
|
| 47 |
+
|
| 48 |
+
// Smooth springs for the parallax
|
| 49 |
+
const springConfig = { damping: 25, stiffness: 150, mass: 0.5 };
|
| 50 |
+
const smoothMouseX = useSpring(mouseX, springConfig);
|
| 51 |
+
const smoothMouseY = useSpring(mouseY, springConfig);
|
| 52 |
+
|
| 53 |
+
// Map mouse values to rotations (-6 to 6 degrees)
|
| 54 |
+
const rotateX = useTransform(smoothMouseY, [-0.5, 0.5], [6, -6]);
|
| 55 |
+
const rotateY = useTransform(smoothMouseX, [-0.5, 0.5], [-6, 6]);
|
| 56 |
+
|
| 57 |
+
// Map mouse values to translations (-8px to 8px)
|
| 58 |
+
const translateX = useTransform(smoothMouseX, [-0.5, 0.5], [-8, 8]);
|
| 59 |
+
const translateY = useTransform(smoothMouseY, [-0.5, 0.5], [-8, 8]);
|
| 60 |
+
|
| 61 |
+
const handleMouseMove = (e: React.MouseEvent<HTMLDivElement>) => {
|
| 62 |
+
// Only apply parallax on desktop/when mouse is present
|
| 63 |
+
if (!isDesktop || reducedMotion) return;
|
| 64 |
+
const rect = e.currentTarget.getBoundingClientRect();
|
| 65 |
+
const x = (e.clientX - rect.left) / rect.width - 0.5; // -0.5 to 0.5
|
| 66 |
+
const y = (e.clientY - rect.top) / rect.height - 0.5; // -0.5 to 0.5
|
| 67 |
+
mouseX.set(x);
|
| 68 |
+
mouseY.set(y);
|
| 69 |
+
setRawMouse({ x, y });
|
| 70 |
+
};
|
| 71 |
+
|
| 72 |
+
const handleMouseLeave = () => {
|
| 73 |
+
mouseX.set(0);
|
| 74 |
+
mouseY.set(0);
|
| 75 |
+
setRawMouse({ x: 0, y: 0 });
|
| 76 |
+
};
|
| 77 |
+
|
| 78 |
+
return (
|
| 79 |
+
<div className="relative z-10 w-full min-h-screen flex items-center overflow-hidden">
|
| 80 |
+
{/* Dynamic Agent Neural Particle network canvas — behind content */}
|
| 81 |
+
<div className="absolute inset-y-0 right-0 w-full lg:w-[55%] pointer-events-none z-0">
|
| 82 |
+
<AgentParticleCanvas
|
| 83 |
+
className="w-full h-full opacity-60 dark:opacity-40"
|
| 84 |
+
mouseX={rawMouse.x}
|
| 85 |
+
mouseY={rawMouse.y}
|
| 86 |
+
isHovered={robotHovered}
|
| 87 |
+
/>
|
| 88 |
+
</div>
|
| 89 |
+
{/* HUD Telemetry Overlays - Minimal & Highly Refined */}
|
| 90 |
+
<div className="absolute top-28 left-6 font-mono text-[8px] text-primary/65 select-none tracking-widest hidden lg:block" aria-hidden="true">
|
| 91 |
+
LOC // 37.7749° N, 122.4194° W <br />
|
| 92 |
+
SEC // HUB_ALPHA_CORE
|
| 93 |
+
</div>
|
| 94 |
+
<div className="absolute bottom-10 left-6 font-mono text-[8px] text-primary/65 select-none tracking-widest hidden lg:block" aria-hidden="true">
|
| 95 |
+
SYS_CLOCK: {mounted ? timeStr : "--:--:--"} UTC
|
| 96 |
+
</div>
|
| 97 |
+
|
| 98 |
+
<div className="flex-1 w-full max-w-7xl mx-auto px-6 lg:px-12 relative z-20">
|
| 99 |
+
<section className="relative flex flex-col justify-center items-start py-20 lg:py-0 w-full lg:w-1/2">
|
| 100 |
+
{/* Symmetrical/Asymmetrical Sleek Gradient Vertical Accent */}
|
| 101 |
+
<div className="absolute -top-12 -left-4 w-[2px] h-20 bg-gradient-to-b from-primary/40 to-transparent pointer-events-none hidden md:block" aria-hidden="true" />
|
| 102 |
+
|
| 103 |
+
<div className="w-full relative z-30">
|
| 104 |
+
<motion.div
|
| 105 |
+
initial={{ scaleX: 0, opacity: 0 }}
|
| 106 |
+
animate={{ scaleX: 1, opacity: 1 }}
|
| 107 |
+
transition={{ duration: 0.8, ease: "easeOut" }}
|
| 108 |
+
className="origin-left h-px w-full bg-gradient-to-r from-primary/60 via-primary/30 to-transparent"
|
| 109 |
+
></motion.div>
|
| 110 |
+
|
| 111 |
+
<motion.div
|
| 112 |
+
initial={{ y: 40, opacity: 0 }}
|
| 113 |
+
animate={{ y: 0, opacity: 1 }}
|
| 114 |
+
transition={{ duration: 0.6, delay: 0.2, ease: "easeOut" }}
|
| 115 |
+
className="mt-8 min-h-[72px] md:min-h-[120px]"
|
| 116 |
+
>
|
| 117 |
+
<h1 className="font-fast-hand text-[clamp(3.25rem,14vw,5.25rem)] lg:text-[clamp(3.9rem,4.8vw,5.5rem)] leading-none tracking-normal text-foreground">
|
| 118 |
+
<DiaTextReveal
|
| 119 |
+
text="HUBAPI"
|
| 120 |
+
duration={2.5}
|
| 121 |
+
colors={["#FFBE7B", "#FE8FB5", "#A07CFE"]}
|
| 122 |
+
/>
|
| 123 |
+
</h1>
|
| 124 |
+
</motion.div>
|
| 125 |
+
|
| 126 |
+
<motion.div
|
| 127 |
+
initial={{ y: 30, opacity: 0 }}
|
| 128 |
+
animate={{ y: 0, opacity: 1 }}
|
| 129 |
+
transition={{ duration: 0.6, delay: 0.4, ease: "easeOut" }}
|
| 130 |
+
className="relative"
|
| 131 |
+
>
|
| 132 |
+
{/* Decorative vertical blueprint tag */}
|
| 133 |
+
<div className="absolute -left-5 top-0 bottom-0 w-[2px] bg-primary/20 rounded-full hidden md:block" aria-hidden="true" />
|
| 134 |
+
<p className="mt-6 max-w-xl text-sm md:text-base text-muted-foreground leading-relaxed font-mono">
|
| 135 |
+
The intelligent neural API gateway that routes every query to the fastest, cheapest model — automatically. Cut your LLM costs by 40% with zero code changes.
|
| 136 |
+
</p>
|
| 137 |
+
</motion.div>
|
| 138 |
+
|
| 139 |
+
<motion.div
|
| 140 |
+
initial={{ y: 30, opacity: 0 }}
|
| 141 |
+
animate={{ y: 0, opacity: 1 }}
|
| 142 |
+
transition={{ duration: 0.6, delay: 0.6, ease: "easeOut" }}
|
| 143 |
+
className="mt-10 relative z-30"
|
| 144 |
+
>
|
| 145 |
+
<div className="corner-bracket p-1 rounded-lg">
|
| 146 |
+
<div className="corner-bracket-inner" />
|
| 147 |
+
<WaitlistForm />
|
| 148 |
+
</div>
|
| 149 |
+
</motion.div>
|
| 150 |
+
</div>
|
| 151 |
+
</section>
|
| 152 |
+
</div>
|
| 153 |
+
|
| 154 |
+
<motion.div
|
| 155 |
+
initial={{ opacity: 0 }}
|
| 156 |
+
animate={{ opacity: 1 }}
|
| 157 |
+
transition={{ duration: 1, delay: 0.5 }}
|
| 158 |
+
className="absolute right-0 top-0 lg:w-[50%] h-full z-[5] flex items-center justify-center opacity-40 lg:opacity-100 overflow-hidden pointer-events-auto cursor-pointer"
|
| 159 |
+
onMouseMove={handleMouseMove}
|
| 160 |
+
onMouseEnter={() => setRobotHovered(true)}
|
| 161 |
+
onMouseLeave={() => {
|
| 162 |
+
handleMouseLeave();
|
| 163 |
+
setRobotHovered(false);
|
| 164 |
+
}}
|
| 165 |
+
style={{ perspective: "1000px" }}
|
| 166 |
+
>
|
| 167 |
+
<div className="relative w-[350px] h-[350px] md:w-[500px] md:h-[500px] lg:w-[600px] lg:h-[600px] xl:w-[700px] xl:h-[700px] translate-x-[10%] lg:translate-x-[5%] pointer-events-none">
|
| 168 |
+
|
| 169 |
+
|
| 170 |
+
{/* Cybernetic HUD Floating Glass Panels removed as requested */}
|
| 171 |
+
|
| 172 |
+
|
| 173 |
+
<motion.div
|
| 174 |
+
className="w-full h-full relative flex items-center justify-center"
|
| 175 |
+
style={{
|
| 176 |
+
rotateX: reducedMotion ? 0 : rotateX,
|
| 177 |
+
rotateY: reducedMotion ? 0 : rotateY,
|
| 178 |
+
x: reducedMotion ? 0 : translateX,
|
| 179 |
+
y: reducedMotion ? 0 : translateY,
|
| 180 |
+
transformStyle: "preserve-3d"
|
| 181 |
+
}}
|
| 182 |
+
>
|
| 183 |
+
{/* Holographic orbital rings, boxes & reticles removed as requested to let the neural grid mesh shine through */}
|
| 184 |
+
<div className="absolute inset-0 pointer-events-none flex items-center justify-center" aria-hidden="true">
|
| 185 |
+
{/* Dynamic theme-consistent ambient glow behind the robot, justifying its rim lights */}
|
| 186 |
+
<div className="absolute w-[60%] h-[60%] bg-gradient-to-tr from-cyan-500/15 via-indigo-500/10 to-transparent blur-3xl pointer-events-none" />
|
| 187 |
+
</div>
|
| 188 |
+
|
| 189 |
+
{/* 3D Robot Image (Floating & Glowing organically) */}
|
| 190 |
+
<motion.div
|
| 191 |
+
animate={{
|
| 192 |
+
y: reducedMotion ? 0 : [-15, 15, -15],
|
| 193 |
+
rotateZ: reducedMotion ? 0 : [-2, 2, -2]
|
| 194 |
+
}}
|
| 195 |
+
transition={{ duration: 6, repeat: Infinity, ease: "easeInOut" }}
|
| 196 |
+
className="w-[90%] md:w-auto md:h-[85%] aspect-square relative flex items-center justify-center"
|
| 197 |
+
>
|
| 198 |
+
{/* Double Rocket Booster Thruster Glow under the robot's left & right hip/thigh nozzles (behind legs) */}
|
| 199 |
+
{/* Left Thruster - Advanced Plasma Ion Drive */}
|
| 200 |
+
<div className="absolute bottom-[33.5%] left-[43.5%] -translate-x-1/2 w-24 h-44 pointer-events-none overflow-visible flex flex-col items-center z-0" aria-hidden="true">
|
| 201 |
+
{/* Intense Plasma Core Glow (Cyan/White matching eyes/core) */}
|
| 202 |
+
<motion.div
|
| 203 |
+
animate={{
|
| 204 |
+
scaleY: [0.85, 1.35, 0.85],
|
| 205 |
+
scaleX: [0.95, 1.15, 0.95],
|
| 206 |
+
opacity: [0.85, 1, 0.85],
|
| 207 |
+
}}
|
| 208 |
+
transition={{
|
| 209 |
+
duration: 0.1,
|
| 210 |
+
repeat: Infinity,
|
| 211 |
+
ease: "easeInOut",
|
| 212 |
+
}}
|
| 213 |
+
className="w-6 h-28 bg-gradient-to-t from-transparent via-cyan-400 to-white rounded-b-full filter blur-[2px] origin-top opacity-95"
|
| 214 |
+
/>
|
| 215 |
+
|
| 216 |
+
{/* Hot cyan/blue ionization core directly at the nozzle */}
|
| 217 |
+
<motion.div
|
| 218 |
+
animate={{
|
| 219 |
+
scale: [0.9, 1.25, 0.9],
|
| 220 |
+
opacity: [0.9, 1, 0.9],
|
| 221 |
+
}}
|
| 222 |
+
transition={{
|
| 223 |
+
duration: 0.08,
|
| 224 |
+
repeat: Infinity,
|
| 225 |
+
ease: "easeInOut",
|
| 226 |
+
}}
|
| 227 |
+
className="absolute top-0 w-12 h-6 bg-gradient-to-b from-cyan-400 via-indigo-600 to-transparent rounded-full filter blur-[3px] opacity-95"
|
| 228 |
+
/>
|
| 229 |
+
|
| 230 |
+
{/* Massive outer thermal halo */}
|
| 231 |
+
<motion.div
|
| 232 |
+
animate={{
|
| 233 |
+
opacity: [0.4, 0.7, 0.4],
|
| 234 |
+
scale: [0.95, 1.05, 0.95],
|
| 235 |
+
}}
|
| 236 |
+
transition={{
|
| 237 |
+
duration: 0.2,
|
| 238 |
+
repeat: Infinity,
|
| 239 |
+
ease: "easeInOut",
|
| 240 |
+
}}
|
| 241 |
+
className="absolute top-0 w-24 h-36 bg-gradient-to-t from-transparent via-indigo-500/25 to-cyan-500/40 rounded-full filter blur-[14px] mix-blend-screen"
|
| 242 |
+
/>
|
| 243 |
+
|
| 244 |
+
{/* Spark particles */}
|
| 245 |
+
<div className="absolute bottom-2 flex gap-3">
|
| 246 |
+
<motion.span
|
| 247 |
+
animate={{ y: [0, 40], opacity: [1, 0], scale: [1, 0.2] }}
|
| 248 |
+
transition={{ duration: 0.65, repeat: Infinity, delay: 0.05, ease: "easeOut" }}
|
| 249 |
+
className="w-0.5 h-0.5 bg-cyan-300 rounded-full"
|
| 250 |
+
/>
|
| 251 |
+
<motion.span
|
| 252 |
+
animate={{ y: [0, 50], opacity: [1, 0], scale: [1.2, 0.1] }}
|
| 253 |
+
transition={{ duration: 0.45, repeat: Infinity, delay: 0.2, ease: "easeOut" }}
|
| 254 |
+
className="w-1.5 h-1.5 bg-indigo-400 rounded-full"
|
| 255 |
+
/>
|
| 256 |
+
</div>
|
| 257 |
+
</div>
|
| 258 |
+
|
| 259 |
+
{/* Right Thruster - Advanced Plasma Ion Drive */}
|
| 260 |
+
<div className="absolute bottom-[34.5%] left-[56.5%] -translate-x-1/2 w-24 h-44 pointer-events-none overflow-visible flex flex-col items-center z-0" aria-hidden="true">
|
| 261 |
+
{/* Intense Plasma Core Glow (Cyan/White matching eyes/core) */}
|
| 262 |
+
<motion.div
|
| 263 |
+
animate={{
|
| 264 |
+
scaleY: [0.85, 1.35, 0.85],
|
| 265 |
+
scaleX: [0.95, 1.15, 0.95],
|
| 266 |
+
opacity: [0.85, 1, 0.85],
|
| 267 |
+
}}
|
| 268 |
+
transition={{
|
| 269 |
+
duration: 0.1,
|
| 270 |
+
repeat: Infinity,
|
| 271 |
+
ease: "easeInOut",
|
| 272 |
+
}}
|
| 273 |
+
className="w-6 h-28 bg-gradient-to-t from-transparent via-cyan-400 to-white rounded-b-full filter blur-[2px] origin-top opacity-95"
|
| 274 |
+
/>
|
| 275 |
+
|
| 276 |
+
{/* Hot cyan/blue ionization core directly at the nozzle */}
|
| 277 |
+
<motion.div
|
| 278 |
+
animate={{
|
| 279 |
+
scale: [0.9, 1.25, 0.9],
|
| 280 |
+
opacity: [0.9, 1, 0.9],
|
| 281 |
+
}}
|
| 282 |
+
transition={{
|
| 283 |
+
duration: 0.08,
|
| 284 |
+
repeat: Infinity,
|
| 285 |
+
ease: "easeInOut",
|
| 286 |
+
}}
|
| 287 |
+
className="absolute top-0 w-12 h-6 bg-gradient-to-b from-cyan-400 via-indigo-600 to-transparent rounded-full filter blur-[3px] opacity-95"
|
| 288 |
+
/>
|
| 289 |
+
|
| 290 |
+
{/* Massive outer thermal halo */}
|
| 291 |
+
<motion.div
|
| 292 |
+
animate={{
|
| 293 |
+
opacity: [0.4, 0.7, 0.4],
|
| 294 |
+
scale: [0.95, 1.05, 0.95],
|
| 295 |
+
}}
|
| 296 |
+
transition={{
|
| 297 |
+
duration: 0.2,
|
| 298 |
+
repeat: Infinity,
|
| 299 |
+
ease: "easeInOut",
|
| 300 |
+
}}
|
| 301 |
+
className="absolute top-0 w-24 h-36 bg-gradient-to-t from-transparent via-indigo-500/25 to-cyan-500/40 rounded-full filter blur-[14px] mix-blend-screen"
|
| 302 |
+
/>
|
| 303 |
+
|
| 304 |
+
{/* Spark particles */}
|
| 305 |
+
<div className="absolute bottom-2 flex gap-3">
|
| 306 |
+
<motion.span
|
| 307 |
+
animate={{ y: [0, 40], opacity: [1, 0], scale: [1, 0.2] }}
|
| 308 |
+
transition={{ duration: 0.7, repeat: Infinity, delay: 0.1, ease: "easeOut" }}
|
| 309 |
+
className="w-0.5 h-0.5 bg-cyan-300 rounded-full"
|
| 310 |
+
/>
|
| 311 |
+
<motion.span
|
| 312 |
+
animate={{ y: [0, 50], opacity: [1, 0], scale: [1.2, 0.1] }}
|
| 313 |
+
transition={{ duration: 0.5, repeat: Infinity, delay: 0.3, ease: "easeOut" }}
|
| 314 |
+
className="w-1.5 h-1.5 bg-indigo-400 rounded-full"
|
| 315 |
+
/>
|
| 316 |
+
</div>
|
| 317 |
+
</div>
|
| 318 |
+
|
| 319 |
+
<Image
|
| 320 |
+
src="/final-robot.png"
|
| 321 |
+
alt="Neural Core Robot"
|
| 322 |
+
fill
|
| 323 |
+
className="object-contain pointer-events-none z-10"
|
| 324 |
+
sizes="(max-width: 768px) 350px, (max-width: 1024px) 500px, (max-width: 1280px) 600px, 700px"
|
| 325 |
+
priority
|
| 326 |
+
/>
|
| 327 |
+
|
| 328 |
+
{/* Dynamic cyan/violet bottom reflection from the plasma thrusters, masked to the robot's silhouette */}
|
| 329 |
+
<motion.div
|
| 330 |
+
className="absolute inset-0 pointer-events-none z-20 mix-blend-color-dodge"
|
| 331 |
+
animate={{
|
| 332 |
+
opacity: [0.65, 0.85, 0.65],
|
| 333 |
+
}}
|
| 334 |
+
transition={{
|
| 335 |
+
duration: 0.15,
|
| 336 |
+
repeat: Infinity,
|
| 337 |
+
ease: "easeInOut",
|
| 338 |
+
}}
|
| 339 |
+
style={{
|
| 340 |
+
maskImage: "url(/final-robot.png)",
|
| 341 |
+
WebkitMaskImage: "url(/final-robot.png)",
|
| 342 |
+
maskSize: "contain",
|
| 343 |
+
WebkitMaskSize: "contain",
|
| 344 |
+
maskRepeat: "no-repeat",
|
| 345 |
+
WebkitMaskRepeat: "no-repeat",
|
| 346 |
+
maskPosition: "center",
|
| 347 |
+
WebkitMaskPosition: "center",
|
| 348 |
+
background: "linear-gradient(to top, rgba(34, 211, 238, 0.75) 0%, rgba(34, 211, 238, 0.35) 25%, rgba(160, 124, 254, 0.2) 45%, transparent 65%)"
|
| 349 |
+
}}
|
| 350 |
+
/>
|
| 351 |
+
</motion.div>
|
| 352 |
+
</motion.div>
|
| 353 |
+
|
| 354 |
+
</div>
|
| 355 |
+
</motion.div>
|
| 356 |
+
</div>
|
| 357 |
+
);
|
| 358 |
+
}
|
components/social-proof.tsx
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
import { Marquee } from "./ui/marquee";
|
| 4 |
+
|
| 5 |
+
const LOGOS = [
|
| 6 |
+
{
|
| 7 |
+
name: "Y Combinator",
|
| 8 |
+
color: "#ff6600",
|
| 9 |
+
svg: (
|
| 10 |
+
<svg className="h-5 w-5" viewBox="0 0 24 24" fill="currentColor">
|
| 11 |
+
<rect width="24" height="24" rx="4" fill="#ff6600" />
|
| 12 |
+
<path d="M6 6h2.5l3.5 6.5L15.5 6H18l-5.5 10v4h-2.5v-4z" fill="white" />
|
| 13 |
+
</svg>
|
| 14 |
+
),
|
| 15 |
+
},
|
| 16 |
+
{
|
| 17 |
+
name: "Sequoia Capital",
|
| 18 |
+
color: "#0f763e",
|
| 19 |
+
svg: (
|
| 20 |
+
<svg className="h-6 w-24" viewBox="0 0 100 24" fill="currentColor">
|
| 21 |
+
<text x="0" y="18" className="font-sans font-black tracking-wider text-sm fill-emerald-500">SEQUOIA</text>
|
| 22 |
+
</svg>
|
| 23 |
+
),
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
name: "Accel Partners",
|
| 27 |
+
color: "#3b82f6",
|
| 28 |
+
svg: (
|
| 29 |
+
<svg className="h-6 w-20" viewBox="0 0 100 24" fill="currentColor">
|
| 30 |
+
<circle cx="8" cy="12" r="6" fill="#3b82f6" />
|
| 31 |
+
<text x="22" y="18" className="font-sans font-bold tracking-tight text-sm fill-current text-[var(--card-foreground)]">ACCEL</text>
|
| 32 |
+
</svg>
|
| 33 |
+
),
|
| 34 |
+
},
|
| 35 |
+
{
|
| 36 |
+
name: "Founders Fund",
|
| 37 |
+
color: "#ec4899",
|
| 38 |
+
svg: (
|
| 39 |
+
<svg className="h-6 w-32" viewBox="0 0 120 24" fill="currentColor">
|
| 40 |
+
<text x="0" y="18" className="font-mono font-semibold tracking-widest text-[11px] fill-rose-500">FOUNDERS FUND</text>
|
| 41 |
+
</svg>
|
| 42 |
+
),
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
name: "Andreessen Horowitz",
|
| 46 |
+
color: "#f59e0b",
|
| 47 |
+
svg: (
|
| 48 |
+
<svg className="h-6 w-12" viewBox="0 0 60 24" fill="currentColor">
|
| 49 |
+
<text x="0" y="18" className="font-sans font-extrabold text-[15px] fill-amber-500">a16z</text>
|
| 50 |
+
</svg>
|
| 51 |
+
),
|
| 52 |
+
},
|
| 53 |
+
{
|
| 54 |
+
name: "Benchmark",
|
| 55 |
+
color: "#8b5cf6",
|
| 56 |
+
svg: (
|
| 57 |
+
<svg className="h-6 w-28" viewBox="0 0 100 24" fill="currentColor">
|
| 58 |
+
<text x="0" y="18" className="font-serif italic font-bold text-sm fill-violet-500">BENCHMARK</text>
|
| 59 |
+
</svg>
|
| 60 |
+
),
|
| 61 |
+
},
|
| 62 |
+
];
|
| 63 |
+
|
| 64 |
+
export function SocialProof() {
|
| 65 |
+
return (
|
| 66 |
+
<section className="relative z-10 w-full py-12 md:py-16 overflow-hidden border-y border-border bg-muted/20 backdrop-blur-sm">
|
| 67 |
+
{/* Decorative background glow */}
|
| 68 |
+
<div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[80%] h-8 bg-primary/5 blur-2xl pointer-events-none" />
|
| 69 |
+
|
| 70 |
+
<div className="max-w-7xl mx-auto px-6">
|
| 71 |
+
<div className="text-center mb-8 space-y-2">
|
| 72 |
+
<p className="text-[10px] font-mono text-primary tracking-[0.2em] uppercase">
|
| 73 |
+
{"// Supported & Backed By Leading Global Investors"}
|
| 74 |
+
</p>
|
| 75 |
+
</div>
|
| 76 |
+
|
| 77 |
+
<div className="relative w-full flex items-center justify-center">
|
| 78 |
+
{/* Left/Right masks for smooth marquee fading edges */}
|
| 79 |
+
<div className="absolute left-0 top-0 bottom-0 w-24 bg-gradient-to-r from-background to-transparent z-10 pointer-events-none" />
|
| 80 |
+
<div className="absolute right-0 top-0 bottom-0 w-24 bg-gradient-to-l from-background to-transparent z-10 pointer-events-none" />
|
| 81 |
+
|
| 82 |
+
<Marquee className="py-4 [--duration:30s] w-full" pauseOnHover>
|
| 83 |
+
{LOGOS.map((logo, idx) => (
|
| 84 |
+
<div
|
| 85 |
+
key={idx}
|
| 86 |
+
className="flex items-center gap-3 px-6 py-3 mx-4 rounded-xl border border-[var(--card-border)] bg-card backdrop-blur-md shadow-sm transition-[border-color,box-shadow,transform] duration-300 hover:border-primary/30 hover:shadow-[0_0_20px_var(--primary-glow)] group hover:-translate-y-0.5 cursor-pointer select-none"
|
| 87 |
+
>
|
| 88 |
+
<div className="opacity-70 group-hover:opacity-100 transition-opacity duration-300">
|
| 89 |
+
{logo.svg}
|
| 90 |
+
</div>
|
| 91 |
+
<span className="text-xs font-mono text-[var(--card-muted-foreground)] group-hover:text-[var(--card-foreground)] transition-colors duration-300">
|
| 92 |
+
{logo.name}
|
| 93 |
+
</span>
|
| 94 |
+
</div>
|
| 95 |
+
))}
|
| 96 |
+
</Marquee>
|
| 97 |
+
</div>
|
| 98 |
+
</div>
|
| 99 |
+
</section>
|
| 100 |
+
);
|
| 101 |
+
}
|
components/theme-provider.tsx
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
import * as React from "react";
|
| 4 |
+
import { ThemeProvider as NextThemesProvider } from "next-themes";
|
| 5 |
+
|
| 6 |
+
export function ThemeProvider({
|
| 7 |
+
children,
|
| 8 |
+
...props
|
| 9 |
+
}: React.ComponentProps<typeof NextThemesProvider>) {
|
| 10 |
+
return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
|
| 11 |
+
}
|
components/ui/bento-grid.tsx
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { type ComponentPropsWithoutRef, type ReactNode } from "react"
|
| 2 |
+
import { ArrowRightIcon } from "@radix-ui/react-icons"
|
| 3 |
+
|
| 4 |
+
import { cn } from "@/lib/utils"
|
| 5 |
+
import { Button } from "@/components/ui/button"
|
| 6 |
+
|
| 7 |
+
interface BentoGridProps extends ComponentPropsWithoutRef<"div"> {
|
| 8 |
+
children: ReactNode
|
| 9 |
+
className?: string
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
interface BentoCardProps extends ComponentPropsWithoutRef<"div"> {
|
| 13 |
+
name: string
|
| 14 |
+
className: string
|
| 15 |
+
background: ReactNode
|
| 16 |
+
Icon: React.ElementType
|
| 17 |
+
description: string
|
| 18 |
+
href: string
|
| 19 |
+
cta: string
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
const BentoGrid = ({ children, className, ...props }: BentoGridProps) => {
|
| 23 |
+
return (
|
| 24 |
+
<div
|
| 25 |
+
className={cn(
|
| 26 |
+
"grid w-full auto-rows-[22rem] grid-cols-3 gap-4",
|
| 27 |
+
className
|
| 28 |
+
)}
|
| 29 |
+
{...props}
|
| 30 |
+
>
|
| 31 |
+
{children}
|
| 32 |
+
</div>
|
| 33 |
+
)
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
const BentoCard = ({
|
| 37 |
+
name,
|
| 38 |
+
className,
|
| 39 |
+
background,
|
| 40 |
+
Icon,
|
| 41 |
+
description,
|
| 42 |
+
href,
|
| 43 |
+
cta,
|
| 44 |
+
...props
|
| 45 |
+
}: BentoCardProps) => (
|
| 46 |
+
<div
|
| 47 |
+
key={name}
|
| 48 |
+
className={cn(
|
| 49 |
+
"group relative col-span-3 flex flex-col justify-between overflow-hidden rounded-xl transition-all duration-300",
|
| 50 |
+
"inverted-card backdrop-blur-xl border border-[var(--card-contrast-border)]",
|
| 51 |
+
"shadow-[0_4px_20px_rgba(0,0,0,0.05)] dark:shadow-[0_4px_30px_rgba(0,0,0,0.2)]",
|
| 52 |
+
"hover:border-primary/50 hover:shadow-[0_0_30px_var(--primary-glow)]",
|
| 53 |
+
className
|
| 54 |
+
)}
|
| 55 |
+
{...props}
|
| 56 |
+
>
|
| 57 |
+
<div>{background}</div>
|
| 58 |
+
<div className="p-5 md:p-6 z-10">
|
| 59 |
+
<div className="pointer-events-none z-10 flex transform-gpu flex-col gap-2 transition-all duration-300 lg:group-hover:-translate-y-10">
|
| 60 |
+
<Icon className="h-10 w-10 origin-left transform-gpu text-foreground/80 dark:text-foreground/70 transition-all duration-300 ease-in-out group-hover:scale-75 group-hover:text-primary filter group-hover:drop-shadow-[0_0_8px_var(--primary-glow)]" />
|
| 61 |
+
<h3 className="text-lg md:text-xl font-bold tracking-tight text-foreground transition-colors duration-300">
|
| 62 |
+
{name}
|
| 63 |
+
</h3>
|
| 64 |
+
<p className="max-w-lg text-xs md:text-sm text-muted-foreground leading-relaxed font-mono">{description}</p>
|
| 65 |
+
</div>
|
| 66 |
+
|
| 67 |
+
<div
|
| 68 |
+
className={cn(
|
| 69 |
+
"pointer-events-none flex w-full translate-y-0 transform-gpu flex-row items-center transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100 lg:hidden mt-3"
|
| 70 |
+
)}
|
| 71 |
+
>
|
| 72 |
+
<Button
|
| 73 |
+
variant="link"
|
| 74 |
+
asChild
|
| 75 |
+
size="sm"
|
| 76 |
+
className="pointer-events-auto p-0 text-foreground font-bold font-mono hover:text-primary transition-colors duration-200"
|
| 77 |
+
>
|
| 78 |
+
<a href={href} className="flex items-center gap-1">
|
| 79 |
+
<span>{cta}</span>
|
| 80 |
+
<ArrowRightIcon className="h-4 w-4 transition-transform group-hover:translate-x-1 duration-200" />
|
| 81 |
+
</a>
|
| 82 |
+
</Button>
|
| 83 |
+
</div>
|
| 84 |
+
</div>
|
| 85 |
+
|
| 86 |
+
<div
|
| 87 |
+
className={cn(
|
| 88 |
+
"pointer-events-none absolute bottom-0 hidden w-full translate-y-10 transform-gpu flex-row items-center p-6 opacity-0 transition-all duration-300 group-hover:translate-y-0 group-hover:opacity-100 lg:flex"
|
| 89 |
+
)}
|
| 90 |
+
>
|
| 91 |
+
<Button
|
| 92 |
+
variant="link"
|
| 93 |
+
asChild
|
| 94 |
+
size="sm"
|
| 95 |
+
className="pointer-events-auto p-0 text-foreground font-bold font-mono hover:text-primary transition-colors duration-200"
|
| 96 |
+
>
|
| 97 |
+
<a href={href} className="flex items-center gap-1">
|
| 98 |
+
<span>{cta}</span>
|
| 99 |
+
<ArrowRightIcon className="h-4 w-4 transition-transform group-hover:translate-x-1 duration-200" />
|
| 100 |
+
</a>
|
| 101 |
+
</Button>
|
| 102 |
+
</div>
|
| 103 |
+
|
| 104 |
+
<div className="pointer-events-none absolute inset-0 transform-gpu transition-all duration-300 group-hover:bg-black/[0.01] group-hover:dark:bg-neutral-800/[0.02]" />
|
| 105 |
+
</div>
|
| 106 |
+
)
|
| 107 |
+
|
| 108 |
+
export { BentoCard, BentoGrid }
|
components/ui/button.tsx
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from "react"
|
| 2 |
+
import { cva, type VariantProps } from "class-variance-authority"
|
| 3 |
+
import { Slot } from "radix-ui"
|
| 4 |
+
|
| 5 |
+
import { cn } from "@/lib/utils"
|
| 6 |
+
|
| 7 |
+
const buttonVariants = cva(
|
| 8 |
+
"group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-[background-color,border-color,text-color,fill,stroke,opacity,box-shadow,transform] duration-200 outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
| 9 |
+
{
|
| 10 |
+
variants: {
|
| 11 |
+
variant: {
|
| 12 |
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
| 13 |
+
outline:
|
| 14 |
+
"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
| 15 |
+
secondary:
|
| 16 |
+
"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
| 17 |
+
ghost:
|
| 18 |
+
"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
| 19 |
+
destructive:
|
| 20 |
+
"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
| 21 |
+
link: "text-primary underline-offset-4 hover:underline",
|
| 22 |
+
},
|
| 23 |
+
size: {
|
| 24 |
+
default:
|
| 25 |
+
"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
| 26 |
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
| 27 |
+
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
| 28 |
+
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
| 29 |
+
icon: "size-8",
|
| 30 |
+
"icon-xs":
|
| 31 |
+
"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
| 32 |
+
"icon-sm":
|
| 33 |
+
"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
| 34 |
+
"icon-lg": "size-9",
|
| 35 |
+
},
|
| 36 |
+
},
|
| 37 |
+
defaultVariants: {
|
| 38 |
+
variant: "default",
|
| 39 |
+
size: "default",
|
| 40 |
+
},
|
| 41 |
+
}
|
| 42 |
+
)
|
| 43 |
+
|
| 44 |
+
function Button({
|
| 45 |
+
className,
|
| 46 |
+
variant = "default",
|
| 47 |
+
size = "default",
|
| 48 |
+
asChild = false,
|
| 49 |
+
...props
|
| 50 |
+
}: React.ComponentProps<"button"> &
|
| 51 |
+
VariantProps<typeof buttonVariants> & {
|
| 52 |
+
asChild?: boolean
|
| 53 |
+
}) {
|
| 54 |
+
const Comp = asChild ? Slot.Root : "button"
|
| 55 |
+
|
| 56 |
+
return (
|
| 57 |
+
<Comp
|
| 58 |
+
data-slot="button"
|
| 59 |
+
data-variant={variant}
|
| 60 |
+
data-size={size}
|
| 61 |
+
className={cn(buttonVariants({ variant, size, className }))}
|
| 62 |
+
{...props}
|
| 63 |
+
/>
|
| 64 |
+
)
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
export { Button, buttonVariants }
|
components/ui/card.tsx
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from "react"
|
| 2 |
+
|
| 3 |
+
import { cn } from "@/lib/utils"
|
| 4 |
+
|
| 5 |
+
function Card({
|
| 6 |
+
className,
|
| 7 |
+
size = "default",
|
| 8 |
+
...props
|
| 9 |
+
}: React.ComponentProps<"div"> & { size?: "default" | "sm" }) {
|
| 10 |
+
return (
|
| 11 |
+
<div
|
| 12 |
+
data-slot="card"
|
| 13 |
+
data-size={size}
|
| 14 |
+
className={cn(
|
| 15 |
+
"group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
|
| 16 |
+
className
|
| 17 |
+
)}
|
| 18 |
+
{...props}
|
| 19 |
+
/>
|
| 20 |
+
)
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
| 24 |
+
return (
|
| 25 |
+
<div
|
| 26 |
+
data-slot="card-header"
|
| 27 |
+
className={cn(
|
| 28 |
+
"group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",
|
| 29 |
+
className
|
| 30 |
+
)}
|
| 31 |
+
{...props}
|
| 32 |
+
/>
|
| 33 |
+
)
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
|
| 37 |
+
return (
|
| 38 |
+
<div
|
| 39 |
+
data-slot="card-title"
|
| 40 |
+
className={cn(
|
| 41 |
+
"font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",
|
| 42 |
+
className
|
| 43 |
+
)}
|
| 44 |
+
{...props}
|
| 45 |
+
/>
|
| 46 |
+
)
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
| 50 |
+
return (
|
| 51 |
+
<div
|
| 52 |
+
data-slot="card-description"
|
| 53 |
+
className={cn("text-sm text-muted-foreground", className)}
|
| 54 |
+
{...props}
|
| 55 |
+
/>
|
| 56 |
+
)
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
|
| 60 |
+
return (
|
| 61 |
+
<div
|
| 62 |
+
data-slot="card-action"
|
| 63 |
+
className={cn(
|
| 64 |
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
| 65 |
+
className
|
| 66 |
+
)}
|
| 67 |
+
{...props}
|
| 68 |
+
/>
|
| 69 |
+
)
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
|
| 73 |
+
return (
|
| 74 |
+
<div
|
| 75 |
+
data-slot="card-content"
|
| 76 |
+
className={cn("px-4 group-data-[size=sm]/card:px-3", className)}
|
| 77 |
+
{...props}
|
| 78 |
+
/>
|
| 79 |
+
)
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
|
| 83 |
+
return (
|
| 84 |
+
<div
|
| 85 |
+
data-slot="card-footer"
|
| 86 |
+
className={cn(
|
| 87 |
+
"flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3",
|
| 88 |
+
className
|
| 89 |
+
)}
|
| 90 |
+
{...props}
|
| 91 |
+
/>
|
| 92 |
+
)
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
export {
|
| 96 |
+
Card,
|
| 97 |
+
CardHeader,
|
| 98 |
+
CardFooter,
|
| 99 |
+
CardTitle,
|
| 100 |
+
CardAction,
|
| 101 |
+
CardDescription,
|
| 102 |
+
CardContent,
|
| 103 |
+
}
|
components/ui/dia-text-reveal.tsx
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client"
|
| 2 |
+
|
| 3 |
+
import { useEffect, useRef, useState, useMemo } from "react"
|
| 4 |
+
import {
|
| 5 |
+
animate,
|
| 6 |
+
motion,
|
| 7 |
+
useInView,
|
| 8 |
+
useMotionValue,
|
| 9 |
+
useReducedMotion,
|
| 10 |
+
useTransform,
|
| 11 |
+
type HTMLMotionProps,
|
| 12 |
+
} from "motion/react"
|
| 13 |
+
|
| 14 |
+
import { cn } from "@/lib/utils"
|
| 15 |
+
|
| 16 |
+
const DEFAULT_COLORS = ["#c679c4", "#fa3d1d", "#ffb005", "#e1e1fe", "#0358f7"]
|
| 17 |
+
const BAND_HALF = 17
|
| 18 |
+
const SWEEP_START = -BAND_HALF
|
| 19 |
+
const SWEEP_END = 100 + BAND_HALF
|
| 20 |
+
|
| 21 |
+
const sweepEase = (t: number) =>
|
| 22 |
+
t < 0.5 ? 4 * t ** 3 : 1 - (-2 * t + 2) ** 3 / 2
|
| 23 |
+
|
| 24 |
+
function buildGradient(pos: number, colors: string[], textColor: string) {
|
| 25 |
+
const bandStart = pos - BAND_HALF
|
| 26 |
+
const bandEnd = pos + BAND_HALF
|
| 27 |
+
|
| 28 |
+
if (bandStart >= 100) {
|
| 29 |
+
return `linear-gradient(90deg, ${textColor}, ${textColor})`
|
| 30 |
+
}
|
| 31 |
+
const n = colors.length
|
| 32 |
+
const parts: string[] = []
|
| 33 |
+
|
| 34 |
+
if (bandStart > 0)
|
| 35 |
+
parts.push(`${textColor} 0%`, `${textColor} ${bandStart.toFixed(2)}%`)
|
| 36 |
+
|
| 37 |
+
colors.forEach((c, i) => {
|
| 38 |
+
const pct = n === 1 ? pos : bandStart + (i / (n - 1)) * BAND_HALF * 2
|
| 39 |
+
parts.push(`${c} ${pct.toFixed(2)}%`)
|
| 40 |
+
})
|
| 41 |
+
|
| 42 |
+
if (bandEnd < 100)
|
| 43 |
+
parts.push(`transparent ${bandEnd.toFixed(2)}%`, `transparent 100%`)
|
| 44 |
+
|
| 45 |
+
return `linear-gradient(90deg, ${parts.join(", ")})`
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
function measureWidths(el: HTMLElement, texts: string[]) {
|
| 49 |
+
const ghost = el.cloneNode() as HTMLElement
|
| 50 |
+
Object.assign(ghost.style, {
|
| 51 |
+
position: "absolute",
|
| 52 |
+
visibility: "hidden",
|
| 53 |
+
pointerEvents: "none",
|
| 54 |
+
width: "auto",
|
| 55 |
+
whiteSpace: "nowrap",
|
| 56 |
+
})
|
| 57 |
+
el.parentElement!.appendChild(ghost)
|
| 58 |
+
const widths = texts.map((t) => {
|
| 59 |
+
ghost.textContent = t
|
| 60 |
+
return ghost.getBoundingClientRect().width
|
| 61 |
+
})
|
| 62 |
+
ghost.remove()
|
| 63 |
+
return widths
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
/**
|
| 67 |
+
* Props for {@link DiaTextReveal}.
|
| 68 |
+
*/
|
| 69 |
+
export interface DiaTextRevealProps extends Omit<
|
| 70 |
+
HTMLMotionProps<"span">,
|
| 71 |
+
"ref" | "children" | "style" | "animate" | "transition" | "color"
|
| 72 |
+
> {
|
| 73 |
+
/**
|
| 74 |
+
* Text to reveal. Pass multiple strings to rotate when {@link DiaTextRevealProps.repeat} is `true`.
|
| 75 |
+
*/
|
| 76 |
+
text: string | string[]
|
| 77 |
+
/**
|
| 78 |
+
* Colors sampled across the moving gradient band. Defaults to a built-in palette.
|
| 79 |
+
*/
|
| 80 |
+
colors?: string[]
|
| 81 |
+
/**
|
| 82 |
+
* CSS color for revealed text after the sweep and for leading/trailing regions during the animation.
|
| 83 |
+
* @defaultValue `"var(--foreground)"`
|
| 84 |
+
*/
|
| 85 |
+
textColor?: string
|
| 86 |
+
/**
|
| 87 |
+
* Duration of one sweep pass, in seconds.
|
| 88 |
+
* @defaultValue `1.5`
|
| 89 |
+
*/
|
| 90 |
+
duration?: number
|
| 91 |
+
/**
|
| 92 |
+
* Delay before the sweep starts, in seconds.
|
| 93 |
+
* @defaultValue `0`
|
| 94 |
+
*/
|
| 95 |
+
delay?: number
|
| 96 |
+
/**
|
| 97 |
+
* When `text` is an array, replay the sweep and advance to the next string after each completion.
|
| 98 |
+
* @defaultValue `false`
|
| 99 |
+
*/
|
| 100 |
+
repeat?: boolean
|
| 101 |
+
/**
|
| 102 |
+
* Pause between cycles when {@link DiaTextRevealProps.repeat} is `true`, in seconds.
|
| 103 |
+
* @defaultValue `0.5`
|
| 104 |
+
*/
|
| 105 |
+
repeatDelay?: number
|
| 106 |
+
/**
|
| 107 |
+
* If `true`, the animation starts only after the element enters the viewport.
|
| 108 |
+
* @defaultValue `true`
|
| 109 |
+
*/
|
| 110 |
+
startOnView?: boolean
|
| 111 |
+
/**
|
| 112 |
+
* Passed to `useInView`: if `true`, in-view detection fires at most once (no replay on scroll-back).
|
| 113 |
+
* @defaultValue `true`
|
| 114 |
+
*/
|
| 115 |
+
once?: boolean
|
| 116 |
+
/**
|
| 117 |
+
* Additional class names for the animated `span` (e.g. typography utilities).
|
| 118 |
+
*/
|
| 119 |
+
className?: string
|
| 120 |
+
/**
|
| 121 |
+
* When `text` has multiple entries, use the widest string’s width for layout instead of animating width per line.
|
| 122 |
+
* @defaultValue `false`
|
| 123 |
+
*/
|
| 124 |
+
fixedWidth?: boolean
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
export function DiaTextReveal({
|
| 128 |
+
text,
|
| 129 |
+
colors = DEFAULT_COLORS,
|
| 130 |
+
textColor = "var(--foreground)",
|
| 131 |
+
duration = 1.5,
|
| 132 |
+
delay = 0,
|
| 133 |
+
repeat = false,
|
| 134 |
+
repeatDelay = 0.5,
|
| 135 |
+
startOnView = true,
|
| 136 |
+
once = true,
|
| 137 |
+
className,
|
| 138 |
+
fixedWidth = false,
|
| 139 |
+
...props
|
| 140 |
+
}: DiaTextRevealProps) {
|
| 141 |
+
const texts = useMemo(() => (Array.isArray(text) ? text : [text]), [text])
|
| 142 |
+
const isMulti = texts.length > 1
|
| 143 |
+
const prefersReducedMotion = useReducedMotion()
|
| 144 |
+
|
| 145 |
+
const spanRef = useRef<HTMLSpanElement>(null)
|
| 146 |
+
const optsRef = useRef({
|
| 147 |
+
colors,
|
| 148 |
+
textColor,
|
| 149 |
+
duration,
|
| 150 |
+
delay,
|
| 151 |
+
repeat,
|
| 152 |
+
repeatDelay,
|
| 153 |
+
texts,
|
| 154 |
+
})
|
| 155 |
+
|
| 156 |
+
// Safe ref assignment inside useEffect to satisfy React 19 rules
|
| 157 |
+
useEffect(() => {
|
| 158 |
+
optsRef.current = {
|
| 159 |
+
colors,
|
| 160 |
+
textColor,
|
| 161 |
+
duration,
|
| 162 |
+
delay,
|
| 163 |
+
repeat,
|
| 164 |
+
repeatDelay,
|
| 165 |
+
texts,
|
| 166 |
+
}
|
| 167 |
+
})
|
| 168 |
+
|
| 169 |
+
const indexRef = useRef(0)
|
| 170 |
+
const hasPlayedRef = useRef(false)
|
| 171 |
+
const timerRef = useRef<ReturnType<typeof setTimeout>>(undefined)
|
| 172 |
+
const playRef = useRef<() => void>(null!)
|
| 173 |
+
const stopRef = useRef<(() => void) | null>(null)
|
| 174 |
+
|
| 175 |
+
const [activeIndex, setActiveIndex] = useState(0)
|
| 176 |
+
const [measuredWidths, setMeasuredWidths] = useState<number[]>([])
|
| 177 |
+
|
| 178 |
+
const sweepPos = useMotionValue(SWEEP_START)
|
| 179 |
+
|
| 180 |
+
const backgroundImage = useTransform(sweepPos, (pos) =>
|
| 181 |
+
buildGradient(pos, optsRef.current.colors, optsRef.current.textColor)
|
| 182 |
+
)
|
| 183 |
+
|
| 184 |
+
const isInView = useInView(spanRef, { once, amount: 0.1 })
|
| 185 |
+
|
| 186 |
+
const depString = Array.isArray(text) ? text.join("\0") : text
|
| 187 |
+
useEffect(() => {
|
| 188 |
+
const el = spanRef.current
|
| 189 |
+
if (!el || !isMulti) return
|
| 190 |
+
setMeasuredWidths(measureWidths(el, texts))
|
| 191 |
+
}, [depString, isMulti, texts])
|
| 192 |
+
|
| 193 |
+
// Safe ref assignment inside useEffect to satisfy React 19 rules
|
| 194 |
+
useEffect(() => {
|
| 195 |
+
playRef.current = () => {
|
| 196 |
+
const { duration, delay, repeat, repeatDelay, texts } = optsRef.current
|
| 197 |
+
|
| 198 |
+
sweepPos.set(SWEEP_START)
|
| 199 |
+
|
| 200 |
+
const controls = animate(sweepPos, SWEEP_END, {
|
| 201 |
+
duration,
|
| 202 |
+
delay,
|
| 203 |
+
ease: sweepEase,
|
| 204 |
+
onComplete() {
|
| 205 |
+
if (!repeat) return
|
| 206 |
+
timerRef.current = setTimeout(() => {
|
| 207 |
+
const next = (indexRef.current + 1) % texts.length
|
| 208 |
+
indexRef.current = next
|
| 209 |
+
setActiveIndex(next)
|
| 210 |
+
playRef.current()
|
| 211 |
+
}, repeatDelay * 1000)
|
| 212 |
+
},
|
| 213 |
+
})
|
| 214 |
+
|
| 215 |
+
stopRef.current = () => controls.stop()
|
| 216 |
+
}
|
| 217 |
+
})
|
| 218 |
+
|
| 219 |
+
useEffect(() => {
|
| 220 |
+
if (prefersReducedMotion) {
|
| 221 |
+
sweepPos.set(SWEEP_END)
|
| 222 |
+
return
|
| 223 |
+
}
|
| 224 |
+
if (startOnView && !isInView) return
|
| 225 |
+
if (once && hasPlayedRef.current) return
|
| 226 |
+
hasPlayedRef.current = true
|
| 227 |
+
playRef.current()
|
| 228 |
+
|
| 229 |
+
return () => {
|
| 230 |
+
stopRef.current?.()
|
| 231 |
+
clearTimeout(timerRef.current)
|
| 232 |
+
}
|
| 233 |
+
}, [isInView, startOnView, once, prefersReducedMotion, sweepPos])
|
| 234 |
+
|
| 235 |
+
const fixedW =
|
| 236 |
+
isMulti && fixedWidth && measuredWidths.length > 0
|
| 237 |
+
? Math.max(...measuredWidths)
|
| 238 |
+
: undefined
|
| 239 |
+
|
| 240 |
+
const animatedW =
|
| 241 |
+
isMulti && !fixedWidth && measuredWidths[activeIndex] != null
|
| 242 |
+
? measuredWidths[activeIndex]
|
| 243 |
+
: undefined
|
| 244 |
+
|
| 245 |
+
return (
|
| 246 |
+
<motion.span
|
| 247 |
+
ref={spanRef}
|
| 248 |
+
className={cn("align-bottom leading-[100%] text-inherit", className)}
|
| 249 |
+
style={{
|
| 250 |
+
transform: "translateY(-2px)",
|
| 251 |
+
color: "transparent",
|
| 252 |
+
backgroundClip: "text",
|
| 253 |
+
WebkitBackgroundClip: "text",
|
| 254 |
+
backgroundSize: "100% 100%",
|
| 255 |
+
backgroundImage,
|
| 256 |
+
...(isMulti && {
|
| 257 |
+
display: "inline-block",
|
| 258 |
+
overflow: "hidden",
|
| 259 |
+
whiteSpace: "nowrap",
|
| 260 |
+
verticalAlign: "text-center",
|
| 261 |
+
...(fixedW != null && { width: fixedW }),
|
| 262 |
+
}),
|
| 263 |
+
}}
|
| 264 |
+
animate={animatedW != null ? { width: animatedW } : undefined}
|
| 265 |
+
transition={{ duration: 0.4, ease: [0.4, 0, 0.2, 1] }}
|
| 266 |
+
{...props}
|
| 267 |
+
>
|
| 268 |
+
{tex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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client"
|
| 2 |
+
|
| 3 |
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react"
|
| 4 |
+
|
| 5 |
+
import { cn } from "@/lib/utils"
|
| 6 |
+
|
| 7 |
+
interface FlickeringGridProps extends React.HTMLAttributes<HTMLDivElement> {
|
| 8 |
+
squareSize?: number
|
| 9 |
+
gridGap?: number
|
| 10 |
+
flickerChance?: number
|
| 11 |
+
color?: string
|
| 12 |
+
width?: number
|
| 13 |
+
height?: number
|
| 14 |
+
className?: string
|
| 15 |
+
maxOpacity?: number
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
export const FlickeringGrid: React.FC<FlickeringGridProps> = ({
|
| 19 |
+
squareSize = 4,
|
| 20 |
+
gridGap = 6,
|
| 21 |
+
flickerChance = 0.3,
|
| 22 |
+
color = "rgb(0, 0, 0)",
|
| 23 |
+
width,
|
| 24 |
+
height,
|
| 25 |
+
className,
|
| 26 |
+
maxOpacity = 0.3,
|
| 27 |
+
...props
|
| 28 |
+
}) => {
|
| 29 |
+
const canvasRef = useRef<HTMLCanvasElement>(null)
|
| 30 |
+
const containerRef = useRef<HTMLDivElement>(null)
|
| 31 |
+
const [isInView, setIsInView] = useState(false)
|
| 32 |
+
const [canvasSize, setCanvasSize] = useState({ width: 0, height: 0 })
|
| 33 |
+
|
| 34 |
+
const memoizedColor = useMemo(() => {
|
| 35 |
+
const toRGBA = (color: string) => {
|
| 36 |
+
if (typeof window === "undefined") {
|
| 37 |
+
return `rgba(0, 0, 0,`
|
| 38 |
+
}
|
| 39 |
+
const canvas = document.createElement("canvas")
|
| 40 |
+
canvas.width = canvas.height = 1
|
| 41 |
+
const ctx = canvas.getContext("2d")
|
| 42 |
+
if (!ctx) return "rgba(255, 0, 0,"
|
| 43 |
+
ctx.fillStyle = color
|
| 44 |
+
ctx.fillRect(0, 0, 1, 1)
|
| 45 |
+
const [r, g, b] = Array.from(ctx.getImageData(0, 0, 1, 1).data)
|
| 46 |
+
return `rgba(${r}, ${g}, ${b},`
|
| 47 |
+
}
|
| 48 |
+
return toRGBA(color)
|
| 49 |
+
}, [color])
|
| 50 |
+
|
| 51 |
+
const setupCanvas = useCallback(
|
| 52 |
+
(canvas: HTMLCanvasElement, width: number, height: number) => {
|
| 53 |
+
const dpr = window.devicePixelRatio || 1
|
| 54 |
+
canvas.width = width * dpr
|
| 55 |
+
canvas.height = height * dpr
|
| 56 |
+
canvas.style.width = `${width}px`
|
| 57 |
+
canvas.style.height = `${height}px`
|
| 58 |
+
const cols = Math.ceil(width / (squareSize + gridGap))
|
| 59 |
+
const rows = Math.ceil(height / (squareSize + gridGap))
|
| 60 |
+
|
| 61 |
+
const squares = new Float32Array(cols * rows)
|
| 62 |
+
for (let i = 0; i < squares.length; i++) {
|
| 63 |
+
squares[i] = Math.random() * maxOpacity
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
return { cols, rows, squares, dpr }
|
| 67 |
+
},
|
| 68 |
+
[squareSize, gridGap, maxOpacity]
|
| 69 |
+
)
|
| 70 |
+
|
| 71 |
+
const updateSquares = useCallback(
|
| 72 |
+
(squares: Float32Array, deltaTime: number) => {
|
| 73 |
+
for (let i = 0; i < squares.length; i++) {
|
| 74 |
+
if (Math.random() < flickerChance * deltaTime) {
|
| 75 |
+
squares[i] = Math.random() * maxOpacity
|
| 76 |
+
}
|
| 77 |
+
}
|
| 78 |
+
},
|
| 79 |
+
[flickerChance, maxOpacity]
|
| 80 |
+
)
|
| 81 |
+
|
| 82 |
+
const drawGrid = useCallback(
|
| 83 |
+
(
|
| 84 |
+
ctx: CanvasRenderingContext2D,
|
| 85 |
+
width: number,
|
| 86 |
+
height: number,
|
| 87 |
+
cols: number,
|
| 88 |
+
rows: number,
|
| 89 |
+
squares: Float32Array,
|
| 90 |
+
dpr: number
|
| 91 |
+
) => {
|
| 92 |
+
ctx.clearRect(0, 0, width, height)
|
| 93 |
+
ctx.fillStyle = "transparent"
|
| 94 |
+
ctx.fillRect(0, 0, width, height)
|
| 95 |
+
|
| 96 |
+
for (let i = 0; i < cols; i++) {
|
| 97 |
+
for (let j = 0; j < rows; j++) {
|
| 98 |
+
const opacity = squares[i * rows + j]
|
| 99 |
+
ctx.fillStyle = `${memoizedColor}${opacity})`
|
| 100 |
+
ctx.fillRect(
|
| 101 |
+
i * (squareSize + gridGap) * dpr,
|
| 102 |
+
j * (squareSize + gridGap) * dpr,
|
| 103 |
+
squareSize * dpr,
|
| 104 |
+
squareSize * dpr
|
| 105 |
+
)
|
| 106 |
+
}
|
| 107 |
+
}
|
| 108 |
+
},
|
| 109 |
+
[memoizedColor, squareSize, gridGap]
|
| 110 |
+
)
|
| 111 |
+
|
| 112 |
+
useEffect(() => {
|
| 113 |
+
const canvas = canvasRef.current
|
| 114 |
+
const container = containerRef.current
|
| 115 |
+
const ctx = canvas?.getContext("2d") ?? null
|
| 116 |
+
let animationFrameId: number | null = null
|
| 117 |
+
let resizeObserver: ResizeObserver | null = null
|
| 118 |
+
let intersectionObserver: IntersectionObserver | null = null
|
| 119 |
+
let gridParams: ReturnType<typeof setupCanvas> | null = null
|
| 120 |
+
|
| 121 |
+
if (canvas && container && ctx) {
|
| 122 |
+
const updateCanvasSize = () => {
|
| 123 |
+
const newWidth = width || container.clientWidth
|
| 124 |
+
const newHeight = height || container.clientHeight
|
| 125 |
+
setCanvasSize({ width: newWidth, height: newHeight })
|
| 126 |
+
gridParams = setupCanvas(canvas, newWidth, newHeight)
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
updateCanvasSize()
|
| 130 |
+
|
| 131 |
+
let lastTime = 0
|
| 132 |
+
const animate = (time: number) => {
|
| 133 |
+
if (!isInView || !gridParams) return
|
| 134 |
+
|
| 135 |
+
const deltaTime = (time - lastTime) / 1000
|
| 136 |
+
lastTime = time
|
| 137 |
+
|
| 138 |
+
updateSquares(gridParams.squares, deltaTime)
|
| 139 |
+
drawGrid(
|
| 140 |
+
ctx,
|
| 141 |
+
canvas.width,
|
| 142 |
+
canvas.height,
|
| 143 |
+
gridParams.cols,
|
| 144 |
+
gridParams.rows,
|
| 145 |
+
gridParams.squares,
|
| 146 |
+
gridParams.dpr
|
| 147 |
+
)
|
| 148 |
+
animationFrameId = requestAnimationFrame(animate)
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
resizeObserver = new ResizeObserver(() => {
|
| 152 |
+
updateCanvasSize()
|
| 153 |
+
})
|
| 154 |
+
resizeObserver.observe(container)
|
| 155 |
+
|
| 156 |
+
intersectionObserver = new IntersectionObserver(
|
| 157 |
+
([entry]) => {
|
| 158 |
+
setIsInView(entry.isIntersecting)
|
| 159 |
+
},
|
| 160 |
+
{ threshold: 0 }
|
| 161 |
+
)
|
| 162 |
+
intersectionObserver.observe(canvas)
|
| 163 |
+
|
| 164 |
+
if (isInView) {
|
| 165 |
+
animationFrameId = requestAnimationFrame(animate)
|
| 166 |
+
}
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
return () => {
|
| 170 |
+
if (animationFrameId !== null) {
|
| 171 |
+
cancelAnimationFrame(animationFrameId)
|
| 172 |
+
}
|
| 173 |
+
if (resizeObserver) {
|
| 174 |
+
resizeObserver.disconnect()
|
| 175 |
+
}
|
| 176 |
+
if (intersectionObserver) {
|
| 177 |
+
intersectionObserver.disconnect()
|
| 178 |
+
}
|
| 179 |
+
}
|
| 180 |
+
}, [setupCanvas, updateSquares, drawGrid, width, height, isInView])
|
| 181 |
+
|
| 182 |
+
return (
|
| 183 |
+
<div
|
| 184 |
+
ref={containerRef}
|
| 185 |
+
className={cn(`h-full w-full ${className}`)}
|
| 186 |
+
{...props}
|
| 187 |
+
>
|
| 188 |
+
<canvas
|
| 189 |
+
ref={canvasRef}
|
| 190 |
+
className="pointer-events-none"
|
| 191 |
+
style={{
|
| 192 |
+
width: canvasSize.width,
|
| 193 |
+
height: canvasSize.height,
|
| 194 |
+
}}
|
| 195 |
+
/>
|
| 196 |
+
</div>
|
| 197 |
+
)
|
| 198 |
+
}
|
components/ui/hexagon-pattern.tsx
ADDED
|
@@ -0,0 +1,302 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { useId } from "react"
|
| 2 |
+
|
| 3 |
+
import { cn } from "@/lib/utils"
|
| 4 |
+
|
| 5 |
+
interface HexagonPatternProps extends React.SVGProps<SVGSVGElement> {
|
| 6 |
+
/**
|
| 7 |
+
* The radius of each hexagon (center to vertex).
|
| 8 |
+
* @default 40
|
| 9 |
+
*/
|
| 10 |
+
radius?: number
|
| 11 |
+
/**
|
| 12 |
+
* Spacing in pixels between adjacent hexagons.
|
| 13 |
+
* The tile grows by this amount while the visual radius stays fixed,
|
| 14 |
+
* so the gap is evenly distributed on all sides of each hexagon.
|
| 15 |
+
* @default 0
|
| 16 |
+
*/
|
| 17 |
+
gap?: number
|
| 18 |
+
/**
|
| 19 |
+
* Offset applied to the pattern origin on the x-axis.
|
| 20 |
+
* @default -1
|
| 21 |
+
*/
|
| 22 |
+
x?: number
|
| 23 |
+
/**
|
| 24 |
+
* Offset applied to the pattern origin on the y-axis.
|
| 25 |
+
* @default -1
|
| 26 |
+
*/
|
| 27 |
+
y?: number
|
| 28 |
+
/**
|
| 29 |
+
* Controls the orientation of the hexagons.
|
| 30 |
+
* - `"horizontal"` — flat-top hexagons tiled in a horizontal honeycomb grid.
|
| 31 |
+
* - `"vertical"` — pointy-top hexagons tiled in a vertical honeycomb grid.
|
| 32 |
+
* @default "horizontal"
|
| 33 |
+
*/
|
| 34 |
+
direction?: "horizontal" | "vertical"
|
| 35 |
+
/**
|
| 36 |
+
* SVG stroke-dasharray applied to each hexagon outline.
|
| 37 |
+
* @default "0"
|
| 38 |
+
*/
|
| 39 |
+
strokeDasharray?: string
|
| 40 |
+
/**
|
| 41 |
+
* Array of [col, row] coordinates for hexagons that should be highlighted
|
| 42 |
+
* (filled) on top of the repeating pattern — mirrors the `squares` prop of
|
| 43 |
+
* GridPattern.
|
| 44 |
+
*/
|
| 45 |
+
hexagons?: Array<[col: number, row: number]>
|
| 46 |
+
className?: string
|
| 47 |
+
[key: string]: unknown
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
type HexPoint = readonly [number, number]
|
| 51 |
+
|
| 52 |
+
function hexVertexList(
|
| 53 |
+
cx: number,
|
| 54 |
+
cy: number,
|
| 55 |
+
r: number,
|
| 56 |
+
direction: "horizontal" | "vertical"
|
| 57 |
+
): HexPoint[] {
|
| 58 |
+
const startAngle = direction === "horizontal" ? 0 : 30
|
| 59 |
+
return Array.from({ length: 6 }, (_, i) => {
|
| 60 |
+
const angle = ((startAngle + i * 60) * Math.PI) / 180
|
| 61 |
+
return [cx + r * Math.cos(angle), cy + r * Math.sin(angle)] as const
|
| 62 |
+
})
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
function hexPoints(
|
| 66 |
+
cx: number,
|
| 67 |
+
cy: number,
|
| 68 |
+
r: number,
|
| 69 |
+
direction: "horizontal" | "vertical"
|
| 70 |
+
): string {
|
| 71 |
+
return hexVertexList(cx, cy, r, direction)
|
| 72 |
+
.map(([px, py]) => `${px},${py}`)
|
| 73 |
+
.join(" ")
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
function edgeLexKey(a: HexPoint, b: HexPoint): string {
|
| 77 |
+
const [p, q] =
|
| 78 |
+
a[0] < b[0] || (a[0] === b[0] && a[1] <= b[1]) ? [a, b] : [b, a]
|
| 79 |
+
return `${p[0].toFixed(6)},${p[1].toFixed(6)}|${q[0].toFixed(6)},${q[1].toFixed(6)}`
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
function collectUniqueHexEdges(
|
| 83 |
+
centers: [number, number][],
|
| 84 |
+
r: number,
|
| 85 |
+
direction: "horizontal" | "vertical"
|
| 86 |
+
): [HexPoint, HexPoint][] {
|
| 87 |
+
const seen = new Set<string>()
|
| 88 |
+
const edges: [HexPoint, HexPoint][] = []
|
| 89 |
+
for (const [cx, cy] of centers) {
|
| 90 |
+
const verts = hexVertexList(cx, cy, r, direction)
|
| 91 |
+
for (let i = 0; i < 6; i++) {
|
| 92 |
+
const a = verts[i]
|
| 93 |
+
const b = verts[(i + 1) % 6]
|
| 94 |
+
const key = edgeLexKey(a, b)
|
| 95 |
+
if (!seen.has(key)) {
|
| 96 |
+
seen.add(key)
|
| 97 |
+
edges.push([a, b])
|
| 98 |
+
}
|
| 99 |
+
}
|
| 100 |
+
}
|
| 101 |
+
return edges
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
function isSolidStrokeDasharray(strokeDasharray: string): boolean {
|
| 105 |
+
const t = strokeDasharray.trim()
|
| 106 |
+
return t === "" || t === "none" || t === "0"
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
function getHexSpacing(
|
| 110 |
+
r: number,
|
| 111 |
+
direction: "horizontal" | "vertical",
|
| 112 |
+
gap: number
|
| 113 |
+
): {
|
| 114 |
+
colStep: number
|
| 115 |
+
rowStep: number
|
| 116 |
+
tileW: number
|
| 117 |
+
tileH: number
|
| 118 |
+
} {
|
| 119 |
+
const sqrt3 = Math.sqrt(3)
|
| 120 |
+
|
| 121 |
+
// `gap` should match the visible edge-to-edge spacing, so we add it along
|
| 122 |
+
// the shared-edge normal instead of directly on the raw x/y axes.
|
| 123 |
+
if (direction === "horizontal") {
|
| 124 |
+
const colStep = (3 * r) / 2 + (sqrt3 * gap) / 2
|
| 125 |
+
const rowStep = sqrt3 * r + gap
|
| 126 |
+
|
| 127 |
+
return {
|
| 128 |
+
colStep,
|
| 129 |
+
rowStep,
|
| 130 |
+
tileW: colStep * 2,
|
| 131 |
+
tileH: rowStep,
|
| 132 |
+
}
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
const colStep = sqrt3 * r + gap
|
| 136 |
+
const rowStep = (3 * r) / 2 + (sqrt3 * gap) / 2
|
| 137 |
+
|
| 138 |
+
return {
|
| 139 |
+
colStep,
|
| 140 |
+
rowStep,
|
| 141 |
+
tileW: colStep,
|
| 142 |
+
tileH: rowStep * 2,
|
| 143 |
+
}
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
function getTileGeometry(
|
| 147 |
+
r: number,
|
| 148 |
+
direction: "horizontal" | "vertical",
|
| 149 |
+
gap: number
|
| 150 |
+
): {
|
| 151 |
+
tileW: number
|
| 152 |
+
tileH: number
|
| 153 |
+
centers: [number, number][]
|
| 154 |
+
} {
|
| 155 |
+
if (direction === "horizontal") {
|
| 156 |
+
const { colStep, rowStep, tileW, tileH } = getHexSpacing(r, direction, gap)
|
| 157 |
+
|
| 158 |
+
const canonical: [number, number][] = [
|
| 159 |
+
[colStep / 2, rowStep / 2],
|
| 160 |
+
[(colStep * 3) / 2, rowStep],
|
| 161 |
+
]
|
| 162 |
+
|
| 163 |
+
const centers: [number, number][] = []
|
| 164 |
+
for (const [cx, cy] of canonical) {
|
| 165 |
+
centers.push([cx, cy])
|
| 166 |
+
if (cy - r < 0) centers.push([cx, cy + tileH])
|
| 167 |
+
if (cy + r > tileH) centers.push([cx, cy - tileH])
|
| 168 |
+
if (cx - r < 0) centers.push([cx + tileW, cy])
|
| 169 |
+
if (cx + r > tileW) centers.push([cx - tileW, cy])
|
| 170 |
+
if (cy - r < 0 && cx - r < 0) centers.push([cx + tileW, cy + tileH])
|
| 171 |
+
if (cy - r < 0 && cx + r > tileW) centers.push([cx - tileW, cy + tileH])
|
| 172 |
+
if (cy + r > tileH && cx - r < 0) centers.push([cx + tileW, cy - tileH])
|
| 173 |
+
if (cy + r > tileH && cx + r > tileW)
|
| 174 |
+
centers.push([cx - tileW, cy - tileH])
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
return { tileW, tileH, centers }
|
| 178 |
+
} else {
|
| 179 |
+
const { colStep, rowStep, tileW, tileH } = getHexSpacing(r, direction, gap)
|
| 180 |
+
|
| 181 |
+
const canonical: [number, number][] = [
|
| 182 |
+
[colStep / 2, rowStep / 2],
|
| 183 |
+
[colStep, (rowStep * 3) / 2],
|
| 184 |
+
]
|
| 185 |
+
|
| 186 |
+
const centers: [number, number][] = []
|
| 187 |
+
for (const [cx, cy] of canonical) {
|
| 188 |
+
centers.push([cx, cy])
|
| 189 |
+
if (cy - r < 0) centers.push([cx, cy + tileH])
|
| 190 |
+
if (cy + r > tileH) centers.push([cx, cy - tileH])
|
| 191 |
+
if (cx - r < 0) centers.push([cx + tileW, cy])
|
| 192 |
+
if (cx + r > tileW) centers.push([cx - tileW, cy])
|
| 193 |
+
if (cy - r < 0 && cx - r < 0) centers.push([cx + tileW, cy + tileH])
|
| 194 |
+
if (cy - r < 0 && cx + r > tileW) centers.push([cx - tileW, cy + tileH])
|
| 195 |
+
if (cy + r > tileH && cx - r < 0) centers.push([cx + tileW, cy - tileH])
|
| 196 |
+
if (cy + r > tileH && cx + r > tileW)
|
| 197 |
+
centers.push([cx - tileW, cy - tileH])
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
return { tileW, tileH, centers }
|
| 201 |
+
}
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
function hexCenter(
|
| 205 |
+
col: number,
|
| 206 |
+
row: number,
|
| 207 |
+
r: number,
|
| 208 |
+
direction: "horizontal" | "vertical",
|
| 209 |
+
gap: number
|
| 210 |
+
): [number, number] {
|
| 211 |
+
if (direction === "horizontal") {
|
| 212 |
+
const { colStep, rowStep } = getHexSpacing(r, direction, gap)
|
| 213 |
+
const x = col * colStep + colStep / 2
|
| 214 |
+
const y = row * rowStep + rowStep / 2 + (col % 2 !== 0 ? rowStep / 2 : 0)
|
| 215 |
+
return [x, y]
|
| 216 |
+
} else {
|
| 217 |
+
const { colStep, rowStep } = getHexSpacing(r, direction, gap)
|
| 218 |
+
const x = col * colStep + colStep / 2 + (row % 2 !== 0 ? colStep / 2 : 0)
|
| 219 |
+
const y = row * rowStep + rowStep / 2
|
| 220 |
+
return [x, y]
|
| 221 |
+
}
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
export function HexagonPattern({
|
| 225 |
+
radius = 40,
|
| 226 |
+
gap = 0,
|
| 227 |
+
x = -1,
|
| 228 |
+
y = -1,
|
| 229 |
+
strokeDasharray = "0",
|
| 230 |
+
direction = "horizontal",
|
| 231 |
+
hexagons,
|
| 232 |
+
className,
|
| 233 |
+
...props
|
| 234 |
+
}: HexagonPatternProps) {
|
| 235 |
+
const id = useId()
|
| 236 |
+
|
| 237 |
+
const { tileW, tileH, centers } = getTileGeometry(radius, direction, gap)
|
| 238 |
+
const solidStroke = isSolidStrokeDasharray(strokeDasharray)
|
| 239 |
+
const dashedEdges = solidStroke
|
| 240 |
+
? null
|
| 241 |
+
: collectUniqueHexEdges(centers, radius, direction)
|
| 242 |
+
|
| 243 |
+
return (
|
| 244 |
+
<svg
|
| 245 |
+
aria-hidden="true"
|
| 246 |
+
className={cn(
|
| 247 |
+
"pointer-events-none absolute inset-0 h-full w-full fill-gray-400/30 stroke-gray-400/30",
|
| 248 |
+
className
|
| 249 |
+
)}
|
| 250 |
+
{...props}
|
| 251 |
+
>
|
| 252 |
+
<defs>
|
| 253 |
+
<pattern
|
| 254 |
+
id={id}
|
| 255 |
+
width={tileW}
|
| 256 |
+
height={tileH}
|
| 257 |
+
patternUnits="userSpaceOnUse"
|
| 258 |
+
x={x}
|
| 259 |
+
y={y}
|
| 260 |
+
>
|
| 261 |
+
{solidStroke
|
| 262 |
+
? centers.map(([cx, cy]) => (
|
| 263 |
+
<polygon
|
| 264 |
+
className="fill-none"
|
| 265 |
+
key={`${cx}-${cy}`}
|
| 266 |
+
points={hexPoints(cx, cy, radius, direction)}
|
| 267 |
+
strokeDasharray={strokeDasharray}
|
| 268 |
+
/>
|
| 269 |
+
))
|
| 270 |
+
: dashedEdges?.map(([a, b]) => (
|
| 271 |
+
<line
|
| 272 |
+
className="fill-none"
|
| 273 |
+
key={edgeLexKey(a, b)}
|
| 274 |
+
x1={a[0]}
|
| 275 |
+
x2={b[0]}
|
| 276 |
+
y1={a[1]}
|
| 277 |
+
y2={b[1]}
|
| 278 |
+
strokeDasharray={strokeDasharray}
|
| 279 |
+
/>
|
| 280 |
+
))}
|
| 281 |
+
</pattern>
|
| 282 |
+
</defs>
|
| 283 |
+
|
| 284 |
+
<rect width="100%" height="100%" fill={`url(#${id})`} stroke="none" />
|
| 285 |
+
|
| 286 |
+
{hexagons && hexagons.length > 0 && (
|
| 287 |
+
<svg aria-hidden="true" className="overflow-visible" x={x} y={y}>
|
| 288 |
+
{hexagons.map(([col, row]) => {
|
| 289 |
+
const [cx, cy] = hexCenter(col, row, radius, direction, gap)
|
| 290 |
+
return (
|
| 291 |
+
<polygon
|
| 292 |
+
key={`${col}-${row}`}
|
| 293 |
+
points={hexPoints(cx, cy, radius - 1, direction)}
|
| 294 |
+
strokeWidth="0"
|
| 295 |
+
/>
|
| 296 |
+
)
|
| 297 |
+
})}
|
| 298 |
+
</svg>
|
| 299 |
+
)}
|
| 300 |
+
</svg>
|
| 301 |
+
)
|
| 302 |
+
}
|
components/ui/icon-cloud.tsx
ADDED
|
@@ -0,0 +1,544 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client"
|
| 2 |
+
|
| 3 |
+
import React, { useEffect, useRef, useState } from "react"
|
| 4 |
+
import { renderToString } from "react-dom/server"
|
| 5 |
+
|
| 6 |
+
interface Icon {
|
| 7 |
+
x: number
|
| 8 |
+
y: number
|
| 9 |
+
z: number
|
| 10 |
+
scale: number
|
| 11 |
+
opacity: number
|
| 12 |
+
id: number
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
export interface CloudItem {
|
| 16 |
+
id: string
|
| 17 |
+
title: string
|
| 18 |
+
url: string
|
| 19 |
+
image: string
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
interface IconCloudProps {
|
| 23 |
+
icons?: React.ReactNode[]
|
| 24 |
+
images?: string[]
|
| 25 |
+
items?: CloudItem[]
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
function easeOutCubic(t: number): number {
|
| 29 |
+
return 1 - Math.pow(1 - t, 3)
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
export function IconCloud({ icons, images, items }: IconCloudProps) {
|
| 33 |
+
const canvasRef = useRef<HTMLCanvasElement>(null)
|
| 34 |
+
const [iconPositions, setIconPositions] = useState<Icon[]>([])
|
| 35 |
+
const [isDragging, setIsDragging] = useState(false)
|
| 36 |
+
const [lastMousePos, setLastMousePos] = useState({ x: 0, y: 0 })
|
| 37 |
+
const [mousePos, setMousePos] = useState({ x: 0, y: 0 })
|
| 38 |
+
const [dragMoved, setDragMoved] = useState(false)
|
| 39 |
+
const [targetRotation, setTargetRotation] = useState<{
|
| 40 |
+
x: number
|
| 41 |
+
y: number
|
| 42 |
+
startX: number
|
| 43 |
+
startY: number
|
| 44 |
+
distance: number
|
| 45 |
+
startTime: number
|
| 46 |
+
duration: number
|
| 47 |
+
} | null>(null)
|
| 48 |
+
const animationFrameRef = useRef<number>(0)
|
| 49 |
+
const rotationRef = useRef({ x: 0, y: 0 })
|
| 50 |
+
const velocityRef = useRef({ x: 0.002, y: -0.002 })
|
| 51 |
+
const iconCanvasesRef = useRef<HTMLCanvasElement[]>([])
|
| 52 |
+
const imagesLoadedRef = useRef<boolean[]>([])
|
| 53 |
+
|
| 54 |
+
// Create icon canvases once when icons/images change
|
| 55 |
+
useEffect(() => {
|
| 56 |
+
if (!icons && !images && !items) return
|
| 57 |
+
|
| 58 |
+
const targetItems = items ?? icons ?? images ?? []
|
| 59 |
+
imagesLoadedRef.current = new Array(targetItems.length).fill(false)
|
| 60 |
+
|
| 61 |
+
const newIconCanvases = targetItems.map((item, index) => {
|
| 62 |
+
const size = 100; // High-res offscreen canvas for crisp SVG rendering
|
| 63 |
+
const offscreen = document.createElement("canvas")
|
| 64 |
+
offscreen.width = size
|
| 65 |
+
offscreen.height = size
|
| 66 |
+
const offCtx = offscreen.getContext("2d")
|
| 67 |
+
|
| 68 |
+
if (offCtx) {
|
| 69 |
+
if (images || items) {
|
| 70 |
+
// Handle image URLs directly
|
| 71 |
+
const src = items ? items[index].image : images![index]
|
| 72 |
+
const img = new Image()
|
| 73 |
+
img.crossOrigin = "anonymous"
|
| 74 |
+
img.src = src
|
| 75 |
+
img.onload = () => {
|
| 76 |
+
// Create a temporary canvas to measure the actual pixel bounds
|
| 77 |
+
const tempCanvas = document.createElement("canvas")
|
| 78 |
+
tempCanvas.width = size
|
| 79 |
+
tempCanvas.height = size
|
| 80 |
+
const tempCtx = tempCanvas.getContext("2d")
|
| 81 |
+
if (!tempCtx) return
|
| 82 |
+
|
| 83 |
+
tempCtx.drawImage(img, 0, 0, size, size)
|
| 84 |
+
|
| 85 |
+
try {
|
| 86 |
+
// Find bounding box of non-transparent pixels
|
| 87 |
+
const imageData = tempCtx.getImageData(0, 0, size, size)
|
| 88 |
+
const data = imageData.data
|
| 89 |
+
let minX = size, minY = size, maxX = 0, maxY = 0
|
| 90 |
+
|
| 91 |
+
for (let y = 0; y < size; y++) {
|
| 92 |
+
for (let x = 0; x < size; x++) {
|
| 93 |
+
const alpha = data[(y * size + x) * 4 + 3]
|
| 94 |
+
if (alpha > 10) { // Ignore faint shadows/anti-aliasing
|
| 95 |
+
if (x < minX) minX = x
|
| 96 |
+
if (y < minY) minY = y
|
| 97 |
+
if (x > maxX) maxX = x
|
| 98 |
+
if (y > maxY) maxY = y
|
| 99 |
+
}
|
| 100 |
+
}
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
// Fallback if image is completely empty
|
| 104 |
+
if (minX > maxX || minY > maxY) {
|
| 105 |
+
minX = 0; minY = 0; maxX = size; maxY = size;
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
const cropWidth = maxX - minX + 1
|
| 109 |
+
const cropHeight = maxY - minY + 1
|
| 110 |
+
|
| 111 |
+
// Calculate scaling to fit the maximum dimension, preserving aspect ratio
|
| 112 |
+
const scale = size / Math.max(cropWidth, cropHeight)
|
| 113 |
+
// Make them slightly smaller than the absolute edge (e.g. 90% of max size)
|
| 114 |
+
const paddingScale = 0.9
|
| 115 |
+
const finalWidth = cropWidth * scale * paddingScale
|
| 116 |
+
const finalHeight = cropHeight * scale * paddingScale
|
| 117 |
+
const dx = (size - finalWidth) / 2
|
| 118 |
+
const dy = (size - finalHeight) / 2
|
| 119 |
+
|
| 120 |
+
offCtx.clearRect(0, 0, size, size)
|
| 121 |
+
// Draw the tightly cropped image scaled up
|
| 122 |
+
offCtx.drawImage(
|
| 123 |
+
tempCanvas,
|
| 124 |
+
minX, minY, cropWidth, cropHeight,
|
| 125 |
+
dx, dy, finalWidth, finalHeight
|
| 126 |
+
)
|
| 127 |
+
} catch {
|
| 128 |
+
// Fallback if CORS prevents getImageData
|
| 129 |
+
offCtx.clearRect(0, 0, size, size)
|
| 130 |
+
offCtx.drawImage(img, 0, 0, size, size)
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
imagesLoadedRef.current[index] = true
|
| 134 |
+
}
|
| 135 |
+
} else {
|
| 136 |
+
// Handle SVG icons
|
| 137 |
+
offCtx.scale(size / 24, size / 24) // scale up assuming 24x24 standard SVG
|
| 138 |
+
const svgString = renderToString(item as React.ReactElement)
|
| 139 |
+
const img = new Image()
|
| 140 |
+
img.src = "data:image/svg+xml;base64," + btoa(svgString)
|
| 141 |
+
img.onload = () => {
|
| 142 |
+
offCtx.clearRect(0, 0, size, size)
|
| 143 |
+
offCtx.drawImage(img, 0, 0, size, size)
|
| 144 |
+
imagesLoadedRef.current[index] = true
|
| 145 |
+
}
|
| 146 |
+
}
|
| 147 |
+
}
|
| 148 |
+
return offscreen
|
| 149 |
+
})
|
| 150 |
+
|
| 151 |
+
iconCanvasesRef.current = newIconCanvases
|
| 152 |
+
}, [icons, images, items])
|
| 153 |
+
|
| 154 |
+
// Generate initial icon positions on a sphere
|
| 155 |
+
useEffect(() => {
|
| 156 |
+
const targetItems = items ?? icons ?? images ?? []
|
| 157 |
+
const newIcons: Icon[] = []
|
| 158 |
+
const numIcons = targetItems.length || 20
|
| 159 |
+
|
| 160 |
+
// Fibonacci sphere parameters
|
| 161 |
+
const offset = 2 / numIcons
|
| 162 |
+
const increment = Math.PI * (3 - Math.sqrt(5))
|
| 163 |
+
|
| 164 |
+
for (let i = 0; i < numIcons; i++) {
|
| 165 |
+
const y = i * offset - 1 + offset / 2
|
| 166 |
+
const r = Math.sqrt(1 - y * y)
|
| 167 |
+
const phi = i * increment
|
| 168 |
+
|
| 169 |
+
const x = Math.cos(phi) * r
|
| 170 |
+
const z = Math.sin(phi) * r
|
| 171 |
+
|
| 172 |
+
newIcons.push({
|
| 173 |
+
x: x * 100,
|
| 174 |
+
y: y * 100,
|
| 175 |
+
z: z * 100,
|
| 176 |
+
scale: 1,
|
| 177 |
+
opacity: 1,
|
| 178 |
+
id: i,
|
| 179 |
+
})
|
| 180 |
+
}
|
| 181 |
+
const timer = setTimeout(() => {
|
| 182 |
+
setIconPositions(newIcons)
|
| 183 |
+
}, 0)
|
| 184 |
+
return () => clearTimeout(timer)
|
| 185 |
+
}, [icons, images, items])
|
| 186 |
+
|
| 187 |
+
// Handle mouse events
|
| 188 |
+
const handleMouseDown = (e: React.MouseEvent<HTMLCanvasElement>) => {
|
| 189 |
+
const rect = canvasRef.current?.getBoundingClientRect()
|
| 190 |
+
if (!rect || !canvasRef.current) return
|
| 191 |
+
|
| 192 |
+
const scaleX = canvasRef.current.width / rect.width
|
| 193 |
+
const scaleY = canvasRef.current.height / rect.height
|
| 194 |
+
const x = (e.clientX - rect.left) * scaleX
|
| 195 |
+
const y = (e.clientY - rect.top) * scaleY
|
| 196 |
+
|
| 197 |
+
const ctx = canvasRef.current.getContext("2d")
|
| 198 |
+
if (!ctx) return
|
| 199 |
+
|
| 200 |
+
iconPositions.forEach((icon) => {
|
| 201 |
+
const cosX = Math.cos(rotationRef.current.x)
|
| 202 |
+
const sinX = Math.sin(rotationRef.current.x)
|
| 203 |
+
const cosY = Math.cos(rotationRef.current.y)
|
| 204 |
+
const sinY = Math.sin(rotationRef.current.y)
|
| 205 |
+
|
| 206 |
+
const rotatedX = icon.x * cosY - icon.z * sinY
|
| 207 |
+
const rotatedZ = icon.x * sinY + icon.z * cosY
|
| 208 |
+
const rotatedY = icon.y * cosX + rotatedZ * sinX
|
| 209 |
+
|
| 210 |
+
const screenX = canvasRef.current!.width / 2 + rotatedX
|
| 211 |
+
const screenY = canvasRef.current!.height / 2 + rotatedY
|
| 212 |
+
|
| 213 |
+
const scale = (rotatedZ + 200) / 300
|
| 214 |
+
const radius = 20 * scale
|
| 215 |
+
const dx = x - screenX
|
| 216 |
+
const dy = y - screenY
|
| 217 |
+
|
| 218 |
+
if (dx * dx + dy * dy < radius * radius) {
|
| 219 |
+
const targetX = -Math.atan2(
|
| 220 |
+
icon.y,
|
| 221 |
+
Math.sqrt(icon.x * icon.x + icon.z * icon.z)
|
| 222 |
+
)
|
| 223 |
+
const targetY = Math.atan2(icon.x, icon.z)
|
| 224 |
+
|
| 225 |
+
const currentX = rotationRef.current.x
|
| 226 |
+
const currentY = rotationRef.current.y
|
| 227 |
+
const distance = Math.sqrt(
|
| 228 |
+
Math.pow(targetX - currentX, 2) + Math.pow(targetY - currentY, 2)
|
| 229 |
+
)
|
| 230 |
+
|
| 231 |
+
const duration = Math.min(2000, Math.max(800, distance * 1000))
|
| 232 |
+
|
| 233 |
+
setTargetRotation({
|
| 234 |
+
x: targetX,
|
| 235 |
+
y: targetY,
|
| 236 |
+
startX: currentX,
|
| 237 |
+
startY: currentY,
|
| 238 |
+
distance,
|
| 239 |
+
startTime: performance.now(),
|
| 240 |
+
duration,
|
| 241 |
+
})
|
| 242 |
+
return
|
| 243 |
+
}
|
| 244 |
+
})
|
| 245 |
+
|
| 246 |
+
setIsDragging(true)
|
| 247 |
+
setDragMoved(false)
|
| 248 |
+
setLastMousePos({ x: e.clientX, y: e.clientY })
|
| 249 |
+
}
|
| 250 |
+
|
| 251 |
+
const handleMouseMove = (e: React.MouseEvent<HTMLCanvasElement>) => {
|
| 252 |
+
const rect = canvasRef.current?.getBoundingClientRect()
|
| 253 |
+
if (rect && canvasRef.current) {
|
| 254 |
+
const scaleX = canvasRef.current.width / rect.width
|
| 255 |
+
const scaleY = canvasRef.current.height / rect.height
|
| 256 |
+
const x = (e.clientX - rect.left) * scaleX
|
| 257 |
+
const y = (e.clientY - rect.top) * scaleY
|
| 258 |
+
setMousePos({ x, y })
|
| 259 |
+
}
|
| 260 |
+
|
| 261 |
+
if (isDragging) {
|
| 262 |
+
const deltaX = e.clientX - lastMousePos.x
|
| 263 |
+
const deltaY = e.clientY - lastMousePos.y
|
| 264 |
+
|
| 265 |
+
if (Math.abs(deltaX) > 2 || Math.abs(deltaY) > 2) {
|
| 266 |
+
setDragMoved(true)
|
| 267 |
+
}
|
| 268 |
+
|
| 269 |
+
rotationRef.current = {
|
| 270 |
+
x: rotationRef.current.x + deltaY * 0.002,
|
| 271 |
+
y: rotationRef.current.y + deltaX * 0.002,
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
+
// Update velocity immediately based on drag to maintain inertia after release
|
| 275 |
+
velocityRef.current = {
|
| 276 |
+
x: deltaY * 0.002,
|
| 277 |
+
y: deltaX * 0.002,
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
setLastMousePos({ x: e.clientX, y: e.clientY })
|
| 281 |
+
}
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
const handleMouseUp = () => {
|
| 285 |
+
if (!dragMoved && !isDragging && items) {
|
| 286 |
+
// Click handled separately
|
| 287 |
+
}
|
| 288 |
+
setIsDragging(false)
|
| 289 |
+
}
|
| 290 |
+
|
| 291 |
+
const handleMouseLeave = () => {
|
| 292 |
+
setIsDragging(false)
|
| 293 |
+
// When mouse leaves, reset the target mouse pos to center smoothly
|
| 294 |
+
setMousePos({ x: 0, y: 0 })
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
const handleClick = (e: React.MouseEvent<HTMLCanvasElement>) => {
|
| 298 |
+
if (dragMoved) return // Was dragging
|
| 299 |
+
const rect = canvasRef.current?.getBoundingClientRect()
|
| 300 |
+
if (!rect || !canvasRef.current || !items) return
|
| 301 |
+
|
| 302 |
+
const scaleX = canvasRef.current.width / rect.width
|
| 303 |
+
const scaleY = canvasRef.current.height / rect.height
|
| 304 |
+
const x = (e.clientX - rect.left) * scaleX
|
| 305 |
+
const y = (e.clientY - rect.top) * scaleY
|
| 306 |
+
|
| 307 |
+
let clickedItem: CloudItem | null = null
|
| 308 |
+
let maxZ = -Infinity
|
| 309 |
+
|
| 310 |
+
iconPositions.forEach((icon, index) => {
|
| 311 |
+
const cosX = Math.cos(rotationRef.current.x)
|
| 312 |
+
const sinX = Math.sin(rotationRef.current.x)
|
| 313 |
+
const cosY = Math.cos(rotationRef.current.y)
|
| 314 |
+
const sinY = Math.sin(rotationRef.current.y)
|
| 315 |
+
|
| 316 |
+
const rotatedX = icon.x * cosY - icon.z * sinY
|
| 317 |
+
const rotatedZ = icon.x * sinY + icon.z * cosY
|
| 318 |
+
const rotatedY = icon.y * cosX + rotatedZ * sinX
|
| 319 |
+
|
| 320 |
+
const screenX = canvasRef.current!.width / 2 + rotatedX
|
| 321 |
+
const screenY = canvasRef.current!.height / 2 + rotatedY
|
| 322 |
+
|
| 323 |
+
const scale = (rotatedZ + 200) / 300
|
| 324 |
+
const radius = 20 * scale
|
| 325 |
+
const dx = x - screenX
|
| 326 |
+
const dy = y - screenY
|
| 327 |
+
|
| 328 |
+
if (dx * dx + dy * dy < radius * radius) {
|
| 329 |
+
if (rotatedZ > maxZ && rotatedZ > -50) {
|
| 330 |
+
maxZ = rotatedZ
|
| 331 |
+
clickedItem = items[index]
|
| 332 |
+
}
|
| 333 |
+
}
|
| 334 |
+
})
|
| 335 |
+
|
| 336 |
+
if (clickedItem) {
|
| 337 |
+
window.open((clickedItem as CloudItem).url, "_blank")
|
| 338 |
+
}
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
// Animation and rendering
|
| 342 |
+
useEffect(() => {
|
| 343 |
+
const canvas = canvasRef.current
|
| 344 |
+
const ctx = canvas?.getContext("2d")
|
| 345 |
+
if (canvas && ctx) {
|
| 346 |
+
const animate = () => {
|
| 347 |
+
ctx.clearRect(0, 0, canvas.width, canvas.height)
|
| 348 |
+
|
| 349 |
+
const centerX = canvas.width / 2
|
| 350 |
+
const centerY = canvas.height / 2
|
| 351 |
+
|
| 352 |
+
// Calculate normalized mouse coordinates [-1, 1] relative to center
|
| 353 |
+
// If mousePos is 0,0 (mouse left canvas), it will naturally go to a constant drift
|
| 354 |
+
const nx = mousePos.x === 0 && mousePos.y === 0 ? 0.2 : (mousePos.x - centerX) / centerX
|
| 355 |
+
const ny = mousePos.x === 0 && mousePos.y === 0 ? 0.2 : (mousePos.y - centerY) / centerY
|
| 356 |
+
|
| 357 |
+
let targetVelocityX = 0.002 // default idle speed X
|
| 358 |
+
let targetVelocityY = -0.002 // default idle speed Y
|
| 359 |
+
|
| 360 |
+
// If mouse is interacting over canvas bounds, adjust velocity based on pointer
|
| 361 |
+
if (mousePos.x > 0 && mousePos.x < canvas.width && mousePos.y > 0 && mousePos.y < canvas.height) {
|
| 362 |
+
targetVelocityX = ny * 0.008
|
| 363 |
+
targetVelocityY = nx * 0.008
|
| 364 |
+
} else if (mousePos.x === 0 && mousePos.y === 0) {
|
| 365 |
+
// When mouse hasn't interacted or left, fallback to gentle diagonal spin
|
| 366 |
+
targetVelocityX = 0.002
|
| 367 |
+
targetVelocityY = -0.002
|
| 368 |
+
}
|
| 369 |
+
|
| 370 |
+
let hoveredItemIndex: number | null = null
|
| 371 |
+
let maxZ = -Infinity
|
| 372 |
+
|
| 373 |
+
if (targetRotation) {
|
| 374 |
+
const elapsed = performance.now() - targetRotation.startTime
|
| 375 |
+
const progress = Math.min(1, elapsed / targetRotation.duration)
|
| 376 |
+
const easedProgress = easeOutCubic(progress)
|
| 377 |
+
|
| 378 |
+
rotationRef.current = {
|
| 379 |
+
x:
|
| 380 |
+
targetRotation.startX +
|
| 381 |
+
(targetRotation.x - targetRotation.startX) * easedProgress,
|
| 382 |
+
y:
|
| 383 |
+
targetRotation.startY +
|
| 384 |
+
(targetRotation.y - targetRotation.startY) * easedProgress,
|
| 385 |
+
}
|
| 386 |
+
|
| 387 |
+
if (progress >= 1) {
|
| 388 |
+
setTargetRotation(null)
|
| 389 |
+
}
|
| 390 |
+
} else if (!isDragging) {
|
| 391 |
+
// Apply inertia (smoothly transition to the target velocity)
|
| 392 |
+
velocityRef.current.x += (targetVelocityX - velocityRef.current.x) * 0.05
|
| 393 |
+
velocityRef.current.y += (targetVelocityY - velocityRef.current.y) * 0.05
|
| 394 |
+
|
| 395 |
+
rotationRef.current = {
|
| 396 |
+
x: rotationRef.current.x + velocityRef.current.x,
|
| 397 |
+
y: rotationRef.current.y + velocityRef.current.y,
|
| 398 |
+
}
|
| 399 |
+
} else {
|
| 400 |
+
// While dragging, we let handleMouseMove control rotation directly
|
| 401 |
+
// but we still smoothly decay the targetVelocity to zero to avoid snapping
|
| 402 |
+
velocityRef.current.x *= 0.95
|
| 403 |
+
velocityRef.current.y *= 0.95
|
| 404 |
+
}
|
| 405 |
+
|
| 406 |
+
iconPositions.forEach((icon, index) => {
|
| 407 |
+
const cosX = Math.cos(rotationRef.current.x)
|
| 408 |
+
const sinX = Math.sin(rotationRef.current.x)
|
| 409 |
+
const cosY = Math.cos(rotationRef.current.y)
|
| 410 |
+
const sinY = Math.sin(rotationRef.current.y)
|
| 411 |
+
|
| 412 |
+
const rotatedX = icon.x * cosY - icon.z * sinY
|
| 413 |
+
const rotatedZ = icon.x * sinY + icon.z * cosY
|
| 414 |
+
const rotatedY = icon.y * cosX + rotatedZ * sinX
|
| 415 |
+
|
| 416 |
+
const scale = (rotatedZ + 200) / 300
|
| 417 |
+
const opacity = Math.max(0.2, Math.min(1, (rotatedZ + 150) / 200))
|
| 418 |
+
|
| 419 |
+
// Check hover state
|
| 420 |
+
const screenX = canvas.width / 2 + rotatedX
|
| 421 |
+
const screenY = canvas.height / 2 + rotatedY
|
| 422 |
+
const radius = 20 * scale
|
| 423 |
+
const hdx = mousePos.x - screenX
|
| 424 |
+
const hdy = mousePos.y - screenY
|
| 425 |
+
|
| 426 |
+
if (hdx * hdx + hdy * hdy < radius * radius && rotatedZ > maxZ && rotatedZ > -50) {
|
| 427 |
+
maxZ = rotatedZ
|
| 428 |
+
hoveredItemIndex = index
|
| 429 |
+
}
|
| 430 |
+
|
| 431 |
+
ctx.save()
|
| 432 |
+
ctx.translate(
|
| 433 |
+
canvas.width / 2 + rotatedX,
|
| 434 |
+
canvas.height / 2 + rotatedY
|
| 435 |
+
)
|
| 436 |
+
ctx.scale(scale, scale)
|
| 437 |
+
ctx.globalAlpha = opacity
|
| 438 |
+
|
| 439 |
+
if (icons || images || items) {
|
| 440 |
+
// Only try to render icons/images if they exist
|
| 441 |
+
if (
|
| 442 |
+
iconCanvasesRef.current[index] &&
|
| 443 |
+
imagesLoadedRef.current[index]
|
| 444 |
+
) {
|
| 445 |
+
ctx.drawImage(iconCanvasesRef.current[index], -20, -20, 40, 40)
|
| 446 |
+
}
|
| 447 |
+
} else {
|
| 448 |
+
// Show numbered circles if no icons/images are provided
|
| 449 |
+
ctx.beginPath()
|
| 450 |
+
ctx.arc(0, 0, 20, 0, Math.PI * 2)
|
| 451 |
+
ctx.fillStyle = "#4444ff"
|
| 452 |
+
ctx.fill()
|
| 453 |
+
ctx.fillStyle = "white"
|
| 454 |
+
ctx.textAlign = "center"
|
| 455 |
+
ctx.textBaseline = "middle"
|
| 456 |
+
ctx.font = "16px Arial"
|
| 457 |
+
ctx.fillText(`${icon.id + 1}`, 0, 0)
|
| 458 |
+
}
|
| 459 |
+
|
| 460 |
+
ctx.restore()
|
| 461 |
+
})
|
| 462 |
+
|
| 463 |
+
if (hoveredItemIndex !== null && items) {
|
| 464 |
+
canvas.style.cursor = "pointer"
|
| 465 |
+
const hoveredItem = items[hoveredItemIndex]
|
| 466 |
+
|
| 467 |
+
// Draw tooltip
|
| 468 |
+
const hoveredIcon = iconPositions[hoveredItemIndex]
|
| 469 |
+
const cosX = Math.cos(rotationRef.current.x)
|
| 470 |
+
const sinX = Math.sin(rotationRef.current.x)
|
| 471 |
+
const cosY = Math.cos(rotationRef.current.y)
|
| 472 |
+
const sinY = Math.sin(rotationRef.current.y)
|
| 473 |
+
const rotatedX = hoveredIcon.x * cosY - hoveredIcon.z * sinY
|
| 474 |
+
const rotatedZ = hoveredIcon.x * sinY + hoveredIcon.z * cosY
|
| 475 |
+
const rotatedY = hoveredIcon.y * cosX + rotatedZ * sinX
|
| 476 |
+
|
| 477 |
+
const screenX = canvas.width / 2 + rotatedX
|
| 478 |
+
const screenY = canvas.height / 2 + rotatedY
|
| 479 |
+
|
| 480 |
+
ctx.font = "14px Inter, sans-serif"
|
| 481 |
+
const textWidth = ctx.measureText(hoveredItem.title).width
|
| 482 |
+
|
| 483 |
+
// Tooltip background
|
| 484 |
+
ctx.fillStyle = "rgba(0, 0, 0, 0.75)"
|
| 485 |
+
// Use a simple rect instead of roundRect for better compatibility, or emulate it
|
| 486 |
+
// Since it's modern web, roundRect is fine in most places, but let's use standard arcs
|
| 487 |
+
const rw = textWidth + 24
|
| 488 |
+
const rh = 28
|
| 489 |
+
const rx = screenX - rw / 2
|
| 490 |
+
const ry = screenY - 50
|
| 491 |
+
const r = 6
|
| 492 |
+
|
| 493 |
+
ctx.beginPath()
|
| 494 |
+
ctx.moveTo(rx + r, ry)
|
| 495 |
+
ctx.lineTo(rx + rw - r, ry)
|
| 496 |
+
ctx.quadraticCurveTo(rx + rw, ry, rx + rw, ry + r)
|
| 497 |
+
ctx.lineTo(rx + rw, ry + rh - r)
|
| 498 |
+
ctx.quadraticCurveTo(rx + rw, ry + rh, rx + rw - r, ry + rh)
|
| 499 |
+
ctx.lineTo(rx + r, ry + rh)
|
| 500 |
+
ctx.quadraticCurveTo(rx, ry + rh, rx, ry + rh - r)
|
| 501 |
+
ctx.lineTo(rx, ry + r)
|
| 502 |
+
ctx.quadraticCurveTo(rx, ry, rx + r, ry)
|
| 503 |
+
ctx.closePath()
|
| 504 |
+
ctx.fill()
|
| 505 |
+
|
| 506 |
+
// Tooltip text
|
| 507 |
+
ctx.fillStyle = "#ffffff"
|
| 508 |
+
ctx.textAlign = "center"
|
| 509 |
+
ctx.textBaseline = "middle"
|
| 510 |
+
ctx.fillText(hoveredItem.title, screenX, ry + rh / 2)
|
| 511 |
+
|
| 512 |
+
} else {
|
| 513 |
+
canvas.style.cursor = isDragging ? "grabbing" : "grab"
|
| 514 |
+
}
|
| 515 |
+
|
| 516 |
+
animationFrameRef.current = requestAnimationFrame(animate)
|
| 517 |
+
}
|
| 518 |
+
|
| 519 |
+
animate()
|
| 520 |
+
}
|
| 521 |
+
|
| 522 |
+
return () => {
|
| 523 |
+
if (animationFrameRef.current) {
|
| 524 |
+
cancelAnimationFrame(animationFrameRef.current)
|
| 525 |
+
}
|
| 526 |
+
}
|
| 527 |
+
}, [icons, images, items, iconPositions, isDragging, mousePos, targetRotation])
|
| 528 |
+
|
| 529 |
+
return (
|
| 530 |
+
<canvas
|
| 531 |
+
ref={canvasRef}
|
| 532 |
+
width={400}
|
| 533 |
+
height={400}
|
| 534 |
+
onMouseDown={handleMouseDown}
|
| 535 |
+
onMouseMove={handleMouseMove}
|
| 536 |
+
onMouseUp={handleMouseUp}
|
| 537 |
+
onMouseLeave={handleMouseLeave}
|
| 538 |
+
onClick={handleClick}
|
| 539 |
+
className="rounded-lg"
|
| 540 |
+
aria-label="Interactive 3D Icon Cloud"
|
| 541 |
+
role="img"
|
| 542 |
+
/>
|
| 543 |
+
)
|
| 544 |
+
}
|
components/ui/input.tsx
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from "react"
|
| 2 |
+
|
| 3 |
+
import { cn } from "@/lib/utils"
|
| 4 |
+
|
| 5 |
+
function Input({ className, type, ...props }: React.ComponentProps<"input">) {
|
| 6 |
+
return (
|
| 7 |
+
<input
|
| 8 |
+
type={type}
|
| 9 |
+
data-slot="input"
|
| 10 |
+
className={cn(
|
| 11 |
+
"h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
|
| 12 |
+
className
|
| 13 |
+
)}
|
| 14 |
+
{...props}
|
| 15 |
+
/>
|
| 16 |
+
)
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
export { Input }
|
components/ui/label.tsx
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client"
|
| 2 |
+
|
| 3 |
+
import * as React from "react"
|
| 4 |
+
import { Label as LabelPrimitive } from "radix-ui"
|
| 5 |
+
|
| 6 |
+
import { cn } from "@/lib/utils"
|
| 7 |
+
|
| 8 |
+
function Label({
|
| 9 |
+
className,
|
| 10 |
+
...props
|
| 11 |
+
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
| 12 |
+
return (
|
| 13 |
+
<LabelPrimitive.Root
|
| 14 |
+
data-slot="label"
|
| 15 |
+
className={cn(
|
| 16 |
+
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
| 17 |
+
className
|
| 18 |
+
)}
|
| 19 |
+
{...props}
|
| 20 |
+
/>
|
| 21 |
+
)
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
export { Label }
|
components/ui/marquee.tsx
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { type ComponentPropsWithoutRef } from "react"
|
| 2 |
+
|
| 3 |
+
import { cn } from "@/lib/utils"
|
| 4 |
+
|
| 5 |
+
interface MarqueeProps extends ComponentPropsWithoutRef<"div"> {
|
| 6 |
+
/**
|
| 7 |
+
* Optional CSS class name to apply custom styles
|
| 8 |
+
*/
|
| 9 |
+
className?: string
|
| 10 |
+
/**
|
| 11 |
+
* Whether to reverse the animation direction
|
| 12 |
+
* @default false
|
| 13 |
+
*/
|
| 14 |
+
reverse?: boolean
|
| 15 |
+
/**
|
| 16 |
+
* Whether to pause the animation on hover
|
| 17 |
+
* @default false
|
| 18 |
+
*/
|
| 19 |
+
pauseOnHover?: boolean
|
| 20 |
+
/**
|
| 21 |
+
* Content to be displayed in the marquee
|
| 22 |
+
*/
|
| 23 |
+
children: React.ReactNode
|
| 24 |
+
/**
|
| 25 |
+
* Whether to animate vertically instead of horizontally
|
| 26 |
+
* @default false
|
| 27 |
+
*/
|
| 28 |
+
vertical?: boolean
|
| 29 |
+
/**
|
| 30 |
+
* Number of times to repeat the content
|
| 31 |
+
* @default 4
|
| 32 |
+
*/
|
| 33 |
+
repeat?: number
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
export function Marquee({
|
| 37 |
+
className,
|
| 38 |
+
reverse = false,
|
| 39 |
+
pauseOnHover = false,
|
| 40 |
+
children,
|
| 41 |
+
vertical = false,
|
| 42 |
+
repeat = 4,
|
| 43 |
+
...props
|
| 44 |
+
}: MarqueeProps) {
|
| 45 |
+
return (
|
| 46 |
+
<div
|
| 47 |
+
{...props}
|
| 48 |
+
className={cn(
|
| 49 |
+
"group flex gap-(--gap) overflow-hidden p-2 [--duration:40s] [--gap:1rem]",
|
| 50 |
+
{
|
| 51 |
+
"flex-row": !vertical,
|
| 52 |
+
"flex-col": vertical,
|
| 53 |
+
},
|
| 54 |
+
className
|
| 55 |
+
)}
|
| 56 |
+
>
|
| 57 |
+
{Array(repeat)
|
| 58 |
+
.fill(0)
|
| 59 |
+
.map((_, i) => (
|
| 60 |
+
<div
|
| 61 |
+
key={i}
|
| 62 |
+
className={cn("flex shrink-0 justify-around gap-(--gap)", {
|
| 63 |
+
"animate-marquee flex-row": !vertical,
|
| 64 |
+
"animate-marquee-vertical flex-col": vertical,
|
| 65 |
+
"group-hover:[animation-play-state:paused]": pauseOnHover,
|
| 66 |
+
"[animation-direction:reverse]": reverse,
|
| 67 |
+
})}
|
| 68 |
+
>
|
| 69 |
+
{children}
|
| 70 |
+
</div>
|
| 71 |
+
))}
|
| 72 |
+
</div>
|
| 73 |
+
)
|
| 74 |
+
}
|
components/ui/number-ticker.tsx
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client"
|
| 2 |
+
|
| 3 |
+
import { useEffect, useRef, type ComponentPropsWithoutRef } from "react"
|
| 4 |
+
import { useInView, useMotionValue, useSpring } from "motion/react"
|
| 5 |
+
|
| 6 |
+
import { cn } from "@/lib/utils"
|
| 7 |
+
|
| 8 |
+
interface NumberTickerProps extends ComponentPropsWithoutRef<"span"> {
|
| 9 |
+
value: number
|
| 10 |
+
startValue?: number
|
| 11 |
+
direction?: "up" | "down"
|
| 12 |
+
delay?: number
|
| 13 |
+
decimalPlaces?: number
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
export function NumberTicker({
|
| 17 |
+
value,
|
| 18 |
+
startValue = 0,
|
| 19 |
+
direction = "up",
|
| 20 |
+
delay = 0,
|
| 21 |
+
className,
|
| 22 |
+
decimalPlaces = 0,
|
| 23 |
+
...props
|
| 24 |
+
}: NumberTickerProps) {
|
| 25 |
+
const ref = useRef<HTMLSpanElement>(null)
|
| 26 |
+
const motionValue = useMotionValue(direction === "down" ? value : startValue)
|
| 27 |
+
const springValue = useSpring(motionValue, {
|
| 28 |
+
damping: 60,
|
| 29 |
+
stiffness: 100,
|
| 30 |
+
})
|
| 31 |
+
const isInView = useInView(ref, { once: true, margin: "0px" })
|
| 32 |
+
|
| 33 |
+
useEffect(() => {
|
| 34 |
+
let timer: ReturnType<typeof setTimeout> | null = null
|
| 35 |
+
|
| 36 |
+
if (isInView) {
|
| 37 |
+
timer = setTimeout(() => {
|
| 38 |
+
motionValue.set(direction === "down" ? startValue : value)
|
| 39 |
+
}, delay * 1000)
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
return () => {
|
| 43 |
+
if (timer !== null) {
|
| 44 |
+
clearTimeout(timer)
|
| 45 |
+
}
|
| 46 |
+
}
|
| 47 |
+
}, [motionValue, isInView, delay, value, direction, startValue])
|
| 48 |
+
|
| 49 |
+
useEffect(
|
| 50 |
+
() =>
|
| 51 |
+
springValue.on("change", (latest) => {
|
| 52 |
+
if (ref.current) {
|
| 53 |
+
ref.current.textContent = Intl.NumberFormat("en-US", {
|
| 54 |
+
minimumFractionDigits: decimalPlaces,
|
| 55 |
+
maximumFractionDigits: decimalPlaces,
|
| 56 |
+
}).format(Number(latest.toFixed(decimalPlaces)))
|
| 57 |
+
}
|
| 58 |
+
}),
|
| 59 |
+
[springValue, decimalPlaces]
|
| 60 |
+
)
|
| 61 |
+
|
| 62 |
+
return (
|
| 63 |
+
<span
|
| 64 |
+
ref={ref}
|
| 65 |
+
className={cn(
|
| 66 |
+
"inline-block tracking-wider text-black tabular-nums dark:text-white",
|
| 67 |
+
className
|
| 68 |
+
)}
|
| 69 |
+
{...props}
|
| 70 |
+
>
|
| 71 |
+
{startValue}
|
| 72 |
+
</span>
|
| 73 |
+
)
|
| 74 |
+
}
|
components/ui/particles.tsx
ADDED
|
@@ -0,0 +1,346 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 2 |
+
|
| 3 |
+
import React, {
|
| 4 |
+
useEffect,
|
| 5 |
+
useRef,
|
| 6 |
+
useState,
|
| 7 |
+
type ComponentPropsWithoutRef,
|
| 8 |
+
} from "react"
|
| 9 |
+
|
| 10 |
+
import { cn } from "@/lib/utils"
|
| 11 |
+
|
| 12 |
+
interface MousePosition {
|
| 13 |
+
x: number
|
| 14 |
+
y: number
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
function MousePosition(): MousePosition {
|
| 18 |
+
const [mousePosition, setMousePosition] = useState<MousePosition>({
|
| 19 |
+
x: 0,
|
| 20 |
+
y: 0,
|
| 21 |
+
})
|
| 22 |
+
|
| 23 |
+
useEffect(() => {
|
| 24 |
+
const handleMouseMove = (event: MouseEvent) => {
|
| 25 |
+
setMousePosition({ x: event.clientX, y: event.clientY })
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
window.addEventListener("mousemove", handleMouseMove)
|
| 29 |
+
|
| 30 |
+
return () => {
|
| 31 |
+
window.removeEventListener("mousemove", handleMouseMove)
|
| 32 |
+
}
|
| 33 |
+
}, [])
|
| 34 |
+
|
| 35 |
+
return mousePosition
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
interface ParticlesProps extends ComponentPropsWithoutRef<"div"> {
|
| 39 |
+
className?: string
|
| 40 |
+
quantity?: number
|
| 41 |
+
staticity?: number
|
| 42 |
+
ease?: number
|
| 43 |
+
size?: number
|
| 44 |
+
refresh?: boolean
|
| 45 |
+
color?: string
|
| 46 |
+
vx?: number
|
| 47 |
+
vy?: number
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
function hexToRgb(hex: string): number[] {
|
| 51 |
+
hex = hex.replace("#", "")
|
| 52 |
+
|
| 53 |
+
if (hex.length === 3) {
|
| 54 |
+
hex = hex
|
| 55 |
+
.split("")
|
| 56 |
+
.map((char) => char + char)
|
| 57 |
+
.join("")
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
const hexInt = parseInt(hex, 16)
|
| 61 |
+
const red = (hexInt >> 16) & 255
|
| 62 |
+
const green = (hexInt >> 8) & 255
|
| 63 |
+
const blue = hexInt & 255
|
| 64 |
+
return [red, green, blue]
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
type Circle = {
|
| 68 |
+
x: number
|
| 69 |
+
y: number
|
| 70 |
+
translateX: number
|
| 71 |
+
translateY: number
|
| 72 |
+
size: number
|
| 73 |
+
alpha: number
|
| 74 |
+
targetAlpha: number
|
| 75 |
+
dx: number
|
| 76 |
+
dy: number
|
| 77 |
+
magnetism: number
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
export const Particles: React.FC<ParticlesProps> = ({
|
| 81 |
+
className = "",
|
| 82 |
+
quantity = 100,
|
| 83 |
+
staticity = 50,
|
| 84 |
+
ease = 50,
|
| 85 |
+
size = 0.4,
|
| 86 |
+
refresh = false,
|
| 87 |
+
color = "#ffffff",
|
| 88 |
+
vx = 0,
|
| 89 |
+
vy = 0,
|
| 90 |
+
...props
|
| 91 |
+
}) => {
|
| 92 |
+
const canvasRef = useRef<HTMLCanvasElement>(null)
|
| 93 |
+
const canvasContainerRef = useRef<HTMLDivElement>(null)
|
| 94 |
+
const context = useRef<CanvasRenderingContext2D | null>(null)
|
| 95 |
+
const circles = useRef<Circle[]>([])
|
| 96 |
+
const mousePosition = MousePosition()
|
| 97 |
+
const mouse = useRef<{ x: number; y: number }>({ x: 0, y: 0 })
|
| 98 |
+
const canvasSize = useRef<{ w: number; h: number }>({ w: 0, h: 0 })
|
| 99 |
+
const dpr = typeof window !== "undefined" ? window.devicePixelRatio : 1
|
| 100 |
+
const rafID = useRef<number | null>(null)
|
| 101 |
+
const resizeTimeout = useRef<NodeJS.Timeout | null>(null)
|
| 102 |
+
const initCanvasRef = useRef<() => void>(() => {})
|
| 103 |
+
const onMouseMoveRef = useRef<() => void>(() => {})
|
| 104 |
+
const animateRef = useRef<() => void>(() => {})
|
| 105 |
+
const isVisibleRef = useRef<boolean>(true)
|
| 106 |
+
|
| 107 |
+
useEffect(() => {
|
| 108 |
+
const observer = new IntersectionObserver(
|
| 109 |
+
([entry]) => {
|
| 110 |
+
isVisibleRef.current = entry.isIntersecting
|
| 111 |
+
},
|
| 112 |
+
{ threshold: 0, rootMargin: "100px" }
|
| 113 |
+
)
|
| 114 |
+
|
| 115 |
+
if (canvasContainerRef.current) {
|
| 116 |
+
observer.observe(canvasContainerRef.current)
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
return () => {
|
| 120 |
+
observer.disconnect()
|
| 121 |
+
}
|
| 122 |
+
}, [])
|
| 123 |
+
|
| 124 |
+
useEffect(() => {
|
| 125 |
+
if (canvasRef.current) {
|
| 126 |
+
context.current = canvasRef.current.getContext("2d")
|
| 127 |
+
}
|
| 128 |
+
initCanvasRef.current()
|
| 129 |
+
animateRef.current()
|
| 130 |
+
|
| 131 |
+
const handleResize = () => {
|
| 132 |
+
if (resizeTimeout.current) {
|
| 133 |
+
clearTimeout(resizeTimeout.current)
|
| 134 |
+
}
|
| 135 |
+
resizeTimeout.current = setTimeout(() => {
|
| 136 |
+
initCanvasRef.current()
|
| 137 |
+
}, 200)
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
window.addEventListener("resize", handleResize)
|
| 141 |
+
|
| 142 |
+
return () => {
|
| 143 |
+
if (rafID.current != null) {
|
| 144 |
+
window.cancelAnimationFrame(rafID.current)
|
| 145 |
+
}
|
| 146 |
+
if (resizeTimeout.current) {
|
| 147 |
+
clearTimeout(resizeTimeout.current)
|
| 148 |
+
}
|
| 149 |
+
window.removeEventListener("resize", handleResize)
|
| 150 |
+
}
|
| 151 |
+
}, [color])
|
| 152 |
+
|
| 153 |
+
useEffect(() => {
|
| 154 |
+
onMouseMoveRef.current()
|
| 155 |
+
}, [mousePosition.x, mousePosition.y])
|
| 156 |
+
|
| 157 |
+
useEffect(() => {
|
| 158 |
+
initCanvasRef.current()
|
| 159 |
+
}, [refresh])
|
| 160 |
+
|
| 161 |
+
const initCanvas = () => {
|
| 162 |
+
resizeCanvas()
|
| 163 |
+
drawParticles()
|
| 164 |
+
}
|
| 165 |
+
|
| 166 |
+
const onMouseMove = () => {
|
| 167 |
+
if (canvasRef.current) {
|
| 168 |
+
const rect = canvasRef.current.getBoundingClientRect()
|
| 169 |
+
const { w, h } = canvasSize.current
|
| 170 |
+
const x = mousePosition.x - rect.left - w / 2
|
| 171 |
+
const y = mousePosition.y - rect.top - h / 2
|
| 172 |
+
const inside = x < w / 2 && x > -w / 2 && y < h / 2 && y > -h / 2
|
| 173 |
+
if (inside) {
|
| 174 |
+
mouse.current.x = x
|
| 175 |
+
mouse.current.y = y
|
| 176 |
+
}
|
| 177 |
+
}
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
const resizeCanvas = () => {
|
| 181 |
+
if (canvasContainerRef.current && canvasRef.current && context.current) {
|
| 182 |
+
canvasSize.current.w = canvasContainerRef.current.offsetWidth
|
| 183 |
+
canvasSize.current.h = canvasContainerRef.current.offsetHeight
|
| 184 |
+
|
| 185 |
+
canvasRef.current.width = canvasSize.current.w * dpr
|
| 186 |
+
canvasRef.current.height = canvasSize.current.h * dpr
|
| 187 |
+
canvasRef.current.style.width = `${canvasSize.current.w}px`
|
| 188 |
+
canvasRef.current.style.height = `${canvasSize.current.h}px`
|
| 189 |
+
context.current.scale(dpr, dpr)
|
| 190 |
+
|
| 191 |
+
// Clear existing particles and create new ones with exact quantity
|
| 192 |
+
circles.current = []
|
| 193 |
+
for (let i = 0; i < quantity; i++) {
|
| 194 |
+
const circle = circleParams()
|
| 195 |
+
drawCircle(circle)
|
| 196 |
+
}
|
| 197 |
+
}
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
const circleParams = (): Circle => {
|
| 201 |
+
const x = Math.floor(Math.random() * canvasSize.current.w)
|
| 202 |
+
const y = Math.floor(Math.random() * canvasSize.current.h)
|
| 203 |
+
const translateX = 0
|
| 204 |
+
const translateY = 0
|
| 205 |
+
const pSize = Math.floor(Math.random() * 2) + size
|
| 206 |
+
const alpha = 0
|
| 207 |
+
const targetAlpha = parseFloat((Math.random() * 0.6 + 0.1).toFixed(1))
|
| 208 |
+
const dx = (Math.random() - 0.5) * 0.1
|
| 209 |
+
const dy = (Math.random() - 0.5) * 0.1
|
| 210 |
+
const magnetism = 0.1 + Math.random() * 4
|
| 211 |
+
return {
|
| 212 |
+
x,
|
| 213 |
+
y,
|
| 214 |
+
translateX,
|
| 215 |
+
translateY,
|
| 216 |
+
size: pSize,
|
| 217 |
+
alpha,
|
| 218 |
+
targetAlpha,
|
| 219 |
+
dx,
|
| 220 |
+
dy,
|
| 221 |
+
magnetism,
|
| 222 |
+
}
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
const rgb = hexToRgb(color)
|
| 226 |
+
|
| 227 |
+
const drawCircle = (circle: Circle, update = false) => {
|
| 228 |
+
if (context.current) {
|
| 229 |
+
const { x, y, translateX, translateY, size, alpha } = circle
|
| 230 |
+
context.current.translate(translateX, translateY)
|
| 231 |
+
context.current.beginPath()
|
| 232 |
+
context.current.arc(x, y, size, 0, 2 * Math.PI)
|
| 233 |
+
context.current.fillStyle = `rgba(${rgb.join(", ")}, ${alpha})`
|
| 234 |
+
context.current.fill()
|
| 235 |
+
context.current.setTransform(dpr, 0, 0, dpr, 0, 0)
|
| 236 |
+
|
| 237 |
+
if (!update) {
|
| 238 |
+
circles.current.push(circle)
|
| 239 |
+
}
|
| 240 |
+
}
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
const clearContext = () => {
|
| 244 |
+
if (context.current) {
|
| 245 |
+
context.current.clearRect(
|
| 246 |
+
0,
|
| 247 |
+
0,
|
| 248 |
+
canvasSize.current.w,
|
| 249 |
+
canvasSize.current.h
|
| 250 |
+
)
|
| 251 |
+
}
|
| 252 |
+
}
|
| 253 |
+
|
| 254 |
+
const drawParticles = () => {
|
| 255 |
+
clearContext()
|
| 256 |
+
const particleCount = quantity
|
| 257 |
+
for (let i = 0; i < particleCount; i++) {
|
| 258 |
+
const circle = circleParams()
|
| 259 |
+
drawCircle(circle)
|
| 260 |
+
}
|
| 261 |
+
}
|
| 262 |
+
|
| 263 |
+
const remapValue = (
|
| 264 |
+
value: number,
|
| 265 |
+
start1: number,
|
| 266 |
+
end1: number,
|
| 267 |
+
start2: number,
|
| 268 |
+
end2: number
|
| 269 |
+
): number => {
|
| 270 |
+
const remapped =
|
| 271 |
+
((value - start1) * (end2 - start2)) / (end1 - start1) + start2
|
| 272 |
+
return remapped > 0 ? remapped : 0
|
| 273 |
+
}
|
| 274 |
+
|
| 275 |
+
const animate = () => {
|
| 276 |
+
if (!isVisibleRef.current) {
|
| 277 |
+
rafID.current = window.requestAnimationFrame(animateRef.current)
|
| 278 |
+
return
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
clearContext()
|
| 282 |
+
circles.current.forEach((circle: Circle, i: number) => {
|
| 283 |
+
// Handle the alpha value
|
| 284 |
+
const edge = [
|
| 285 |
+
circle.x + circle.translateX - circle.size, // distance from left edge
|
| 286 |
+
canvasSize.current.w - circle.x - circle.translateX - circle.size, // distance from right edge
|
| 287 |
+
circle.y + circle.translateY - circle.size, // distance from top edge
|
| 288 |
+
canvasSize.current.h - circle.y - circle.translateY - circle.size, // distance from bottom edge
|
| 289 |
+
]
|
| 290 |
+
const closestEdge = edge.reduce((a, b) => Math.min(a, b))
|
| 291 |
+
const remapClosestEdge = parseFloat(
|
| 292 |
+
remapValue(closestEdge, 0, 20, 0, 1).toFixed(2)
|
| 293 |
+
)
|
| 294 |
+
if (remapClosestEdge > 1) {
|
| 295 |
+
circle.alpha += 0.02
|
| 296 |
+
if (circle.alpha > circle.targetAlpha) {
|
| 297 |
+
circle.alpha = circle.targetAlpha
|
| 298 |
+
}
|
| 299 |
+
} else {
|
| 300 |
+
circle.alpha = circle.targetAlpha * remapClosestEdge
|
| 301 |
+
}
|
| 302 |
+
circle.x += circle.dx + vx
|
| 303 |
+
circle.y += circle.dy + vy
|
| 304 |
+
circle.translateX +=
|
| 305 |
+
(mouse.current.x / (staticity / circle.magnetism) - circle.translateX) /
|
| 306 |
+
ease
|
| 307 |
+
circle.translateY +=
|
| 308 |
+
(mouse.current.y / (staticity / circle.magnetism) - circle.translateY) /
|
| 309 |
+
ease
|
| 310 |
+
|
| 311 |
+
drawCircle(circle, true)
|
| 312 |
+
|
| 313 |
+
// circle gets out of the canvas
|
| 314 |
+
if (
|
| 315 |
+
circle.x < -circle.size ||
|
| 316 |
+
circle.x > canvasSize.current.w + circle.size ||
|
| 317 |
+
circle.y < -circle.size ||
|
| 318 |
+
circle.y > canvasSize.current.h + circle.size
|
| 319 |
+
) {
|
| 320 |
+
// remove the circle from the array
|
| 321 |
+
circles.current.splice(i, 1)
|
| 322 |
+
// create a new circle
|
| 323 |
+
const newCircle = circleParams()
|
| 324 |
+
drawCircle(newCircle)
|
| 325 |
+
}
|
| 326 |
+
})
|
| 327 |
+
rafID.current = window.requestAnimationFrame(animateRef.current)
|
| 328 |
+
}
|
| 329 |
+
|
| 330 |
+
useEffect(() => {
|
| 331 |
+
initCanvasRef.current = initCanvas
|
| 332 |
+
onMouseMoveRef.current = onMouseMove
|
| 333 |
+
animateRef.current = animate
|
| 334 |
+
})
|
| 335 |
+
|
| 336 |
+
return (
|
| 337 |
+
<div
|
| 338 |
+
className={cn("pointer-events-none", className)}
|
| 339 |
+
ref={canvasContainerRef}
|
| 340 |
+
aria-hidden="true"
|
| 341 |
+
{...props}
|
| 342 |
+
>
|
| 343 |
+
<canvas ref={canvasRef} className="size-full" />
|
| 344 |
+
</div>
|
| 345 |
+
)
|
| 346 |
+
}
|
components/ui/shimmer-button.tsx
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import React, { type ComponentPropsWithoutRef, type CSSProperties } from "react"
|
| 2 |
+
import { cn } from "@/lib/utils"
|
| 3 |
+
|
| 4 |
+
export interface ShimmerButtonProps extends ComponentPropsWithoutRef<"button"> {
|
| 5 |
+
shimmerColor?: string
|
| 6 |
+
shimmerSize?: string
|
| 7 |
+
borderRadius?: string
|
| 8 |
+
shimmerDuration?: string
|
| 9 |
+
background?: string
|
| 10 |
+
className?: string
|
| 11 |
+
children?: React.ReactNode
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
export const ShimmerButton = React.forwardRef<
|
| 15 |
+
HTMLButtonElement,
|
| 16 |
+
ShimmerButtonProps
|
| 17 |
+
>(
|
| 18 |
+
(
|
| 19 |
+
{
|
| 20 |
+
shimmerColor = "var(--button-shimmer)",
|
| 21 |
+
shimmerSize = "0.05em",
|
| 22 |
+
shimmerDuration = "3s",
|
| 23 |
+
borderRadius = "100px",
|
| 24 |
+
background = "var(--button-bg)",
|
| 25 |
+
className,
|
| 26 |
+
children,
|
| 27 |
+
...props
|
| 28 |
+
},
|
| 29 |
+
ref
|
| 30 |
+
) => {
|
| 31 |
+
return (
|
| 32 |
+
<button
|
| 33 |
+
style={
|
| 34 |
+
{
|
| 35 |
+
"--spread": "90deg",
|
| 36 |
+
"--shimmer-color": shimmerColor,
|
| 37 |
+
"--radius": borderRadius,
|
| 38 |
+
"--speed": shimmerDuration,
|
| 39 |
+
"--cut": shimmerSize,
|
| 40 |
+
"--bg": background,
|
| 41 |
+
} as CSSProperties
|
| 42 |
+
}
|
| 43 |
+
className={cn(
|
| 44 |
+
"group relative z-0 flex cursor-pointer items-center justify-center overflow-hidden [border-radius:var(--radius)] border border-[var(--button-border)] px-6 py-3 whitespace-nowrap text-[var(--button-text)] [background:var(--bg)]",
|
| 45 |
+
"transform-gpu transition-transform duration-300 ease-in-out active:translate-y-px",
|
| 46 |
+
className
|
| 47 |
+
)}
|
| 48 |
+
ref={ref}
|
| 49 |
+
{...props}
|
| 50 |
+
>
|
| 51 |
+
{/* spark container */}
|
| 52 |
+
<div
|
| 53 |
+
className={cn(
|
| 54 |
+
"-z-30 blur-[2px]",
|
| 55 |
+
"@container-[size] absolute inset-0 overflow-visible"
|
| 56 |
+
)}
|
| 57 |
+
>
|
| 58 |
+
{/* spark */}
|
| 59 |
+
<div className="animate-shimmer-slide absolute inset-0 aspect-[1] h-[100cqh] rounded-none [mask:none]">
|
| 60 |
+
{/* spark before */}
|
| 61 |
+
<div className="animate-spin-around absolute -inset-full w-auto [translate:0_0] rotate-0 [background:conic-gradient(from_calc(270deg-(var(--spread)*0.5)),transparent_0,var(--shimmer-color)_var(--spread),transparent_var(--spread))]" />
|
| 62 |
+
</div>
|
| 63 |
+
</div>
|
| 64 |
+
{children}
|
| 65 |
+
|
| 66 |
+
{/* Highlight */}
|
| 67 |
+
<div
|
| 68 |
+
className={cn(
|
| 69 |
+
"absolute inset-0 size-full",
|
| 70 |
+
"rounded-2xl px-4 py-1.5 text-sm font-medium shadow-[inset_0_-8px_10px_var(--primary-glow)]",
|
| 71 |
+
"transform-gpu transition-all duration-300 ease-in-out",
|
| 72 |
+
"group-hover:shadow-[inset_0_-6px_10px_var(--primary-glow)]",
|
| 73 |
+
"group-active:shadow-[inset_0_-10px_10px_var(--primary-glow)]"
|
| 74 |
+
)}
|
| 75 |
+
/>
|
| 76 |
+
|
| 77 |
+
{/* backdrop */}
|
| 78 |
+
<div
|
| 79 |
+
className={cn(
|
| 80 |
+
"absolute inset-(--cut) -z-20 [border-radius:var(--radius)] [background:var(--bg)]"
|
| 81 |
+
)}
|
| 82 |
+
/>
|
| 83 |
+
</button>
|
| 84 |
+
)
|
| 85 |
+
}
|
| 86 |
+
)
|
| 87 |
+
|
| 88 |
+
ShimmerButton.displayName = "ShimmerButton"
|
components/ui/shine-border.tsx
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client"
|
| 2 |
+
|
| 3 |
+
import * as React from "react"
|
| 4 |
+
|
| 5 |
+
import { cn } from "@/lib/utils"
|
| 6 |
+
|
| 7 |
+
interface ShineBorderProps extends React.HTMLAttributes<HTMLDivElement> {
|
| 8 |
+
/**
|
| 9 |
+
* Width of the border in pixels
|
| 10 |
+
* @default 1
|
| 11 |
+
*/
|
| 12 |
+
borderWidth?: number
|
| 13 |
+
/**
|
| 14 |
+
* Duration of the animation in seconds
|
| 15 |
+
* @default 14
|
| 16 |
+
*/
|
| 17 |
+
duration?: number
|
| 18 |
+
/**
|
| 19 |
+
* Color of the border, can be a single color or an array of colors
|
| 20 |
+
* @default "#000000"
|
| 21 |
+
*/
|
| 22 |
+
shineColor?: string | string[]
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
/**
|
| 26 |
+
* Shine Border
|
| 27 |
+
*
|
| 28 |
+
* An animated background border effect component with configurable properties.
|
| 29 |
+
*/
|
| 30 |
+
export function ShineBorder({
|
| 31 |
+
borderWidth = 1,
|
| 32 |
+
duration = 14,
|
| 33 |
+
shineColor = "#000000",
|
| 34 |
+
className,
|
| 35 |
+
style,
|
| 36 |
+
...props
|
| 37 |
+
}: ShineBorderProps) {
|
| 38 |
+
return (
|
| 39 |
+
<div
|
| 40 |
+
style={
|
| 41 |
+
{
|
| 42 |
+
"--border-width": `${borderWidth}px`,
|
| 43 |
+
"--duration": `${duration}s`,
|
| 44 |
+
backgroundImage: `radial-gradient(transparent,transparent, ${
|
| 45 |
+
Array.isArray(shineColor) ? shineColor.join(",") : shineColor
|
| 46 |
+
},transparent,transparent)`,
|
| 47 |
+
backgroundSize: "300% 300%",
|
| 48 |
+
mask: `linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,
|
| 49 |
+
WebkitMask: `linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,
|
| 50 |
+
WebkitMaskComposite: "xor",
|
| 51 |
+
maskComposite: "exclude",
|
| 52 |
+
padding: "var(--border-width)",
|
| 53 |
+
...style,
|
| 54 |
+
} as React.CSSProperties
|
| 55 |
+
}
|
| 56 |
+
className={cn(
|
| 57 |
+
"motion-safe:animate-shine pointer-events-none absolute inset-0 size-full rounded-[inherit] will-change-[background-position]",
|
| 58 |
+
className
|
| 59 |
+
)}
|
| 60 |
+
{...props}
|
| 61 |
+
/>
|
| 62 |
+
)
|
| 63 |
+
}
|
components/ui/split-flap-text.tsx
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client"
|
| 2 |
+
|
| 3 |
+
import type React from "react"
|
| 4 |
+
import { motion } from "motion/react"
|
| 5 |
+
import { useMemo, useState, useCallback, useEffect, useRef, createContext, useContext } from "react"
|
| 6 |
+
import { Volume2, VolumeX } from "lucide-react"
|
| 7 |
+
|
| 8 |
+
interface AudioContextType {
|
| 9 |
+
isMuted: boolean
|
| 10 |
+
toggleMute: () => void
|
| 11 |
+
playClick: () => void
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
const SplitFlapAudioContext = createContext<AudioContextType | null>(null)
|
| 15 |
+
|
| 16 |
+
export function useSplitFlapAudio() {
|
| 17 |
+
return useContext(SplitFlapAudioContext)
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
export function SplitFlapAudioProvider({ children }: { children: React.ReactNode }) {
|
| 21 |
+
const [isMuted, setIsMuted] = useState(true)
|
| 22 |
+
const audioContextRef = useRef<AudioContext | null>(null)
|
| 23 |
+
|
| 24 |
+
const getAudioContext = useCallback(() => {
|
| 25 |
+
if (typeof window === "undefined") return null
|
| 26 |
+
if (!audioContextRef.current) {
|
| 27 |
+
const AudioContextClass = window.AudioContext || (window as Window & { webkitAudioContext?: typeof AudioContext }).webkitAudioContext
|
| 28 |
+
if (AudioContextClass) {
|
| 29 |
+
audioContextRef.current = new AudioContextClass()
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
+
return audioContextRef.current
|
| 33 |
+
}, [])
|
| 34 |
+
|
| 35 |
+
const triggerHaptic = useCallback(() => {
|
| 36 |
+
if (isMuted) return
|
| 37 |
+
if (typeof navigator !== "undefined" && "vibrate" in navigator) {
|
| 38 |
+
navigator.vibrate(10)
|
| 39 |
+
}
|
| 40 |
+
}, [isMuted])
|
| 41 |
+
|
| 42 |
+
const playClick = useCallback(() => {
|
| 43 |
+
if (isMuted) return
|
| 44 |
+
|
| 45 |
+
triggerHaptic()
|
| 46 |
+
|
| 47 |
+
try {
|
| 48 |
+
const ctx = getAudioContext()
|
| 49 |
+
if (!ctx) return
|
| 50 |
+
|
| 51 |
+
if (ctx.state === "suspended") {
|
| 52 |
+
ctx.resume()
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
const oscillator = ctx.createOscillator()
|
| 56 |
+
const gainNode = ctx.createGain()
|
| 57 |
+
const filter = ctx.createBiquadFilter()
|
| 58 |
+
const lowpass = ctx.createBiquadFilter()
|
| 59 |
+
|
| 60 |
+
oscillator.type = "square"
|
| 61 |
+
oscillator.frequency.setValueAtTime(800 + Math.random() * 400, ctx.currentTime)
|
| 62 |
+
oscillator.frequency.exponentialRampToValueAtTime(200, ctx.currentTime + 0.015)
|
| 63 |
+
|
| 64 |
+
filter.type = "bandpass"
|
| 65 |
+
filter.frequency.setValueAtTime(1200, ctx.currentTime)
|
| 66 |
+
filter.Q.setValueAtTime(0.8, ctx.currentTime)
|
| 67 |
+
|
| 68 |
+
lowpass.type = "lowpass"
|
| 69 |
+
lowpass.frequency.value = 2500
|
| 70 |
+
lowpass.Q.value = 0.5
|
| 71 |
+
|
| 72 |
+
gainNode.gain.setValueAtTime(0.05, ctx.currentTime)
|
| 73 |
+
gainNode.gain.exponentialRampToValueAtTime(0.001, ctx.currentTime + 0.02)
|
| 74 |
+
|
| 75 |
+
oscillator.connect(filter)
|
| 76 |
+
filter.connect(gainNode)
|
| 77 |
+
gainNode.connect(lowpass)
|
| 78 |
+
lowpass.connect(ctx.destination)
|
| 79 |
+
|
| 80 |
+
oscillator.start(ctx.currentTime)
|
| 81 |
+
oscillator.stop(ctx.currentTime + 0.02)
|
| 82 |
+
} catch {
|
| 83 |
+
// Audio not supported
|
| 84 |
+
}
|
| 85 |
+
}, [isMuted, getAudioContext, triggerHaptic])
|
| 86 |
+
|
| 87 |
+
const toggleMute = useCallback(() => {
|
| 88 |
+
setIsMuted((prev) => !prev)
|
| 89 |
+
if (isMuted) {
|
| 90 |
+
try {
|
| 91 |
+
const ctx = getAudioContext()
|
| 92 |
+
if (ctx && ctx.state === "suspended") {
|
| 93 |
+
ctx.resume()
|
| 94 |
+
}
|
| 95 |
+
} catch {
|
| 96 |
+
// Audio not supported
|
| 97 |
+
}
|
| 98 |
+
}
|
| 99 |
+
}, [isMuted, getAudioContext])
|
| 100 |
+
|
| 101 |
+
const value = useMemo(() => ({ isMuted, toggleMute, playClick }), [isMuted, toggleMute, playClick])
|
| 102 |
+
|
| 103 |
+
return <SplitFlapAudioContext.Provider value={value}>{children}</SplitFlapAudioContext.Provider>
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
export function SplitFlapMuteToggle({ className = "" }: { className?: string }) {
|
| 107 |
+
const audio = useSplitFlapAudio()
|
| 108 |
+
if (!audio) return null
|
| 109 |
+
|
| 110 |
+
return (
|
| 111 |
+
<button
|
| 112 |
+
onClick={audio.toggleMute}
|
| 113 |
+
className={`inline-flex items-center gap-2 font-mono text-[10px] uppercase tracking-widest text-muted-foreground hover:text-foreground transition-colors duration-200 ${className}`}
|
| 114 |
+
aria-label={audio.isMuted ? "Unmute sound effects" : "Mute sound effects"}
|
| 115 |
+
>
|
| 116 |
+
{audio.isMuted ? <VolumeX className="w-4 h-4" /> : <Volume2 className="w-4 h-4" />}
|
| 117 |
+
<span>{audio.isMuted ? "Sound Off" : "Sound On"}</span>
|
| 118 |
+
</button>
|
| 119 |
+
)
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
interface SplitFlapTextProps {
|
| 123 |
+
text: string
|
| 124 |
+
className?: string
|
| 125 |
+
speed?: number
|
| 126 |
+
fontSize?: string | number
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
const CHARSET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split("")
|
| 130 |
+
|
| 131 |
+
function SplitFlapTextInner({ text, className = "", speed = 50, fontSize = "inherit" }: SplitFlapTextProps) {
|
| 132 |
+
const chars = useMemo(() => text.split(""), [text])
|
| 133 |
+
const [animationKey, setAnimationKey] = useState(0)
|
| 134 |
+
const [hasInitialized, setHasInitialized] = useState(false)
|
| 135 |
+
const audio = useSplitFlapAudio()
|
| 136 |
+
|
| 137 |
+
const handleMouseEnter = useCallback(() => {
|
| 138 |
+
setAnimationKey((prev) => prev + 1)
|
| 139 |
+
}, [])
|
| 140 |
+
|
| 141 |
+
useEffect(() => {
|
| 142 |
+
const timer = setTimeout(() => {
|
| 143 |
+
setHasInitialized(true)
|
| 144 |
+
}, 1000)
|
| 145 |
+
return () => clearTimeout(timer)
|
| 146 |
+
}, [])
|
| 147 |
+
|
| 148 |
+
return (
|
| 149 |
+
<div
|
| 150 |
+
className={`inline-flex gap-[0.08em] items-center cursor-pointer ${className}`}
|
| 151 |
+
aria-label={text}
|
| 152 |
+
onMouseEnter={handleMouseEnter}
|
| 153 |
+
style={{ perspective: "1000px" }}
|
| 154 |
+
>
|
| 155 |
+
{chars.map((char, index) => (
|
| 156 |
+
<SplitFlapChar
|
| 157 |
+
key={index}
|
| 158 |
+
char={char.toUpperCase()}
|
| 159 |
+
index={index}
|
| 160 |
+
animationKey={animationKey}
|
| 161 |
+
skipEntrance={hasInitialized}
|
| 162 |
+
speed={speed}
|
| 163 |
+
fontSize={fontSize}
|
| 164 |
+
playClick={audio?.playClick}
|
| 165 |
+
/>
|
| 166 |
+
))}
|
| 167 |
+
</div>
|
| 168 |
+
)
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
export function SplitFlapText(props: SplitFlapTextProps) {
|
| 172 |
+
return <SplitFlapTextInner {...props} />
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
interface SplitFlapCharProps {
|
| 176 |
+
char: string
|
| 177 |
+
index: number
|
| 178 |
+
animationKey: number
|
| 179 |
+
skipEntrance: boolean
|
| 180 |
+
speed: number
|
| 181 |
+
fontSize: string | number
|
| 182 |
+
playClick?: () => void
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
+
function SplitFlapChar({ char, index, animationKey, skipEntrance, speed, fontSize, playClick }: SplitFlapCharProps) {
|
| 186 |
+
const displayChar = CHARSET.includes(char) ? char : " "
|
| 187 |
+
const isSpace = char === " "
|
| 188 |
+
const [currentChar, setCurrentChar] = useState(skipEntrance ? displayChar : " ")
|
| 189 |
+
const [isSettled, setIsSettled] = useState(skipEntrance)
|
| 190 |
+
const intervalRef = useRef<ReturnType<typeof setInterval> | null>(null)
|
| 191 |
+
const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null)
|
| 192 |
+
|
| 193 |
+
const tileDelay = 0.15 * index
|
| 194 |
+
|
| 195 |
+
const bgColor = isSettled ? "hsl(0, 0%, 0%)" : "rgba(249, 115, 22, 0.2)"
|
| 196 |
+
const textColor = isSettled ? "#ffffff" : "#f97316"
|
| 197 |
+
|
| 198 |
+
useEffect(() => {
|
| 199 |
+
if (isSpace) return
|
| 200 |
+
|
| 201 |
+
if (intervalRef.current) clearInterval(intervalRef.current)
|
| 202 |
+
if (timeoutRef.current) clearTimeout(timeoutRef.current)
|
| 203 |
+
|
| 204 |
+
const baseFlips = 8
|
| 205 |
+
const startDelay = skipEntrance ? tileDelay * 400 : tileDelay * 800
|
| 206 |
+
let flipIndex = 0
|
| 207 |
+
let hasStartedSettling = false
|
| 208 |
+
|
| 209 |
+
timeoutRef.current = setTimeout(() => {
|
| 210 |
+
setIsSettled(false)
|
| 211 |
+
setCurrentChar(CHARSET[Math.floor(Math.random() * CHARSET.length)])
|
| 212 |
+
|
| 213 |
+
intervalRef.current = setInterval(() => {
|
| 214 |
+
const settleThreshold = baseFlips + index * 3
|
| 215 |
+
|
| 216 |
+
if (flipIndex >= settleThreshold && !hasStartedSettling) {
|
| 217 |
+
hasStartedSettling = true
|
| 218 |
+
if (intervalRef.current) clearInterval(intervalRef.current)
|
| 219 |
+
setCurrentChar(displayChar)
|
| 220 |
+
setIsSettled(true)
|
| 221 |
+
if (playClick) playClick()
|
| 222 |
+
return
|
| 223 |
+
}
|
| 224 |
+
setCurrentChar(CHARSET[Math.floor(Math.random() * CHARSET.length)])
|
| 225 |
+
if (flipIndex % 2 === 0 && playClick) playClick()
|
| 226 |
+
flipIndex++
|
| 227 |
+
}, speed)
|
| 228 |
+
}, startDelay)
|
| 229 |
+
|
| 230 |
+
return () => {
|
| 231 |
+
if (intervalRef.current) clearInterval(intervalRef.current)
|
| 232 |
+
if (timeoutRef.current) clearTimeout(timeoutRef.current)
|
| 233 |
+
}
|
| 234 |
+
}, [displayChar, isSpace, tileDelay, animationKey, skipEntrance, index, speed, playClick])
|
| 235 |
+
|
| 236 |
+
if (isSpace) {
|
| 237 |
+
return (
|
| 238 |
+
<div
|
| 239 |
+
style={{
|
| 240 |
+
width: "0.3em",
|
| 241 |
+
fontSize: fontSize,
|
| 242 |
+
}}
|
| 243 |
+
/>
|
| 244 |
+
)
|
| 245 |
+
}
|
| 246 |
+
|
| 247 |
+
return (
|
| 248 |
+
<motion.div
|
| 249 |
+
initial={skipEntrance ? { opacity: 1, y: 0 } : { opacity: 0, y: 20 }}
|
| 250 |
+
animate={{ opacity: 1, y: 0 }}
|
| 251 |
+
transition={{ delay: tileDelay, duration: 0.3, ease: "easeOut" }}
|
| 252 |
+
className="relative overflow-hidden flex items-center justify-center font-[family-name:var(--font-bebas)]"
|
| 253 |
+
style={{
|
| 254 |
+
fontSize: fontSize,
|
| 255 |
+
width: "0.65em",
|
| 256 |
+
height: "1.05em",
|
| 257 |
+
backgroundColor: bgColor,
|
| 258 |
+
transformStyle: "preserve-3d",
|
| 259 |
+
transition: "background-color 0.15s ease",
|
| 260 |
+
}}
|
| 261 |
+
>
|
| 262 |
+
<div className="absolute inset-x-0 top-1/2 h-[1px] bg-black/20 pointer-events-none z-10" />
|
| 263 |
+
|
| 264 |
+
<div className="absolute inset-x-0 top-0 bottom-1/2 flex items-end justify-center overflow-hidden">
|
| 265 |
+
<span
|
| 266 |
+
className="block translate-y-[0.52em] leading-none transition-colors duration-150"
|
| 267 |
+
style={{ color: textColor }}
|
| 268 |
+
>
|
| 269 |
+
{currentChar}
|
| 270 |
+
</span>
|
| 271 |
+
</div>
|
| 272 |
+
|
| 273 |
+
<div className="absolute inset-x-0 top-1/2 bottom-0 flex items-start justify-center overflow-hidden">
|
| 274 |
+
<span
|
| 275 |
+
className="-translate-y-[0.52em] leading-none transition-colors duration-150"
|
| 276 |
+
style={{ color: textColor }}
|
| 277 |
+
>
|
| 278 |
+
{currentChar}
|
| 279 |
+
</span>
|
| 280 |
+
</div>
|
| 281 |
+
|
| 282 |
+
<motion.div
|
| 283 |
+
key={`${animationKey}-${isSettled}`}
|
| 284 |
+
initial={{ rotateX: -90 }}
|
| 285 |
+
animate={{ rotateX: 0 }}
|
| 286 |
+
transition={{
|
| 287 |
+
delay: skipEntrance ? tileDelay * 0.5 : tileDelay + 0.15,
|
| 288 |
+
duration: 0.25,
|
| 289 |
+
ease: [0.22, 0.61, 0.36, 1],
|
| 290 |
+
}}
|
| 291 |
+
className="absolute inset-x-0 top-0 bottom-1/2 origin-bottom overflow-hidden"
|
| 292 |
+
style={{
|
| 293 |
+
backgroundColor: bgColor,
|
| 294 |
+
transformStyle: "preserve-3d",
|
| 295 |
+
backfaceVisibility: "hidden",
|
| 296 |
+
transition: "background-color 0.15s ease",
|
| 297 |
+
}}
|
| 298 |
+
>
|
| 299 |
+
<div className="flex h-full items-end justify-center">
|
| 300 |
+
<span
|
| 301 |
+
className="translate-y-[0.52em] leading-none transition-colors duration-150"
|
| 302 |
+
style={{ color: textColor }}
|
| 303 |
+
>
|
| 304 |
+
{currentChar}
|
| 305 |
+
</span>
|
| 306 |
+
</div>
|
| 307 |
+
</motion.div>
|
| 308 |
+
</motion.div>
|
| 309 |
+
)
|
| 310 |
+
}
|
components/ui/terminal.tsx
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client"
|
| 2 |
+
|
| 3 |
+
import {
|
| 4 |
+
Children,
|
| 5 |
+
createContext,
|
| 6 |
+
useContext,
|
| 7 |
+
useEffect,
|
| 8 |
+
useMemo,
|
| 9 |
+
useRef,
|
| 10 |
+
useState,
|
| 11 |
+
type ComponentType,
|
| 12 |
+
type RefAttributes,
|
| 13 |
+
} from "react"
|
| 14 |
+
import {
|
| 15 |
+
motion,
|
| 16 |
+
useInView,
|
| 17 |
+
type DOMMotionComponents,
|
| 18 |
+
type HTMLMotionProps,
|
| 19 |
+
type MotionProps,
|
| 20 |
+
} from "motion/react"
|
| 21 |
+
|
| 22 |
+
import { cn } from "@/lib/utils"
|
| 23 |
+
|
| 24 |
+
interface SequenceContextValue {
|
| 25 |
+
completeItem: (index: number) => void
|
| 26 |
+
activeIndex: number
|
| 27 |
+
sequenceStarted: boolean
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
const SequenceContext = createContext<SequenceContextValue | null>(null)
|
| 31 |
+
|
| 32 |
+
const useSequence = () => useContext(SequenceContext)
|
| 33 |
+
|
| 34 |
+
const ItemIndexContext = createContext<number | null>(null)
|
| 35 |
+
const useItemIndex = () => useContext(ItemIndexContext)
|
| 36 |
+
|
| 37 |
+
const motionElements = {
|
| 38 |
+
article: motion.article,
|
| 39 |
+
div: motion.div,
|
| 40 |
+
h1: motion.h1,
|
| 41 |
+
h2: motion.h2,
|
| 42 |
+
h3: motion.h3,
|
| 43 |
+
h4: motion.h4,
|
| 44 |
+
h5: motion.h5,
|
| 45 |
+
h6: motion.h6,
|
| 46 |
+
li: motion.li,
|
| 47 |
+
p: motion.p,
|
| 48 |
+
section: motion.section,
|
| 49 |
+
span: motion.span,
|
| 50 |
+
} as const
|
| 51 |
+
|
| 52 |
+
type MotionElementType = Extract<
|
| 53 |
+
keyof DOMMotionComponents,
|
| 54 |
+
keyof typeof motionElements
|
| 55 |
+
>
|
| 56 |
+
type TerminalTypingMotionComponent = ComponentType<
|
| 57 |
+
Omit<HTMLMotionProps<"span">, "ref"> & RefAttributes<HTMLElement>
|
| 58 |
+
>
|
| 59 |
+
|
| 60 |
+
interface AnimatedSpanProps extends MotionProps {
|
| 61 |
+
children: React.ReactNode
|
| 62 |
+
delay?: number
|
| 63 |
+
className?: string
|
| 64 |
+
startOnView?: boolean
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
export const AnimatedSpan = ({
|
| 68 |
+
children,
|
| 69 |
+
delay = 0,
|
| 70 |
+
className,
|
| 71 |
+
startOnView = false,
|
| 72 |
+
...props
|
| 73 |
+
}: AnimatedSpanProps) => {
|
| 74 |
+
const elementRef = useRef<HTMLDivElement | null>(null)
|
| 75 |
+
const isInView = useInView(elementRef as React.RefObject<Element>, {
|
| 76 |
+
amount: 0.3,
|
| 77 |
+
once: true,
|
| 78 |
+
})
|
| 79 |
+
|
| 80 |
+
const sequence = useSequence()
|
| 81 |
+
const itemIndex = useItemIndex()
|
| 82 |
+
const [hasStarted, setHasStarted] = useState(false)
|
| 83 |
+
useEffect(() => {
|
| 84 |
+
if (!sequence || itemIndex === null) return
|
| 85 |
+
if (!sequence.sequenceStarted) return
|
| 86 |
+
if (hasStarted) return
|
| 87 |
+
if (sequence.activeIndex === itemIndex) {
|
| 88 |
+
const timer = setTimeout(() => setHasStarted(true), 0)
|
| 89 |
+
return () => clearTimeout(timer)
|
| 90 |
+
}
|
| 91 |
+
}, [sequence, hasStarted, itemIndex])
|
| 92 |
+
|
| 93 |
+
const shouldAnimate = sequence ? hasStarted : startOnView ? isInView : true
|
| 94 |
+
|
| 95 |
+
return (
|
| 96 |
+
<motion.div
|
| 97 |
+
ref={elementRef}
|
| 98 |
+
initial={{ opacity: 0, y: -5 }}
|
| 99 |
+
animate={shouldAnimate ? { opacity: 1, y: 0 } : { opacity: 0, y: -5 }}
|
| 100 |
+
transition={{ duration: 0.3, delay: sequence ? 0 : delay / 1000 }}
|
| 101 |
+
className={cn("grid text-sm font-normal tracking-tight", className)}
|
| 102 |
+
onAnimationComplete={() => {
|
| 103 |
+
if (!sequence) return
|
| 104 |
+
if (itemIndex === null) return
|
| 105 |
+
sequence.completeItem(itemIndex)
|
| 106 |
+
}}
|
| 107 |
+
{...props}
|
| 108 |
+
>
|
| 109 |
+
{children}
|
| 110 |
+
</motion.div>
|
| 111 |
+
)
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
interface TypingAnimationProps extends Omit<MotionProps, "children"> {
|
| 115 |
+
children: string
|
| 116 |
+
className?: string
|
| 117 |
+
duration?: number
|
| 118 |
+
delay?: number
|
| 119 |
+
as?: MotionElementType
|
| 120 |
+
startOnView?: boolean
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
export const TypingAnimation = ({
|
| 124 |
+
children,
|
| 125 |
+
className,
|
| 126 |
+
duration = 60,
|
| 127 |
+
delay = 0,
|
| 128 |
+
as: Component = "span",
|
| 129 |
+
startOnView = true,
|
| 130 |
+
...props
|
| 131 |
+
}: TypingAnimationProps) => {
|
| 132 |
+
if (typeof children !== "string") {
|
| 133 |
+
throw new Error("TypingAnimation: children must be a string. Received:")
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
const MotionComponent = motionElements[
|
| 137 |
+
Component
|
| 138 |
+
] as TerminalTypingMotionComponent
|
| 139 |
+
|
| 140 |
+
const [displayedText, setDisplayedText] = useState<string>("")
|
| 141 |
+
const [started, setStarted] = useState(false)
|
| 142 |
+
const elementRef = useRef<HTMLElement | null>(null)
|
| 143 |
+
const isInView = useInView(elementRef as React.RefObject<Element>, {
|
| 144 |
+
amount: 0.3,
|
| 145 |
+
once: true,
|
| 146 |
+
})
|
| 147 |
+
|
| 148 |
+
const sequence = useSequence()
|
| 149 |
+
const itemIndex = useItemIndex()
|
| 150 |
+
const hasSequence = sequence !== null
|
| 151 |
+
const sequenceStarted = sequence?.sequenceStarted ?? false
|
| 152 |
+
const sequenceActiveIndex = sequence?.activeIndex ?? null
|
| 153 |
+
const sequenceCompleteItemRef = useRef<
|
| 154 |
+
SequenceContextValue["completeItem"] | null
|
| 155 |
+
>(null)
|
| 156 |
+
const sequenceItemIndexRef = useRef<number | null>(null)
|
| 157 |
+
|
| 158 |
+
useEffect(() => {
|
| 159 |
+
sequenceCompleteItemRef.current = sequence?.completeItem ?? null
|
| 160 |
+
sequenceItemIndexRef.current = itemIndex
|
| 161 |
+
}, [sequence?.completeItem, itemIndex])
|
| 162 |
+
|
| 163 |
+
useEffect(() => {
|
| 164 |
+
let startTimeout: ReturnType<typeof setTimeout> | null = null
|
| 165 |
+
|
| 166 |
+
if (hasSequence && itemIndex !== null) {
|
| 167 |
+
if (sequenceStarted && !started && sequenceActiveIndex === itemIndex) {
|
| 168 |
+
startTimeout = setTimeout(() => setStarted(true), 0)
|
| 169 |
+
}
|
| 170 |
+
} else if (!startOnView || isInView) {
|
| 171 |
+
startTimeout = setTimeout(() => setStarted(true), delay)
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
return () => {
|
| 175 |
+
if (startTimeout !== null) {
|
| 176 |
+
clearTimeout(startTimeout)
|
| 177 |
+
}
|
| 178 |
+
}
|
| 179 |
+
}, [
|
| 180 |
+
delay,
|
| 181 |
+
startOnView,
|
| 182 |
+
isInView,
|
| 183 |
+
started,
|
| 184 |
+
hasSequence,
|
| 185 |
+
sequenceActiveIndex,
|
| 186 |
+
sequenceStarted,
|
| 187 |
+
itemIndex,
|
| 188 |
+
])
|
| 189 |
+
|
| 190 |
+
useEffect(() => {
|
| 191 |
+
let typingEffect: ReturnType<typeof setInterval> | null = null
|
| 192 |
+
|
| 193 |
+
if (started) {
|
| 194 |
+
let i = 0
|
| 195 |
+
typingEffect = setInterval(() => {
|
| 196 |
+
if (i < children.length) {
|
| 197 |
+
setDisplayedText(children.substring(0, i + 1))
|
| 198 |
+
i++
|
| 199 |
+
} else {
|
| 200 |
+
if (typingEffect !== null) {
|
| 201 |
+
clearInterval(typingEffect)
|
| 202 |
+
}
|
| 203 |
+
const completeItem = sequenceCompleteItemRef.current
|
| 204 |
+
const currentItemIndex = sequenceItemIndexRef.current
|
| 205 |
+
if (completeItem && currentItemIndex !== null) {
|
| 206 |
+
completeItem(currentItemIndex)
|
| 207 |
+
}
|
| 208 |
+
}
|
| 209 |
+
}, duration)
|
| 210 |
+
}
|
| 211 |
+
|
| 212 |
+
return () => {
|
| 213 |
+
if (typingEffect !== null) {
|
| 214 |
+
clearInterval(typingEffect)
|
| 215 |
+
}
|
| 216 |
+
}
|
| 217 |
+
}, [children, duration, started])
|
| 218 |
+
|
| 219 |
+
return (
|
| 220 |
+
<MotionComponent
|
| 221 |
+
ref={elementRef}
|
| 222 |
+
className={cn("text-sm font-normal tracking-tight", className)}
|
| 223 |
+
{...props}
|
| 224 |
+
>
|
| 225 |
+
{displayedText}
|
| 226 |
+
</MotionComponent>
|
| 227 |
+
)
|
| 228 |
+
}
|
| 229 |
+
|
| 230 |
+
interface TerminalProps {
|
| 231 |
+
children: React.ReactNode
|
| 232 |
+
className?: string
|
| 233 |
+
sequence?: boolean
|
| 234 |
+
startOnView?: boolean
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
export const Terminal = ({
|
| 238 |
+
children,
|
| 239 |
+
className,
|
| 240 |
+
sequence = true,
|
| 241 |
+
startOnView = true,
|
| 242 |
+
}: TerminalProps) => {
|
| 243 |
+
const containerRef = useRef<HTMLDivElement | null>(null)
|
| 244 |
+
const isInView = useInView(containerRef as React.RefObject<Element>, {
|
| 245 |
+
amount: 0.3,
|
| 246 |
+
once: true,
|
| 247 |
+
})
|
| 248 |
+
|
| 249 |
+
const [activeIndex, setActiveIndex] = useState(0)
|
| 250 |
+
const sequenceHasStarted = sequence ? !startOnView || isInView : false
|
| 251 |
+
|
| 252 |
+
const contextValue = useMemo<SequenceContextValue | null>(() => {
|
| 253 |
+
if (!sequence) return null
|
| 254 |
+
return {
|
| 255 |
+
completeItem: (index: number) => {
|
| 256 |
+
setActiveIndex((current) => (index === current ? current + 1 : current))
|
| 257 |
+
},
|
| 258 |
+
activeIndex,
|
| 259 |
+
sequenceStarted: sequenceHasStarted,
|
| 260 |
+
}
|
| 261 |
+
}, [sequence, activeIndex, sequenceHasStarted])
|
| 262 |
+
|
| 263 |
+
const wrappedChildren = useMemo(() => {
|
| 264 |
+
if (!sequence) return children
|
| 265 |
+
const array = Children.toArray(children)
|
| 266 |
+
return array.map((child, index) => (
|
| 267 |
+
<ItemIndexContext.Provider key={index} value={index}>
|
| 268 |
+
{child as React.ReactNode}
|
| 269 |
+
</ItemIndexContext.Provider>
|
| 270 |
+
))
|
| 271 |
+
}, [children, sequence])
|
| 272 |
+
|
| 273 |
+
const content = (
|
| 274 |
+
<div
|
| 275 |
+
ref={containerRef}
|
| 276 |
+
className={cn(
|
| 277 |
+
"border-border bg-background z-0 h-full max-h-100 w-full max-w-lg rounded-xl border",
|
| 278 |
+
className
|
| 279 |
+
)}
|
| 280 |
+
>
|
| 281 |
+
<div className="border-border flex flex-col gap-y-2 border-b p-4">
|
| 282 |
+
<div className="flex flex-row gap-x-2">
|
| 283 |
+
<div className="h-2 w-2 rounded-full bg-red-500"></div>
|
| 284 |
+
<div className="h-2 w-2 rounded-full bg-yellow-500"></div>
|
| 285 |
+
<div className="h-2 w-2 rounded-full bg-green-500"></div>
|
| 286 |
+
</div>
|
| 287 |
+
</div>
|
| 288 |
+
<pre className="p-4">
|
| 289 |
+
<code className="grid gap-y-1 overflow-auto">{wrappedChildren}</code>
|
| 290 |
+
</pre>
|
| 291 |
+
</div>
|
| 292 |
+
)
|
| 293 |
+
|
| 294 |
+
if (!sequence) return content
|
| 295 |
+
|
| 296 |
+
return (
|
| 297 |
+
<SequenceContext.Provider value={contextValue}>
|
| 298 |
+
{content}
|
| 299 |
+
</SequenceContext.Provider>
|
| 300 |
+
)
|
| 301 |
+
}
|
components/waitlist-form.tsx
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
import { useState } from "react";
|
| 4 |
+
import { AlertTriangle } from "lucide-react";
|
| 5 |
+
import { CyberTicketModal } from "./CyberTicketModal";
|
| 6 |
+
import { ShimmerButton } from "@/components/ui/shimmer-button";
|
| 7 |
+
|
| 8 |
+
export function WaitlistForm() {
|
| 9 |
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
| 10 |
+
const [isTicketOpen, setIsTicketOpen] = useState(false);
|
| 11 |
+
const [email, setEmail] = useState("");
|
| 12 |
+
const [error, setError] = useState<string | null>(null);
|
| 13 |
+
|
| 14 |
+
const validateEmail = (emailStr: string) => {
|
| 15 |
+
const regex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
| 16 |
+
return regex.test(emailStr);
|
| 17 |
+
};
|
| 18 |
+
|
| 19 |
+
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
| 20 |
+
e.preventDefault();
|
| 21 |
+
setError(null);
|
| 22 |
+
|
| 23 |
+
if (!email) {
|
| 24 |
+
setError("Email address is required.");
|
| 25 |
+
return;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
if (!validateEmail(email)) {
|
| 29 |
+
setError("Please enter a valid email address.");
|
| 30 |
+
return;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
setIsSubmitting(true);
|
| 34 |
+
|
| 35 |
+
// Simulate API registration latency
|
| 36 |
+
setTimeout(() => {
|
| 37 |
+
setIsSubmitting(false);
|
| 38 |
+
setIsTicketOpen(true);
|
| 39 |
+
}, 1200);
|
| 40 |
+
};
|
| 41 |
+
|
| 42 |
+
return (
|
| 43 |
+
<div className="w-full flex flex-col gap-2">
|
| 44 |
+
<form
|
| 45 |
+
className="flex flex-col sm:flex-row items-center justify-center gap-3 max-w-lg w-full"
|
| 46 |
+
onSubmit={handleSubmit}
|
| 47 |
+
noValidate
|
| 48 |
+
>
|
| 49 |
+
<div className="relative w-full sm:flex-1 group">
|
| 50 |
+
<div className={`absolute -inset-0.5 rounded-lg blur opacity-0 group-focus-within:opacity-100 transition duration-500 ${error ? 'bg-destructive/45' : 'bg-primary/20'}`}></div>
|
| 51 |
+
<label htmlFor="email-input" className="sr-only">
|
| 52 |
+
Email address for waitlist
|
| 53 |
+
</label>
|
| 54 |
+
<input
|
| 55 |
+
id="email-input"
|
| 56 |
+
type="email"
|
| 57 |
+
placeholder="name@company.com…"
|
| 58 |
+
autoComplete="email"
|
| 59 |
+
spellCheck={false}
|
| 60 |
+
disabled={isSubmitting}
|
| 61 |
+
value={email}
|
| 62 |
+
onChange={(e) => {
|
| 63 |
+
setEmail(e.target.value);
|
| 64 |
+
if (error) setError(null);
|
| 65 |
+
}}
|
| 66 |
+
className={`relative w-full h-14 sm:h-16 px-6 bg-white/80 dark:bg-background/80 backdrop-blur-sm border font-mono text-sm text-foreground placeholder:text-black/35 dark:placeholder:text-white/20 outline-none focus-visible:outline-none focus-visible:ring-1 transition-colors duration-300 disabled:opacity-50 [clip-path:polygon(12px_0,100%_0,100%_calc(100%_-_12px),calc(100%_-_12px)_100%,0_100%,0_12px)] ${
|
| 67 |
+
error
|
| 68 |
+
? 'border-destructive focus-visible:ring-destructive focus-visible:ring-destructive/50'
|
| 69 |
+
: 'border-black/10 dark:border-white/10 focus-visible:ring-primary focus-visible:ring-primary/50'
|
| 70 |
+
}`}
|
| 71 |
+
name="email"
|
| 72 |
+
/>
|
| 73 |
+
</div>
|
| 74 |
+
<ShimmerButton
|
| 75 |
+
type="submit"
|
| 76 |
+
disabled={isSubmitting}
|
| 77 |
+
borderRadius="8px"
|
| 78 |
+
className="w-full sm:w-auto h-14 sm:h-16 px-8 uppercase font-mono text-xs tracking-[0.2em] font-bold cursor-pointer transition-all duration-300 disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-black shadow-md hover:shadow-lg dark:hover:shadow-[0_0_20px_var(--primary-glow)] hover:scale-[1.02] active:scale-[0.98]"
|
| 79 |
+
>
|
| 80 |
+
<span className="relative z-10 flex items-center justify-center gap-2">
|
| 81 |
+
{isSubmitting && (
|
| 82 |
+
<svg className="animate-spin h-3 w-3 text-current" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
| 83 |
+
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
|
| 84 |
+
<path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
| 85 |
+
</svg>
|
| 86 |
+
)}
|
| 87 |
+
{isSubmitting ? "PROCESSING…" : "ACCESS_HUBAPI"}
|
| 88 |
+
</span>
|
| 89 |
+
</ShimmerButton>
|
| 90 |
+
</form>
|
| 91 |
+
|
| 92 |
+
{error && (
|
| 93 |
+
<div className="flex items-center gap-2 font-mono text-xs text-destructive animate-fade-in pl-1">
|
| 94 |
+
<AlertTriangle className="h-3.5 w-3.5 shrink-0" />
|
| 95 |
+
<span>{error}</span>
|
| 96 |
+
</div>
|
| 97 |
+
)}
|
| 98 |
+
|
| 99 |
+
{/* Cyber Ticket Modal */}
|
| 100 |
+
<CyberTicketModal
|
| 101 |
+
isOpen={isTicketOpen}
|
| 102 |
+
onClose={() => setIsTicketOpen(false)}
|
| 103 |
+
email={email}
|
| 104 |
+
/>
|
| 105 |
+
</div>
|
| 106 |
+
);
|
| 107 |
+
}
|
data/cities-data.json
ADDED
|
@@ -0,0 +1,4419 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"code3": "JPN",
|
| 4 |
+
"country": "Japan",
|
| 5 |
+
"iso2": "JP",
|
| 6 |
+
"color": "#dc143c",
|
| 7 |
+
"cities": [
|
| 8 |
+
{
|
| 9 |
+
"city": "Tokyo",
|
| 10 |
+
"coordinates": [
|
| 11 |
+
139.6922,
|
| 12 |
+
35.6897
|
| 13 |
+
],
|
| 14 |
+
"capital": true,
|
| 15 |
+
"population": 37732000,
|
| 16 |
+
"edgeRegion": "hnd1"
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"city": "Osaka",
|
| 20 |
+
"coordinates": [
|
| 21 |
+
135.5023,
|
| 22 |
+
34.6937
|
| 23 |
+
],
|
| 24 |
+
"capital": false,
|
| 25 |
+
"population": 37732000,
|
| 26 |
+
"edgeRegion": "kix1"
|
| 27 |
+
}
|
| 28 |
+
]
|
| 29 |
+
},
|
| 30 |
+
{
|
| 31 |
+
"code3": "IDN",
|
| 32 |
+
"country": "Indonesia",
|
| 33 |
+
"iso2": "ID",
|
| 34 |
+
"color": "#1e40af",
|
| 35 |
+
"cities": [
|
| 36 |
+
{
|
| 37 |
+
"city": "Jakarta",
|
| 38 |
+
"coordinates": [
|
| 39 |
+
106.8275,
|
| 40 |
+
-6.175
|
| 41 |
+
],
|
| 42 |
+
"capital": true,
|
| 43 |
+
"population": 33756000
|
| 44 |
+
}
|
| 45 |
+
]
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"code3": "IND",
|
| 49 |
+
"country": "India",
|
| 50 |
+
"iso2": "IN",
|
| 51 |
+
"color": "#f59e0b",
|
| 52 |
+
"cities": [
|
| 53 |
+
{
|
| 54 |
+
"city": "Delhi",
|
| 55 |
+
"coordinates": [
|
| 56 |
+
77.23,
|
| 57 |
+
28.61
|
| 58 |
+
],
|
| 59 |
+
"capital": false,
|
| 60 |
+
"population": 32226000
|
| 61 |
+
},
|
| 62 |
+
{
|
| 63 |
+
"city": "Mumbai",
|
| 64 |
+
"coordinates": [
|
| 65 |
+
72.8775,
|
| 66 |
+
19.0761
|
| 67 |
+
],
|
| 68 |
+
"capital": false,
|
| 69 |
+
"population": 24973000,
|
| 70 |
+
"edgeRegion": "bom1"
|
| 71 |
+
},
|
| 72 |
+
{
|
| 73 |
+
"city": "Kolkāta",
|
| 74 |
+
"coordinates": [
|
| 75 |
+
88.37,
|
| 76 |
+
22.5675
|
| 77 |
+
],
|
| 78 |
+
"capital": false,
|
| 79 |
+
"population": 18502000
|
| 80 |
+
}
|
| 81 |
+
]
|
| 82 |
+
},
|
| 83 |
+
{
|
| 84 |
+
"code3": "CHN",
|
| 85 |
+
"country": "China",
|
| 86 |
+
"iso2": "CN",
|
| 87 |
+
"color": "#dc143c",
|
| 88 |
+
"cities": [
|
| 89 |
+
{
|
| 90 |
+
"city": "Guangzhou",
|
| 91 |
+
"coordinates": [
|
| 92 |
+
113.26,
|
| 93 |
+
23.13
|
| 94 |
+
],
|
| 95 |
+
"capital": false,
|
| 96 |
+
"population": 26940000
|
| 97 |
+
},
|
| 98 |
+
{
|
| 99 |
+
"city": "Shanghai",
|
| 100 |
+
"coordinates": [
|
| 101 |
+
121.4747,
|
| 102 |
+
31.2286
|
| 103 |
+
],
|
| 104 |
+
"capital": false,
|
| 105 |
+
"population": 24073000
|
| 106 |
+
},
|
| 107 |
+
{
|
| 108 |
+
"city": "Beijing",
|
| 109 |
+
"coordinates": [
|
| 110 |
+
116.3975,
|
| 111 |
+
39.9067
|
| 112 |
+
],
|
| 113 |
+
"capital": true,
|
| 114 |
+
"population": 18522000
|
| 115 |
+
},
|
| 116 |
+
{
|
| 117 |
+
"city": "Shenzhen",
|
| 118 |
+
"coordinates": [
|
| 119 |
+
114.0596,
|
| 120 |
+
22.5415
|
| 121 |
+
],
|
| 122 |
+
"capital": false,
|
| 123 |
+
"population": 17619000
|
| 124 |
+
},
|
| 125 |
+
{
|
| 126 |
+
"city": "Chengdu",
|
| 127 |
+
"coordinates": [
|
| 128 |
+
104.0633,
|
| 129 |
+
30.66
|
| 130 |
+
],
|
| 131 |
+
"capital": false,
|
| 132 |
+
"population": 14645000
|
| 133 |
+
}
|
| 134 |
+
]
|
| 135 |
+
},
|
| 136 |
+
{
|
| 137 |
+
"code3": "PHL",
|
| 138 |
+
"country": "Philippines",
|
| 139 |
+
"iso2": "PH",
|
| 140 |
+
"color": "#15803d",
|
| 141 |
+
"cities": [
|
| 142 |
+
{
|
| 143 |
+
"city": "Manila",
|
| 144 |
+
"coordinates": [
|
| 145 |
+
120.9772,
|
| 146 |
+
14.5958
|
| 147 |
+
],
|
| 148 |
+
"capital": true,
|
| 149 |
+
"population": 24922000
|
| 150 |
+
}
|
| 151 |
+
]
|
| 152 |
+
},
|
| 153 |
+
{
|
| 154 |
+
"code3": "BRA",
|
| 155 |
+
"country": "Brazil",
|
| 156 |
+
"iso2": "BR",
|
| 157 |
+
"color": "#FF0000",
|
| 158 |
+
"cities": [
|
| 159 |
+
{
|
| 160 |
+
"city": "São Paulo",
|
| 161 |
+
"coordinates": [
|
| 162 |
+
-46.6333,
|
| 163 |
+
-23.55
|
| 164 |
+
],
|
| 165 |
+
"capital": false,
|
| 166 |
+
"population": 23086000,
|
| 167 |
+
"edgeRegion": "gru1"
|
| 168 |
+
},
|
| 169 |
+
{
|
| 170 |
+
"city": "Rio de Janeiro",
|
| 171 |
+
"coordinates": [
|
| 172 |
+
-43.2056,
|
| 173 |
+
-22.9111
|
| 174 |
+
],
|
| 175 |
+
"capital": false,
|
| 176 |
+
"population": 12592000
|
| 177 |
+
},
|
| 178 |
+
{
|
| 179 |
+
"city": "Belo Horizonte",
|
| 180 |
+
"coordinates": [
|
| 181 |
+
-43.9333,
|
| 182 |
+
-19.9167
|
| 183 |
+
],
|
| 184 |
+
"capital": false,
|
| 185 |
+
"population": 5328000
|
| 186 |
+
}
|
| 187 |
+
]
|
| 188 |
+
},
|
| 189 |
+
{
|
| 190 |
+
"code3": "KOR",
|
| 191 |
+
"country": "Korea, South",
|
| 192 |
+
"iso2": "KR",
|
| 193 |
+
"color": "#f59e0b",
|
| 194 |
+
"cities": [
|
| 195 |
+
{
|
| 196 |
+
"city": "Seoul",
|
| 197 |
+
"coordinates": [
|
| 198 |
+
126.99,
|
| 199 |
+
37.56
|
| 200 |
+
],
|
| 201 |
+
"capital": true,
|
| 202 |
+
"population": 23016000,
|
| 203 |
+
"edgeRegion": "icn1"
|
| 204 |
+
}
|
| 205 |
+
]
|
| 206 |
+
},
|
| 207 |
+
{
|
| 208 |
+
"code3": "MEX",
|
| 209 |
+
"country": "Mexico",
|
| 210 |
+
"iso2": "MX",
|
| 211 |
+
"color": "#15803d",
|
| 212 |
+
"cities": [
|
| 213 |
+
{
|
| 214 |
+
"city": "Mexico City",
|
| 215 |
+
"coordinates": [
|
| 216 |
+
-99.1333,
|
| 217 |
+
19.4333
|
| 218 |
+
],
|
| 219 |
+
"capital": true,
|
| 220 |
+
"population": 21804000
|
| 221 |
+
}
|
| 222 |
+
]
|
| 223 |
+
},
|
| 224 |
+
{
|
| 225 |
+
"code3": "EGY",
|
| 226 |
+
"country": "Egypt",
|
| 227 |
+
"iso2": "EG",
|
| 228 |
+
"color": "#1e40af",
|
| 229 |
+
"cities": [
|
| 230 |
+
{
|
| 231 |
+
"city": "Cairo",
|
| 232 |
+
"coordinates": [
|
| 233 |
+
31.2358,
|
| 234 |
+
30.0444
|
| 235 |
+
],
|
| 236 |
+
"capital": true,
|
| 237 |
+
"population": 20296000
|
| 238 |
+
}
|
| 239 |
+
]
|
| 240 |
+
},
|
| 241 |
+
{
|
| 242 |
+
"code3": "USA",
|
| 243 |
+
"country": "United States",
|
| 244 |
+
"iso2": "US",
|
| 245 |
+
"color": "#1e40af",
|
| 246 |
+
"cities": [
|
| 247 |
+
{
|
| 248 |
+
"city": "New York",
|
| 249 |
+
"coordinates": [
|
| 250 |
+
-73.9249,
|
| 251 |
+
40.6943
|
| 252 |
+
],
|
| 253 |
+
"capital": false,
|
| 254 |
+
"population": 18908608
|
| 255 |
+
},
|
| 256 |
+
{
|
| 257 |
+
"city": "Los Angeles",
|
| 258 |
+
"coordinates": [
|
| 259 |
+
-118.4068,
|
| 260 |
+
34.1141
|
| 261 |
+
],
|
| 262 |
+
"capital": false,
|
| 263 |
+
"population": 11922389
|
| 264 |
+
},
|
| 265 |
+
{
|
| 266 |
+
"city": "Chicago",
|
| 267 |
+
"coordinates": [
|
| 268 |
+
-87.6866,
|
| 269 |
+
41.8375
|
| 270 |
+
],
|
| 271 |
+
"capital": false,
|
| 272 |
+
"population": 8497759
|
| 273 |
+
},
|
| 274 |
+
{
|
| 275 |
+
"city": "Miami",
|
| 276 |
+
"coordinates": [
|
| 277 |
+
-80.2101,
|
| 278 |
+
25.784
|
| 279 |
+
],
|
| 280 |
+
"capital": false,
|
| 281 |
+
"population": 6080145
|
| 282 |
+
},
|
| 283 |
+
{
|
| 284 |
+
"city": "Houston",
|
| 285 |
+
"coordinates": [
|
| 286 |
+
-95.3885,
|
| 287 |
+
29.786
|
| 288 |
+
],
|
| 289 |
+
"capital": false,
|
| 290 |
+
"population": 5970127
|
| 291 |
+
},
|
| 292 |
+
{
|
| 293 |
+
"city": "Dallas",
|
| 294 |
+
"coordinates": [
|
| 295 |
+
-96.7667,
|
| 296 |
+
32.7935
|
| 297 |
+
],
|
| 298 |
+
"capital": false,
|
| 299 |
+
"population": 5830932
|
| 300 |
+
},
|
| 301 |
+
{
|
| 302 |
+
"city": "Philadelphia",
|
| 303 |
+
"coordinates": [
|
| 304 |
+
-75.1339,
|
| 305 |
+
40.0077
|
| 306 |
+
],
|
| 307 |
+
"capital": false,
|
| 308 |
+
"population": 5683533
|
| 309 |
+
},
|
| 310 |
+
{
|
| 311 |
+
"city": "Atlanta",
|
| 312 |
+
"coordinates": [
|
| 313 |
+
-84.422,
|
| 314 |
+
33.7628
|
| 315 |
+
],
|
| 316 |
+
"capital": false,
|
| 317 |
+
"population": 5180179
|
| 318 |
+
},
|
| 319 |
+
{
|
| 320 |
+
"city": "Washington",
|
| 321 |
+
"coordinates": [
|
| 322 |
+
-77.0163,
|
| 323 |
+
38.9047
|
| 324 |
+
],
|
| 325 |
+
"capital": true,
|
| 326 |
+
"population": 5116378,
|
| 327 |
+
"edgeRegion": "iad1"
|
| 328 |
+
},
|
| 329 |
+
{
|
| 330 |
+
"city": "Boston",
|
| 331 |
+
"coordinates": [
|
| 332 |
+
-71.0852,
|
| 333 |
+
42.3188
|
| 334 |
+
],
|
| 335 |
+
"capital": false,
|
| 336 |
+
"population": 4328315
|
| 337 |
+
},
|
| 338 |
+
{
|
| 339 |
+
"city": "Phoenix",
|
| 340 |
+
"coordinates": [
|
| 341 |
+
-112.0892,
|
| 342 |
+
33.5722
|
| 343 |
+
],
|
| 344 |
+
"capital": false,
|
| 345 |
+
"population": 4064275
|
| 346 |
+
},
|
| 347 |
+
{
|
| 348 |
+
"city": "Detroit",
|
| 349 |
+
"coordinates": [
|
| 350 |
+
-83.1024,
|
| 351 |
+
42.3834
|
| 352 |
+
],
|
| 353 |
+
"capital": false,
|
| 354 |
+
"population": 3725908
|
| 355 |
+
},
|
| 356 |
+
{
|
| 357 |
+
"city": "Seattle",
|
| 358 |
+
"coordinates": [
|
| 359 |
+
-122.3244,
|
| 360 |
+
47.6211
|
| 361 |
+
],
|
| 362 |
+
"capital": false,
|
| 363 |
+
"population": 3561397
|
| 364 |
+
},
|
| 365 |
+
{
|
| 366 |
+
"city": "San Francisco",
|
| 367 |
+
"coordinates": [
|
| 368 |
+
-122.4449,
|
| 369 |
+
37.7558
|
| 370 |
+
],
|
| 371 |
+
"capital": false,
|
| 372 |
+
"population": 3364979,
|
| 373 |
+
"edgeRegion": "sfo1"
|
| 374 |
+
},
|
| 375 |
+
{
|
| 376 |
+
"city": "San Diego",
|
| 377 |
+
"coordinates": [
|
| 378 |
+
-117.1222,
|
| 379 |
+
32.8313
|
| 380 |
+
],
|
| 381 |
+
"capital": false,
|
| 382 |
+
"population": 3046560
|
| 383 |
+
},
|
| 384 |
+
{
|
| 385 |
+
"city": "Minneapolis",
|
| 386 |
+
"coordinates": [
|
| 387 |
+
-93.2678,
|
| 388 |
+
44.9635
|
| 389 |
+
],
|
| 390 |
+
"capital": false,
|
| 391 |
+
"population": 2892569
|
| 392 |
+
},
|
| 393 |
+
{
|
| 394 |
+
"city": "Tampa",
|
| 395 |
+
"coordinates": [
|
| 396 |
+
-82.4447,
|
| 397 |
+
27.9945
|
| 398 |
+
],
|
| 399 |
+
"capital": false,
|
| 400 |
+
"population": 2861173
|
| 401 |
+
},
|
| 402 |
+
{
|
| 403 |
+
"city": "Brooklyn",
|
| 404 |
+
"coordinates": [
|
| 405 |
+
-73.9496,
|
| 406 |
+
40.6501
|
| 407 |
+
],
|
| 408 |
+
"capital": false,
|
| 409 |
+
"population": 2736074
|
| 410 |
+
},
|
| 411 |
+
{
|
| 412 |
+
"city": "Denver",
|
| 413 |
+
"coordinates": [
|
| 414 |
+
-104.8758,
|
| 415 |
+
39.762
|
| 416 |
+
],
|
| 417 |
+
"capital": false,
|
| 418 |
+
"population": 2687458
|
| 419 |
+
},
|
| 420 |
+
{
|
| 421 |
+
"city": "Queens",
|
| 422 |
+
"coordinates": [
|
| 423 |
+
-73.7976,
|
| 424 |
+
40.7498
|
| 425 |
+
],
|
| 426 |
+
"capital": false,
|
| 427 |
+
"population": 2405464
|
| 428 |
+
},
|
| 429 |
+
{
|
| 430 |
+
"city": "Cleveland",
|
| 431 |
+
"coordinates": [
|
| 432 |
+
-81.6805,
|
| 433 |
+
41.4764
|
| 434 |
+
],
|
| 435 |
+
"capital": false,
|
| 436 |
+
"population": 1680247,
|
| 437 |
+
"edgeRegion": "cle1"
|
| 438 |
+
},
|
| 439 |
+
{
|
| 440 |
+
"city": "Portland",
|
| 441 |
+
"coordinates": [
|
| 442 |
+
-122.65,
|
| 443 |
+
45.5371
|
| 444 |
+
],
|
| 445 |
+
"capital": false,
|
| 446 |
+
"population": 2095808,
|
| 447 |
+
"edgeRegion": "pdx1"
|
| 448 |
+
}
|
| 449 |
+
]
|
| 450 |
+
},
|
| 451 |
+
{
|
| 452 |
+
"code3": "BGD",
|
| 453 |
+
"country": "Bangladesh",
|
| 454 |
+
"iso2": "BD",
|
| 455 |
+
"color": "#dc143c",
|
| 456 |
+
"cities": [
|
| 457 |
+
{
|
| 458 |
+
"city": "Dhaka",
|
| 459 |
+
"coordinates": [
|
| 460 |
+
90.3889,
|
| 461 |
+
23.7639
|
| 462 |
+
],
|
| 463 |
+
"capital": true,
|
| 464 |
+
"population": 18627000
|
| 465 |
+
}
|
| 466 |
+
]
|
| 467 |
+
},
|
| 468 |
+
{
|
| 469 |
+
"code3": "THA",
|
| 470 |
+
"country": "Thailand",
|
| 471 |
+
"iso2": "TH",
|
| 472 |
+
"color": "#15803d",
|
| 473 |
+
"cities": [
|
| 474 |
+
{
|
| 475 |
+
"city": "Bangkok",
|
| 476 |
+
"coordinates": [
|
| 477 |
+
100.4942,
|
| 478 |
+
13.7525
|
| 479 |
+
],
|
| 480 |
+
"capital": true,
|
| 481 |
+
"population": 18007000
|
| 482 |
+
}
|
| 483 |
+
]
|
| 484 |
+
},
|
| 485 |
+
{
|
| 486 |
+
"code3": "RUS",
|
| 487 |
+
"country": "Russia",
|
| 488 |
+
"iso2": "RU",
|
| 489 |
+
"color": "#FF0000",
|
| 490 |
+
"cities": [
|
| 491 |
+
{
|
| 492 |
+
"city": "Moscow",
|
| 493 |
+
"coordinates": [
|
| 494 |
+
37.6172,
|
| 495 |
+
55.7558
|
| 496 |
+
],
|
| 497 |
+
"capital": true,
|
| 498 |
+
"population": 17332000
|
| 499 |
+
}
|
| 500 |
+
]
|
| 501 |
+
},
|
| 502 |
+
{
|
| 503 |
+
"code3": "ARG",
|
| 504 |
+
"country": "Argentina",
|
| 505 |
+
"iso2": "AR",
|
| 506 |
+
"color": "#f59e0b",
|
| 507 |
+
"cities": [
|
| 508 |
+
{
|
| 509 |
+
"city": "Buenos Aires",
|
| 510 |
+
"coordinates": [
|
| 511 |
+
-58.3817,
|
| 512 |
+
-34.6033
|
| 513 |
+
],
|
| 514 |
+
"capital": true,
|
| 515 |
+
"population": 16710000
|
| 516 |
+
}
|
| 517 |
+
]
|
| 518 |
+
},
|
| 519 |
+
{
|
| 520 |
+
"code3": "NGA",
|
| 521 |
+
"country": "Nigeria",
|
| 522 |
+
"iso2": "NG",
|
| 523 |
+
"color": "#2563eb",
|
| 524 |
+
"cities": [
|
| 525 |
+
{
|
| 526 |
+
"city": "Lagos",
|
| 527 |
+
"coordinates": [
|
| 528 |
+
3.3841,
|
| 529 |
+
6.455
|
| 530 |
+
],
|
| 531 |
+
"capital": false,
|
| 532 |
+
"population": 16637000
|
| 533 |
+
}
|
| 534 |
+
]
|
| 535 |
+
},
|
| 536 |
+
{
|
| 537 |
+
"code3": "TUR",
|
| 538 |
+
"country": "Turkey",
|
| 539 |
+
"iso2": "TR",
|
| 540 |
+
"color": "#1e40af",
|
| 541 |
+
"cities": [
|
| 542 |
+
{
|
| 543 |
+
"city": "Istanbul",
|
| 544 |
+
"coordinates": [
|
| 545 |
+
28.955,
|
| 546 |
+
41.0136
|
| 547 |
+
],
|
| 548 |
+
"capital": false,
|
| 549 |
+
"population": 16079000
|
| 550 |
+
}
|
| 551 |
+
]
|
| 552 |
+
},
|
| 553 |
+
{
|
| 554 |
+
"code3": "PAK",
|
| 555 |
+
"country": "Pakistan",
|
| 556 |
+
"iso2": "PK",
|
| 557 |
+
"color": "#FFCE00",
|
| 558 |
+
"cities": [
|
| 559 |
+
{
|
| 560 |
+
"city": "Karachi",
|
| 561 |
+
"coordinates": [
|
| 562 |
+
67.01,
|
| 563 |
+
24.86
|
| 564 |
+
],
|
| 565 |
+
"capital": false,
|
| 566 |
+
"population": 15738000
|
| 567 |
+
}
|
| 568 |
+
]
|
| 569 |
+
},
|
| 570 |
+
{
|
| 571 |
+
"code3": "VNM",
|
| 572 |
+
"country": "Vietnam",
|
| 573 |
+
"iso2": "VN",
|
| 574 |
+
"color": "#dc143c",
|
| 575 |
+
"cities": [
|
| 576 |
+
{
|
| 577 |
+
"city": "Ho Chi Minh City",
|
| 578 |
+
"coordinates": [
|
| 579 |
+
106.7019,
|
| 580 |
+
10.7756
|
| 581 |
+
],
|
| 582 |
+
"capital": false,
|
| 583 |
+
"population": 15136000
|
| 584 |
+
}
|
| 585 |
+
]
|
| 586 |
+
},
|
| 587 |
+
{
|
| 588 |
+
"code3": "IRN",
|
| 589 |
+
"country": "Iran",
|
| 590 |
+
"iso2": "IR",
|
| 591 |
+
"color": "#15803d",
|
| 592 |
+
"cities": [
|
| 593 |
+
{
|
| 594 |
+
"city": "Tehran",
|
| 595 |
+
"coordinates": [
|
| 596 |
+
51.3889,
|
| 597 |
+
35.6892
|
| 598 |
+
],
|
| 599 |
+
"capital": true,
|
| 600 |
+
"population": 14148000
|
| 601 |
+
}
|
| 602 |
+
]
|
| 603 |
+
},
|
| 604 |
+
{
|
| 605 |
+
"code3": "COD",
|
| 606 |
+
"country": "Congo (Kinshasa)",
|
| 607 |
+
"iso2": "CD",
|
| 608 |
+
"color": "#FF0000",
|
| 609 |
+
"cities": [
|
| 610 |
+
{
|
| 611 |
+
"city": "Kinshasa",
|
| 612 |
+
"coordinates": [
|
| 613 |
+
15.3119,
|
| 614 |
+
-4.3219
|
| 615 |
+
],
|
| 616 |
+
"capital": true,
|
| 617 |
+
"population": 12836000
|
| 618 |
+
}
|
| 619 |
+
]
|
| 620 |
+
},
|
| 621 |
+
{
|
| 622 |
+
"code3": "GBR",
|
| 623 |
+
"country": "United Kingdom",
|
| 624 |
+
"iso2": "GB",
|
| 625 |
+
"color": "#2563eb",
|
| 626 |
+
"cities": [
|
| 627 |
+
{
|
| 628 |
+
"city": "London",
|
| 629 |
+
"coordinates": [
|
| 630 |
+
-0.1275,
|
| 631 |
+
51.5072
|
| 632 |
+
],
|
| 633 |
+
"capital": true,
|
| 634 |
+
"population": 11262000,
|
| 635 |
+
"edgeRegion": "lhr1"
|
| 636 |
+
}
|
| 637 |
+
]
|
| 638 |
+
},
|
| 639 |
+
{
|
| 640 |
+
"code3": "FRA",
|
| 641 |
+
"country": "France",
|
| 642 |
+
"iso2": "FR",
|
| 643 |
+
"color": "#2563eb",
|
| 644 |
+
"cities": [
|
| 645 |
+
{
|
| 646 |
+
"city": "Paris",
|
| 647 |
+
"coordinates": [
|
| 648 |
+
2.3522,
|
| 649 |
+
48.8567
|
| 650 |
+
],
|
| 651 |
+
"capital": true,
|
| 652 |
+
"population": 11060000,
|
| 653 |
+
"edgeRegion": "cdg1"
|
| 654 |
+
}
|
| 655 |
+
]
|
| 656 |
+
},
|
| 657 |
+
{
|
| 658 |
+
"code3": "PER",
|
| 659 |
+
"country": "Peru",
|
| 660 |
+
"iso2": "PE",
|
| 661 |
+
"color": "#1e40af",
|
| 662 |
+
"cities": [
|
| 663 |
+
{
|
| 664 |
+
"city": "Lima",
|
| 665 |
+
"coordinates": [
|
| 666 |
+
-77.0375,
|
| 667 |
+
-12.06
|
| 668 |
+
],
|
| 669 |
+
"capital": true,
|
| 670 |
+
"population": 10320000
|
| 671 |
+
}
|
| 672 |
+
]
|
| 673 |
+
},
|
| 674 |
+
{
|
| 675 |
+
"code3": "AGO",
|
| 676 |
+
"country": "Angola",
|
| 677 |
+
"iso2": "AO",
|
| 678 |
+
"color": "#FFCE00",
|
| 679 |
+
"cities": [
|
| 680 |
+
{
|
| 681 |
+
"city": "Luanda",
|
| 682 |
+
"coordinates": [
|
| 683 |
+
13.2344,
|
| 684 |
+
-8.8383
|
| 685 |
+
],
|
| 686 |
+
"capital": true,
|
| 687 |
+
"population": 9051000
|
| 688 |
+
}
|
| 689 |
+
]
|
| 690 |
+
},
|
| 691 |
+
{
|
| 692 |
+
"code3": "MYS",
|
| 693 |
+
"country": "Malaysia",
|
| 694 |
+
"iso2": "MY",
|
| 695 |
+
"color": "#dc143c",
|
| 696 |
+
"cities": [
|
| 697 |
+
{
|
| 698 |
+
"city": "Kuala Lumpur",
|
| 699 |
+
"coordinates": [
|
| 700 |
+
101.6953,
|
| 701 |
+
3.1478
|
| 702 |
+
],
|
| 703 |
+
"capital": true,
|
| 704 |
+
"population": 8911000
|
| 705 |
+
}
|
| 706 |
+
]
|
| 707 |
+
},
|
| 708 |
+
{
|
| 709 |
+
"code3": "ZAF",
|
| 710 |
+
"country": "South Africa",
|
| 711 |
+
"iso2": "ZA",
|
| 712 |
+
"color": "#15803d",
|
| 713 |
+
"cities": [
|
| 714 |
+
{
|
| 715 |
+
"city": "Johannesburg",
|
| 716 |
+
"coordinates": [
|
| 717 |
+
28.0456,
|
| 718 |
+
-26.2044
|
| 719 |
+
],
|
| 720 |
+
"capital": false,
|
| 721 |
+
"population": 8500000
|
| 722 |
+
},
|
| 723 |
+
{
|
| 724 |
+
"city": "Cape Town",
|
| 725 |
+
"coordinates": [
|
| 726 |
+
18.4239,
|
| 727 |
+
-33.9253
|
| 728 |
+
],
|
| 729 |
+
"capital": true,
|
| 730 |
+
"population": 4770313,
|
| 731 |
+
"edgeRegion": "cpt1"
|
| 732 |
+
}
|
| 733 |
+
]
|
| 734 |
+
},
|
| 735 |
+
{
|
| 736 |
+
"code3": "COL",
|
| 737 |
+
"country": "Colombia",
|
| 738 |
+
"iso2": "CO",
|
| 739 |
+
"color": "#FF0000",
|
| 740 |
+
"cities": [
|
| 741 |
+
{
|
| 742 |
+
"city": "Bogotá",
|
| 743 |
+
"coordinates": [
|
| 744 |
+
-74.0722,
|
| 745 |
+
4.7111
|
| 746 |
+
],
|
| 747 |
+
"capital": true,
|
| 748 |
+
"population": 7968095
|
| 749 |
+
}
|
| 750 |
+
]
|
| 751 |
+
},
|
| 752 |
+
{
|
| 753 |
+
"code3": "TZA",
|
| 754 |
+
"country": "Tanzania",
|
| 755 |
+
"iso2": "TZ",
|
| 756 |
+
"color": "#f59e0b",
|
| 757 |
+
"cities": [
|
| 758 |
+
{
|
| 759 |
+
"city": "Dar es Salaam",
|
| 760 |
+
"coordinates": [
|
| 761 |
+
39.2803,
|
| 762 |
+
-6.8161
|
| 763 |
+
],
|
| 764 |
+
"capital": false,
|
| 765 |
+
"population": 7962000
|
| 766 |
+
}
|
| 767 |
+
]
|
| 768 |
+
},
|
| 769 |
+
{
|
| 770 |
+
"code3": "SDN",
|
| 771 |
+
"country": "Sudan",
|
| 772 |
+
"iso2": "SD",
|
| 773 |
+
"color": "#2563eb",
|
| 774 |
+
"cities": [
|
| 775 |
+
{
|
| 776 |
+
"city": "Khartoum",
|
| 777 |
+
"coordinates": [
|
| 778 |
+
32.5,
|
| 779 |
+
15.6
|
| 780 |
+
],
|
| 781 |
+
"capital": true,
|
| 782 |
+
"population": 7869000
|
| 783 |
+
}
|
| 784 |
+
]
|
| 785 |
+
},
|
| 786 |
+
{
|
| 787 |
+
"code3": "HKG",
|
| 788 |
+
"country": "Hong Kong",
|
| 789 |
+
"iso2": "HK",
|
| 790 |
+
"color": "#1e40af",
|
| 791 |
+
"cities": [
|
| 792 |
+
{
|
| 793 |
+
"city": "Hong Kong",
|
| 794 |
+
"coordinates": [
|
| 795 |
+
114.2,
|
| 796 |
+
22.3
|
| 797 |
+
],
|
| 798 |
+
"capital": true,
|
| 799 |
+
"population": 7450000,
|
| 800 |
+
"edgeRegion": "hkg1"
|
| 801 |
+
}
|
| 802 |
+
]
|
| 803 |
+
},
|
| 804 |
+
{
|
| 805 |
+
"code3": "SAU",
|
| 806 |
+
"country": "Saudi Arabia",
|
| 807 |
+
"iso2": "SA",
|
| 808 |
+
"color": "#FFCE00",
|
| 809 |
+
"cities": [
|
| 810 |
+
{
|
| 811 |
+
"city": "Riyadh",
|
| 812 |
+
"coordinates": [
|
| 813 |
+
46.7167,
|
| 814 |
+
24.6333
|
| 815 |
+
],
|
| 816 |
+
"capital": true,
|
| 817 |
+
"population": 7237000
|
| 818 |
+
}
|
| 819 |
+
]
|
| 820 |
+
},
|
| 821 |
+
{
|
| 822 |
+
"code3": "CHL",
|
| 823 |
+
"country": "Chile",
|
| 824 |
+
"iso2": "CL",
|
| 825 |
+
"color": "#dc143c",
|
| 826 |
+
"cities": [
|
| 827 |
+
{
|
| 828 |
+
"city": "Santiago",
|
| 829 |
+
"coordinates": [
|
| 830 |
+
-70.6506,
|
| 831 |
+
-33.4372
|
| 832 |
+
],
|
| 833 |
+
"capital": true,
|
| 834 |
+
"population": 7171000
|
| 835 |
+
}
|
| 836 |
+
]
|
| 837 |
+
},
|
| 838 |
+
{
|
| 839 |
+
"code3": "ESP",
|
| 840 |
+
"country": "Spain",
|
| 841 |
+
"iso2": "ES",
|
| 842 |
+
"color": "#15803d",
|
| 843 |
+
"cities": [
|
| 844 |
+
{
|
| 845 |
+
"city": "Madrid",
|
| 846 |
+
"coordinates": [
|
| 847 |
+
-3.7033,
|
| 848 |
+
40.4169
|
| 849 |
+
],
|
| 850 |
+
"capital": true,
|
| 851 |
+
"population": 6211000
|
| 852 |
+
}
|
| 853 |
+
]
|
| 854 |
+
},
|
| 855 |
+
{
|
| 856 |
+
"code3": "IRQ",
|
| 857 |
+
"country": "Iraq",
|
| 858 |
+
"iso2": "IQ",
|
| 859 |
+
"color": "#FF0000",
|
| 860 |
+
"cities": [
|
| 861 |
+
{
|
| 862 |
+
"city": "Baghdad",
|
| 863 |
+
"coordinates": [
|
| 864 |
+
44.3661,
|
| 865 |
+
33.3153
|
| 866 |
+
],
|
| 867 |
+
"capital": true,
|
| 868 |
+
"population": 6183000
|
| 869 |
+
}
|
| 870 |
+
]
|
| 871 |
+
},
|
| 872 |
+
{
|
| 873 |
+
"code3": "SGP",
|
| 874 |
+
"country": "Singapore",
|
| 875 |
+
"iso2": "SG",
|
| 876 |
+
"color": "#f59e0b",
|
| 877 |
+
"cities": [
|
| 878 |
+
{
|
| 879 |
+
"city": "Singapore",
|
| 880 |
+
"coordinates": [
|
| 881 |
+
103.8,
|
| 882 |
+
1.3
|
| 883 |
+
],
|
| 884 |
+
"capital": true,
|
| 885 |
+
"population": 5983000,
|
| 886 |
+
"edgeRegion": "sin1"
|
| 887 |
+
}
|
| 888 |
+
]
|
| 889 |
+
},
|
| 890 |
+
{
|
| 891 |
+
"code3": "CMR",
|
| 892 |
+
"country": "Cameroon",
|
| 893 |
+
"iso2": "CM",
|
| 894 |
+
"color": "#2563eb",
|
| 895 |
+
"cities": [
|
| 896 |
+
{
|
| 897 |
+
"city": "Douala",
|
| 898 |
+
"coordinates": [
|
| 899 |
+
9.7,
|
| 900 |
+
4.05
|
| 901 |
+
],
|
| 902 |
+
"capital": false,
|
| 903 |
+
"population": 5768400
|
| 904 |
+
}
|
| 905 |
+
]
|
| 906 |
+
},
|
| 907 |
+
{
|
| 908 |
+
"code3": "CAN",
|
| 909 |
+
"country": "Canada",
|
| 910 |
+
"iso2": "CA",
|
| 911 |
+
"color": "#FF0000",
|
| 912 |
+
"cities": [
|
| 913 |
+
{
|
| 914 |
+
"city": "Toronto",
|
| 915 |
+
"coordinates": [
|
| 916 |
+
-79.3733,
|
| 917 |
+
43.7417
|
| 918 |
+
],
|
| 919 |
+
"capital": false,
|
| 920 |
+
"population": 5647656
|
| 921 |
+
},
|
| 922 |
+
{
|
| 923 |
+
"city": "Montréal",
|
| 924 |
+
"coordinates": [
|
| 925 |
+
-73.5617,
|
| 926 |
+
45.5089
|
| 927 |
+
],
|
| 928 |
+
"capital": false,
|
| 929 |
+
"population": 3675219
|
| 930 |
+
},
|
| 931 |
+
{
|
| 932 |
+
"city": "Vancouver",
|
| 933 |
+
"coordinates": [
|
| 934 |
+
-123.1,
|
| 935 |
+
49.25
|
| 936 |
+
],
|
| 937 |
+
"capital": false,
|
| 938 |
+
"population": 2426160
|
| 939 |
+
},
|
| 940 |
+
{
|
| 941 |
+
"city": "Calgary",
|
| 942 |
+
"coordinates": [
|
| 943 |
+
-114.0719,
|
| 944 |
+
51.0447
|
| 945 |
+
],
|
| 946 |
+
"capital": false,
|
| 947 |
+
"population": 1239220
|
| 948 |
+
},
|
| 949 |
+
{
|
| 950 |
+
"city": "Edmonton",
|
| 951 |
+
"coordinates": [
|
| 952 |
+
-113.4937,
|
| 953 |
+
53.5461
|
| 954 |
+
],
|
| 955 |
+
"capital": false,
|
| 956 |
+
"population": 932546
|
| 957 |
+
},
|
| 958 |
+
{
|
| 959 |
+
"city": "Ottawa",
|
| 960 |
+
"coordinates": [
|
| 961 |
+
-75.6972,
|
| 962 |
+
45.4215
|
| 963 |
+
],
|
| 964 |
+
"capital": true,
|
| 965 |
+
"population": 934243
|
| 966 |
+
},
|
| 967 |
+
{
|
| 968 |
+
"city": "Winnipeg",
|
| 969 |
+
"coordinates": [
|
| 970 |
+
-97.1384,
|
| 971 |
+
49.8951
|
| 972 |
+
],
|
| 973 |
+
"capital": false,
|
| 974 |
+
"population": 749534
|
| 975 |
+
},
|
| 976 |
+
{
|
| 977 |
+
"city": "Quebec City",
|
| 978 |
+
"coordinates": [
|
| 979 |
+
-71.208,
|
| 980 |
+
46.8139
|
| 981 |
+
],
|
| 982 |
+
"capital": false,
|
| 983 |
+
"population": 531902
|
| 984 |
+
}
|
| 985 |
+
]
|
| 986 |
+
},
|
| 987 |
+
{
|
| 988 |
+
"code3": "KEN",
|
| 989 |
+
"country": "Kenya",
|
| 990 |
+
"iso2": "KE",
|
| 991 |
+
"color": "#FFCE00",
|
| 992 |
+
"cities": [
|
| 993 |
+
{
|
| 994 |
+
"city": "Nairobi",
|
| 995 |
+
"coordinates": [
|
| 996 |
+
36.8172,
|
| 997 |
+
-1.2864
|
| 998 |
+
],
|
| 999 |
+
"capital": true,
|
| 1000 |
+
"population": 5545000
|
| 1001 |
+
}
|
| 1002 |
+
]
|
| 1003 |
+
},
|
| 1004 |
+
{
|
| 1005 |
+
"code3": "MMR",
|
| 1006 |
+
"country": "Burma",
|
| 1007 |
+
"iso2": "MM",
|
| 1008 |
+
"color": "#dc143c",
|
| 1009 |
+
"cities": [
|
| 1010 |
+
{
|
| 1011 |
+
"city": "Rangoon",
|
| 1012 |
+
"coordinates": [
|
| 1013 |
+
96.16,
|
| 1014 |
+
16.795
|
| 1015 |
+
],
|
| 1016 |
+
"capital": true,
|
| 1017 |
+
"population": 5209541
|
| 1018 |
+
}
|
| 1019 |
+
]
|
| 1020 |
+
},
|
| 1021 |
+
{
|
| 1022 |
+
"code3": "AUS",
|
| 1023 |
+
"country": "Australia",
|
| 1024 |
+
"iso2": "AU",
|
| 1025 |
+
"color": "#15803d",
|
| 1026 |
+
"cities": [
|
| 1027 |
+
{
|
| 1028 |
+
"city": "Melbourne",
|
| 1029 |
+
"coordinates": [
|
| 1030 |
+
144.9631,
|
| 1031 |
+
-37.8142
|
| 1032 |
+
],
|
| 1033 |
+
"capital": false,
|
| 1034 |
+
"population": 5031195
|
| 1035 |
+
},
|
| 1036 |
+
{
|
| 1037 |
+
"city": "Sydney",
|
| 1038 |
+
"coordinates": [
|
| 1039 |
+
151.21,
|
| 1040 |
+
-33.8678
|
| 1041 |
+
],
|
| 1042 |
+
"capital": false,
|
| 1043 |
+
"population": 4840600,
|
| 1044 |
+
"edgeRegion": "syd1"
|
| 1045 |
+
},
|
| 1046 |
+
{
|
| 1047 |
+
"city": "Brisbane",
|
| 1048 |
+
"coordinates": [
|
| 1049 |
+
153.0281,
|
| 1050 |
+
-27.4678
|
| 1051 |
+
],
|
| 1052 |
+
"capital": false,
|
| 1053 |
+
"population": 2360241
|
| 1054 |
+
}
|
| 1055 |
+
]
|
| 1056 |
+
},
|
| 1057 |
+
{
|
| 1058 |
+
"code3": "CIV",
|
| 1059 |
+
"country": "Côte d\\'Ivoire",
|
| 1060 |
+
"iso2": "CI",
|
| 1061 |
+
"color": "#FF0000",
|
| 1062 |
+
"cities": [
|
| 1063 |
+
{
|
| 1064 |
+
"city": "Abidjan",
|
| 1065 |
+
"coordinates": [
|
| 1066 |
+
-4.0333,
|
| 1067 |
+
5.3167
|
| 1068 |
+
],
|
| 1069 |
+
"capital": true,
|
| 1070 |
+
"population": 4980000
|
| 1071 |
+
}
|
| 1072 |
+
]
|
| 1073 |
+
},
|
| 1074 |
+
{
|
| 1075 |
+
"code3": "DEU",
|
| 1076 |
+
"country": "Germany",
|
| 1077 |
+
"iso2": "DE",
|
| 1078 |
+
"color": "#FFCE00",
|
| 1079 |
+
"cities": [
|
| 1080 |
+
{
|
| 1081 |
+
"city": "Berlin",
|
| 1082 |
+
"coordinates": [
|
| 1083 |
+
13.405,
|
| 1084 |
+
52.52
|
| 1085 |
+
],
|
| 1086 |
+
"capital": true,
|
| 1087 |
+
"population": 4890363
|
| 1088 |
+
},
|
| 1089 |
+
{
|
| 1090 |
+
"city": "Frankfurt",
|
| 1091 |
+
"coordinates": [
|
| 1092 |
+
8.6822,
|
| 1093 |
+
50.1106
|
| 1094 |
+
],
|
| 1095 |
+
"capital": false,
|
| 1096 |
+
"population": 773068,
|
| 1097 |
+
"edgeRegion": "fra1"
|
| 1098 |
+
}
|
| 1099 |
+
]
|
| 1100 |
+
},
|
| 1101 |
+
{
|
| 1102 |
+
"code3": "AFG",
|
| 1103 |
+
"country": "Afghanistan",
|
| 1104 |
+
"iso2": "AF",
|
| 1105 |
+
"color": "#2563eb",
|
| 1106 |
+
"cities": [
|
| 1107 |
+
{
|
| 1108 |
+
"city": "Kabul",
|
| 1109 |
+
"coordinates": [
|
| 1110 |
+
69.1783,
|
| 1111 |
+
34.5253
|
| 1112 |
+
],
|
| 1113 |
+
"capital": true,
|
| 1114 |
+
"population": 4273156
|
| 1115 |
+
}
|
| 1116 |
+
]
|
| 1117 |
+
},
|
| 1118 |
+
{
|
| 1119 |
+
"code3": "MLI",
|
| 1120 |
+
"country": "Mali",
|
| 1121 |
+
"iso2": "ML",
|
| 1122 |
+
"color": "#1e40af",
|
| 1123 |
+
"cities": [
|
| 1124 |
+
{
|
| 1125 |
+
"city": "Bamako",
|
| 1126 |
+
"coordinates": [
|
| 1127 |
+
-8.0028,
|
| 1128 |
+
12.6392
|
| 1129 |
+
],
|
| 1130 |
+
"capital": true,
|
| 1131 |
+
"population": 4227569
|
| 1132 |
+
}
|
| 1133 |
+
]
|
| 1134 |
+
},
|
| 1135 |
+
{
|
| 1136 |
+
"code3": "JOR",
|
| 1137 |
+
"country": "Jordan",
|
| 1138 |
+
"iso2": "JO",
|
| 1139 |
+
"color": "#FFCE00",
|
| 1140 |
+
"cities": [
|
| 1141 |
+
{
|
| 1142 |
+
"city": "Amman",
|
| 1143 |
+
"coordinates": [
|
| 1144 |
+
35.9328,
|
| 1145 |
+
31.9497
|
| 1146 |
+
],
|
| 1147 |
+
"capital": true,
|
| 1148 |
+
"population": 4007526
|
| 1149 |
+
}
|
| 1150 |
+
]
|
| 1151 |
+
},
|
| 1152 |
+
{
|
| 1153 |
+
"code3": "MAR",
|
| 1154 |
+
"country": "Morocco",
|
| 1155 |
+
"iso2": "MA",
|
| 1156 |
+
"color": "#dc143c",
|
| 1157 |
+
"cities": [
|
| 1158 |
+
{
|
| 1159 |
+
"city": "Casablanca",
|
| 1160 |
+
"coordinates": [
|
| 1161 |
+
-7.5833,
|
| 1162 |
+
33.5333
|
| 1163 |
+
],
|
| 1164 |
+
"capital": false,
|
| 1165 |
+
"population": 3499000
|
| 1166 |
+
}
|
| 1167 |
+
]
|
| 1168 |
+
},
|
| 1169 |
+
{
|
| 1170 |
+
"code3": "GHA",
|
| 1171 |
+
"country": "Ghana",
|
| 1172 |
+
"iso2": "GH",
|
| 1173 |
+
"color": "#15803d",
|
| 1174 |
+
"cities": [
|
| 1175 |
+
{
|
| 1176 |
+
"city": "Kumasi",
|
| 1177 |
+
"coordinates": [
|
| 1178 |
+
-1.625,
|
| 1179 |
+
6.7
|
| 1180 |
+
],
|
| 1181 |
+
"capital": false,
|
| 1182 |
+
"population": 3490030
|
| 1183 |
+
}
|
| 1184 |
+
]
|
| 1185 |
+
},
|
| 1186 |
+
{
|
| 1187 |
+
"code3": "DZA",
|
| 1188 |
+
"country": "Algeria",
|
| 1189 |
+
"iso2": "DZ",
|
| 1190 |
+
"color": "#FF0000",
|
| 1191 |
+
"cities": [
|
| 1192 |
+
{
|
| 1193 |
+
"city": "Algiers",
|
| 1194 |
+
"coordinates": [
|
| 1195 |
+
3.0589,
|
| 1196 |
+
36.7539
|
| 1197 |
+
],
|
| 1198 |
+
"capital": true,
|
| 1199 |
+
"population": 3415811
|
| 1200 |
+
}
|
| 1201 |
+
]
|
| 1202 |
+
},
|
| 1203 |
+
{
|
| 1204 |
+
"code3": "ARE",
|
| 1205 |
+
"country": "United Arab Emirates",
|
| 1206 |
+
"iso2": "AE",
|
| 1207 |
+
"color": "#f59e0b",
|
| 1208 |
+
"cities": [
|
| 1209 |
+
{
|
| 1210 |
+
"city": "Dubai",
|
| 1211 |
+
"coordinates": [
|
| 1212 |
+
55.2972,
|
| 1213 |
+
25.2631
|
| 1214 |
+
],
|
| 1215 |
+
"capital": false,
|
| 1216 |
+
"population": 3331420,
|
| 1217 |
+
"edgeRegion": "dxb1"
|
| 1218 |
+
}
|
| 1219 |
+
]
|
| 1220 |
+
},
|
| 1221 |
+
{
|
| 1222 |
+
"code3": "BOL",
|
| 1223 |
+
"country": "Bolivia",
|
| 1224 |
+
"iso2": "BO",
|
| 1225 |
+
"color": "#2563eb",
|
| 1226 |
+
"cities": [
|
| 1227 |
+
{
|
| 1228 |
+
"city": "Santa Cruz de la Sierra",
|
| 1229 |
+
"coordinates": [
|
| 1230 |
+
-63.1975,
|
| 1231 |
+
-17.7892
|
| 1232 |
+
],
|
| 1233 |
+
"capital": false,
|
| 1234 |
+
"population": 3151676
|
| 1235 |
+
}
|
| 1236 |
+
]
|
| 1237 |
+
},
|
| 1238 |
+
{
|
| 1239 |
+
"code3": "GRC",
|
| 1240 |
+
"country": "Greece",
|
| 1241 |
+
"iso2": "GR",
|
| 1242 |
+
"color": "#1e40af",
|
| 1243 |
+
"cities": [
|
| 1244 |
+
{
|
| 1245 |
+
"city": "Athens",
|
| 1246 |
+
"coordinates": [
|
| 1247 |
+
23.7281,
|
| 1248 |
+
37.9842
|
| 1249 |
+
],
|
| 1250 |
+
"capital": true,
|
| 1251 |
+
"population": 3059764
|
| 1252 |
+
}
|
| 1253 |
+
]
|
| 1254 |
+
},
|
| 1255 |
+
{
|
| 1256 |
+
"code3": "ETH",
|
| 1257 |
+
"country": "Ethiopia",
|
| 1258 |
+
"iso2": "ET",
|
| 1259 |
+
"color": "#FFCE00",
|
| 1260 |
+
"cities": [
|
| 1261 |
+
{
|
| 1262 |
+
"city": "Addis Ababa",
|
| 1263 |
+
"coordinates": [
|
| 1264 |
+
38.74,
|
| 1265 |
+
9.03
|
| 1266 |
+
],
|
| 1267 |
+
"capital": true,
|
| 1268 |
+
"population": 3041002
|
| 1269 |
+
}
|
| 1270 |
+
]
|
| 1271 |
+
},
|
| 1272 |
+
{
|
| 1273 |
+
"code3": "TWN",
|
| 1274 |
+
"country": "Taiwan",
|
| 1275 |
+
"iso2": "TW",
|
| 1276 |
+
"color": "#dc143c",
|
| 1277 |
+
"cities": [
|
| 1278 |
+
{
|
| 1279 |
+
"city": "Taichung",
|
| 1280 |
+
"coordinates": [
|
| 1281 |
+
120.6794,
|
| 1282 |
+
24.1439
|
| 1283 |
+
],
|
| 1284 |
+
"capital": false,
|
| 1285 |
+
"population": 3033885
|
| 1286 |
+
}
|
| 1287 |
+
]
|
| 1288 |
+
},
|
| 1289 |
+
{
|
| 1290 |
+
"code3": "GTM",
|
| 1291 |
+
"country": "Guatemala",
|
| 1292 |
+
"iso2": "GT",
|
| 1293 |
+
"color": "#15803d",
|
| 1294 |
+
"cities": [
|
| 1295 |
+
{
|
| 1296 |
+
"city": "Guatemala City",
|
| 1297 |
+
"coordinates": [
|
| 1298 |
+
-90.5353,
|
| 1299 |
+
14.6133
|
| 1300 |
+
],
|
| 1301 |
+
"capital": true,
|
| 1302 |
+
"population": 3014000
|
| 1303 |
+
}
|
| 1304 |
+
]
|
| 1305 |
+
},
|
| 1306 |
+
{
|
| 1307 |
+
"code3": "KWT",
|
| 1308 |
+
"country": "Kuwait",
|
| 1309 |
+
"iso2": "KW",
|
| 1310 |
+
"color": "#FF0000",
|
| 1311 |
+
"cities": [
|
| 1312 |
+
{
|
| 1313 |
+
"city": "Kuwait City",
|
| 1314 |
+
"coordinates": [
|
| 1315 |
+
47.9783,
|
| 1316 |
+
29.3697
|
| 1317 |
+
],
|
| 1318 |
+
"capital": true,
|
| 1319 |
+
"population": 3000000
|
| 1320 |
+
}
|
| 1321 |
+
]
|
| 1322 |
+
},
|
| 1323 |
+
{
|
| 1324 |
+
"code3": "HUN",
|
| 1325 |
+
"country": "Hungary",
|
| 1326 |
+
"iso2": "HU",
|
| 1327 |
+
"color": "#f59e0b",
|
| 1328 |
+
"cities": [
|
| 1329 |
+
{
|
| 1330 |
+
"city": "Budapest",
|
| 1331 |
+
"coordinates": [
|
| 1332 |
+
19.0514,
|
| 1333 |
+
47.4925
|
| 1334 |
+
],
|
| 1335 |
+
"capital": true,
|
| 1336 |
+
"population": 2997958
|
| 1337 |
+
}
|
| 1338 |
+
]
|
| 1339 |
+
},
|
| 1340 |
+
{
|
| 1341 |
+
"code3": "YEM",
|
| 1342 |
+
"country": "Yemen",
|
| 1343 |
+
"iso2": "YE",
|
| 1344 |
+
"color": "#2563eb",
|
| 1345 |
+
"cities": [
|
| 1346 |
+
{
|
| 1347 |
+
"city": "Sanaa",
|
| 1348 |
+
"coordinates": [
|
| 1349 |
+
44.2064,
|
| 1350 |
+
15.3483
|
| 1351 |
+
],
|
| 1352 |
+
"capital": true,
|
| 1353 |
+
"population": 2957000
|
| 1354 |
+
}
|
| 1355 |
+
]
|
| 1356 |
+
},
|
| 1357 |
+
{
|
| 1358 |
+
"code3": "UZB",
|
| 1359 |
+
"country": "Uzbekistan",
|
| 1360 |
+
"iso2": "UZ",
|
| 1361 |
+
"color": "#1e40af",
|
| 1362 |
+
"cities": [
|
| 1363 |
+
{
|
| 1364 |
+
"city": "Tashkent",
|
| 1365 |
+
"coordinates": [
|
| 1366 |
+
69.2797,
|
| 1367 |
+
41.3111
|
| 1368 |
+
],
|
| 1369 |
+
"capital": true,
|
| 1370 |
+
"population": 2956384
|
| 1371 |
+
}
|
| 1372 |
+
]
|
| 1373 |
+
},
|
| 1374 |
+
{
|
| 1375 |
+
"code3": "UKR",
|
| 1376 |
+
"country": "Ukraine",
|
| 1377 |
+
"iso2": "UA",
|
| 1378 |
+
"color": "#FFCE00",
|
| 1379 |
+
"cities": [
|
| 1380 |
+
{
|
| 1381 |
+
"city": "Kyiv",
|
| 1382 |
+
"coordinates": [
|
| 1383 |
+
30.5233,
|
| 1384 |
+
50.45
|
| 1385 |
+
],
|
| 1386 |
+
"capital": true,
|
| 1387 |
+
"population": 2952301
|
| 1388 |
+
}
|
| 1389 |
+
]
|
| 1390 |
+
},
|
| 1391 |
+
{
|
| 1392 |
+
"code3": "PRK",
|
| 1393 |
+
"country": "Korea, North",
|
| 1394 |
+
"iso2": "KP",
|
| 1395 |
+
"color": "#dc143c",
|
| 1396 |
+
"cities": [
|
| 1397 |
+
{
|
| 1398 |
+
"city": "Pyongyang",
|
| 1399 |
+
"coordinates": [
|
| 1400 |
+
125.7475,
|
| 1401 |
+
39.0167
|
| 1402 |
+
],
|
| 1403 |
+
"capital": true,
|
| 1404 |
+
"population": 2863000
|
| 1405 |
+
}
|
| 1406 |
+
]
|
| 1407 |
+
},
|
| 1408 |
+
{
|
| 1409 |
+
"code3": "ITA",
|
| 1410 |
+
"country": "Italy",
|
| 1411 |
+
"iso2": "IT",
|
| 1412 |
+
"color": "#15803d",
|
| 1413 |
+
"cities": [
|
| 1414 |
+
{
|
| 1415 |
+
"city": "Rome",
|
| 1416 |
+
"coordinates": [
|
| 1417 |
+
12.4828,
|
| 1418 |
+
41.8933
|
| 1419 |
+
],
|
| 1420 |
+
"capital": true,
|
| 1421 |
+
"population": 2748109
|
| 1422 |
+
}
|
| 1423 |
+
]
|
| 1424 |
+
},
|
| 1425 |
+
{
|
| 1426 |
+
"code3": "ECU",
|
| 1427 |
+
"country": "Ecuador",
|
| 1428 |
+
"iso2": "EC",
|
| 1429 |
+
"color": "#FF0000",
|
| 1430 |
+
"cities": [
|
| 1431 |
+
{
|
| 1432 |
+
"city": "Guayaquil",
|
| 1433 |
+
"coordinates": [
|
| 1434 |
+
-79.8875,
|
| 1435 |
+
-2.19
|
| 1436 |
+
],
|
| 1437 |
+
"capital": false,
|
| 1438 |
+
"population": 2650288
|
| 1439 |
+
}
|
| 1440 |
+
]
|
| 1441 |
+
},
|
| 1442 |
+
{
|
| 1443 |
+
"code3": "SOM",
|
| 1444 |
+
"country": "Somalia",
|
| 1445 |
+
"iso2": "SO",
|
| 1446 |
+
"color": "#f59e0b",
|
| 1447 |
+
"cities": [
|
| 1448 |
+
{
|
| 1449 |
+
"city": "Mogadishu",
|
| 1450 |
+
"coordinates": [
|
| 1451 |
+
45.3419,
|
| 1452 |
+
2.0392
|
| 1453 |
+
],
|
| 1454 |
+
"capital": true,
|
| 1455 |
+
"population": 2610483
|
| 1456 |
+
}
|
| 1457 |
+
]
|
| 1458 |
+
},
|
| 1459 |
+
{
|
| 1460 |
+
"code3": "SYR",
|
| 1461 |
+
"country": "Syria",
|
| 1462 |
+
"iso2": "SY",
|
| 1463 |
+
"color": "#2563eb",
|
| 1464 |
+
"cities": [
|
| 1465 |
+
{
|
| 1466 |
+
"city": "Damascus",
|
| 1467 |
+
"coordinates": [
|
| 1468 |
+
36.2919,
|
| 1469 |
+
33.5131
|
| 1470 |
+
],
|
| 1471 |
+
"capital": true,
|
| 1472 |
+
"population": 2584771
|
| 1473 |
+
}
|
| 1474 |
+
]
|
| 1475 |
+
},
|
| 1476 |
+
{
|
| 1477 |
+
"code3": "ZMB",
|
| 1478 |
+
"country": "Zambia",
|
| 1479 |
+
"iso2": "ZM",
|
| 1480 |
+
"color": "#1e40af",
|
| 1481 |
+
"cities": [
|
| 1482 |
+
{
|
| 1483 |
+
"city": "Lusaka",
|
| 1484 |
+
"coordinates": [
|
| 1485 |
+
28.2833,
|
| 1486 |
+
-15.4167
|
| 1487 |
+
],
|
| 1488 |
+
"capital": true,
|
| 1489 |
+
"population": 2467563
|
| 1490 |
+
}
|
| 1491 |
+
]
|
| 1492 |
+
},
|
| 1493 |
+
{
|
| 1494 |
+
"code3": "BFA",
|
| 1495 |
+
"country": "Burkina Faso",
|
| 1496 |
+
"iso2": "BF",
|
| 1497 |
+
"color": "#FFCE00",
|
| 1498 |
+
"cities": [
|
| 1499 |
+
{
|
| 1500 |
+
"city": "Ouagadougou",
|
| 1501 |
+
"coordinates": [
|
| 1502 |
+
-1.5275,
|
| 1503 |
+
12.3686
|
| 1504 |
+
],
|
| 1505 |
+
"capital": true,
|
| 1506 |
+
"population": 2453496
|
| 1507 |
+
}
|
| 1508 |
+
]
|
| 1509 |
+
},
|
| 1510 |
+
{
|
| 1511 |
+
"code3": "LBN",
|
| 1512 |
+
"country": "Lebanon",
|
| 1513 |
+
"iso2": "LB",
|
| 1514 |
+
"color": "#dc143c",
|
| 1515 |
+
"cities": [
|
| 1516 |
+
{
|
| 1517 |
+
"city": "Beirut",
|
| 1518 |
+
"coordinates": [
|
| 1519 |
+
35.5057,
|
| 1520 |
+
33.8983
|
| 1521 |
+
],
|
| 1522 |
+
"capital": true,
|
| 1523 |
+
"population": 2421354
|
| 1524 |
+
}
|
| 1525 |
+
]
|
| 1526 |
+
},
|
| 1527 |
+
{
|
| 1528 |
+
"code3": "ROU",
|
| 1529 |
+
"country": "Romania",
|
| 1530 |
+
"iso2": "RO",
|
| 1531 |
+
"color": "#15803d",
|
| 1532 |
+
"cities": [
|
| 1533 |
+
{
|
| 1534 |
+
"city": "Bucharest",
|
| 1535 |
+
"coordinates": [
|
| 1536 |
+
26.1039,
|
| 1537 |
+
44.4325
|
| 1538 |
+
],
|
| 1539 |
+
"capital": true,
|
| 1540 |
+
"population": 2412530
|
| 1541 |
+
}
|
| 1542 |
+
]
|
| 1543 |
+
},
|
| 1544 |
+
{
|
| 1545 |
+
"code3": "LKA",
|
| 1546 |
+
"country": "Sri Lanka",
|
| 1547 |
+
"iso2": "LK",
|
| 1548 |
+
"color": "#FF0000",
|
| 1549 |
+
"cities": [
|
| 1550 |
+
{
|
| 1551 |
+
"city": "Colombo",
|
| 1552 |
+
"coordinates": [
|
| 1553 |
+
79.8428,
|
| 1554 |
+
6.9344
|
| 1555 |
+
],
|
| 1556 |
+
"capital": true,
|
| 1557 |
+
"population": 2323826
|
| 1558 |
+
}
|
| 1559 |
+
]
|
| 1560 |
+
},
|
| 1561 |
+
{
|
| 1562 |
+
"code3": "AZE",
|
| 1563 |
+
"country": "Azerbaijan",
|
| 1564 |
+
"iso2": "AZ",
|
| 1565 |
+
"color": "#f59e0b",
|
| 1566 |
+
"cities": [
|
| 1567 |
+
{
|
| 1568 |
+
"city": "Baku",
|
| 1569 |
+
"coordinates": [
|
| 1570 |
+
49.8822,
|
| 1571 |
+
40.3953
|
| 1572 |
+
],
|
| 1573 |
+
"capital": true,
|
| 1574 |
+
"population": 2300500
|
| 1575 |
+
}
|
| 1576 |
+
]
|
| 1577 |
+
},
|
| 1578 |
+
{
|
| 1579 |
+
"code3": "MDG",
|
| 1580 |
+
"country": "Madagascar",
|
| 1581 |
+
"iso2": "MG",
|
| 1582 |
+
"color": "#2563eb",
|
| 1583 |
+
"cities": [
|
| 1584 |
+
{
|
| 1585 |
+
"city": "Antananarivo",
|
| 1586 |
+
"coordinates": [
|
| 1587 |
+
47.525,
|
| 1588 |
+
-18.91
|
| 1589 |
+
],
|
| 1590 |
+
"capital": true,
|
| 1591 |
+
"population": 2300000
|
| 1592 |
+
}
|
| 1593 |
+
]
|
| 1594 |
+
},
|
| 1595 |
+
{
|
| 1596 |
+
"code3": "VEN",
|
| 1597 |
+
"country": "Venezuela",
|
| 1598 |
+
"iso2": "VE",
|
| 1599 |
+
"color": "#1e40af",
|
| 1600 |
+
"cities": [
|
| 1601 |
+
{
|
| 1602 |
+
"city": "Caracas",
|
| 1603 |
+
"coordinates": [
|
| 1604 |
+
-66.9036,
|
| 1605 |
+
10.4806
|
| 1606 |
+
],
|
| 1607 |
+
"capital": true,
|
| 1608 |
+
"population": 2245744
|
| 1609 |
+
}
|
| 1610 |
+
]
|
| 1611 |
+
},
|
| 1612 |
+
{
|
| 1613 |
+
"code3": "AUT",
|
| 1614 |
+
"country": "Austria",
|
| 1615 |
+
"iso2": "AT",
|
| 1616 |
+
"color": "#FFCE00",
|
| 1617 |
+
"cities": [
|
| 1618 |
+
{
|
| 1619 |
+
"city": "Vienna",
|
| 1620 |
+
"coordinates": [
|
| 1621 |
+
16.3725,
|
| 1622 |
+
48.2083
|
| 1623 |
+
],
|
| 1624 |
+
"capital": true,
|
| 1625 |
+
"population": 2223236
|
| 1626 |
+
}
|
| 1627 |
+
]
|
| 1628 |
+
},
|
| 1629 |
+
{
|
| 1630 |
+
"code3": "ZWE",
|
| 1631 |
+
"country": "Zimbabwe",
|
| 1632 |
+
"iso2": "ZW",
|
| 1633 |
+
"color": "#dc143c",
|
| 1634 |
+
"cities": [
|
| 1635 |
+
{
|
| 1636 |
+
"city": "Harare",
|
| 1637 |
+
"coordinates": [
|
| 1638 |
+
31.0522,
|
| 1639 |
+
-17.8292
|
| 1640 |
+
],
|
| 1641 |
+
"capital": true,
|
| 1642 |
+
"population": 2150000
|
| 1643 |
+
}
|
| 1644 |
+
]
|
| 1645 |
+
},
|
| 1646 |
+
{
|
| 1647 |
+
"code3": "KHM",
|
| 1648 |
+
"country": "Cambodia",
|
| 1649 |
+
"iso2": "KH",
|
| 1650 |
+
"color": "#15803d",
|
| 1651 |
+
"cities": [
|
| 1652 |
+
{
|
| 1653 |
+
"city": "Phnom Penh",
|
| 1654 |
+
"coordinates": [
|
| 1655 |
+
104.9211,
|
| 1656 |
+
11.5694
|
| 1657 |
+
],
|
| 1658 |
+
"capital": true,
|
| 1659 |
+
"population": 2129371
|
| 1660 |
+
}
|
| 1661 |
+
]
|
| 1662 |
+
},
|
| 1663 |
+
{
|
| 1664 |
+
"code3": "SWE",
|
| 1665 |
+
"country": "Sweden",
|
| 1666 |
+
"iso2": "SE",
|
| 1667 |
+
"color": "#FF0000",
|
| 1668 |
+
"cities": [
|
| 1669 |
+
{
|
| 1670 |
+
"city": "Stockholm",
|
| 1671 |
+
"coordinates": [
|
| 1672 |
+
18.0686,
|
| 1673 |
+
59.3294
|
| 1674 |
+
],
|
| 1675 |
+
"capital": true,
|
| 1676 |
+
"population": 2121000,
|
| 1677 |
+
"edgeRegion": "arn1"
|
| 1678 |
+
}
|
| 1679 |
+
]
|
| 1680 |
+
},
|
| 1681 |
+
{
|
| 1682 |
+
"code3": "CUB",
|
| 1683 |
+
"country": "Cuba",
|
| 1684 |
+
"iso2": "CU",
|
| 1685 |
+
"color": "#f59e0b",
|
| 1686 |
+
"cities": [
|
| 1687 |
+
{
|
| 1688 |
+
"city": "Havana",
|
| 1689 |
+
"coordinates": [
|
| 1690 |
+
-82.3589,
|
| 1691 |
+
23.1367
|
| 1692 |
+
],
|
| 1693 |
+
"capital": true,
|
| 1694 |
+
"population": 2089532
|
| 1695 |
+
}
|
| 1696 |
+
]
|
| 1697 |
+
},
|
| 1698 |
+
{
|
| 1699 |
+
"code3": "BLR",
|
| 1700 |
+
"country": "Belarus",
|
| 1701 |
+
"iso2": "BY",
|
| 1702 |
+
"color": "#2563eb",
|
| 1703 |
+
"cities": [
|
| 1704 |
+
{
|
| 1705 |
+
"city": "Minsk",
|
| 1706 |
+
"coordinates": [
|
| 1707 |
+
27.5667,
|
| 1708 |
+
53.9
|
| 1709 |
+
],
|
| 1710 |
+
"capital": true,
|
| 1711 |
+
"population": 1995471
|
| 1712 |
+
}
|
| 1713 |
+
]
|
| 1714 |
+
},
|
| 1715 |
+
{
|
| 1716 |
+
"code3": "NLD",
|
| 1717 |
+
"country": "Netherlands",
|
| 1718 |
+
"iso2": "NL",
|
| 1719 |
+
"color": "#1e40af",
|
| 1720 |
+
"cities": [
|
| 1721 |
+
{
|
| 1722 |
+
"city": "Tilburg",
|
| 1723 |
+
"coordinates": [
|
| 1724 |
+
5.0833,
|
| 1725 |
+
51.55
|
| 1726 |
+
],
|
| 1727 |
+
"capital": false,
|
| 1728 |
+
"population": 1944588
|
| 1729 |
+
}
|
| 1730 |
+
]
|
| 1731 |
+
},
|
| 1732 |
+
{
|
| 1733 |
+
"code3": "KAZ",
|
| 1734 |
+
"country": "Kazakhstan",
|
| 1735 |
+
"iso2": "KZ",
|
| 1736 |
+
"color": "#FFCE00",
|
| 1737 |
+
"cities": [
|
| 1738 |
+
{
|
| 1739 |
+
"city": "Almaty",
|
| 1740 |
+
"coordinates": [
|
| 1741 |
+
76.915,
|
| 1742 |
+
43.24
|
| 1743 |
+
],
|
| 1744 |
+
"capital": false,
|
| 1745 |
+
"population": 1916822
|
| 1746 |
+
}
|
| 1747 |
+
]
|
| 1748 |
+
},
|
| 1749 |
+
{
|
| 1750 |
+
"code3": "MWI",
|
| 1751 |
+
"country": "Malawi",
|
| 1752 |
+
"iso2": "MW",
|
| 1753 |
+
"color": "#dc143c",
|
| 1754 |
+
"cities": [
|
| 1755 |
+
{
|
| 1756 |
+
"city": "Blantyre",
|
| 1757 |
+
"coordinates": [
|
| 1758 |
+
35.0058,
|
| 1759 |
+
-15.7861
|
| 1760 |
+
],
|
| 1761 |
+
"capital": false,
|
| 1762 |
+
"population": 1895973
|
| 1763 |
+
}
|
| 1764 |
+
]
|
| 1765 |
+
},
|
| 1766 |
+
{
|
| 1767 |
+
"code3": "POL",
|
| 1768 |
+
"country": "Poland",
|
| 1769 |
+
"iso2": "PL",
|
| 1770 |
+
"color": "#15803d",
|
| 1771 |
+
"cities": [
|
| 1772 |
+
{
|
| 1773 |
+
"city": "Warsaw",
|
| 1774 |
+
"coordinates": [
|
| 1775 |
+
21.0111,
|
| 1776 |
+
52.23
|
| 1777 |
+
],
|
| 1778 |
+
"capital": true,
|
| 1779 |
+
"population": 1860281
|
| 1780 |
+
}
|
| 1781 |
+
]
|
| 1782 |
+
},
|
| 1783 |
+
{
|
| 1784 |
+
"code3": "PRI",
|
| 1785 |
+
"country": "Puerto Rico",
|
| 1786 |
+
"iso2": "PR",
|
| 1787 |
+
"color": "#FF0000",
|
| 1788 |
+
"cities": [
|
| 1789 |
+
{
|
| 1790 |
+
"city": "San Juan",
|
| 1791 |
+
"coordinates": [
|
| 1792 |
+
-66.061,
|
| 1793 |
+
18.3985
|
| 1794 |
+
],
|
| 1795 |
+
"capital": true,
|
| 1796 |
+
"population": 1814587
|
| 1797 |
+
}
|
| 1798 |
+
]
|
| 1799 |
+
},
|
| 1800 |
+
{
|
| 1801 |
+
"code3": "COG",
|
| 1802 |
+
"country": "Congo (Brazzaville)",
|
| 1803 |
+
"iso2": "CG",
|
| 1804 |
+
"color": "#f59e0b",
|
| 1805 |
+
"cities": [
|
| 1806 |
+
{
|
| 1807 |
+
"city": "Brazzaville",
|
| 1808 |
+
"coordinates": [
|
| 1809 |
+
15.2711,
|
| 1810 |
+
-4.2694
|
| 1811 |
+
],
|
| 1812 |
+
"capital": true,
|
| 1813 |
+
"population": 1733263
|
| 1814 |
+
}
|
| 1815 |
+
]
|
| 1816 |
+
},
|
| 1817 |
+
{
|
| 1818 |
+
"code3": "OMN",
|
| 1819 |
+
"country": "Oman",
|
| 1820 |
+
"iso2": "OM",
|
| 1821 |
+
"color": "#2563eb",
|
| 1822 |
+
"cities": [
|
| 1823 |
+
{
|
| 1824 |
+
"city": "Masqaţ",
|
| 1825 |
+
"coordinates": [
|
| 1826 |
+
58.4083,
|
| 1827 |
+
23.5889
|
| 1828 |
+
],
|
| 1829 |
+
"capital": false,
|
| 1830 |
+
"population": 1720000
|
| 1831 |
+
}
|
| 1832 |
+
]
|
| 1833 |
+
},
|
| 1834 |
+
{
|
| 1835 |
+
"code3": "URY",
|
| 1836 |
+
"country": "Uruguay",
|
| 1837 |
+
"iso2": "UY",
|
| 1838 |
+
"color": "#1e40af",
|
| 1839 |
+
"cities": [
|
| 1840 |
+
{
|
| 1841 |
+
"city": "Montevideo",
|
| 1842 |
+
"coordinates": [
|
| 1843 |
+
-56.1819,
|
| 1844 |
+
-34.8836
|
| 1845 |
+
],
|
| 1846 |
+
"capital": true,
|
| 1847 |
+
"population": 1719453
|
| 1848 |
+
}
|
| 1849 |
+
]
|
| 1850 |
+
},
|
| 1851 |
+
{
|
| 1852 |
+
"code3": "HND",
|
| 1853 |
+
"country": "Honduras",
|
| 1854 |
+
"iso2": "HN",
|
| 1855 |
+
"color": "#FFCE00",
|
| 1856 |
+
"cities": [
|
| 1857 |
+
{
|
| 1858 |
+
"city": "Tegucigalpa",
|
| 1859 |
+
"coordinates": [
|
| 1860 |
+
-87.2047,
|
| 1861 |
+
14.1058
|
| 1862 |
+
],
|
| 1863 |
+
"capital": true,
|
| 1864 |
+
"population": 1682725
|
| 1865 |
+
}
|
| 1866 |
+
]
|
| 1867 |
+
},
|
| 1868 |
+
{
|
| 1869 |
+
"code3": "UGA",
|
| 1870 |
+
"country": "Uganda",
|
| 1871 |
+
"iso2": "UG",
|
| 1872 |
+
"color": "#dc143c",
|
| 1873 |
+
"cities": [
|
| 1874 |
+
{
|
| 1875 |
+
"city": "Kampala",
|
| 1876 |
+
"coordinates": [
|
| 1877 |
+
32.5811,
|
| 1878 |
+
0.3136
|
| 1879 |
+
],
|
| 1880 |
+
"capital": true,
|
| 1881 |
+
"population": 1680600
|
| 1882 |
+
}
|
| 1883 |
+
]
|
| 1884 |
+
},
|
| 1885 |
+
{
|
| 1886 |
+
"code3": "GIN",
|
| 1887 |
+
"country": "Guinea",
|
| 1888 |
+
"iso2": "GN",
|
| 1889 |
+
"color": "#15803d",
|
| 1890 |
+
"cities": [
|
| 1891 |
+
{
|
| 1892 |
+
"city": "Conakry",
|
| 1893 |
+
"coordinates": [
|
| 1894 |
+
-13.7122,
|
| 1895 |
+
9.5092
|
| 1896 |
+
],
|
| 1897 |
+
"capital": true,
|
| 1898 |
+
"population": 1667864
|
| 1899 |
+
}
|
| 1900 |
+
]
|
| 1901 |
+
},
|
| 1902 |
+
{
|
| 1903 |
+
"code3": "BGR",
|
| 1904 |
+
"country": "Bulgaria",
|
| 1905 |
+
"iso2": "BG",
|
| 1906 |
+
"color": "#FF0000",
|
| 1907 |
+
"cities": [
|
| 1908 |
+
{
|
| 1909 |
+
"city": "Sofia",
|
| 1910 |
+
"coordinates": [
|
| 1911 |
+
23.33,
|
| 1912 |
+
42.7
|
| 1913 |
+
],
|
| 1914 |
+
"capital": true,
|
| 1915 |
+
"population": 1547779
|
| 1916 |
+
}
|
| 1917 |
+
]
|
| 1918 |
+
},
|
| 1919 |
+
{
|
| 1920 |
+
"code3": "CRI",
|
| 1921 |
+
"country": "Costa Rica",
|
| 1922 |
+
"iso2": "CR",
|
| 1923 |
+
"color": "#f59e0b",
|
| 1924 |
+
"cities": [
|
| 1925 |
+
{
|
| 1926 |
+
"city": "San José",
|
| 1927 |
+
"coordinates": [
|
| 1928 |
+
-84.08,
|
| 1929 |
+
9.9325
|
| 1930 |
+
],
|
| 1931 |
+
"capital": true,
|
| 1932 |
+
"population": 1543000
|
| 1933 |
+
}
|
| 1934 |
+
]
|
| 1935 |
+
},
|
| 1936 |
+
{
|
| 1937 |
+
"code3": "RWA",
|
| 1938 |
+
"country": "Rwanda",
|
| 1939 |
+
"iso2": "RW",
|
| 1940 |
+
"color": "#2563eb",
|
| 1941 |
+
"cities": [
|
| 1942 |
+
{
|
| 1943 |
+
"city": "Kigali",
|
| 1944 |
+
"coordinates": [
|
| 1945 |
+
30.0594,
|
| 1946 |
+
-1.9439
|
| 1947 |
+
],
|
| 1948 |
+
"capital": true,
|
| 1949 |
+
"population": 1518632
|
| 1950 |
+
}
|
| 1951 |
+
]
|
| 1952 |
+
},
|
| 1953 |
+
{
|
| 1954 |
+
"code3": "PAN",
|
| 1955 |
+
"country": "Panama",
|
| 1956 |
+
"iso2": "PA",
|
| 1957 |
+
"color": "#1e40af",
|
| 1958 |
+
"cities": [
|
| 1959 |
+
{
|
| 1960 |
+
"city": "Panama City",
|
| 1961 |
+
"coordinates": [
|
| 1962 |
+
-79.5167,
|
| 1963 |
+
8.9833
|
| 1964 |
+
],
|
| 1965 |
+
"capital": true,
|
| 1966 |
+
"population": 1500189
|
| 1967 |
+
}
|
| 1968 |
+
]
|
| 1969 |
+
},
|
| 1970 |
+
{
|
| 1971 |
+
"code3": "SEN",
|
| 1972 |
+
"country": "Senegal",
|
| 1973 |
+
"iso2": "SN",
|
| 1974 |
+
"color": "#FFCE00",
|
| 1975 |
+
"cities": [
|
| 1976 |
+
{
|
| 1977 |
+
"city": "Dakar",
|
| 1978 |
+
"coordinates": [
|
| 1979 |
+
-17.4467,
|
| 1980 |
+
14.6928
|
| 1981 |
+
],
|
| 1982 |
+
"capital": true,
|
| 1983 |
+
"population": 1438725
|
| 1984 |
+
}
|
| 1985 |
+
]
|
| 1986 |
+
},
|
| 1987 |
+
{
|
| 1988 |
+
"code3": "MNG",
|
| 1989 |
+
"country": "Mongolia",
|
| 1990 |
+
"iso2": "MN",
|
| 1991 |
+
"color": "#dc143c",
|
| 1992 |
+
"cities": [
|
| 1993 |
+
{
|
| 1994 |
+
"city": "Ulaanbaatar",
|
| 1995 |
+
"coordinates": [
|
| 1996 |
+
106.9172,
|
| 1997 |
+
47.9203
|
| 1998 |
+
],
|
| 1999 |
+
"capital": true,
|
| 2000 |
+
"population": 1396288
|
| 2001 |
+
}
|
| 2002 |
+
]
|
| 2003 |
+
},
|
| 2004 |
+
{
|
| 2005 |
+
"code3": "ISR",
|
| 2006 |
+
"country": "Israel",
|
| 2007 |
+
"iso2": "IL",
|
| 2008 |
+
"color": "#15803d",
|
| 2009 |
+
"cities": [
|
| 2010 |
+
{
|
| 2011 |
+
"city": "Tel Aviv-Yafo",
|
| 2012 |
+
"coordinates": [
|
| 2013 |
+
34.78,
|
| 2014 |
+
32.08
|
| 2015 |
+
],
|
| 2016 |
+
"capital": false,
|
| 2017 |
+
"population": 1388400
|
| 2018 |
+
}
|
| 2019 |
+
]
|
| 2020 |
+
},
|
| 2021 |
+
{
|
| 2022 |
+
"code3": "DNK",
|
| 2023 |
+
"country": "Denmark",
|
| 2024 |
+
"iso2": "DK",
|
| 2025 |
+
"color": "#FF0000",
|
| 2026 |
+
"cities": [
|
| 2027 |
+
{
|
| 2028 |
+
"city": "Copenhagen",
|
| 2029 |
+
"coordinates": [
|
| 2030 |
+
12.5683,
|
| 2031 |
+
55.6761
|
| 2032 |
+
],
|
| 2033 |
+
"capital": true,
|
| 2034 |
+
"population": 1366301
|
| 2035 |
+
}
|
| 2036 |
+
]
|
| 2037 |
+
},
|
| 2038 |
+
{
|
| 2039 |
+
"code3": "FIN",
|
| 2040 |
+
"country": "Finland",
|
| 2041 |
+
"iso2": "FI",
|
| 2042 |
+
"color": "#f59e0b",
|
| 2043 |
+
"cities": [
|
| 2044 |
+
{
|
| 2045 |
+
"city": "Helsinki",
|
| 2046 |
+
"coordinates": [
|
| 2047 |
+
24.9375,
|
| 2048 |
+
60.1708
|
| 2049 |
+
],
|
| 2050 |
+
"capital": true,
|
| 2051 |
+
"population": 1360075
|
| 2052 |
+
}
|
| 2053 |
+
]
|
| 2054 |
+
},
|
| 2055 |
+
{
|
| 2056 |
+
"code3": "CZE",
|
| 2057 |
+
"country": "Czechia",
|
| 2058 |
+
"iso2": "CZ",
|
| 2059 |
+
"color": "#2563eb",
|
| 2060 |
+
"cities": [
|
| 2061 |
+
{
|
| 2062 |
+
"city": "Prague",
|
| 2063 |
+
"coordinates": [
|
| 2064 |
+
14.4214,
|
| 2065 |
+
50.0875
|
| 2066 |
+
],
|
| 2067 |
+
"capital": true,
|
| 2068 |
+
"population": 1357326
|
| 2069 |
+
}
|
| 2070 |
+
]
|
| 2071 |
+
},
|
| 2072 |
+
{
|
| 2073 |
+
"code3": "NZL",
|
| 2074 |
+
"country": "New Zealand",
|
| 2075 |
+
"iso2": "NZ",
|
| 2076 |
+
"color": "#1e40af",
|
| 2077 |
+
"cities": [
|
| 2078 |
+
{
|
| 2079 |
+
"city": "Auckland",
|
| 2080 |
+
"coordinates": [
|
| 2081 |
+
174.74,
|
| 2082 |
+
-36.8406
|
| 2083 |
+
],
|
| 2084 |
+
"capital": false,
|
| 2085 |
+
"population": 1346091
|
| 2086 |
+
}
|
| 2087 |
+
]
|
| 2088 |
+
},
|
| 2089 |
+
{
|
| 2090 |
+
"code3": "DOM",
|
| 2091 |
+
"country": "Dominican Republic",
|
| 2092 |
+
"iso2": "DO",
|
| 2093 |
+
"color": "#FFCE00",
|
| 2094 |
+
"cities": [
|
| 2095 |
+
{
|
| 2096 |
+
"city": "Santiago",
|
| 2097 |
+
"coordinates": [
|
| 2098 |
+
-70.6889,
|
| 2099 |
+
19.4572
|
| 2100 |
+
],
|
| 2101 |
+
"capital": false,
|
| 2102 |
+
"population": 1343423
|
| 2103 |
+
}
|
| 2104 |
+
]
|
| 2105 |
+
},
|
| 2106 |
+
{
|
| 2107 |
+
"code3": "PRT",
|
| 2108 |
+
"country": "Portugal",
|
| 2109 |
+
"iso2": "PT",
|
| 2110 |
+
"color": "#dc143c",
|
| 2111 |
+
"cities": [
|
| 2112 |
+
{
|
| 2113 |
+
"city": "Porto",
|
| 2114 |
+
"coordinates": [
|
| 2115 |
+
-8.622,
|
| 2116 |
+
41.1621
|
| 2117 |
+
],
|
| 2118 |
+
"capital": false,
|
| 2119 |
+
"population": 1278210
|
| 2120 |
+
}
|
| 2121 |
+
]
|
| 2122 |
+
},
|
| 2123 |
+
{
|
| 2124 |
+
"code3": "IRL",
|
| 2125 |
+
"country": "Ireland",
|
| 2126 |
+
"iso2": "IE",
|
| 2127 |
+
"color": "#15803d",
|
| 2128 |
+
"cities": [
|
| 2129 |
+
{
|
| 2130 |
+
"city": "Dublin",
|
| 2131 |
+
"coordinates": [
|
| 2132 |
+
-6.2603,
|
| 2133 |
+
53.35
|
| 2134 |
+
],
|
| 2135 |
+
"capital": true,
|
| 2136 |
+
"population": 1263219,
|
| 2137 |
+
"edgeRegion": "dub1"
|
| 2138 |
+
}
|
| 2139 |
+
]
|
| 2140 |
+
},
|
| 2141 |
+
{
|
| 2142 |
+
"code3": "BEL",
|
| 2143 |
+
"country": "Belgium",
|
| 2144 |
+
"iso2": "BE",
|
| 2145 |
+
"color": "#FF0000",
|
| 2146 |
+
"cities": [
|
| 2147 |
+
{
|
| 2148 |
+
"city": "Brussels",
|
| 2149 |
+
"coordinates": [
|
| 2150 |
+
4.3525,
|
| 2151 |
+
50.8467
|
| 2152 |
+
],
|
| 2153 |
+
"capital": true,
|
| 2154 |
+
"population": 1235192
|
| 2155 |
+
}
|
| 2156 |
+
]
|
| 2157 |
+
},
|
| 2158 |
+
{
|
| 2159 |
+
"code3": "SRB",
|
| 2160 |
+
"country": "Serbia",
|
| 2161 |
+
"iso2": "RS",
|
| 2162 |
+
"color": "#f59e0b",
|
| 2163 |
+
"cities": [
|
| 2164 |
+
{
|
| 2165 |
+
"city": "Belgrade",
|
| 2166 |
+
"coordinates": [
|
| 2167 |
+
20.46,
|
| 2168 |
+
44.82
|
| 2169 |
+
],
|
| 2170 |
+
"capital": true,
|
| 2171 |
+
"population": 1197714
|
| 2172 |
+
}
|
| 2173 |
+
]
|
| 2174 |
+
},
|
| 2175 |
+
{
|
| 2176 |
+
"code3": "QAT",
|
| 2177 |
+
"country": "Qatar",
|
| 2178 |
+
"iso2": "QA",
|
| 2179 |
+
"color": "#2563eb",
|
| 2180 |
+
"cities": [
|
| 2181 |
+
{
|
| 2182 |
+
"city": "Doha",
|
| 2183 |
+
"coordinates": [
|
| 2184 |
+
51.5333,
|
| 2185 |
+
25.2867
|
| 2186 |
+
],
|
| 2187 |
+
"capital": true,
|
| 2188 |
+
"population": 1186023
|
| 2189 |
+
}
|
| 2190 |
+
]
|
| 2191 |
+
},
|
| 2192 |
+
{
|
| 2193 |
+
"code3": "LBY",
|
| 2194 |
+
"country": "Libya",
|
| 2195 |
+
"iso2": "LY",
|
| 2196 |
+
"color": "#1e40af",
|
| 2197 |
+
"cities": [
|
| 2198 |
+
{
|
| 2199 |
+
"city": "Tripoli",
|
| 2200 |
+
"coordinates": [
|
| 2201 |
+
13.1914,
|
| 2202 |
+
32.8872
|
| 2203 |
+
],
|
| 2204 |
+
"capital": true,
|
| 2205 |
+
"population": 1183000
|
| 2206 |
+
}
|
| 2207 |
+
]
|
| 2208 |
+
},
|
| 2209 |
+
{
|
| 2210 |
+
"code3": "BDI",
|
| 2211 |
+
"country": "Burundi",
|
| 2212 |
+
"iso2": "BI",
|
| 2213 |
+
"color": "#FFCE00",
|
| 2214 |
+
"cities": [
|
| 2215 |
+
{
|
| 2216 |
+
"city": "Bujumbura",
|
| 2217 |
+
"coordinates": [
|
| 2218 |
+
29.3667,
|
| 2219 |
+
-3.3833
|
| 2220 |
+
],
|
| 2221 |
+
"capital": true,
|
| 2222 |
+
"population": 1143202
|
| 2223 |
+
}
|
| 2224 |
+
]
|
| 2225 |
+
},
|
| 2226 |
+
{
|
| 2227 |
+
"code3": "MOZ",
|
| 2228 |
+
"country": "Mozambique",
|
| 2229 |
+
"iso2": "MZ",
|
| 2230 |
+
"color": "#dc143c",
|
| 2231 |
+
"cities": [
|
| 2232 |
+
{
|
| 2233 |
+
"city": "Maputo",
|
| 2234 |
+
"coordinates": [
|
| 2235 |
+
32.5833,
|
| 2236 |
+
-25.9667
|
| 2237 |
+
],
|
| 2238 |
+
"capital": true,
|
| 2239 |
+
"population": 1133200
|
| 2240 |
+
}
|
| 2241 |
+
]
|
| 2242 |
+
},
|
| 2243 |
+
{
|
| 2244 |
+
"code3": "KGZ",
|
| 2245 |
+
"country": "Kyrgyzstan",
|
| 2246 |
+
"iso2": "KG",
|
| 2247 |
+
"color": "#15803d",
|
| 2248 |
+
"cities": [
|
| 2249 |
+
{
|
| 2250 |
+
"city": "Bishkek",
|
| 2251 |
+
"coordinates": [
|
| 2252 |
+
74.6122,
|
| 2253 |
+
42.8747
|
| 2254 |
+
],
|
| 2255 |
+
"capital": true,
|
| 2256 |
+
"population": 1120827
|
| 2257 |
+
}
|
| 2258 |
+
]
|
| 2259 |
+
},
|
| 2260 |
+
{
|
| 2261 |
+
"code3": "GEO",
|
| 2262 |
+
"country": "Georgia",
|
| 2263 |
+
"iso2": "GE",
|
| 2264 |
+
"color": "#FF0000",
|
| 2265 |
+
"cities": [
|
| 2266 |
+
{
|
| 2267 |
+
"city": "Tbilisi",
|
| 2268 |
+
"coordinates": [
|
| 2269 |
+
44.7925,
|
| 2270 |
+
41.7225
|
| 2271 |
+
],
|
| 2272 |
+
"capital": true,
|
| 2273 |
+
"population": 1118035
|
| 2274 |
+
}
|
| 2275 |
+
]
|
| 2276 |
+
},
|
| 2277 |
+
{
|
| 2278 |
+
"code3": "MRT",
|
| 2279 |
+
"country": "Mauritania",
|
| 2280 |
+
"iso2": "MR",
|
| 2281 |
+
"color": "#2563eb",
|
| 2282 |
+
"cities": [
|
| 2283 |
+
{
|
| 2284 |
+
"city": "Nouakchott",
|
| 2285 |
+
"coordinates": [
|
| 2286 |
+
-15.9785,
|
| 2287 |
+
18.0858
|
| 2288 |
+
],
|
| 2289 |
+
"capital": true,
|
| 2290 |
+
"population": 1077169
|
| 2291 |
+
}
|
| 2292 |
+
]
|
| 2293 |
+
},
|
| 2294 |
+
{
|
| 2295 |
+
"code3": "ARM",
|
| 2296 |
+
"country": "Armenia",
|
| 2297 |
+
"iso2": "AM",
|
| 2298 |
+
"color": "#1e40af",
|
| 2299 |
+
"cities": [
|
| 2300 |
+
{
|
| 2301 |
+
"city": "Yerevan",
|
| 2302 |
+
"coordinates": [
|
| 2303 |
+
44.5144,
|
| 2304 |
+
40.1814
|
| 2305 |
+
],
|
| 2306 |
+
"capital": true,
|
| 2307 |
+
"population": 1075800
|
| 2308 |
+
}
|
| 2309 |
+
]
|
| 2310 |
+
},
|
| 2311 |
+
{
|
| 2312 |
+
"code3": "NOR",
|
| 2313 |
+
"country": "Norway",
|
| 2314 |
+
"iso2": "NO",
|
| 2315 |
+
"color": "#FFCE00",
|
| 2316 |
+
"cities": [
|
| 2317 |
+
{
|
| 2318 |
+
"city": "Oslo",
|
| 2319 |
+
"coordinates": [
|
| 2320 |
+
10.7389,
|
| 2321 |
+
59.9133
|
| 2322 |
+
],
|
| 2323 |
+
"capital": true,
|
| 2324 |
+
"population": 1064235
|
| 2325 |
+
}
|
| 2326 |
+
]
|
| 2327 |
+
},
|
| 2328 |
+
{
|
| 2329 |
+
"code3": "NIC",
|
| 2330 |
+
"country": "Nicaragua",
|
| 2331 |
+
"iso2": "NI",
|
| 2332 |
+
"color": "#dc143c",
|
| 2333 |
+
"cities": [
|
| 2334 |
+
{
|
| 2335 |
+
"city": "Managua",
|
| 2336 |
+
"coordinates": [
|
| 2337 |
+
-86.2514,
|
| 2338 |
+
12.1364
|
| 2339 |
+
],
|
| 2340 |
+
"capital": true,
|
| 2341 |
+
"population": 1051236
|
| 2342 |
+
}
|
| 2343 |
+
]
|
| 2344 |
+
},
|
| 2345 |
+
{
|
| 2346 |
+
"code3": "TKM",
|
| 2347 |
+
"country": "Turkmenistan",
|
| 2348 |
+
"iso2": "TM",
|
| 2349 |
+
"color": "#15803d",
|
| 2350 |
+
"cities": [
|
| 2351 |
+
{
|
| 2352 |
+
"city": "Ashgabat",
|
| 2353 |
+
"coordinates": [
|
| 2354 |
+
58.38,
|
| 2355 |
+
37.9375
|
| 2356 |
+
],
|
| 2357 |
+
"capital": true,
|
| 2358 |
+
"population": 1030063
|
| 2359 |
+
}
|
| 2360 |
+
]
|
| 2361 |
+
},
|
| 2362 |
+
{
|
| 2363 |
+
"code3": "NER",
|
| 2364 |
+
"country": "Niger",
|
| 2365 |
+
"iso2": "NE",
|
| 2366 |
+
"color": "#FF0000",
|
| 2367 |
+
"cities": [
|
| 2368 |
+
{
|
| 2369 |
+
"city": "Niamey",
|
| 2370 |
+
"coordinates": [
|
| 2371 |
+
2.1175,
|
| 2372 |
+
13.515
|
| 2373 |
+
],
|
| 2374 |
+
"capital": true,
|
| 2375 |
+
"population": 1026848
|
| 2376 |
+
}
|
| 2377 |
+
]
|
| 2378 |
+
},
|
| 2379 |
+
{
|
| 2380 |
+
"code3": "LBR",
|
| 2381 |
+
"country": "Liberia",
|
| 2382 |
+
"iso2": "LR",
|
| 2383 |
+
"color": "#f59e0b",
|
| 2384 |
+
"cities": [
|
| 2385 |
+
{
|
| 2386 |
+
"city": "Monrovia",
|
| 2387 |
+
"coordinates": [
|
| 2388 |
+
-10.8014,
|
| 2389 |
+
6.3133
|
| 2390 |
+
],
|
| 2391 |
+
"capital": true,
|
| 2392 |
+
"population": 1021762
|
| 2393 |
+
}
|
| 2394 |
+
]
|
| 2395 |
+
},
|
| 2396 |
+
{
|
| 2397 |
+
"code3": "HTI",
|
| 2398 |
+
"country": "Haiti",
|
| 2399 |
+
"iso2": "HT",
|
| 2400 |
+
"color": "#2563eb",
|
| 2401 |
+
"cities": [
|
| 2402 |
+
{
|
| 2403 |
+
"city": "Port-au-Prince",
|
| 2404 |
+
"coordinates": [
|
| 2405 |
+
-72.3333,
|
| 2406 |
+
18.5333
|
| 2407 |
+
],
|
| 2408 |
+
"capital": true,
|
| 2409 |
+
"population": 987310
|
| 2410 |
+
}
|
| 2411 |
+
]
|
| 2412 |
+
},
|
| 2413 |
+
{
|
| 2414 |
+
"code3": "ERI",
|
| 2415 |
+
"country": "Eritrea",
|
| 2416 |
+
"iso2": "ER",
|
| 2417 |
+
"color": "#1e40af",
|
| 2418 |
+
"cities": [
|
| 2419 |
+
{
|
| 2420 |
+
"city": "Asmara",
|
| 2421 |
+
"coordinates": [
|
| 2422 |
+
38.925,
|
| 2423 |
+
15.3228
|
| 2424 |
+
],
|
| 2425 |
+
"capital": true,
|
| 2426 |
+
"population": 963000
|
| 2427 |
+
}
|
| 2428 |
+
]
|
| 2429 |
+
},
|
| 2430 |
+
{
|
| 2431 |
+
"code3": "SLE",
|
| 2432 |
+
"country": "Sierra Leone",
|
| 2433 |
+
"iso2": "SL",
|
| 2434 |
+
"color": "#FFCE00",
|
| 2435 |
+
"cities": [
|
| 2436 |
+
{
|
| 2437 |
+
"city": "Freetown",
|
| 2438 |
+
"coordinates": [
|
| 2439 |
+
-13.2344,
|
| 2440 |
+
8.4844
|
| 2441 |
+
],
|
| 2442 |
+
"capital": true,
|
| 2443 |
+
"population": 951000
|
| 2444 |
+
}
|
| 2445 |
+
]
|
| 2446 |
+
},
|
| 2447 |
+
{
|
| 2448 |
+
"code3": "LAO",
|
| 2449 |
+
"country": "Laos",
|
| 2450 |
+
"iso2": "LA",
|
| 2451 |
+
"color": "#dc143c",
|
| 2452 |
+
"cities": [
|
| 2453 |
+
{
|
| 2454 |
+
"city": "Vientiane",
|
| 2455 |
+
"coordinates": [
|
| 2456 |
+
102.63,
|
| 2457 |
+
17.98
|
| 2458 |
+
],
|
| 2459 |
+
"capital": true,
|
| 2460 |
+
"population": 948487
|
| 2461 |
+
}
|
| 2462 |
+
]
|
| 2463 |
+
},
|
| 2464 |
+
{
|
| 2465 |
+
"code3": "LVA",
|
| 2466 |
+
"country": "Latvia",
|
| 2467 |
+
"iso2": "LV",
|
| 2468 |
+
"color": "#15803d",
|
| 2469 |
+
"cities": [
|
| 2470 |
+
{
|
| 2471 |
+
"city": "Riga",
|
| 2472 |
+
"coordinates": [
|
| 2473 |
+
24.1064,
|
| 2474 |
+
56.9489
|
| 2475 |
+
],
|
| 2476 |
+
"capital": true,
|
| 2477 |
+
"population": 920643
|
| 2478 |
+
}
|
| 2479 |
+
]
|
| 2480 |
+
},
|
| 2481 |
+
{
|
| 2482 |
+
"code3": "CAF",
|
| 2483 |
+
"country": "Central African Republic",
|
| 2484 |
+
"iso2": "CF",
|
| 2485 |
+
"color": "#FF0000",
|
| 2486 |
+
"cities": [
|
| 2487 |
+
{
|
| 2488 |
+
"city": "Bangui",
|
| 2489 |
+
"coordinates": [
|
| 2490 |
+
18.5628,
|
| 2491 |
+
4.3733
|
| 2492 |
+
],
|
| 2493 |
+
"capital": true,
|
| 2494 |
+
"population": 889231
|
| 2495 |
+
}
|
| 2496 |
+
]
|
| 2497 |
+
},
|
| 2498 |
+
{
|
| 2499 |
+
"code3": "TJK",
|
| 2500 |
+
"country": "Tajikistan",
|
| 2501 |
+
"iso2": "TJ",
|
| 2502 |
+
"color": "#f59e0b",
|
| 2503 |
+
"cities": [
|
| 2504 |
+
{
|
| 2505 |
+
"city": "Dushanbe",
|
| 2506 |
+
"coordinates": [
|
| 2507 |
+
68.78,
|
| 2508 |
+
38.5367
|
| 2509 |
+
],
|
| 2510 |
+
"capital": true,
|
| 2511 |
+
"population": 863400
|
| 2512 |
+
}
|
| 2513 |
+
]
|
| 2514 |
+
},
|
| 2515 |
+
{
|
| 2516 |
+
"code3": "NPL",
|
| 2517 |
+
"country": "Nepal",
|
| 2518 |
+
"iso2": "NP",
|
| 2519 |
+
"color": "#2563eb",
|
| 2520 |
+
"cities": [
|
| 2521 |
+
{
|
| 2522 |
+
"city": "Kathmandu",
|
| 2523 |
+
"coordinates": [
|
| 2524 |
+
85.32,
|
| 2525 |
+
27.71
|
| 2526 |
+
],
|
| 2527 |
+
"capital": true,
|
| 2528 |
+
"population": 845767
|
| 2529 |
+
}
|
| 2530 |
+
]
|
| 2531 |
+
},
|
| 2532 |
+
{
|
| 2533 |
+
"code3": "GAB",
|
| 2534 |
+
"country": "Gabon",
|
| 2535 |
+
"iso2": "GA",
|
| 2536 |
+
"color": "#1e40af",
|
| 2537 |
+
"cities": [
|
| 2538 |
+
{
|
| 2539 |
+
"city": "Libreville",
|
| 2540 |
+
"coordinates": [
|
| 2541 |
+
9.4542,
|
| 2542 |
+
0.3903
|
| 2543 |
+
],
|
| 2544 |
+
"capital": true,
|
| 2545 |
+
"population": 797003
|
| 2546 |
+
}
|
| 2547 |
+
]
|
| 2548 |
+
},
|
| 2549 |
+
{
|
| 2550 |
+
"code3": "HRV",
|
| 2551 |
+
"country": "Croatia",
|
| 2552 |
+
"iso2": "HR",
|
| 2553 |
+
"color": "#FFCE00",
|
| 2554 |
+
"cities": [
|
| 2555 |
+
{
|
| 2556 |
+
"city": "Zagreb",
|
| 2557 |
+
"coordinates": [
|
| 2558 |
+
15.9775,
|
| 2559 |
+
45.8131
|
| 2560 |
+
],
|
| 2561 |
+
"capital": true,
|
| 2562 |
+
"population": 767131
|
| 2563 |
+
}
|
| 2564 |
+
]
|
| 2565 |
+
},
|
| 2566 |
+
{
|
| 2567 |
+
"code3": "LTU",
|
| 2568 |
+
"country": "Lithuania",
|
| 2569 |
+
"iso2": "LT",
|
| 2570 |
+
"color": "#dc143c",
|
| 2571 |
+
"cities": [
|
| 2572 |
+
{
|
| 2573 |
+
"city": "Vilnius",
|
| 2574 |
+
"coordinates": [
|
| 2575 |
+
25.28,
|
| 2576 |
+
54.6872
|
| 2577 |
+
],
|
| 2578 |
+
"capital": true,
|
| 2579 |
+
"population": 716856
|
| 2580 |
+
}
|
| 2581 |
+
]
|
| 2582 |
+
},
|
| 2583 |
+
{
|
| 2584 |
+
"code3": "MDA",
|
| 2585 |
+
"country": "Moldova",
|
| 2586 |
+
"iso2": "MD",
|
| 2587 |
+
"color": "#15803d",
|
| 2588 |
+
"cities": [
|
| 2589 |
+
{
|
| 2590 |
+
"city": "Chisinau",
|
| 2591 |
+
"coordinates": [
|
| 2592 |
+
28.8353,
|
| 2593 |
+
47.0228
|
| 2594 |
+
],
|
| 2595 |
+
"capital": true,
|
| 2596 |
+
"population": 702300
|
| 2597 |
+
}
|
| 2598 |
+
]
|
| 2599 |
+
},
|
| 2600 |
+
{
|
| 2601 |
+
"code3": "PNG",
|
| 2602 |
+
"country": "Papua New Guinea",
|
| 2603 |
+
"iso2": "PG",
|
| 2604 |
+
"color": "#FF0000",
|
| 2605 |
+
"cities": [
|
| 2606 |
+
{
|
| 2607 |
+
"city": "Port Moresby",
|
| 2608 |
+
"coordinates": [
|
| 2609 |
+
147.1494,
|
| 2610 |
+
-9.4789
|
| 2611 |
+
],
|
| 2612 |
+
"capital": true,
|
| 2613 |
+
"population": 700000
|
| 2614 |
+
}
|
| 2615 |
+
]
|
| 2616 |
+
},
|
| 2617 |
+
{
|
| 2618 |
+
"code3": "BEN",
|
| 2619 |
+
"country": "Benin",
|
| 2620 |
+
"iso2": "BJ",
|
| 2621 |
+
"color": "#f59e0b",
|
| 2622 |
+
"cities": [
|
| 2623 |
+
{
|
| 2624 |
+
"city": "Cotonou",
|
| 2625 |
+
"coordinates": [
|
| 2626 |
+
2.4333,
|
| 2627 |
+
6.3667
|
| 2628 |
+
],
|
| 2629 |
+
"capital": true,
|
| 2630 |
+
"population": 679012
|
| 2631 |
+
}
|
| 2632 |
+
]
|
| 2633 |
+
},
|
| 2634 |
+
{
|
| 2635 |
+
"code3": "BHR",
|
| 2636 |
+
"country": "Bahrain",
|
| 2637 |
+
"iso2": "BH",
|
| 2638 |
+
"color": "#2563eb",
|
| 2639 |
+
"cities": [
|
| 2640 |
+
{
|
| 2641 |
+
"city": "Manama",
|
| 2642 |
+
"coordinates": [
|
| 2643 |
+
50.5775,
|
| 2644 |
+
26.225
|
| 2645 |
+
],
|
| 2646 |
+
"capital": true,
|
| 2647 |
+
"population": 635000
|
| 2648 |
+
}
|
| 2649 |
+
]
|
| 2650 |
+
},
|
| 2651 |
+
{
|
| 2652 |
+
"code3": "EST",
|
| 2653 |
+
"country": "Estonia",
|
| 2654 |
+
"iso2": "EE",
|
| 2655 |
+
"color": "#1e40af",
|
| 2656 |
+
"cities": [
|
| 2657 |
+
{
|
| 2658 |
+
"city": "Tallinn",
|
| 2659 |
+
"coordinates": [
|
| 2660 |
+
24.7453,
|
| 2661 |
+
59.4372
|
| 2662 |
+
],
|
| 2663 |
+
"capital": true,
|
| 2664 |
+
"population": 614561
|
| 2665 |
+
}
|
| 2666 |
+
]
|
| 2667 |
+
},
|
| 2668 |
+
{
|
| 2669 |
+
"code3": "DJI",
|
| 2670 |
+
"country": "Djibouti",
|
| 2671 |
+
"iso2": "DJ",
|
| 2672 |
+
"color": "#FFCE00",
|
| 2673 |
+
"cities": [
|
| 2674 |
+
{
|
| 2675 |
+
"city": "Djibouti",
|
| 2676 |
+
"coordinates": [
|
| 2677 |
+
43.145,
|
| 2678 |
+
11.5883
|
| 2679 |
+
],
|
| 2680 |
+
"capital": true,
|
| 2681 |
+
"population": 603900
|
| 2682 |
+
}
|
| 2683 |
+
]
|
| 2684 |
+
},
|
| 2685 |
+
{
|
| 2686 |
+
"code3": "TUN",
|
| 2687 |
+
"country": "Tunisia",
|
| 2688 |
+
"iso2": "TN",
|
| 2689 |
+
"color": "#dc143c",
|
| 2690 |
+
"cities": [
|
| 2691 |
+
{
|
| 2692 |
+
"city": "Tunis",
|
| 2693 |
+
"coordinates": [
|
| 2694 |
+
10.1817,
|
| 2695 |
+
36.8064
|
| 2696 |
+
],
|
| 2697 |
+
"capital": true,
|
| 2698 |
+
"population": 602560
|
| 2699 |
+
}
|
| 2700 |
+
]
|
| 2701 |
+
},
|
| 2702 |
+
{
|
| 2703 |
+
"code3": "XGZ",
|
| 2704 |
+
"country": "Gaza Strip",
|
| 2705 |
+
"iso2": "XG",
|
| 2706 |
+
"color": "#15803d",
|
| 2707 |
+
"cities": [
|
| 2708 |
+
{
|
| 2709 |
+
"city": "Gaza",
|
| 2710 |
+
"coordinates": [
|
| 2711 |
+
34.456,
|
| 2712 |
+
31.5069
|
| 2713 |
+
],
|
| 2714 |
+
"capital": true,
|
| 2715 |
+
"population": 590481
|
| 2716 |
+
}
|
| 2717 |
+
]
|
| 2718 |
+
},
|
| 2719 |
+
{
|
| 2720 |
+
"code3": "JAM",
|
| 2721 |
+
"country": "Jamaica",
|
| 2722 |
+
"iso2": "JM",
|
| 2723 |
+
"color": "#FF0000",
|
| 2724 |
+
"cities": [
|
| 2725 |
+
{
|
| 2726 |
+
"city": "Kingston",
|
| 2727 |
+
"coordinates": [
|
| 2728 |
+
-76.7931,
|
| 2729 |
+
17.9714
|
| 2730 |
+
],
|
| 2731 |
+
"capital": true,
|
| 2732 |
+
"population": 580000
|
| 2733 |
+
}
|
| 2734 |
+
]
|
| 2735 |
+
},
|
| 2736 |
+
{
|
| 2737 |
+
"code3": "MAC",
|
| 2738 |
+
"country": "Macau",
|
| 2739 |
+
"iso2": "MO",
|
| 2740 |
+
"color": "#f59e0b",
|
| 2741 |
+
"cities": [
|
| 2742 |
+
{
|
| 2743 |
+
"city": "Macau",
|
| 2744 |
+
"coordinates": [
|
| 2745 |
+
113.5461,
|
| 2746 |
+
22.2006
|
| 2747 |
+
],
|
| 2748 |
+
"capital": false,
|
| 2749 |
+
"population": 568700
|
| 2750 |
+
}
|
| 2751 |
+
]
|
| 2752 |
+
},
|
| 2753 |
+
{
|
| 2754 |
+
"code3": "MKD",
|
| 2755 |
+
"country": "North Macedonia",
|
| 2756 |
+
"iso2": "MK",
|
| 2757 |
+
"color": "#2563eb",
|
| 2758 |
+
"cities": [
|
| 2759 |
+
{
|
| 2760 |
+
"city": "Skopje",
|
| 2761 |
+
"coordinates": [
|
| 2762 |
+
21.4317,
|
| 2763 |
+
41.9961
|
| 2764 |
+
],
|
| 2765 |
+
"capital": true,
|
| 2766 |
+
"population": 526502
|
| 2767 |
+
}
|
| 2768 |
+
]
|
| 2769 |
+
},
|
| 2770 |
+
{
|
| 2771 |
+
"code3": "GNB",
|
| 2772 |
+
"country": "Guinea-Bissau",
|
| 2773 |
+
"iso2": "GW",
|
| 2774 |
+
"color": "#1e40af",
|
| 2775 |
+
"cities": [
|
| 2776 |
+
{
|
| 2777 |
+
"city": "Bissau",
|
| 2778 |
+
"coordinates": [
|
| 2779 |
+
-15.5667,
|
| 2780 |
+
11.85
|
| 2781 |
+
],
|
| 2782 |
+
"capital": true,
|
| 2783 |
+
"population": 492004
|
| 2784 |
+
}
|
| 2785 |
+
]
|
| 2786 |
+
},
|
| 2787 |
+
{
|
| 2788 |
+
"code3": "MLT",
|
| 2789 |
+
"country": "Malta",
|
| 2790 |
+
"iso2": "MT",
|
| 2791 |
+
"color": "#FFCE00",
|
| 2792 |
+
"cities": [
|
| 2793 |
+
{
|
| 2794 |
+
"city": "Valletta",
|
| 2795 |
+
"coordinates": [
|
| 2796 |
+
14.5125,
|
| 2797 |
+
35.8983
|
| 2798 |
+
],
|
| 2799 |
+
"capital": true,
|
| 2800 |
+
"population": 480134
|
| 2801 |
+
}
|
| 2802 |
+
]
|
| 2803 |
+
},
|
| 2804 |
+
{
|
| 2805 |
+
"code3": "PRY",
|
| 2806 |
+
"country": "Paraguay",
|
| 2807 |
+
"iso2": "PY",
|
| 2808 |
+
"color": "#dc143c",
|
| 2809 |
+
"cities": [
|
| 2810 |
+
{
|
| 2811 |
+
"city": "Asunción",
|
| 2812 |
+
"coordinates": [
|
| 2813 |
+
-57.6333,
|
| 2814 |
+
-25.3
|
| 2815 |
+
],
|
| 2816 |
+
"capital": true,
|
| 2817 |
+
"population": 477346
|
| 2818 |
+
}
|
| 2819 |
+
]
|
| 2820 |
+
},
|
| 2821 |
+
{
|
| 2822 |
+
"code3": "SVK",
|
| 2823 |
+
"country": "Slovakia",
|
| 2824 |
+
"iso2": "SK",
|
| 2825 |
+
"color": "#15803d",
|
| 2826 |
+
"cities": [
|
| 2827 |
+
{
|
| 2828 |
+
"city": "Bratislava",
|
| 2829 |
+
"coordinates": [
|
| 2830 |
+
17.1097,
|
| 2831 |
+
48.1439
|
| 2832 |
+
],
|
| 2833 |
+
"capital": true,
|
| 2834 |
+
"population": 475503
|
| 2835 |
+
}
|
| 2836 |
+
]
|
| 2837 |
+
},
|
| 2838 |
+
{
|
| 2839 |
+
"code3": "SSD",
|
| 2840 |
+
"country": "South Sudan",
|
| 2841 |
+
"iso2": "SS",
|
| 2842 |
+
"color": "#FF0000",
|
| 2843 |
+
"cities": [
|
| 2844 |
+
{
|
| 2845 |
+
"city": "Juba",
|
| 2846 |
+
"coordinates": [
|
| 2847 |
+
31.6,
|
| 2848 |
+
4.85
|
| 2849 |
+
],
|
| 2850 |
+
"capital": true,
|
| 2851 |
+
"population": 459342
|
| 2852 |
+
}
|
| 2853 |
+
]
|
| 2854 |
+
},
|
| 2855 |
+
{
|
| 2856 |
+
"code3": "CHE",
|
| 2857 |
+
"country": "Switzerland",
|
| 2858 |
+
"iso2": "CH",
|
| 2859 |
+
"color": "#f59e0b",
|
| 2860 |
+
"cities": [
|
| 2861 |
+
{
|
| 2862 |
+
"city": "Zürich",
|
| 2863 |
+
"coordinates": [
|
| 2864 |
+
8.5411,
|
| 2865 |
+
47.3744
|
| 2866 |
+
],
|
| 2867 |
+
"capital": false,
|
| 2868 |
+
"population": 447082
|
| 2869 |
+
}
|
| 2870 |
+
]
|
| 2871 |
+
},
|
| 2872 |
+
{
|
| 2873 |
+
"code3": "NAM",
|
| 2874 |
+
"country": "Namibia",
|
| 2875 |
+
"iso2": "NA",
|
| 2876 |
+
"color": "#2563eb",
|
| 2877 |
+
"cities": [
|
| 2878 |
+
{
|
| 2879 |
+
"city": "Windhoek",
|
| 2880 |
+
"coordinates": [
|
| 2881 |
+
17.0836,
|
| 2882 |
+
-22.57
|
| 2883 |
+
],
|
| 2884 |
+
"capital": true,
|
| 2885 |
+
"population": 431000
|
| 2886 |
+
}
|
| 2887 |
+
]
|
| 2888 |
+
},
|
| 2889 |
+
{
|
| 2890 |
+
"code3": "BIH",
|
| 2891 |
+
"country": "Bosnia and Herzegovina",
|
| 2892 |
+
"iso2": "BA",
|
| 2893 |
+
"color": "#1e40af",
|
| 2894 |
+
"cities": [
|
| 2895 |
+
{
|
| 2896 |
+
"city": "Sarajevo",
|
| 2897 |
+
"coordinates": [
|
| 2898 |
+
18.4131,
|
| 2899 |
+
43.8564
|
| 2900 |
+
],
|
| 2901 |
+
"capital": true,
|
| 2902 |
+
"population": 419957
|
| 2903 |
+
}
|
| 2904 |
+
]
|
| 2905 |
+
},
|
| 2906 |
+
{
|
| 2907 |
+
"code3": "ALB",
|
| 2908 |
+
"country": "Albania",
|
| 2909 |
+
"iso2": "AL",
|
| 2910 |
+
"color": "#2563eb",
|
| 2911 |
+
"cities": [
|
| 2912 |
+
{
|
| 2913 |
+
"city": "Tirana",
|
| 2914 |
+
"coordinates": [
|
| 2915 |
+
19.8178,
|
| 2916 |
+
41.3289
|
| 2917 |
+
],
|
| 2918 |
+
"capital": true,
|
| 2919 |
+
"population": 418495
|
| 2920 |
+
}
|
| 2921 |
+
]
|
| 2922 |
+
},
|
| 2923 |
+
{
|
| 2924 |
+
"code3": "GMB",
|
| 2925 |
+
"country": "Gambia, The",
|
| 2926 |
+
"iso2": "GM",
|
| 2927 |
+
"color": "#1e40af",
|
| 2928 |
+
"cities": [
|
| 2929 |
+
{
|
| 2930 |
+
"city": "Banjul",
|
| 2931 |
+
"coordinates": [
|
| 2932 |
+
-16.5775,
|
| 2933 |
+
13.4531
|
| 2934 |
+
],
|
| 2935 |
+
"capital": true,
|
| 2936 |
+
"population": 413397
|
| 2937 |
+
}
|
| 2938 |
+
]
|
| 2939 |
+
},
|
| 2940 |
+
{
|
| 2941 |
+
"code3": "LSO",
|
| 2942 |
+
"country": "Lesotho",
|
| 2943 |
+
"iso2": "LS",
|
| 2944 |
+
"color": "#FFCE00",
|
| 2945 |
+
"cities": [
|
| 2946 |
+
{
|
| 2947 |
+
"city": "Maseru",
|
| 2948 |
+
"coordinates": [
|
| 2949 |
+
27.48,
|
| 2950 |
+
-29.31
|
| 2951 |
+
],
|
| 2952 |
+
"capital": true,
|
| 2953 |
+
"population": 343541
|
| 2954 |
+
}
|
| 2955 |
+
]
|
| 2956 |
+
},
|
| 2957 |
+
{
|
| 2958 |
+
"code3": "CYP",
|
| 2959 |
+
"country": "Cyprus",
|
| 2960 |
+
"iso2": "CY",
|
| 2961 |
+
"color": "#dc143c",
|
| 2962 |
+
"cities": [
|
| 2963 |
+
{
|
| 2964 |
+
"city": "Nicosia",
|
| 2965 |
+
"coordinates": [
|
| 2966 |
+
33.365,
|
| 2967 |
+
35.1725
|
| 2968 |
+
],
|
| 2969 |
+
"capital": true,
|
| 2970 |
+
"population": 330000
|
| 2971 |
+
}
|
| 2972 |
+
]
|
| 2973 |
+
},
|
| 2974 |
+
{
|
| 2975 |
+
"code3": "SLV",
|
| 2976 |
+
"country": "El Salvador",
|
| 2977 |
+
"iso2": "SV",
|
| 2978 |
+
"color": "#15803d",
|
| 2979 |
+
"cities": [
|
| 2980 |
+
{
|
| 2981 |
+
"city": "San Salvador",
|
| 2982 |
+
"coordinates": [
|
| 2983 |
+
-89.1914,
|
| 2984 |
+
13.6989
|
| 2985 |
+
],
|
| 2986 |
+
"capital": true,
|
| 2987 |
+
"population": 316090
|
| 2988 |
+
}
|
| 2989 |
+
]
|
| 2990 |
+
},
|
| 2991 |
+
{
|
| 2992 |
+
"code3": "REU",
|
| 2993 |
+
"country": "Reunion",
|
| 2994 |
+
"iso2": "RE",
|
| 2995 |
+
"color": "#FF0000",
|
| 2996 |
+
"cities": [
|
| 2997 |
+
{
|
| 2998 |
+
"city": "Saint-Denis",
|
| 2999 |
+
"coordinates": [
|
| 3000 |
+
55.4481,
|
| 3001 |
+
-20.8789
|
| 3002 |
+
],
|
| 3003 |
+
"capital": true,
|
| 3004 |
+
"population": 315080
|
| 3005 |
+
}
|
| 3006 |
+
]
|
| 3007 |
+
},
|
| 3008 |
+
{
|
| 3009 |
+
"code3": "GNQ",
|
| 3010 |
+
"country": "Equatorial Guinea",
|
| 3011 |
+
"iso2": "GQ",
|
| 3012 |
+
"color": "#f59e0b",
|
| 3013 |
+
"cities": [
|
| 3014 |
+
{
|
| 3015 |
+
"city": "Malabo",
|
| 3016 |
+
"coordinates": [
|
| 3017 |
+
8.7744,
|
| 3018 |
+
3.7456
|
| 3019 |
+
],
|
| 3020 |
+
"capital": true,
|
| 3021 |
+
"population": 297000
|
| 3022 |
+
}
|
| 3023 |
+
]
|
| 3024 |
+
},
|
| 3025 |
+
{
|
| 3026 |
+
"code3": "SVN",
|
| 3027 |
+
"country": "Slovenia",
|
| 3028 |
+
"iso2": "SI",
|
| 3029 |
+
"color": "#2563eb",
|
| 3030 |
+
"cities": [
|
| 3031 |
+
{
|
| 3032 |
+
"city": "Ljubljana",
|
| 3033 |
+
"coordinates": [
|
| 3034 |
+
14.5061,
|
| 3035 |
+
46.0514
|
| 3036 |
+
],
|
| 3037 |
+
"capital": true,
|
| 3038 |
+
"population": 284293
|
| 3039 |
+
}
|
| 3040 |
+
]
|
| 3041 |
+
},
|
| 3042 |
+
{
|
| 3043 |
+
"code3": "BHS",
|
| 3044 |
+
"country": "Bahamas, The",
|
| 3045 |
+
"iso2": "BS",
|
| 3046 |
+
"color": "#1e40af",
|
| 3047 |
+
"cities": [
|
| 3048 |
+
{
|
| 3049 |
+
"city": "Nassau",
|
| 3050 |
+
"coordinates": [
|
| 3051 |
+
-77.3386,
|
| 3052 |
+
25.0781
|
| 3053 |
+
],
|
| 3054 |
+
"capital": true,
|
| 3055 |
+
"population": 274400
|
| 3056 |
+
}
|
| 3057 |
+
]
|
| 3058 |
+
},
|
| 3059 |
+
{
|
| 3060 |
+
"code3": "MTQ",
|
| 3061 |
+
"country": "Martinique",
|
| 3062 |
+
"iso2": "MQ",
|
| 3063 |
+
"color": "#FFCE00",
|
| 3064 |
+
"cities": [
|
| 3065 |
+
{
|
| 3066 |
+
"city": "Fort-de-France",
|
| 3067 |
+
"coordinates": [
|
| 3068 |
+
-61.0667,
|
| 3069 |
+
14.6
|
| 3070 |
+
],
|
| 3071 |
+
"capital": true,
|
| 3072 |
+
"population": 253995
|
| 3073 |
+
}
|
| 3074 |
+
]
|
| 3075 |
+
},
|
| 3076 |
+
{
|
| 3077 |
+
"code3": "GLP",
|
| 3078 |
+
"country": "Guadeloupe",
|
| 3079 |
+
"iso2": "GP",
|
| 3080 |
+
"color": "#2563eb",
|
| 3081 |
+
"cities": [
|
| 3082 |
+
{
|
| 3083 |
+
"city": "Pointe-à-Pitre",
|
| 3084 |
+
"coordinates": [
|
| 3085 |
+
-61.5331,
|
| 3086 |
+
16.2411
|
| 3087 |
+
],
|
| 3088 |
+
"capital": false,
|
| 3089 |
+
"population": 250952
|
| 3090 |
+
}
|
| 3091 |
+
]
|
| 3092 |
+
},
|
| 3093 |
+
{
|
| 3094 |
+
"code3": "BWA",
|
| 3095 |
+
"country": "Botswana",
|
| 3096 |
+
"iso2": "BW",
|
| 3097 |
+
"color": "#1e40af",
|
| 3098 |
+
"cities": [
|
| 3099 |
+
{
|
| 3100 |
+
"city": "Gaborone",
|
| 3101 |
+
"coordinates": [
|
| 3102 |
+
25.9122,
|
| 3103 |
+
-24.6581
|
| 3104 |
+
],
|
| 3105 |
+
"capital": true,
|
| 3106 |
+
"population": 235884
|
| 3107 |
+
}
|
| 3108 |
+
]
|
| 3109 |
+
},
|
| 3110 |
+
{
|
| 3111 |
+
"code3": "SUR",
|
| 3112 |
+
"country": "Suriname",
|
| 3113 |
+
"iso2": "SR",
|
| 3114 |
+
"color": "#FFCE00",
|
| 3115 |
+
"cities": [
|
| 3116 |
+
{
|
| 3117 |
+
"city": "Paramaribo",
|
| 3118 |
+
"coordinates": [
|
| 3119 |
+
-55.2039,
|
| 3120 |
+
5.8522
|
| 3121 |
+
],
|
| 3122 |
+
"capital": true,
|
| 3123 |
+
"population": 223757
|
| 3124 |
+
}
|
| 3125 |
+
]
|
| 3126 |
+
},
|
| 3127 |
+
{
|
| 3128 |
+
"code3": "TLS",
|
| 3129 |
+
"country": "Timor-Leste",
|
| 3130 |
+
"iso2": "TL",
|
| 3131 |
+
"color": "#dc143c",
|
| 3132 |
+
"cities": [
|
| 3133 |
+
{
|
| 3134 |
+
"city": "Dili",
|
| 3135 |
+
"coordinates": [
|
| 3136 |
+
125.5783,
|
| 3137 |
+
-8.5536
|
| 3138 |
+
],
|
| 3139 |
+
"capital": true,
|
| 3140 |
+
"population": 222323
|
| 3141 |
+
}
|
| 3142 |
+
]
|
| 3143 |
+
},
|
| 3144 |
+
{
|
| 3145 |
+
"code3": "XKS",
|
| 3146 |
+
"country": "Kosovo",
|
| 3147 |
+
"iso2": "XK",
|
| 3148 |
+
"color": "#15803d",
|
| 3149 |
+
"cities": [
|
| 3150 |
+
{
|
| 3151 |
+
"city": "Prizren",
|
| 3152 |
+
"coordinates": [
|
| 3153 |
+
20.7392,
|
| 3154 |
+
42.2128
|
| 3155 |
+
],
|
| 3156 |
+
"capital": false,
|
| 3157 |
+
"population": 220128
|
| 3158 |
+
}
|
| 3159 |
+
]
|
| 3160 |
+
},
|
| 3161 |
+
{
|
| 3162 |
+
"code3": "XWB",
|
| 3163 |
+
"country": "West Bank",
|
| 3164 |
+
"iso2": "XW",
|
| 3165 |
+
"color": "#FF0000",
|
| 3166 |
+
"cities": [
|
| 3167 |
+
{
|
| 3168 |
+
"city": "Hebron",
|
| 3169 |
+
"coordinates": [
|
| 3170 |
+
35.0969,
|
| 3171 |
+
31.5286
|
| 3172 |
+
],
|
| 3173 |
+
"capital": false,
|
| 3174 |
+
"population": 201063
|
| 3175 |
+
}
|
| 3176 |
+
]
|
| 3177 |
+
},
|
| 3178 |
+
{
|
| 3179 |
+
"code3": "GUY",
|
| 3180 |
+
"country": "Guyana",
|
| 3181 |
+
"iso2": "GY",
|
| 3182 |
+
"color": "#f59e0b",
|
| 3183 |
+
"cities": [
|
| 3184 |
+
{
|
| 3185 |
+
"city": "Georgetown",
|
| 3186 |
+
"coordinates": [
|
| 3187 |
+
-58.1508,
|
| 3188 |
+
6.8058
|
| 3189 |
+
],
|
| 3190 |
+
"capital": true,
|
| 3191 |
+
"population": 200500
|
| 3192 |
+
}
|
| 3193 |
+
]
|
| 3194 |
+
},
|
| 3195 |
+
{
|
| 3196 |
+
"code3": "FJI",
|
| 3197 |
+
"country": "Fiji",
|
| 3198 |
+
"iso2": "FJ",
|
| 3199 |
+
"color": "#2563eb",
|
| 3200 |
+
"cities": [
|
| 3201 |
+
{
|
| 3202 |
+
"city": "Suva",
|
| 3203 |
+
"coordinates": [
|
| 3204 |
+
178.4419,
|
| 3205 |
+
-18.1416
|
| 3206 |
+
],
|
| 3207 |
+
"capital": true,
|
| 3208 |
+
"population": 185913
|
| 3209 |
+
}
|
| 3210 |
+
]
|
| 3211 |
+
},
|
| 3212 |
+
{
|
| 3213 |
+
"code3": "NCL",
|
| 3214 |
+
"country": "New Caledonia",
|
| 3215 |
+
"iso2": "NC",
|
| 3216 |
+
"color": "#1e40af",
|
| 3217 |
+
"cities": [
|
| 3218 |
+
{
|
| 3219 |
+
"city": "Nouméa",
|
| 3220 |
+
"coordinates": [
|
| 3221 |
+
166.458,
|
| 3222 |
+
-22.2758
|
| 3223 |
+
],
|
| 3224 |
+
"capital": true,
|
| 3225 |
+
"population": 182341
|
| 3226 |
+
}
|
| 3227 |
+
]
|
| 3228 |
+
},
|
| 3229 |
+
{
|
| 3230 |
+
"code3": "MNE",
|
| 3231 |
+
"country": "Montenegro",
|
| 3232 |
+
"iso2": "ME",
|
| 3233 |
+
"color": "#FFCE00",
|
| 3234 |
+
"cities": [
|
| 3235 |
+
{
|
| 3236 |
+
"city": "Podgorica",
|
| 3237 |
+
"coordinates": [
|
| 3238 |
+
19.2628,
|
| 3239 |
+
42.4414
|
| 3240 |
+
],
|
| 3241 |
+
"capital": true,
|
| 3242 |
+
"population": 173024
|
| 3243 |
+
}
|
| 3244 |
+
]
|
| 3245 |
+
},
|
| 3246 |
+
{
|
| 3247 |
+
"code3": "CUW",
|
| 3248 |
+
"country": "Curaçao",
|
| 3249 |
+
"iso2": "CW",
|
| 3250 |
+
"color": "#dc143c",
|
| 3251 |
+
"cities": [
|
| 3252 |
+
{
|
| 3253 |
+
"city": "Willemstad",
|
| 3254 |
+
"coordinates": [
|
| 3255 |
+
-68.935,
|
| 3256 |
+
12.108
|
| 3257 |
+
],
|
| 3258 |
+
"capital": true,
|
| 3259 |
+
"population": 150000
|
| 3260 |
+
}
|
| 3261 |
+
]
|
| 3262 |
+
},
|
| 3263 |
+
{
|
| 3264 |
+
"code3": "MUS",
|
| 3265 |
+
"country": "Mauritius",
|
| 3266 |
+
"iso2": "MU",
|
| 3267 |
+
"color": "#15803d",
|
| 3268 |
+
"cities": [
|
| 3269 |
+
{
|
| 3270 |
+
"city": "Port Louis",
|
| 3271 |
+
"coordinates": [
|
| 3272 |
+
57.5042,
|
| 3273 |
+
-20.1644
|
| 3274 |
+
],
|
| 3275 |
+
"capital": true,
|
| 3276 |
+
"population": 149194
|
| 3277 |
+
}
|
| 3278 |
+
]
|
| 3279 |
+
},
|
| 3280 |
+
{
|
| 3281 |
+
"code3": "ISL",
|
| 3282 |
+
"country": "Iceland",
|
| 3283 |
+
"iso2": "IS",
|
| 3284 |
+
"color": "#FF0000",
|
| 3285 |
+
"cities": [
|
| 3286 |
+
{
|
| 3287 |
+
"city": "Reykjavík",
|
| 3288 |
+
"coordinates": [
|
| 3289 |
+
-21.94,
|
| 3290 |
+
64.1467
|
| 3291 |
+
],
|
| 3292 |
+
"capital": true,
|
| 3293 |
+
"population": 139875
|
| 3294 |
+
}
|
| 3295 |
+
]
|
| 3296 |
+
},
|
| 3297 |
+
{
|
| 3298 |
+
"code3": "MDV",
|
| 3299 |
+
"country": "Maldives",
|
| 3300 |
+
"iso2": "MV",
|
| 3301 |
+
"color": "#f59e0b",
|
| 3302 |
+
"cities": [
|
| 3303 |
+
{
|
| 3304 |
+
"city": "Male",
|
| 3305 |
+
"coordinates": [
|
| 3306 |
+
73.5089,
|
| 3307 |
+
4.1753
|
| 3308 |
+
],
|
| 3309 |
+
"capital": true,
|
| 3310 |
+
"population": 133019
|
| 3311 |
+
}
|
| 3312 |
+
]
|
| 3313 |
+
},
|
| 3314 |
+
{
|
| 3315 |
+
"code3": "LUX",
|
| 3316 |
+
"country": "Luxembourg",
|
| 3317 |
+
"iso2": "LU",
|
| 3318 |
+
"color": "#2563eb",
|
| 3319 |
+
"cities": [
|
| 3320 |
+
{
|
| 3321 |
+
"city": "Luxembourg",
|
| 3322 |
+
"coordinates": [
|
| 3323 |
+
6.1319,
|
| 3324 |
+
49.6117
|
| 3325 |
+
],
|
| 3326 |
+
"capital": true,
|
| 3327 |
+
"population": 132780
|
| 3328 |
+
}
|
| 3329 |
+
]
|
| 3330 |
+
},
|
| 3331 |
+
{
|
| 3332 |
+
"code3": "PYF",
|
| 3333 |
+
"country": "French Polynesia",
|
| 3334 |
+
"iso2": "PF",
|
| 3335 |
+
"color": "#1e40af",
|
| 3336 |
+
"cities": [
|
| 3337 |
+
{
|
| 3338 |
+
"city": "Papeete",
|
| 3339 |
+
"coordinates": [
|
| 3340 |
+
-149.5667,
|
| 3341 |
+
-17.5334
|
| 3342 |
+
],
|
| 3343 |
+
"capital": true,
|
| 3344 |
+
"population": 131695
|
| 3345 |
+
}
|
| 3346 |
+
]
|
| 3347 |
+
},
|
| 3348 |
+
{
|
| 3349 |
+
"code3": "GUM",
|
| 3350 |
+
"country": "Guam",
|
| 3351 |
+
"iso2": "GU",
|
| 3352 |
+
"color": "#FFCE00",
|
| 3353 |
+
"cities": [
|
| 3354 |
+
{
|
| 3355 |
+
"city": "Maina",
|
| 3356 |
+
"coordinates": [
|
| 3357 |
+
144.7332,
|
| 3358 |
+
13.4692
|
| 3359 |
+
],
|
| 3360 |
+
"capital": false,
|
| 3361 |
+
"population": 122411
|
| 3362 |
+
}
|
| 3363 |
+
]
|
| 3364 |
+
},
|
| 3365 |
+
{
|
| 3366 |
+
"code3": "BTN",
|
| 3367 |
+
"country": "Bhutan",
|
| 3368 |
+
"iso2": "BT",
|
| 3369 |
+
"color": "#dc143c",
|
| 3370 |
+
"cities": [
|
| 3371 |
+
{
|
| 3372 |
+
"city": "Thimphu",
|
| 3373 |
+
"coordinates": [
|
| 3374 |
+
89.6361,
|
| 3375 |
+
27.4722
|
| 3376 |
+
],
|
| 3377 |
+
"capital": true,
|
| 3378 |
+
"population": 114551
|
| 3379 |
+
}
|
| 3380 |
+
]
|
| 3381 |
+
},
|
| 3382 |
+
{
|
| 3383 |
+
"code3": "TGO",
|
| 3384 |
+
"country": "Togo",
|
| 3385 |
+
"iso2": "TG",
|
| 3386 |
+
"color": "#15803d",
|
| 3387 |
+
"cities": [
|
| 3388 |
+
{
|
| 3389 |
+
"city": "Sokodé",
|
| 3390 |
+
"coordinates": [
|
| 3391 |
+
1.1333,
|
| 3392 |
+
8.9833
|
| 3393 |
+
],
|
| 3394 |
+
"capital": false,
|
| 3395 |
+
"population": 113000
|
| 3396 |
+
}
|
| 3397 |
+
]
|
| 3398 |
+
},
|
| 3399 |
+
{
|
| 3400 |
+
"code3": "SWZ",
|
| 3401 |
+
"country": "Eswatini",
|
| 3402 |
+
"iso2": "SZ",
|
| 3403 |
+
"color": "#FF0000",
|
| 3404 |
+
"cities": [
|
| 3405 |
+
{
|
| 3406 |
+
"city": "Manzini",
|
| 3407 |
+
"coordinates": [
|
| 3408 |
+
31.3667,
|
| 3409 |
+
-26.4833
|
| 3410 |
+
],
|
| 3411 |
+
"capital": false,
|
| 3412 |
+
"population": 110508
|
| 3413 |
+
}
|
| 3414 |
+
]
|
| 3415 |
+
},
|
| 3416 |
+
{
|
| 3417 |
+
"code3": "BRB",
|
| 3418 |
+
"country": "Barbados",
|
| 3419 |
+
"iso2": "BB",
|
| 3420 |
+
"color": "#f59e0b",
|
| 3421 |
+
"cities": [
|
| 3422 |
+
{
|
| 3423 |
+
"city": "Bridgetown",
|
| 3424 |
+
"coordinates": [
|
| 3425 |
+
-59.6167,
|
| 3426 |
+
13.0975
|
| 3427 |
+
],
|
| 3428 |
+
"capital": true,
|
| 3429 |
+
"population": 110000
|
| 3430 |
+
}
|
| 3431 |
+
]
|
| 3432 |
+
},
|
| 3433 |
+
{
|
| 3434 |
+
"code3": "TTO",
|
| 3435 |
+
"country": "Trinidad and Tobago",
|
| 3436 |
+
"iso2": "TT",
|
| 3437 |
+
"color": "#2563eb",
|
| 3438 |
+
"cities": [
|
| 3439 |
+
{
|
| 3440 |
+
"city": "Chaguanas",
|
| 3441 |
+
"coordinates": [
|
| 3442 |
+
-61.4,
|
| 3443 |
+
10.5167
|
| 3444 |
+
],
|
| 3445 |
+
"capital": false,
|
| 3446 |
+
"population": 101297
|
| 3447 |
+
}
|
| 3448 |
+
]
|
| 3449 |
+
},
|
| 3450 |
+
{
|
| 3451 |
+
"code3": "SLB",
|
| 3452 |
+
"country": "Solomon Islands",
|
| 3453 |
+
"iso2": "SB",
|
| 3454 |
+
"color": "#1e40af",
|
| 3455 |
+
"cities": [
|
| 3456 |
+
{
|
| 3457 |
+
"city": "Honiara",
|
| 3458 |
+
"coordinates": [
|
| 3459 |
+
159.9556,
|
| 3460 |
+
-9.4319
|
| 3461 |
+
],
|
| 3462 |
+
"capital": true,
|
| 3463 |
+
"population": 84520
|
| 3464 |
+
}
|
| 3465 |
+
]
|
| 3466 |
+
},
|
| 3467 |
+
{
|
| 3468 |
+
"code3": "MYT",
|
| 3469 |
+
"country": "Mayotte",
|
| 3470 |
+
"iso2": "YT",
|
| 3471 |
+
"color": "#FFCE00",
|
| 3472 |
+
"cities": [
|
| 3473 |
+
{
|
| 3474 |
+
"city": "Mamoudzou",
|
| 3475 |
+
"coordinates": [
|
| 3476 |
+
45.2278,
|
| 3477 |
+
-12.7806
|
| 3478 |
+
],
|
| 3479 |
+
"capital": true,
|
| 3480 |
+
"population": 71437
|
| 3481 |
+
}
|
| 3482 |
+
]
|
| 3483 |
+
},
|
| 3484 |
+
{
|
| 3485 |
+
"code3": "CPV",
|
| 3486 |
+
"country": "Cabo Verde",
|
| 3487 |
+
"iso2": "CV",
|
| 3488 |
+
"color": "#dc143c",
|
| 3489 |
+
"cities": [
|
| 3490 |
+
{
|
| 3491 |
+
"city": "Mindelo",
|
| 3492 |
+
"coordinates": [
|
| 3493 |
+
-24.988,
|
| 3494 |
+
16.886
|
| 3495 |
+
],
|
| 3496 |
+
"capital": false,
|
| 3497 |
+
"population": 70468
|
| 3498 |
+
}
|
| 3499 |
+
]
|
| 3500 |
+
},
|
| 3501 |
+
{
|
| 3502 |
+
"code3": "LCA",
|
| 3503 |
+
"country": "Saint Lucia",
|
| 3504 |
+
"iso2": "LC",
|
| 3505 |
+
"color": "#15803d",
|
| 3506 |
+
"cities": [
|
| 3507 |
+
{
|
| 3508 |
+
"city": "Castries",
|
| 3509 |
+
"coordinates": [
|
| 3510 |
+
-60.9833,
|
| 3511 |
+
14.0167
|
| 3512 |
+
],
|
| 3513 |
+
"capital": true,
|
| 3514 |
+
"population": 70000
|
| 3515 |
+
}
|
| 3516 |
+
]
|
| 3517 |
+
},
|
| 3518 |
+
{
|
| 3519 |
+
"code3": "STP",
|
| 3520 |
+
"country": "Sao Tome and Principe",
|
| 3521 |
+
"iso2": "ST",
|
| 3522 |
+
"color": "#FF0000",
|
| 3523 |
+
"cities": [
|
| 3524 |
+
{
|
| 3525 |
+
"city": "São Tomé",
|
| 3526 |
+
"coordinates": [
|
| 3527 |
+
6.7306,
|
| 3528 |
+
0.3361
|
| 3529 |
+
],
|
| 3530 |
+
"capital": true,
|
| 3531 |
+
"population": 65468
|
| 3532 |
+
}
|
| 3533 |
+
]
|
| 3534 |
+
},
|
| 3535 |
+
{
|
| 3536 |
+
"code3": "GUF",
|
| 3537 |
+
"country": "French Guiana",
|
| 3538 |
+
"iso2": "GF",
|
| 3539 |
+
"color": "#f59e0b",
|
| 3540 |
+
"cities": [
|
| 3541 |
+
{
|
| 3542 |
+
"city": "Cayenne",
|
| 3543 |
+
"coordinates": [
|
| 3544 |
+
-52.33,
|
| 3545 |
+
4.933
|
| 3546 |
+
],
|
| 3547 |
+
"capital": true,
|
| 3548 |
+
"population": 61550
|
| 3549 |
+
}
|
| 3550 |
+
]
|
| 3551 |
+
},
|
| 3552 |
+
{
|
| 3553 |
+
"code3": "BLZ",
|
| 3554 |
+
"country": "Belize",
|
| 3555 |
+
"iso2": "BZ",
|
| 3556 |
+
"color": "#2563eb",
|
| 3557 |
+
"cities": [
|
| 3558 |
+
{
|
| 3559 |
+
"city": "Belize City",
|
| 3560 |
+
"coordinates": [
|
| 3561 |
+
-88.1886,
|
| 3562 |
+
17.4986
|
| 3563 |
+
],
|
| 3564 |
+
"capital": false,
|
| 3565 |
+
"population": 57169
|
| 3566 |
+
}
|
| 3567 |
+
]
|
| 3568 |
+
},
|
| 3569 |
+
{
|
| 3570 |
+
"code3": "BRN",
|
| 3571 |
+
"country": "Brunei",
|
| 3572 |
+
"iso2": "BN",
|
| 3573 |
+
"color": "#1e40af",
|
| 3574 |
+
"cities": [
|
| 3575 |
+
{
|
| 3576 |
+
"city": "Bandar Seri Begawan",
|
| 3577 |
+
"coordinates": [
|
| 3578 |
+
114.9422,
|
| 3579 |
+
4.8903
|
| 3580 |
+
],
|
| 3581 |
+
"capital": true,
|
| 3582 |
+
"population": 50000
|
| 3583 |
+
}
|
| 3584 |
+
]
|
| 3585 |
+
},
|
| 3586 |
+
{
|
| 3587 |
+
"code3": "VUT",
|
| 3588 |
+
"country": "Vanuatu",
|
| 3589 |
+
"iso2": "VU",
|
| 3590 |
+
"color": "#FFCE00",
|
| 3591 |
+
"cities": [
|
| 3592 |
+
{
|
| 3593 |
+
"city": "Port-Vila",
|
| 3594 |
+
"coordinates": [
|
| 3595 |
+
168.3167,
|
| 3596 |
+
-17.7333
|
| 3597 |
+
],
|
| 3598 |
+
"capital": true,
|
| 3599 |
+
"population": 49034
|
| 3600 |
+
}
|
| 3601 |
+
]
|
| 3602 |
+
},
|
| 3603 |
+
{
|
| 3604 |
+
"code3": "WSM",
|
| 3605 |
+
"country": "Samoa",
|
| 3606 |
+
"iso2": "WS",
|
| 3607 |
+
"color": "#dc143c",
|
| 3608 |
+
"cities": [
|
| 3609 |
+
{
|
| 3610 |
+
"city": "Apia",
|
| 3611 |
+
"coordinates": [
|
| 3612 |
+
-171.75,
|
| 3613 |
+
-13.8333
|
| 3614 |
+
],
|
| 3615 |
+
"capital": true,
|
| 3616 |
+
"population": 37708
|
| 3617 |
+
}
|
| 3618 |
+
]
|
| 3619 |
+
},
|
| 3620 |
+
{
|
| 3621 |
+
"code3": "MCO",
|
| 3622 |
+
"country": "Monaco",
|
| 3623 |
+
"iso2": "MC",
|
| 3624 |
+
"color": "#15803d",
|
| 3625 |
+
"cities": [
|
| 3626 |
+
{
|
| 3627 |
+
"city": "Monaco",
|
| 3628 |
+
"coordinates": [
|
| 3629 |
+
7.4167,
|
| 3630 |
+
43.7333
|
| 3631 |
+
],
|
| 3632 |
+
"capital": true,
|
| 3633 |
+
"population": 36371
|
| 3634 |
+
}
|
| 3635 |
+
]
|
| 3636 |
+
},
|
| 3637 |
+
{
|
| 3638 |
+
"code3": "ABW",
|
| 3639 |
+
"country": "Aruba",
|
| 3640 |
+
"iso2": "AW",
|
| 3641 |
+
"color": "#FF0000",
|
| 3642 |
+
"cities": [
|
| 3643 |
+
{
|
| 3644 |
+
"city": "Oranjestad",
|
| 3645 |
+
"coordinates": [
|
| 3646 |
+
-70.0358,
|
| 3647 |
+
12.5186
|
| 3648 |
+
],
|
| 3649 |
+
"capital": true,
|
| 3650 |
+
"population": 34980
|
| 3651 |
+
}
|
| 3652 |
+
]
|
| 3653 |
+
},
|
| 3654 |
+
{
|
| 3655 |
+
"code3": "GIB",
|
| 3656 |
+
"country": "Gibraltar",
|
| 3657 |
+
"iso2": "GI",
|
| 3658 |
+
"color": "#f59e0b",
|
| 3659 |
+
"cities": [
|
| 3660 |
+
{
|
| 3661 |
+
"city": "Gibraltar",
|
| 3662 |
+
"coordinates": [
|
| 3663 |
+
-5.35,
|
| 3664 |
+
36.14
|
| 3665 |
+
],
|
| 3666 |
+
"capital": true,
|
| 3667 |
+
"population": 34003
|
| 3668 |
+
}
|
| 3669 |
+
]
|
| 3670 |
+
},
|
| 3671 |
+
{
|
| 3672 |
+
"code3": "JEY",
|
| 3673 |
+
"country": "Jersey",
|
| 3674 |
+
"iso2": "JE",
|
| 3675 |
+
"color": "#2563eb",
|
| 3676 |
+
"cities": [
|
| 3677 |
+
{
|
| 3678 |
+
"city": "Saint Helier",
|
| 3679 |
+
"coordinates": [
|
| 3680 |
+
-2.11,
|
| 3681 |
+
49.1858
|
| 3682 |
+
],
|
| 3683 |
+
"capital": true,
|
| 3684 |
+
"population": 33522
|
| 3685 |
+
}
|
| 3686 |
+
]
|
| 3687 |
+
},
|
| 3688 |
+
{
|
| 3689 |
+
"code3": "MHL",
|
| 3690 |
+
"country": "Marshall Islands",
|
| 3691 |
+
"iso2": "MH",
|
| 3692 |
+
"color": "#1e40af",
|
| 3693 |
+
"cities": [
|
| 3694 |
+
{
|
| 3695 |
+
"city": "Majuro",
|
| 3696 |
+
"coordinates": [
|
| 3697 |
+
171.3833,
|
| 3698 |
+
7.0833
|
| 3699 |
+
],
|
| 3700 |
+
"capital": true,
|
| 3701 |
+
"population": 30000
|
| 3702 |
+
}
|
| 3703 |
+
]
|
| 3704 |
+
},
|
| 3705 |
+
{
|
| 3706 |
+
"code3": "COM",
|
| 3707 |
+
"country": "Comoros",
|
| 3708 |
+
"iso2": "KM",
|
| 3709 |
+
"color": "#FFCE00",
|
| 3710 |
+
"cities": [
|
| 3711 |
+
{
|
| 3712 |
+
"city": "Mutsamudu",
|
| 3713 |
+
"coordinates": [
|
| 3714 |
+
44.3939,
|
| 3715 |
+
-12.1675
|
| 3716 |
+
],
|
| 3717 |
+
"capital": false,
|
| 3718 |
+
"population": 30000
|
| 3719 |
+
}
|
| 3720 |
+
]
|
| 3721 |
+
},
|
| 3722 |
+
{
|
| 3723 |
+
"code3": "KIR",
|
| 3724 |
+
"country": "Kiribati",
|
| 3725 |
+
"iso2": "KI",
|
| 3726 |
+
"color": "#dc143c",
|
| 3727 |
+
"cities": [
|
| 3728 |
+
{
|
| 3729 |
+
"city": "Tarawa",
|
| 3730 |
+
"coordinates": [
|
| 3731 |
+
173.0176,
|
| 3732 |
+
1.3382
|
| 3733 |
+
],
|
| 3734 |
+
"capital": true,
|
| 3735 |
+
"population": 28802
|
| 3736 |
+
}
|
| 3737 |
+
]
|
| 3738 |
+
},
|
| 3739 |
+
{
|
| 3740 |
+
"code3": "IMN",
|
| 3741 |
+
"country": "Isle of Man",
|
| 3742 |
+
"iso2": "IM",
|
| 3743 |
+
"color": "#15803d",
|
| 3744 |
+
"cities": [
|
| 3745 |
+
{
|
| 3746 |
+
"city": "Douglas",
|
| 3747 |
+
"coordinates": [
|
| 3748 |
+
-4.4775,
|
| 3749 |
+
54.15
|
| 3750 |
+
],
|
| 3751 |
+
"capital": true,
|
| 3752 |
+
"population": 27938
|
| 3753 |
+
}
|
| 3754 |
+
]
|
| 3755 |
+
},
|
| 3756 |
+
{
|
| 3757 |
+
"code3": "CYM",
|
| 3758 |
+
"country": "Cayman Islands",
|
| 3759 |
+
"iso2": "KY",
|
| 3760 |
+
"color": "#FF0000",
|
| 3761 |
+
"cities": [
|
| 3762 |
+
{
|
| 3763 |
+
"city": "George Town",
|
| 3764 |
+
"coordinates": [
|
| 3765 |
+
-81.3744,
|
| 3766 |
+
19.2866
|
| 3767 |
+
],
|
| 3768 |
+
"capital": true,
|
| 3769 |
+
"population": 27704
|
| 3770 |
+
}
|
| 3771 |
+
]
|
| 3772 |
+
},
|
| 3773 |
+
{
|
| 3774 |
+
"code3": "SYC",
|
| 3775 |
+
"country": "Seychelles",
|
| 3776 |
+
"iso2": "SC",
|
| 3777 |
+
"color": "#f59e0b",
|
| 3778 |
+
"cities": [
|
| 3779 |
+
{
|
| 3780 |
+
"city": "Victoria",
|
| 3781 |
+
"coordinates": [
|
| 3782 |
+
55.4525,
|
| 3783 |
+
-4.6231
|
| 3784 |
+
],
|
| 3785 |
+
"capital": true,
|
| 3786 |
+
"population": 24701
|
| 3787 |
+
}
|
| 3788 |
+
]
|
| 3789 |
+
},
|
| 3790 |
+
{
|
| 3791 |
+
"code3": "VCT",
|
| 3792 |
+
"country": "Saint Vincent and the Grenadines",
|
| 3793 |
+
"iso2": "VC",
|
| 3794 |
+
"color": "#2563eb",
|
| 3795 |
+
"cities": [
|
| 3796 |
+
{
|
| 3797 |
+
"city": "Calliaqua",
|
| 3798 |
+
"coordinates": [
|
| 3799 |
+
-61.1928,
|
| 3800 |
+
13.1308
|
| 3801 |
+
],
|
| 3802 |
+
"capital": false,
|
| 3803 |
+
"population": 24205
|
| 3804 |
+
}
|
| 3805 |
+
]
|
| 3806 |
+
},
|
| 3807 |
+
{
|
| 3808 |
+
"code3": "AND",
|
| 3809 |
+
"country": "Andorra",
|
| 3810 |
+
"iso2": "AD",
|
| 3811 |
+
"color": "#FFCE00",
|
| 3812 |
+
"cities": [
|
| 3813 |
+
{
|
| 3814 |
+
"city": "Andorra la Vella",
|
| 3815 |
+
"coordinates": [
|
| 3816 |
+
1.5,
|
| 3817 |
+
42.5
|
| 3818 |
+
],
|
| 3819 |
+
"capital": true,
|
| 3820 |
+
"population": 22615
|
| 3821 |
+
}
|
| 3822 |
+
]
|
| 3823 |
+
},
|
| 3824 |
+
{
|
| 3825 |
+
"code3": "GGY",
|
| 3826 |
+
"country": "Guernsey",
|
| 3827 |
+
"iso2": "GG",
|
| 3828 |
+
"color": "#15803d",
|
| 3829 |
+
"cities": [
|
| 3830 |
+
{
|
| 3831 |
+
"city": "Saint Peter Port",
|
| 3832 |
+
"coordinates": [
|
| 3833 |
+
-2.5368,
|
| 3834 |
+
49.4555
|
| 3835 |
+
],
|
| 3836 |
+
"capital": true,
|
| 3837 |
+
"population": 18958
|
| 3838 |
+
}
|
| 3839 |
+
]
|
| 3840 |
+
},
|
| 3841 |
+
{
|
| 3842 |
+
"code3": "GRL",
|
| 3843 |
+
"country": "Greenland",
|
| 3844 |
+
"iso2": "GL",
|
| 3845 |
+
"color": "#FF0000",
|
| 3846 |
+
"cities": [
|
| 3847 |
+
{
|
| 3848 |
+
"city": "Nuuk",
|
| 3849 |
+
"coordinates": [
|
| 3850 |
+
-51.6942,
|
| 3851 |
+
64.1814
|
| 3852 |
+
],
|
| 3853 |
+
"capital": true,
|
| 3854 |
+
"population": 18326
|
| 3855 |
+
}
|
| 3856 |
+
]
|
| 3857 |
+
},
|
| 3858 |
+
{
|
| 3859 |
+
"code3": "DMA",
|
| 3860 |
+
"country": "Dominica",
|
| 3861 |
+
"iso2": "DM",
|
| 3862 |
+
"color": "#f59e0b",
|
| 3863 |
+
"cities": [
|
| 3864 |
+
{
|
| 3865 |
+
"city": "Roseau",
|
| 3866 |
+
"coordinates": [
|
| 3867 |
+
-61.3883,
|
| 3868 |
+
15.3014
|
| 3869 |
+
],
|
| 3870 |
+
"capital": true,
|
| 3871 |
+
"population": 14725
|
| 3872 |
+
}
|
| 3873 |
+
]
|
| 3874 |
+
},
|
| 3875 |
+
{
|
| 3876 |
+
"code3": "FSM",
|
| 3877 |
+
"country": "Micronesia, Federated States of",
|
| 3878 |
+
"iso2": "FM",
|
| 3879 |
+
"color": "#2563eb",
|
| 3880 |
+
"cities": [
|
| 3881 |
+
{
|
| 3882 |
+
"city": "Weno",
|
| 3883 |
+
"coordinates": [
|
| 3884 |
+
151.8583,
|
| 3885 |
+
7.4417
|
| 3886 |
+
],
|
| 3887 |
+
"capital": false,
|
| 3888 |
+
"population": 13856
|
| 3889 |
+
}
|
| 3890 |
+
]
|
| 3891 |
+
},
|
| 3892 |
+
{
|
| 3893 |
+
"code3": "FRO",
|
| 3894 |
+
"country": "Faroe Islands",
|
| 3895 |
+
"iso2": "FO",
|
| 3896 |
+
"color": "#1e40af",
|
| 3897 |
+
"cities": [
|
| 3898 |
+
{
|
| 3899 |
+
"city": "Tórshavn",
|
| 3900 |
+
"coordinates": [
|
| 3901 |
+
-6.7833,
|
| 3902 |
+
62
|
| 3903 |
+
],
|
| 3904 |
+
"capital": true,
|
| 3905 |
+
"population": 13326
|
| 3906 |
+
}
|
| 3907 |
+
]
|
| 3908 |
+
},
|
| 3909 |
+
{
|
| 3910 |
+
"code3": "KNA",
|
| 3911 |
+
"country": "Saint Kitts and Nevis",
|
| 3912 |
+
"iso2": "KN",
|
| 3913 |
+
"color": "#FFCE00",
|
| 3914 |
+
"cities": [
|
| 3915 |
+
{
|
| 3916 |
+
"city": "Basseterre",
|
| 3917 |
+
"coordinates": [
|
| 3918 |
+
-62.7333,
|
| 3919 |
+
17.3
|
| 3920 |
+
],
|
| 3921 |
+
"capital": true,
|
| 3922 |
+
"population": 13220
|
| 3923 |
+
}
|
| 3924 |
+
]
|
| 3925 |
+
},
|
| 3926 |
+
{
|
| 3927 |
+
"code3": "VGB",
|
| 3928 |
+
"country": "Virgin Islands, British",
|
| 3929 |
+
"iso2": "VG",
|
| 3930 |
+
"color": "#dc143c",
|
| 3931 |
+
"cities": [
|
| 3932 |
+
{
|
| 3933 |
+
"city": "Road Town",
|
| 3934 |
+
"coordinates": [
|
| 3935 |
+
-64.6167,
|
| 3936 |
+
18.4167
|
| 3937 |
+
],
|
| 3938 |
+
"capital": true,
|
| 3939 |
+
"population": 12603
|
| 3940 |
+
}
|
| 3941 |
+
]
|
| 3942 |
+
},
|
| 3943 |
+
{
|
| 3944 |
+
"code3": "ASM",
|
| 3945 |
+
"country": "American Samoa",
|
| 3946 |
+
"iso2": "AS",
|
| 3947 |
+
"color": "#15803d",
|
| 3948 |
+
"cities": [
|
| 3949 |
+
{
|
| 3950 |
+
"city": "Pago Pago",
|
| 3951 |
+
"coordinates": [
|
| 3952 |
+
-170.7046,
|
| 3953 |
+
-14.274
|
| 3954 |
+
],
|
| 3955 |
+
"capital": true,
|
| 3956 |
+
"population": 12576
|
| 3957 |
+
}
|
| 3958 |
+
]
|
| 3959 |
+
},
|
| 3960 |
+
{
|
| 3961 |
+
"code3": "SMR",
|
| 3962 |
+
"country": "San Marino",
|
| 3963 |
+
"iso2": "SM",
|
| 3964 |
+
"color": "#f59e0b",
|
| 3965 |
+
"cities": [
|
| 3966 |
+
{
|
| 3967 |
+
"city": "Serravalle",
|
| 3968 |
+
"coordinates": [
|
| 3969 |
+
12.4817,
|
| 3970 |
+
43.9717
|
| 3971 |
+
],
|
| 3972 |
+
"capital": false,
|
| 3973 |
+
"population": 10878
|
| 3974 |
+
}
|
| 3975 |
+
]
|
| 3976 |
+
},
|
| 3977 |
+
{
|
| 3978 |
+
"code3": "BES",
|
| 3979 |
+
"country": "Bonaire, Sint Eustatius, and Saba",
|
| 3980 |
+
"iso2": "BQ",
|
| 3981 |
+
"color": "#2563eb",
|
| 3982 |
+
"cities": [
|
| 3983 |
+
{
|
| 3984 |
+
"city": "Kralendijk",
|
| 3985 |
+
"coordinates": [
|
| 3986 |
+
-68.2656,
|
| 3987 |
+
12.1444
|
| 3988 |
+
],
|
| 3989 |
+
"capital": false,
|
| 3990 |
+
"population": 10620
|
| 3991 |
+
}
|
| 3992 |
+
]
|
| 3993 |
+
},
|
| 3994 |
+
{
|
| 3995 |
+
"code3": "PLW",
|
| 3996 |
+
"country": "Palau",
|
| 3997 |
+
"iso2": "PW",
|
| 3998 |
+
"color": "#1e40af",
|
| 3999 |
+
"cities": [
|
| 4000 |
+
{
|
| 4001 |
+
"city": "Koror",
|
| 4002 |
+
"coordinates": [
|
| 4003 |
+
134.4792,
|
| 4004 |
+
7.3419
|
| 4005 |
+
],
|
| 4006 |
+
"capital": false,
|
| 4007 |
+
"population": 8744
|
| 4008 |
+
}
|
| 4009 |
+
]
|
| 4010 |
+
},
|
| 4011 |
+
{
|
| 4012 |
+
"code3": "TUV",
|
| 4013 |
+
"country": "Tuvalu",
|
| 4014 |
+
"iso2": "TV",
|
| 4015 |
+
"color": "#FFCE00",
|
| 4016 |
+
"cities": [
|
| 4017 |
+
{
|
| 4018 |
+
"city": "Funafuti",
|
| 4019 |
+
"coordinates": [
|
| 4020 |
+
179.2,
|
| 4021 |
+
-8.5167
|
| 4022 |
+
],
|
| 4023 |
+
"capital": true,
|
| 4024 |
+
"population": 6025
|
| 4025 |
+
}
|
| 4026 |
+
]
|
| 4027 |
+
},
|
| 4028 |
+
{
|
| 4029 |
+
"code3": "LIE",
|
| 4030 |
+
"country": "Liechtenstein",
|
| 4031 |
+
"iso2": "LI",
|
| 4032 |
+
"color": "#dc143c",
|
| 4033 |
+
"cities": [
|
| 4034 |
+
{
|
| 4035 |
+
"city": "Schaan",
|
| 4036 |
+
"coordinates": [
|
| 4037 |
+
9.5097,
|
| 4038 |
+
47.1667
|
| 4039 |
+
],
|
| 4040 |
+
"capital": false,
|
| 4041 |
+
"population": 5998
|
| 4042 |
+
}
|
| 4043 |
+
]
|
| 4044 |
+
},
|
| 4045 |
+
{
|
| 4046 |
+
"code3": "MAF",
|
| 4047 |
+
"country": "Saint Martin",
|
| 4048 |
+
"iso2": "MF",
|
| 4049 |
+
"color": "#15803d",
|
| 4050 |
+
"cities": [
|
| 4051 |
+
{
|
| 4052 |
+
"city": "Marigot",
|
| 4053 |
+
"coordinates": [
|
| 4054 |
+
-63.0847,
|
| 4055 |
+
18.0706
|
| 4056 |
+
],
|
| 4057 |
+
"capital": true,
|
| 4058 |
+
"population": 5700
|
| 4059 |
+
}
|
| 4060 |
+
]
|
| 4061 |
+
},
|
| 4062 |
+
{
|
| 4063 |
+
"code3": "SPM",
|
| 4064 |
+
"country": "Saint Pierre and Miquelon",
|
| 4065 |
+
"iso2": "PM",
|
| 4066 |
+
"color": "#FF0000",
|
| 4067 |
+
"cities": [
|
| 4068 |
+
{
|
| 4069 |
+
"city": "Saint-Pierre",
|
| 4070 |
+
"coordinates": [
|
| 4071 |
+
-56.1778,
|
| 4072 |
+
46.7778
|
| 4073 |
+
],
|
| 4074 |
+
"capital": true,
|
| 4075 |
+
"population": 5394
|
| 4076 |
+
}
|
| 4077 |
+
]
|
| 4078 |
+
},
|
| 4079 |
+
{
|
| 4080 |
+
"code3": "COK",
|
| 4081 |
+
"country": "Cook Islands",
|
| 4082 |
+
"iso2": "CK",
|
| 4083 |
+
"color": "#f59e0b",
|
| 4084 |
+
"cities": [
|
| 4085 |
+
{
|
| 4086 |
+
"city": "Avarua",
|
| 4087 |
+
"coordinates": [
|
| 4088 |
+
-159.771,
|
| 4089 |
+
-21.207
|
| 4090 |
+
],
|
| 4091 |
+
"capital": true,
|
| 4092 |
+
"population": 4009
|
| 4093 |
+
}
|
| 4094 |
+
]
|
| 4095 |
+
},
|
| 4096 |
+
{
|
| 4097 |
+
"code3": "TCA",
|
| 4098 |
+
"country": "Turks and Caicos Islands",
|
| 4099 |
+
"iso2": "TC",
|
| 4100 |
+
"color": "#2563eb",
|
| 4101 |
+
"cities": [
|
| 4102 |
+
{
|
| 4103 |
+
"city": "Grand Turk",
|
| 4104 |
+
"coordinates": [
|
| 4105 |
+
-71.139,
|
| 4106 |
+
21.459
|
| 4107 |
+
],
|
| 4108 |
+
"capital": true,
|
| 4109 |
+
"population": 3700
|
| 4110 |
+
}
|
| 4111 |
+
]
|
| 4112 |
+
},
|
| 4113 |
+
{
|
| 4114 |
+
"code3": "AIA",
|
| 4115 |
+
"country": "Anguilla",
|
| 4116 |
+
"iso2": "AI",
|
| 4117 |
+
"color": "#1e40af",
|
| 4118 |
+
"cities": [
|
| 4119 |
+
{
|
| 4120 |
+
"city": "The Valley",
|
| 4121 |
+
"coordinates": [
|
| 4122 |
+
-63.0517,
|
| 4123 |
+
18.2208
|
| 4124 |
+
],
|
| 4125 |
+
"capital": true,
|
| 4126 |
+
"population": 3269
|
| 4127 |
+
}
|
| 4128 |
+
]
|
| 4129 |
+
},
|
| 4130 |
+
{
|
| 4131 |
+
"code3": "MNP",
|
| 4132 |
+
"country": "Northern Mariana Islands",
|
| 4133 |
+
"iso2": "MP",
|
| 4134 |
+
"color": "#FFCE00",
|
| 4135 |
+
"cities": [
|
| 4136 |
+
{
|
| 4137 |
+
"city": "Capitol Hill",
|
| 4138 |
+
"coordinates": [
|
| 4139 |
+
145.7546,
|
| 4140 |
+
15.2137
|
| 4141 |
+
],
|
| 4142 |
+
"capital": true,
|
| 4143 |
+
"population": 2500
|
| 4144 |
+
}
|
| 4145 |
+
]
|
| 4146 |
+
},
|
| 4147 |
+
{
|
| 4148 |
+
"code3": "BLM",
|
| 4149 |
+
"country": "Saint Barthelemy",
|
| 4150 |
+
"iso2": "BL",
|
| 4151 |
+
"color": "#dc143c",
|
| 4152 |
+
"cities": [
|
| 4153 |
+
{
|
| 4154 |
+
"city": "Gustavia",
|
| 4155 |
+
"coordinates": [
|
| 4156 |
+
-62.8506,
|
| 4157 |
+
17.8979
|
| 4158 |
+
],
|
| 4159 |
+
"capital": true,
|
| 4160 |
+
"population": 2300
|
| 4161 |
+
}
|
| 4162 |
+
]
|
| 4163 |
+
},
|
| 4164 |
+
{
|
| 4165 |
+
"code3": "FLK",
|
| 4166 |
+
"country": "Falkland Islands (Islas Malvinas)",
|
| 4167 |
+
"iso2": "FK",
|
| 4168 |
+
"color": "#15803d",
|
| 4169 |
+
"cities": [
|
| 4170 |
+
{
|
| 4171 |
+
"city": "Stanley",
|
| 4172 |
+
"coordinates": [
|
| 4173 |
+
-57.85,
|
| 4174 |
+
-51.7
|
| 4175 |
+
],
|
| 4176 |
+
"capital": true,
|
| 4177 |
+
"population": 2213
|
| 4178 |
+
}
|
| 4179 |
+
]
|
| 4180 |
+
},
|
| 4181 |
+
{
|
| 4182 |
+
"code3": "SXM",
|
| 4183 |
+
"country": "Sint Maarten",
|
| 4184 |
+
"iso2": "SX",
|
| 4185 |
+
"color": "#FF0000",
|
| 4186 |
+
"cities": [
|
| 4187 |
+
{
|
| 4188 |
+
"city": "Philipsburg",
|
| 4189 |
+
"coordinates": [
|
| 4190 |
+
-63.0458,
|
| 4191 |
+
18.0237
|
| 4192 |
+
],
|
| 4193 |
+
"capital": true,
|
| 4194 |
+
"population": 1894
|
| 4195 |
+
}
|
| 4196 |
+
]
|
| 4197 |
+
},
|
| 4198 |
+
{
|
| 4199 |
+
"code3": "XSV",
|
| 4200 |
+
"country": "Svalbard",
|
| 4201 |
+
"iso2": "XR",
|
| 4202 |
+
"color": "#f59e0b",
|
| 4203 |
+
"cities": [
|
| 4204 |
+
{
|
| 4205 |
+
"city": "Longyearbyen",
|
| 4206 |
+
"coordinates": [
|
| 4207 |
+
15.65,
|
| 4208 |
+
78.22
|
| 4209 |
+
],
|
| 4210 |
+
"capital": true,
|
| 4211 |
+
"population": 1753
|
| 4212 |
+
}
|
| 4213 |
+
]
|
| 4214 |
+
},
|
| 4215 |
+
{
|
| 4216 |
+
"code3": "CXR",
|
| 4217 |
+
"country": "Christmas Island",
|
| 4218 |
+
"iso2": "CX",
|
| 4219 |
+
"color": "#2563eb",
|
| 4220 |
+
"cities": [
|
| 4221 |
+
{
|
| 4222 |
+
"city": "Flying Fish Cove",
|
| 4223 |
+
"coordinates": [
|
| 4224 |
+
105.6728,
|
| 4225 |
+
-10.4261
|
| 4226 |
+
],
|
| 4227 |
+
"capital": true,
|
| 4228 |
+
"population": 1599
|
| 4229 |
+
}
|
| 4230 |
+
]
|
| 4231 |
+
},
|
| 4232 |
+
{
|
| 4233 |
+
"code3": "WLF",
|
| 4234 |
+
"country": "Wallis and Futuna",
|
| 4235 |
+
"iso2": "WF",
|
| 4236 |
+
"color": "#1e40af",
|
| 4237 |
+
"cities": [
|
| 4238 |
+
{
|
| 4239 |
+
"city": "Mata-Utu",
|
| 4240 |
+
"coordinates": [
|
| 4241 |
+
-176.1833,
|
| 4242 |
+
-13.2833
|
| 4243 |
+
],
|
| 4244 |
+
"capital": true,
|
| 4245 |
+
"population": 1029
|
| 4246 |
+
}
|
| 4247 |
+
]
|
| 4248 |
+
},
|
| 4249 |
+
{
|
| 4250 |
+
"code3": "BMU",
|
| 4251 |
+
"country": "Bermuda",
|
| 4252 |
+
"iso2": "BM",
|
| 4253 |
+
"color": "#FFCE00",
|
| 4254 |
+
"cities": [
|
| 4255 |
+
{
|
| 4256 |
+
"city": "Hamilton",
|
| 4257 |
+
"coordinates": [
|
| 4258 |
+
-64.782,
|
| 4259 |
+
32.293
|
| 4260 |
+
],
|
| 4261 |
+
"capital": true,
|
| 4262 |
+
"population": 854
|
| 4263 |
+
}
|
| 4264 |
+
]
|
| 4265 |
+
},
|
| 4266 |
+
{
|
| 4267 |
+
"code3": "VAT",
|
| 4268 |
+
"country": "Vatican City",
|
| 4269 |
+
"iso2": "VA",
|
| 4270 |
+
"color": "#dc143c",
|
| 4271 |
+
"cities": [
|
| 4272 |
+
{
|
| 4273 |
+
"city": "Vatican City",
|
| 4274 |
+
"coordinates": [
|
| 4275 |
+
12.453,
|
| 4276 |
+
41.904
|
| 4277 |
+
],
|
| 4278 |
+
"capital": true,
|
| 4279 |
+
"population": 825
|
| 4280 |
+
}
|
| 4281 |
+
]
|
| 4282 |
+
},
|
| 4283 |
+
{
|
| 4284 |
+
"code3": "NRU",
|
| 4285 |
+
"country": "Nauru",
|
| 4286 |
+
"iso2": "NR",
|
| 4287 |
+
"color": "#15803d",
|
| 4288 |
+
"cities": [
|
| 4289 |
+
{
|
| 4290 |
+
"city": "Yaren",
|
| 4291 |
+
"coordinates": [
|
| 4292 |
+
166.9209,
|
| 4293 |
+
-0.5477
|
| 4294 |
+
],
|
| 4295 |
+
"capital": true,
|
| 4296 |
+
"population": 747
|
| 4297 |
+
}
|
| 4298 |
+
]
|
| 4299 |
+
},
|
| 4300 |
+
{
|
| 4301 |
+
"code3": "SHN",
|
| 4302 |
+
"country": "Saint Helena, Ascension, and Tristan da Cunha",
|
| 4303 |
+
"iso2": "SH",
|
| 4304 |
+
"color": "#FF0000",
|
| 4305 |
+
"cities": [
|
| 4306 |
+
{
|
| 4307 |
+
"city": "Jamestown",
|
| 4308 |
+
"coordinates": [
|
| 4309 |
+
-5.7179,
|
| 4310 |
+
-15.9251
|
| 4311 |
+
],
|
| 4312 |
+
"capital": true,
|
| 4313 |
+
"population": 714
|
| 4314 |
+
}
|
| 4315 |
+
]
|
| 4316 |
+
},
|
| 4317 |
+
{
|
| 4318 |
+
"code3": "NIU",
|
| 4319 |
+
"country": "Niue",
|
| 4320 |
+
"iso2": "NU",
|
| 4321 |
+
"color": "#f59e0b",
|
| 4322 |
+
"cities": [
|
| 4323 |
+
{
|
| 4324 |
+
"city": "Alofi",
|
| 4325 |
+
"coordinates": [
|
| 4326 |
+
-169.921,
|
| 4327 |
+
-19.056
|
| 4328 |
+
],
|
| 4329 |
+
"capital": true,
|
| 4330 |
+
"population": 597
|
| 4331 |
+
}
|
| 4332 |
+
]
|
| 4333 |
+
},
|
| 4334 |
+
{
|
| 4335 |
+
"code3": "MSR",
|
| 4336 |
+
"country": "Montserrat",
|
| 4337 |
+
"iso2": "MS",
|
| 4338 |
+
"color": "#2563eb",
|
| 4339 |
+
"cities": [
|
| 4340 |
+
{
|
| 4341 |
+
"city": "Brades",
|
| 4342 |
+
"coordinates": [
|
| 4343 |
+
-62.2106,
|
| 4344 |
+
16.7928
|
| 4345 |
+
],
|
| 4346 |
+
"capital": true,
|
| 4347 |
+
"population": 391
|
| 4348 |
+
}
|
| 4349 |
+
]
|
| 4350 |
+
},
|
| 4351 |
+
{
|
| 4352 |
+
"code3": "NFK",
|
| 4353 |
+
"country": "Norfolk Island",
|
| 4354 |
+
"iso2": "NF",
|
| 4355 |
+
"color": "#1e40af",
|
| 4356 |
+
"cities": [
|
| 4357 |
+
{
|
| 4358 |
+
"city": "Kingston",
|
| 4359 |
+
"coordinates": [
|
| 4360 |
+
167.9619,
|
| 4361 |
+
-29.0606
|
| 4362 |
+
],
|
| 4363 |
+
"capital": true,
|
| 4364 |
+
"population": 341
|
| 4365 |
+
}
|
| 4366 |
+
]
|
| 4367 |
+
},
|
| 4368 |
+
{
|
| 4369 |
+
"code3": "SGS",
|
| 4370 |
+
"country": "South Georgia and South Sandwich Islands",
|
| 4371 |
+
"iso2": "GS",
|
| 4372 |
+
"color": "#FFCE00",
|
| 4373 |
+
"cities": [
|
| 4374 |
+
{
|
| 4375 |
+
"city": "Grytviken",
|
| 4376 |
+
"coordinates": [
|
| 4377 |
+
-36.508,
|
| 4378 |
+
-54.2806
|
| 4379 |
+
],
|
| 4380 |
+
"capital": false,
|
| 4381 |
+
"population": 99
|
| 4382 |
+
}
|
| 4383 |
+
]
|
| 4384 |
+
},
|
| 4385 |
+
{
|
| 4386 |
+
"code3": "PCN",
|
| 4387 |
+
"country": "Pitcairn Islands",
|
| 4388 |
+
"iso2": "PN",
|
| 4389 |
+
"color": "#dc143c",
|
| 4390 |
+
"cities": [
|
| 4391 |
+
{
|
| 4392 |
+
"city": "Adamstown",
|
| 4393 |
+
"coordinates": [
|
| 4394 |
+
-130.1,
|
| 4395 |
+
-25.0667
|
| 4396 |
+
],
|
| 4397 |
+
"capital": true,
|
| 4398 |
+
"population": 47
|
| 4399 |
+
}
|
| 4400 |
+
]
|
| 4401 |
+
},
|
| 4402 |
+
{
|
| 4403 |
+
"code3": "VIR",
|
| 4404 |
+
"country": "U.S. Virgin Islands",
|
| 4405 |
+
"iso2": "VI",
|
| 4406 |
+
"color": "#15803d",
|
| 4407 |
+
"cities": [
|
| 4408 |
+
{
|
| 4409 |
+
"city": "Charlotte Amalie",
|
| 4410 |
+
"coordinates": [
|
| 4411 |
+
-64.9331,
|
| 4412 |
+
18.342
|
| 4413 |
+
],
|
| 4414 |
+
"capital": true,
|
| 4415 |
+
"population": null
|
| 4416 |
+
}
|
| 4417 |
+
]
|
| 4418 |
+
}
|
| 4419 |
+
]
|
data/country-data.ts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export interface CountryData {
|
| 2 |
+
value: number;
|
| 3 |
+
color?: string;
|
| 4 |
+
}
|
| 5 |
+
|
| 6 |
+
export interface RegionMarker {
|
| 7 |
+
id: string;
|
| 8 |
+
name: string;
|
| 9 |
+
coordinates: [number, number];
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
export const topCountries = [
|
| 13 |
+
{ code: "US", name: "United States", requests: 40774304356, color: "#1e40af" },
|
| 14 |
+
{ code: "DE", name: "Germany", requests: 6211054435, color: "#FFCE00" },
|
| 15 |
+
{ code: "GB", name: "United Kingdom", requests: 4951724702, color: "#2563eb" },
|
| 16 |
+
{ code: "IN", name: "India", requests: 4357156091, color: "#f59e0b" },
|
| 17 |
+
{ code: "BR", name: "Brazil", requests: 3932756153, color: "#FF0000" },
|
| 18 |
+
{ code: "SG", name: "Singapore", requests: 3806778302, color: "#f59e0b" },
|
| 19 |
+
{ code: "JP", name: "Japan", requests: 3690185948, color: "#dc143c" },
|
| 20 |
+
];
|
| 21 |
+
|
| 22 |
+
export const countryRequests: Record<string, CountryData> = {
|
| 23 |
+
US: { value: 40774304356, color: "#1e40af" },
|
| 24 |
+
DE: { value: 6211054435, color: "#FFCE00" },
|
| 25 |
+
GB: { value: 4951724702, color: "#2563eb" },
|
| 26 |
+
IN: { value: 4357156091, color: "#f59e0b" },
|
| 27 |
+
BR: { value: 3932756153, color: "#FF0000" },
|
| 28 |
+
SG: { value: 3806778302, color: "#f59e0b" },
|
| 29 |
+
JP: { value: 3690185948, color: "#dc143c" },
|
| 30 |
+
FR: { value: 3511746816, color: "#1d4ed8" },
|
| 31 |
+
CA: { value: 3308254672, color: "#b91c1c" },
|
| 32 |
+
SE: { value: 2456891234, color: "#2563eb" },
|
| 33 |
+
AU: { value: 2234567890, color: "#3b82f6" },
|
| 34 |
+
KR: { value: 2123456789, color: "#3b82f6" },
|
| 35 |
+
NL: { value: 1987654321, color: "#ea580c" },
|
| 36 |
+
NO: { value: 1876543210, color: "#dc2626" },
|
| 37 |
+
CN: { value: 1765432109, color: "#991b1b" },
|
| 38 |
+
ES: { value: 1654321098, color: "#b91c1c" },
|
| 39 |
+
DK: { value: 1543210987, color: "#dc2626" },
|
| 40 |
+
FI: { value: 1432109876, color: "#3b82f6" },
|
| 41 |
+
IT: { value: 1321098765, color: "#15803d" },
|
| 42 |
+
HK: { value: 1210987654, color: "#b91c1c" },
|
| 43 |
+
IE: { value: 1109876543, color: "#16a34a" },
|
| 44 |
+
PL: { value: 998765432, color: "#dc2626" },
|
| 45 |
+
ID: { value: 887654321, color: "#b91c1c" },
|
| 46 |
+
TH: { value: 776543210, color: "#2563eb" },
|
| 47 |
+
MX: { value: 665432109, color: "#15803d" },
|
| 48 |
+
CH: { value: 554321098, color: "#dc2626" },
|
| 49 |
+
VN: { value: 443210987, color: "#b91c1c" },
|
| 50 |
+
PH: { value: 332109876, color: "#2563eb" },
|
| 51 |
+
TR: { value: 221098765, color: "#b91c1c" },
|
| 52 |
+
BE: { value: 198765432, color: "#525252" },
|
| 53 |
+
AR: { value: 187654321, color: "#3b82f6" },
|
| 54 |
+
AT: { value: 176543210, color: "#dc2626" },
|
| 55 |
+
RU: { value: 165432109, color: "#2563eb" },
|
| 56 |
+
ZA: { value: 154321098, color: "#16a34a" },
|
| 57 |
+
};
|
| 58 |
+
|
| 59 |
+
export const regionMarkers: RegionMarker[] = [
|
| 60 |
+
{ id: "hnd1", name: "Tokyo", coordinates: [139.6922, 35.6897] },
|
| 61 |
+
{ id: "kix1", name: "Osaka", coordinates: [135.5023, 34.6937] },
|
| 62 |
+
{ id: "bom1", name: "Mumbai", coordinates: [72.8775, 19.0761] },
|
| 63 |
+
{ id: "gru1", name: "Sao Paulo", coordinates: [-46.6333, -23.55] },
|
| 64 |
+
{ id: "icn1", name: "Seoul", coordinates: [126.99, 37.56] },
|
| 65 |
+
{ id: "iad1", name: "Virginia", coordinates: [-77.0163, 38.9047] },
|
| 66 |
+
{ id: "sfo1", name: "San Francisco", coordinates: [-122.4449, 37.7558] },
|
| 67 |
+
{ id: "cle1", name: "Cleveland", coordinates: [-81.6805, 41.4764] },
|
| 68 |
+
{ id: "pdx1", name: "Portland", coordinates: [-122.65, 45.5371] },
|
| 69 |
+
{ id: "lhr1", name: "London", coordinates: [-0.1275, 51.5072] },
|
| 70 |
+
{ id: "cdg1", name: "Paris", coordinates: [2.3522, 48.8567] },
|
| 71 |
+
{ id: "cpt1", name: "Cape Town", coordinates: [18.4239, -33.9253] },
|
| 72 |
+
{ id: "hkg1", name: "Hong Kong", coordinates: [114.2, 22.3] },
|
| 73 |
+
{ id: "sin1", name: "Singapore", coordinates: [103.8, 1.3] },
|
| 74 |
+
{ id: "syd1", name: "Sydney", coordinates: [151.21, -33.8678] },
|
| 75 |
+
{ id: "fra1", name: "Frankfurt", coordinates: [8.6822, 50.1106] },
|
| 76 |
+
{ id: "dxb1", name: "Dubai", coordinates: [55.2972, 25.2631] },
|
| 77 |
+
{ id: "arn1", name: "Stockholm", coordinates: [18.0686, 59.3294] },
|
| 78 |
+
{ id: "dub1", name: "Dublin", coordinates: [-6.2603, 53.35] },
|
| 79 |
+
];
|
| 80 |
+
|
| 81 |
+
export const stats = {
|
| 82 |
+
totalRequests: 115832282051,
|
| 83 |
+
totalDeployments: 6120247,
|
| 84 |
+
firewallActions: {
|
| 85 |
+
total: 7507223309,
|
| 86 |
+
systemBlocks: 1398205677,
|
| 87 |
+
systemChallenges: 3171279448,
|
| 88 |
+
customWafBlocks: 328783789,
|
| 89 |
+
},
|
| 90 |
+
botManagement: {
|
| 91 |
+
botsBlocked: 415683895,
|
| 92 |
+
humansVerified: 2408122336,
|
| 93 |
+
},
|
| 94 |
+
cacheHits: 78945678901,
|
| 95 |
+
isrRevalidations: 1234567890,
|
| 96 |
+
aiGatewayRequests: 24086391,
|
| 97 |
+
};
|
| 98 |
+
|
| 99 |
+
export const formatNumber = (num: number): string => {
|
| 100 |
+
return num.toLocaleString("en-US");
|
| 101 |
+
};
|
data/dotted-map-data.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/llm-provider-icons.ts
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export const LOBE_ICON_BASE = "/icons";
|
| 2 |
+
|
| 3 |
+
export const firstRowFeaturedSlugs = [
|
| 4 |
+
"openai",
|
| 5 |
+
"google",
|
| 6 |
+
"anthropic",
|
| 7 |
+
"microsoft",
|
| 8 |
+
"meta",
|
| 9 |
+
"aws",
|
| 10 |
+
"nvidia",
|
| 11 |
+
"huggingface",
|
| 12 |
+
"apple",
|
| 13 |
+
"ibm",
|
| 14 |
+
"alibabacloud",
|
| 15 |
+
"bytedance",
|
| 16 |
+
"github",
|
| 17 |
+
];
|
| 18 |
+
|
| 19 |
+
export const secondRowFeaturedSlugs = [
|
| 20 |
+
"claude",
|
| 21 |
+
"gemini",
|
| 22 |
+
"deepseek",
|
| 23 |
+
"mistral",
|
| 24 |
+
"grok",
|
| 25 |
+
"qwen",
|
| 26 |
+
"bedrock",
|
| 27 |
+
"azureai",
|
| 28 |
+
"groq",
|
| 29 |
+
"moonshot",
|
| 30 |
+
"adobe",
|
| 31 |
+
"cloudflare",
|
| 32 |
+
"googlecloud",
|
| 33 |
+
];
|
| 34 |
+
|
| 35 |
+
export function toLobeSvgUrl(slug: string) {
|
| 36 |
+
const overrides: Record<string, string> = {
|
| 37 |
+
anthropic: `${LOBE_ICON_BASE}/anthropic.svg`,
|
| 38 |
+
openai: `${LOBE_ICON_BASE}/openai.svg`,
|
| 39 |
+
apple: `${LOBE_ICON_BASE}/apple.svg`,
|
| 40 |
+
xiaomi: `${LOBE_ICON_BASE}/xiaomimimo.svg`,
|
| 41 |
+
grok: `${LOBE_ICON_BASE}/grok.svg`,
|
| 42 |
+
ibm: `${LOBE_ICON_BASE}/ibm.svg`,
|
| 43 |
+
zai: `${LOBE_ICON_BASE}/zai.svg`,
|
| 44 |
+
moonshot: `${LOBE_ICON_BASE}/moonshot.svg`,
|
| 45 |
+
xai: `${LOBE_ICON_BASE}/xai.svg`,
|
| 46 |
+
replicate: `${LOBE_ICON_BASE}/replicate.svg`,
|
| 47 |
+
groq: `${LOBE_ICON_BASE}/groq.svg`,
|
| 48 |
+
ollama: `${LOBE_ICON_BASE}/ollama.svg`,
|
| 49 |
+
github: `${LOBE_ICON_BASE}/github.svg`,
|
| 50 |
+
};
|
| 51 |
+
|
| 52 |
+
if (overrides[slug]) {
|
| 53 |
+
return overrides[slug];
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
return `${LOBE_ICON_BASE}/${slug}-color.svg`;
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
export function uniqueSlugs(slugs: string[]) {
|
| 60 |
+
return Array.from(new Set(slugs));
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
export const allLLMProviderSlugs = uniqueSlugs([
|
| 64 |
+
...firstRowFeaturedSlugs,
|
| 65 |
+
...secondRowFeaturedSlugs,
|
| 66 |
+
]);
|
| 67 |
+
|
| 68 |
+
export const providerUrls: Record<string, string> = {
|
| 69 |
+
openai: "https://openai.com",
|
| 70 |
+
chatgpt: "https://chatgpt.com",
|
| 71 |
+
anthropic: "https://anthropic.com",
|
| 72 |
+
claude: "https://claude.ai",
|
| 73 |
+
google: "https://ai.google.dev/",
|
| 74 |
+
gemini: "https://gemini.google.com",
|
| 75 |
+
deepmind: "https://deepmind.google/",
|
| 76 |
+
meta: "https://ai.meta.com/",
|
| 77 |
+
llama: "https://llama.meta.com/",
|
| 78 |
+
mistral: "https://mistral.ai/",
|
| 79 |
+
cohere: "https://cohere.com/",
|
| 80 |
+
xai: "https://x.ai/",
|
| 81 |
+
grok: "https://grok.x.ai/",
|
| 82 |
+
perplexity: "https://www.perplexity.ai/",
|
| 83 |
+
huggingface: "https://huggingface.co/",
|
| 84 |
+
ollama: "https://ollama.com/",
|
| 85 |
+
replicate: "https://replicate.com/",
|
| 86 |
+
together: "https://together.ai/",
|
| 87 |
+
openrouter: "https://openrouter.ai/",
|
| 88 |
+
azureai: "https://azure.microsoft.com/en-us/solutions/ai",
|
| 89 |
+
aws: "https://aws.amazon.com/ai/",
|
| 90 |
+
bedrock: "https://aws.amazon.com/bedrock/",
|
| 91 |
+
nvidia: "https://www.nvidia.com/en-us/ai-data-science/",
|
| 92 |
+
groq: "https://groq.com/",
|
| 93 |
+
cerebras: "https://www.cerebras.net/",
|
| 94 |
+
deepseek: "https://www.deepseek.com/",
|
| 95 |
+
qwen: "https://qwenlm.github.io/",
|
| 96 |
+
lmstudio: "https://lmstudio.ai/",
|
| 97 |
+
vllm: "https://github.com/vllm-project/vllm",
|
| 98 |
+
jan: "https://jan.ai/",
|
| 99 |
+
anythingllm: "https://useanything.com/",
|
| 100 |
+
cloudflare: "https://developers.cloudflare.com/workers-ai/",
|
| 101 |
+
workersai: "https://developers.cloudflare.com/workers-ai/",
|
| 102 |
+
databricks: "https://www.databricks.com/",
|
| 103 |
+
ibm: "https://www.ibm.com/watsonx",
|
| 104 |
+
watsonx: "https://www.ibm.com/watsonx",
|
| 105 |
+
crusoe: "https://crusoe.ai/",
|
| 106 |
+
baseten: "https://baseten.co/",
|
| 107 |
+
modal: "https://modal.com/",
|
| 108 |
+
fireworks: "https://fireworks.ai/",
|
| 109 |
+
deepinfra: "https://deepinfra.com/",
|
| 110 |
+
fal: "https://fal.ai/",
|
| 111 |
+
lepton: "https://www.lepton.ai/",
|
| 112 |
+
edenai: "https://www.edenai.co/",
|
| 113 |
+
googlecloud: "https://cloud.google.com/",
|
| 114 |
+
github: "https://github.com/",
|
| 115 |
+
};
|
| 116 |
+
|
| 117 |
+
export function formatProviderName(slug: string): string {
|
| 118 |
+
const customNames: Record<string, string> = {
|
| 119 |
+
openai: "OpenAI",
|
| 120 |
+
chatgpt: "ChatGPT",
|
| 121 |
+
anthropic: "Anthropic",
|
| 122 |
+
xai: "xAI",
|
| 123 |
+
deepmind: "DeepMind",
|
| 124 |
+
azureai: "Azure AI",
|
| 125 |
+
googlecloud: "Google Cloud",
|
| 126 |
+
vertexai: "Vertex AI",
|
| 127 |
+
alibabacloud: "Alibaba Cloud",
|
| 128 |
+
aws: "AWS",
|
| 129 |
+
ibm: "IBM",
|
| 130 |
+
lmstudio: "LM Studio",
|
| 131 |
+
vllm: "vLLM",
|
| 132 |
+
llamacpp: "llama.cpp",
|
| 133 |
+
gpt4all: "GPT4All",
|
| 134 |
+
openrouter: "OpenRouter",
|
| 135 |
+
huggingface: "Hugging Face",
|
| 136 |
+
anythingllm: "AnythingLLM",
|
| 137 |
+
modelscope: "ModelScope",
|
| 138 |
+
sillytavern: "SillyTavern",
|
| 139 |
+
openwebui: "Open WebUI",
|
| 140 |
+
textgenerationwebui: "Text Gen WebUI",
|
| 141 |
+
localai: "LocalAI",
|
| 142 |
+
koboldcpp: "KoboldCPP",
|
| 143 |
+
chatglm: "ChatGLM",
|
| 144 |
+
"01": "01.AI",
|
| 145 |
+
"01ai": "01.AI",
|
| 146 |
+
ai21: "AI21 Labs",
|
| 147 |
+
alephalpha: "Aleph Alpha",
|
| 148 |
+
essentialai: "Essential AI",
|
| 149 |
+
workersai: "Workers AI",
|
| 150 |
+
aimlapi: "AIML API",
|
| 151 |
+
cometapi: "Comet API",
|
| 152 |
+
aionlabs: "AION Labs",
|
| 153 |
+
aihummix: "AI Hum Mix",
|
| 154 |
+
stepfun: "StepFun",
|
| 155 |
+
github: "GitHub",
|
| 156 |
+
};
|
| 157 |
+
|
| 158 |
+
if (customNames[slug]) return customNames[slug];
|
| 159 |
+
|
| 160 |
+
// Default title case
|
| 161 |
+
return slug.charAt(0).toUpperCase() + slug.slice(1);
|
| 162 |
+
}
|
icons_list.txt
ADDED
|
File without changes
|
lib/utils.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { clsx, type ClassValue } from "clsx"
|
| 2 |
+
import { twMerge } from "tailwind-merge"
|
| 3 |
+
|
| 4 |
+
export function cn(...inputs: ClassValue[]) {
|
| 5 |
+
return twMerge(clsx(inputs))
|
| 6 |
+
}
|