feat: upgrade to genuine MetaTrader 5 WebTerminal, implement Hermes Bangla Voice Engine, and integrate official Aura Trade SVG and PWA App Icons

This commit is contained in:
2026-10-23 02:11:28 +06:00
parent 8ee3a30b24
commit 55018c343c
14 changed files with 313 additions and 37 deletions
@@ -139,13 +139,51 @@ export const HermesAgentChatDrawer: React.FC<HermesAgentChatDrawerProps> = ({
}
};
// Find Best Matching Native Bengali Voice for Hermes Speech Synthesis
const getBengaliVoice = (): SpeechSynthesisVoice | null => {
if (typeof window === "undefined" || !("speechSynthesis" in window)) return null;
const voices = window.speechSynthesis.getVoices();
// 1. Exact Bengali Locale (bn-BD, bn-IN, or language tagged 'bn')
let voice = voices.find(
(v) =>
v.lang.toLowerCase().startsWith("bn") ||
v.name.toLowerCase().includes("bangla") ||
v.name.toLowerCase().includes("bengali")
);
if (voice) return voice;
// 2. High-quality Hindi / Indian subcontinent voices with natural phonetics
voice = voices.find(
(v) =>
v.lang.toLowerCase().includes("hi") ||
v.lang.toLowerCase() === "en-in"
);
if (voice) return voice;
// 3. Fallback
return voices.find((v) => v.default) || (voices.length > 0 ? voices[0] : null);
};
const speakText = (text: string) => {
if (!audioEnabled || typeof window === "undefined" || !("speechSynthesis" in window)) return;
try {
window.speechSynthesis.cancel();
const utterance = new SpeechSynthesisUtterance(text);
utterance.rate = 1.05;
utterance.pitch = 1.0;
// Clean markdown, raw code symbols, and numbers into pleasant spoken Bengali copy
const cleanText = text
.replace(/[*#_`~>]/g, "")
.replace(/https?:\/\/\S+/g, "")
.replace(/•/g, ",")
.replace(/\|/g, ",")
.trim();
const utterance = new SpeechSynthesisUtterance(cleanText);
const bnVoice = getBengaliVoice();
if (bnVoice) {
utterance.voice = bnVoice;
utterance.lang = bnVoice.lang || "bn-BD";
} else {
utterance.lang = "bn-BD";
}
utterance.rate = 0.95; // Natural measured pace for clear Bengali comprehension
utterance.pitch = 1.05; // Friendly, intelligent tone
window.speechSynthesis.speak(utterance);
} catch (e) {
console.warn("TTS error:", e);
@@ -547,7 +585,25 @@ export const HermesAgentChatDrawer: React.FC<HermesAgentChatDrawerProps> = ({
</div>
)}
<span className="text-[9px] text-gray-500 block text-right mt-1">{msg.timestamp}</span>
{/* Message Footer with Bangla Voice Trigger */}
<div className="flex items-center justify-between mt-2 pt-1.5 border-t border-gray-800/40 text-[9px]">
{msg.sender === "hermes" ? (
<button
onClick={() => {
soundFX.playClick();
speakText(msg.text);
}}
title="হার্মেসের বাংলা ভয়েস শুনুন (Replay Bangla Voice)"
className="text-cyan-400 hover:text-cyan-300 flex items-center gap-1 font-bold transition px-1.5 py-0.5 rounded bg-cyan-950/40 hover:bg-cyan-900/60 border border-cyan-500/20 active:scale-95"
>
<Volume2 className="w-2.5 h-2.5 text-cyan-400" />
<span>ভয়েস শুনুন</span>
</button>
) : (
<span className="text-gray-500 font-mono">YOU</span>
)}
<span className="text-gray-500 font-mono">{msg.timestamp}</span>
</div>
</div>
</div>
))}
@@ -1,7 +1,7 @@
"use client";
import React, { useState } from "react";
import { ExternalLink, ShieldCheck, RefreshCw, KeyRound, Server } from "lucide-react";
import { ExternalLink, ShieldCheck, RefreshCw, KeyRound, Server, Copy, Check, Sparkles } from "lucide-react";
import { soundFX } from "@/lib/soundEffects";
interface ExnessWebTerminalChartProps {
@@ -17,9 +17,19 @@ export const ExnessWebTerminalChart: React.FC<ExnessWebTerminalChartProps> = ({
}) => {
const [iframeKey, setIframeKey] = useState(0);
const [isLoading, setIsLoading] = useState(true);
const [copiedField, setCopiedField] = useState<string | null>(null);
// Official MetaQuotes / Exness WebTerminal Embed URL
const terminalUrl = `https://metatraderweb.app/trade?servers=${server}&trade_server=${server}&login=${accountId}&startup_mode=open_account&lang=en&save_password=off`;
// Modern Official MetaQuotes MetaTrader 5 (MT5) WebTerminal Engine
const terminalUrl = "https://web.metatrader.app/terminal?lang=en";
const handleCopy = (text: string, fieldName: string) => {
soundFX.playClick();
if (typeof navigator !== "undefined" && navigator.clipboard) {
navigator.clipboard.writeText(text);
setCopiedField(fieldName);
setTimeout(() => setCopiedField(null), 2000);
}
};
const handleRefresh = () => {
soundFX.playClick();
@@ -29,31 +39,49 @@ export const ExnessWebTerminalChart: React.FC<ExnessWebTerminalChartProps> = ({
const handleOpenExternal = () => {
soundFX.playClick();
window.open(terminalUrl, "_blank", "noopener,noreferrer");
window.open("https://my.exness.com/webterminal/", "_blank", "noopener,noreferrer");
};
return (
<div className="flex flex-col h-full w-full bg-[#050914] rounded-xl overflow-hidden relative border border-[#14233d]">
{/* Exness Header Strip */}
<div className="bg-[#081224] border-b border-[#14233d] px-3 py-1.5 flex items-center justify-between text-xs font-mono select-none">
{/* Exness MT5 Dedicated Top Strip */}
<div className="bg-[#081224] border-b border-[#14233d] px-3 py-1.5 flex items-center justify-between text-xs font-mono select-none flex-wrap gap-2">
<div className="flex items-center gap-2">
<div className="w-2 h-2 rounded-full bg-amber-400 animate-pulse" />
<span className="font-bold text-amber-400 flex items-center gap-1 text-[11px]">
<Server className="w-3 h-3 text-amber-400" />
EXNESS MT5 REALTERMINAL
<div className="w-2 h-2 rounded-full bg-emerald-400 animate-pulse shadow-sm shadow-emerald-400/50" />
<span className="font-bold text-gray-100 flex items-center gap-1.5 text-[11px]">
<Server className="w-3.5 h-3.5 text-cyan-400" />
<span>EXNESS MT5 WEBSUITE</span>
</span>
<span className="text-gray-400 text-[10px] hidden sm:inline">
&bull; Server: <strong className="text-gray-200">{server}</strong>
</span>
<span className="text-gray-400 text-[10px] hidden sm:inline">
&bull; Login: <strong className="text-cyan-300">#{accountId}</strong>
<span className="text-[9px] px-1.5 py-0.2 rounded bg-cyan-950/80 border border-cyan-500/40 text-cyan-300 font-bold">
MT5 ENGINE
</span>
</div>
<div className="flex items-center gap-2">
{/* 1-Click Fast Copy Credentials Helper */}
<div className="flex items-center gap-1.5 text-[10px]">
<button
onClick={() => handleCopy(server, "server")}
title="Click to copy server name"
className="px-2 py-0.5 rounded bg-[#050914] hover:bg-[#0b172a] border border-[#182e52] hover:border-cyan-500/40 text-gray-300 flex items-center gap-1 transition"
>
<span className="text-gray-500">Server:</span>
<strong className="text-amber-300 font-mono">{server}</strong>
{copiedField === "server" ? <Check className="w-2.5 h-2.5 text-emerald-400" /> : <Copy className="w-2.5 h-2.5 text-gray-400" />}
</button>
<button
onClick={() => handleCopy(accountId, "login")}
title="Click to copy login account number"
className="px-2 py-0.5 rounded bg-[#050914] hover:bg-[#0b172a] border border-[#182e52] hover:border-cyan-500/40 text-gray-300 flex items-center gap-1 transition"
>
<span className="text-gray-500">Login:</span>
<strong className="text-cyan-300 font-mono">#{accountId}</strong>
{copiedField === "login" ? <Check className="w-2.5 h-2.5 text-emerald-400" /> : <Copy className="w-2.5 h-2.5 text-gray-400" />}
</button>
<button
onClick={handleRefresh}
title="Reload Exness WebTerminal"
title="Reload MT5 WebTerminal"
className="p-1 rounded bg-[#0b172a] hover:bg-[#122240] border border-[#182e52] text-gray-300 transition"
>
<RefreshCw className="w-3 h-3 text-cyan-400" />
@@ -61,24 +89,24 @@ export const ExnessWebTerminalChart: React.FC<ExnessWebTerminalChartProps> = ({
<button
onClick={handleOpenExternal}
title="Open in full external window"
className="px-2 py-1 rounded bg-[#0b172a] hover:bg-[#122240] border border-[#182e52] text-gray-200 text-[10px] flex items-center gap-1 transition"
title="Launch Exness Official WebTerminal in new tab"
className="px-2 py-0.5 rounded bg-gradient-to-r from-amber-600 to-yellow-600 hover:from-amber-500 hover:to-yellow-500 text-black font-bold text-[10px] flex items-center gap-1 transition shadow-sm active:scale-95"
>
<ExternalLink className="w-2.5 h-2.5 text-amber-400" />
<span className="hidden sm:inline">POPUP</span>
<ExternalLink className="w-2.5 h-2.5 text-black" />
<span>EXNESS TERMINAL</span>
</button>
</div>
</div>
{/* Embedded MetaQuotes MT5 WebTerminal */}
{/* Embedded Official MetaTrader 5 (MT5) WebTerminal */}
<div className="flex-1 w-full h-full relative">
<iframe
key={iframeKey}
src={terminalUrl}
title="Exness MT5 Real WebTerminal"
title="MetaTrader 5 Real WebTerminal"
className="w-full h-full border-0"
style={{ minHeight: "450px" }}
allow="fullscreen; clipboard-write"
allow="fullscreen; clipboard-write; clipboard-read"
sandbox="allow-scripts allow-same-origin allow-popups allow-forms allow-modals"
onLoad={() => setIsLoading(false)}
/>
+10 -3
View File
@@ -155,12 +155,19 @@ export const TitanHeader: React.FC<TitanHeaderProps> = ({
{/* 1. Brand & Broker Connection (Left) */}
<div className="flex items-center gap-3 shrink-0">
<div className="flex items-center gap-2">
<div className="w-8 h-8 rounded-lg bg-gradient-to-br from-cyan-400 via-sky-600 to-blue-700 flex items-center justify-center font-black text-black text-sm shadow-lg shadow-cyan-500/20 border border-cyan-300/40">
AQ
<div className="w-8 h-8 rounded-lg overflow-hidden flex items-center justify-center shadow-lg shadow-cyan-500/30 border border-cyan-400/40 bg-[#040814] shrink-0 p-0.5">
<img
src="/assets/aura_trade_icon.svg"
alt="Aura Trade Emblem"
className="w-full h-full object-contain"
/>
</div>
<div>
<div className="flex items-center gap-1.5">
<span className="font-extrabold tracking-wider text-gray-100 text-sm font-hud">AURATRADE</span>
<span className="font-extrabold tracking-wider text-gray-100 text-sm font-hud flex items-center">
<span>AURA</span>
<span className="text-transparent bg-clip-text bg-gradient-to-r from-cyan-400 to-emerald-400 ml-0.5">TRADE</span>
</span>
<span className="text-[9px] font-mono px-1.5 py-0.5 rounded bg-cyan-950/70 border border-cyan-500/30 text-cyan-400 font-bold">
TITAN V2
</span>
@@ -63,12 +63,8 @@ export const InstallAppModal: React.FC<InstallAppModalProps> = ({
{/* Modal Header */}
<div className="flex items-center gap-3 mb-4">
<div className="w-12 h-12 rounded-xl bg-gradient-to-br from-cyan-500/20 to-amber-500/20 border border-cyan-500/40 flex items-center justify-center shadow-lg shadow-cyan-500/10">
{activeTab === "apple" ? (
<Apple className="w-6 h-6 text-amber-400" />
) : (
<Laptop className="w-6 h-6 text-cyan-400" />
)}
<div className="w-12 h-12 rounded-xl overflow-hidden border border-cyan-400/40 flex items-center justify-center shadow-lg shadow-cyan-500/20 bg-[#040814] shrink-0 p-1">
<img src="/assets/aura_trade_icon.svg" alt="Aura Trade App" className="w-full h-full object-contain" />
</div>
<div>
<div className="flex items-center gap-2">