import React, { useState, useEffect, useRef } from 'react';
import ReactDOM from 'react-dom/client';
import { GoogleGenAI } from "@google/genai";
// --- AI LOGIC ---
const askAI = async (prompt: string) => {
// Re-initialize to ensure latest context
const ai = new GoogleGenAI({ apiKey: process.env.API_KEY || "" });
try {
const response = await ai.models.generateContent({
model: 'gemini-3-flash-preview',
contents: prompt,
config: {
systemInstruction: "You are the senior investment advisor at Crown Bankers. You specialize in solar energy ROI, financial diversification, and wealth management. Be professional, sophisticated, and encouraging. Disclaimer: This is for informational purposes only.",
temperature: 0.8,
},
});
return response.text;
} catch (err) {
console.error(err);
return "I'm currently reviewing our market data. Please try again or contact our human specialists.";
}
};
// --- SUB-COMPONENTS ---
const Navbar = () => {
const [scrolled, setScrolled] = useState(false);
const [isMenuOpen, setIsMenuOpen] = useState(false);
useEffect(() => {
const handle = () => setScrolled(window.scrollY > 50);
window.addEventListener('scroll', handle);
return () => window.removeEventListener('scroll', handle);
}, []);
return (
window.scrollTo(0,0)}>
CROWN
BANKERS
Portal
Join Now
setIsMenuOpen(!isMenuOpen)}>
{isMenuOpen && (
)}
);
};
const Hero = () => (
Empowering Sustainable Wealth β’ Since 2019
WE INVEST IN THE
NEXT GENERATION.
Laying the global foundation for premium solar infrastructure. By 2026, we will be the world leader in clean energy investment solutions.
Invest Now
Explore Projects
);
const Ticker = () => {
const items = [
{ l: "BTC/USD", v: "94,210.50", c: "+1.2%" },
{ l: "SOL/USD", v: "228.42", c: "+4.5%" },
{ l: "EUR/USD", v: "1.0821", c: "-0.05%" },
{ l: "S&P 500", v: "6,002.14", c: "+0.14%" },
{ l: "GOLD/OZ", v: "2,634.11", c: "-0.21%" },
{ l: "ETH/USD", v: "3,142.10", c: "+0.8%" }
];
const list = [...items, ...items, ...items];
return (
{list.map((it, i) => (
{it.l}
{it.v}
{it.c}
))}
);
};
const Features = () => (
Pioneering Solar Future.
With 7+ years of elite market experience, we're building infrastructure that powers progress while protecting the planet.
{[
{ t: "Strategic Innovation", d: "High-security facilities meeting global standards for certified solar energy production.", i: "βοΈ" },
{ t: "Recognized Excellence", d: "Award-winning approach to global supply chains and complex energy markets.", i: "π" },
{ t: "Reliable Growth", d: "Cutting-edge testing and rigorous quality control for maximum investment safety.", i: "π‘οΈ" }
].map((f, i) => (
))}
);
const InvestmentPackages = () => {
const pkgs = [
{ name: "Solar Starter", price: "$25 - $2,499", yield: "1.5% - 1.8%", duration: "150 Days", total: "225% - 270%", ref: "7%", binary: "10%", icon: "π" },
{ name: "Power Growth", price: "$2,500 - $19,999", yield: "1.8% - 2.1%", duration: "140 Days", total: "252% - 294%", ref: "8%", binary: "10%", icon: "β‘", featured: true },
{ name: "Elite Energy", price: "$20,000 - $50,000", yield: "2.1% - 2.4%", duration: "130 Days", total: "273% - 312%", ref: "9%", binary: "10%", icon: "π" }
];
return (
Yield & Investment.
Curated financial portfolios designed for the modern eco-conscious investor. High yields, professional management, and total transparency.
{pkgs.map((p, i) => (
{p.icon}
{p.name}
Investment Plan
{p.price}
Daily Yield
{p.yield}
Duration
{p.duration}
Total Return
{p.total}
Referral
{p.ref}
Binary Bonus
{p.binary}
Invest Today
))}
);
};
const EarningsCalculator = () => {
const [val, setVal] = useState('');
const [res, setRes] = useState(null);
const calc = () => {
const n = parseFloat(val);
if (n >= 25 && n <= 50000) setRes(n * 0.019);
else setRes(null);
};
return (
Forecast Earnings.
Calculate Returns
{res && (
Estimated Daily Profit:
${res.toFixed(2)}
)}
Historical Performance Indicator Only.
);
};
const Testimonials = () => (
Voices of Trust.
{[
{ n: "Alex Ross", f: "πΊπΈ", t: "Crown Bankers redefined my approach to asset management. Reliability is their core DNA.", i: "https://i.pravatar.cc/150?u=alex" },
{ n: "Bingwen Chen", f: "π¨π³", t: "Expert financial guidance combined with nature-friendly vision. A perfect partner.", i: "https://i.pravatar.cc/150?u=bing" },
{ n: "Jett Kenney", f: "π©π°", t: "Transparent, profitable, and professional. Best-in-class support for global investors.", i: "https://i.pravatar.cc/150?u=jett" }
].map((r, i) => (
))}
);
const AIAssistant = () => {
const [open, setOpen] = useState(false);
const [msgs, setMsgs] = useState<{r: 'u'|'a', c: string}[]>([]);
const [input, setInput] = useState('');
const [loading, setLoading] = useState(false);
const scroll = useRef(null);
useEffect(() => { if(scroll.current) scroll.current.scrollTop = scroll.current.scrollHeight; }, [msgs]);
const handleSend = async () => {
if(!input.trim() || loading) return;
const userMsg = { r: 'u' as const, c: input };
setMsgs(p => [...p, userMsg]);
setInput('');
setLoading(true);
const reply = await askAI(input);
setMsgs(p => [...p, { r: 'a' as const, c: reply || "I'm sorry, I'm having trouble thinking." }]);
setLoading(false);
};
return (
<>
setOpen(!open)} className="fixed bottom-8 left-8 z-[200] w-16 h-16 bg-green-600 rounded-full flex items-center justify-center shadow-2xl hover:scale-110 active:scale-95 transition-all border-4 border-white">
π¬
{open && (
CA
Crown AI Advisor
Direct Protocol
setOpen(false)} className="text-3xl opacity-50 hover:opacity-100">Γ
{msgs.length === 0 && (
Hello. I am the Crown AI protocols engine. How can I assist your financial journey?
)}
{msgs.map((m, i) => (
))}
{loading &&
}
)}
>
);
};
const Footer = () => (
);
// --- MAIN APP COMPONENT ---
const App = () => (
Sustainable Growth Protocols.
Crown Bankers provides elite-level banking and investment infrastructure. By bridging renewable energy with sophisticated finance, we ensure your wealth grows in harmony with the planet.
Infrastructure Ready
Q1 2026
);
// --- MOUNTING ---
const rootElement = document.getElementById('root');
if (rootElement) {
const root = ReactDOM.createRoot(rootElement);
root.render( );
}