Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 22 additions & 5 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,30 @@

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* global.css mein sabse upar ye change karo */

:root {
/* --- LIGHT THEME (Default) --- */
--bg: #ffffff;
--surface: #f8f9fa;
--border: #e2e8f0;
--brand: #5B54B8;
--brand-hover: #4a44a3;
--muted: #64748b;
--accent: #5B54B8;
--text: #0f172a;
--card: rgba(255,255,255,0.8);
--card-solid: #ffffff;
--card-border: rgba(0,0,0,0.1);
}

.dark {
/* --- DARK THEME (Jo pehle root mein tha) --- */
--bg: #0e0c1e;
--surface: #1a1730;
--border: #2a2550;
--brand: #5B54B8;
--brand-hover: #7A74CC;
--brand-dark: #3F3A8A;
--muted: #a9a5c4;
--accent: #9d97e8;
--text: #ffffff;
Expand Down Expand Up @@ -57,12 +74,12 @@ body::after {

/* Glassmorphism card */
.glass-card {
background: rgba(30,27,56,0.5);
background: var(--card); /* var use karo, hardcoded rgba nahi */
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border: 1px solid rgba(91,84,184,0.15);
transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
border: 1px solid var(--card-border);
/* ... rest same */
}

.glass-card:hover {
border-color: rgba(91,84,184,0.35);
box-shadow: 0 0 30px -8px rgba(91,84,184,0.25);
Expand Down
148 changes: 88 additions & 60 deletions src/components/marketing/Nav.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client'
import { useState } from 'react'
import { useState, useEffect } from 'react'
import Link from 'next/link'
import { usePathname } from 'next/navigation'
import { Menu, X, Sparkles, Crown, ChevronRight } from 'lucide-react'
import { Menu, X, Sparkles, Crown, ChevronRight, Moon, Sun } from 'lucide-react'
import { ConplyLogo } from '@/components/ui/ConplyLogo'
import { JurisdictionFlag } from '@/components/ui/JurisdictionFlag'
import { BOOKING_URL } from '@/lib/constants'
Expand All @@ -14,8 +14,8 @@ const LINKS = [
]

type Jurisdiction = {
slug: 'gibraltar' | 'luxembourg'
label: string
slug: 'gibraltar' | 'luxembourg'
label: string
regulator: string
}

Expand All @@ -26,30 +26,55 @@ const JURISDICTIONS: Jurisdiction[] = [

const TIERS = [
{ slug: 'pro', label: 'Pro', tag: 'Premium', desc: 'Team-wide compliance training', icon: Sparkles, color: '#a78bfa' },
{ slug: 'genius', label: 'Genius', tag: 'Platinum', desc: 'Personalised learning journeys per user', icon: Crown, color: '#fbbf24' },
{ slug: 'genius', label: 'Genius', tag: 'Platinum', desc: 'Personalised learning journeys per user', icon: Crown, color: '#fbbf24' },
]

export function Nav() {
const pathname = usePathname()
const [open, setOpen] = useState(false)
const [productsOpen, setProductsOpen] = useState(false)
const [hoveredJx, setHoveredJx] = useState<'gibraltar' | 'luxembourg' | null>(null)

// Dark theme state
const [theme, setTheme] = useState<string | null>(null)

// 1. Initial theme load (client-side only)
useEffect(() => {
const saved = localStorage.getItem("theme") || "light"
setTheme(saved)
}, [])

// 2. Apply theme to HTML tag
useEffect(() => {
if (!theme) return

if (theme === "dark") {
document.documentElement.classList.add("dark")
} else {
document.documentElement.classList.remove("dark")
}
localStorage.setItem("theme", theme)
}, [theme])

const isActive = (href: string) =>
href === pathname || pathname.startsWith(href + '/')

const isProductsActive = pathname.startsWith('/products')

// Theme toggle function
const toggleTheme = () => {
setTheme(prev => (prev === "dark" ? "light" : "dark"))
}

return (
<nav className="px-6 py-4 max-w-6xl mx-auto">
<div className="flex items-center justify-between">
<Link href="/" className="flex items-center" onClick={() => setOpen(false)}>
<ConplyLogo size="sm" />
</Link>

{/* Desktop */}
{/* Desktop Navigation */}
<div className="hidden md:flex items-center gap-1">
{/* Products dropdown, cascading */}
<div
className="relative"
onMouseEnter={() => setProductsOpen(true)}
Expand All @@ -72,11 +97,7 @@ export function Nav() {
{JURISDICTIONS.map(j => {
const active = hoveredJx === j.slug
return (
<div
key={j.slug}
onMouseEnter={() => setHoveredJx(j.slug)}
className="relative"
>
<div key={j.slug} onMouseEnter={() => setHoveredJx(j.slug)} className="relative">
<div
className="flex items-center justify-between gap-3 px-3 py-2.5 rounded-lg cursor-pointer transition-colors"
style={{ background: active ? 'rgba(91,84,184,0.1)' : 'transparent' }}
Expand All @@ -95,7 +116,6 @@ export function Nav() {
<ChevronRight className="w-3.5 h-3.5" style={{ color: active ? 'var(--accent)' : 'var(--muted)', opacity: active ? 1 : 0.5 }} />
</div>

{/* Flyout aligned to this row */}
{active && (
<div
className="absolute top-0 rounded-xl p-2 w-72"
Expand All @@ -116,8 +136,6 @@ export function Nav() {
onClick={() => { setProductsOpen(false); setHoveredJx(null) }}
className="flex items-start gap-3 px-3 py-3 rounded-lg transition-colors"
style={{ background: isActive(href) ? 'rgba(91,84,184,0.1)' : 'transparent' }}
onMouseEnter={e => (e.currentTarget.style.background = 'rgba(91,84,184,0.08)')}
onMouseLeave={e => (e.currentTarget.style.background = isActive(href) ? 'rgba(91,84,184,0.1)' : 'transparent')}
>
<div
className="w-9 h-9 rounded-lg flex items-center justify-center flex-shrink-0 mt-0.5"
Expand All @@ -127,19 +145,15 @@ export function Nav() {
</div>
<div>
<div className="flex items-center gap-2 mb-0.5">
<span className="text-sm font-semibold" style={{ color: 'var(--text)' }}>
{t.label}
</span>
<span className="text-sm font-semibold" style={{ color: 'var(--text)' }}>{t.label}</span>
<span
className="text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded"
style={{ background: `${t.color}20`, color: t.color }}
>
{t.tag}
</span>
</div>
<p className="text-xs leading-relaxed" style={{ color: 'var(--muted)' }}>
{t.desc}
</p>
<p className="text-xs leading-relaxed" style={{ color: 'var(--muted)' }}>{t.desc}</p>
</div>
</Link>
)
Expand All @@ -154,30 +168,35 @@ export function Nav() {
)}
</div>

{LINKS.map(link => {
const active = isActive(link.href)
return (
<Link
key={link.href}
href={link.href}
className="text-sm px-3 py-2 rounded-lg transition-colors"
style={{
color: active ? 'var(--text)' : 'var(--muted)',
background: active ? 'rgba(91,84,184,0.08)' : 'transparent',
}}
>
{link.label}
</Link>
)
})}
<Link
href="/auth"
className="text-sm px-3 py-2 rounded-lg transition-colors"
style={{ color: 'var(--muted)' }}
>
{LINKS.map(link => (
<Link
key={link.href}
href={link.href}
className="text-sm px-3 py-2 rounded-lg transition-colors"
style={{
color: isActive(link.href) ? 'var(--text)' : 'var(--muted)',
background: isActive(link.href) ? 'rgba(91,84,184,0.08)' : 'transparent',
}}
>
{link.label}
</Link>
))}

<Link href="/auth" className="text-sm px-3 py-2 rounded-lg transition-colors" style={{ color: 'var(--muted)' }}>
Log in
</Link>

<div className="w-px h-5 mx-1" style={{ background: 'var(--border)' }} />

{/* Theme Toggle Button */}
<button
onClick={toggleTheme}
className="p-2 rounded-lg transition-colors hover:bg-gray-100 dark:hover:bg-gray-800"
title="Toggle theme"
>
{theme === "dark" ? <Sun size={18} className="text-yellow-400" /> : <Moon size={18} className="text-slate-600" />}
</button>

<a
href={BOOKING_URL} target="_blank" rel="noopener noreferrer"
className="text-sm font-semibold px-4 py-2 rounded-lg transition-colors text-white ml-1"
Expand All @@ -201,6 +220,16 @@ export function Nav() {
{/* Mobile drawer */}
{open && (
<div className="md:hidden pt-6 pb-2 space-y-1">
{/* Mobile Theme Toggle */}
<div className="px-3 pb-4">
<button
onClick={toggleTheme}
className="flex items-center gap-2 text-sm font-medium w-full p-2 rounded-lg border border-gray-200 dark:border-gray-700"
>
{theme === "dark" ? <><Sun size={16} /> Light Mode</> : <><Moon size={16} /> Dark Mode</>}
</button>
</div>

{JURISDICTIONS.map(j => (
<div key={j.slug} className="space-y-1">
<div className="flex items-center gap-2.5 px-3 pt-3 pb-1">
Expand Down Expand Up @@ -239,23 +268,21 @@ export function Nav() {

<div className="h-px my-3" style={{ background: 'var(--border)' }} />

{LINKS.map(link => {
const active = isActive(link.href)
return (
<Link
key={link.href}
href={link.href}
onClick={() => setOpen(false)}
className="block px-3 py-2.5 rounded-lg text-sm transition-colors"
style={{
color: active ? 'var(--text)' : 'var(--muted)',
background: active ? 'rgba(91,84,184,0.1)' : 'transparent',
}}
>
{link.label}
</Link>
)
})}
{LINKS.map(link => (
<Link
key={link.href}
href={link.href}
onClick={() => setOpen(false)}
className="block px-3 py-2.5 rounded-lg text-sm transition-colors"
style={{
color: isActive(link.href) ? 'var(--text)' : 'var(--muted)',
background: isActive(link.href) ? 'rgba(91,84,184,0.1)' : 'transparent',
}}
>
{link.label}
</Link>
))}

<Link
href="/auth"
onClick={() => setOpen(false)}
Expand All @@ -264,6 +291,7 @@ export function Nav() {
>
Log in
</Link>

<div className="pt-3">
<a
href={BOOKING_URL} target="_blank" rel="noopener noreferrer"
Expand All @@ -278,4 +306,4 @@ export function Nav() {
)}
</nav>
)
}
}
3 changes: 2 additions & 1 deletion tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Config } from 'tailwindcss'

const config: Config = {
darkMode: "class", // ADD
content: ['./src/**/*.{ts,tsx}'],
theme: {
extend: {
Expand Down Expand Up @@ -31,4 +32,4 @@ const config: Config = {
plugins: [],
}

export default config
export default config