feat: add PWA 1-click install, Apple iOS Add-to-Home-Screen guide modal, manifest, and service worker

This commit is contained in:
2026-10-23 00:23:16 +06:00
parent e8ee5e8ac2
commit 5a79667bf7
11 changed files with 412 additions and 4 deletions
+43 -3
View File
@@ -1,9 +1,27 @@
import "./globals.css";
import type { Metadata } from "next";
import type { Metadata, Viewport } from "next";
export const viewport: Viewport = {
themeColor: "#030712",
width: "device-width",
initialScale: 1,
maximumScale: 1,
userScalable: false,
};
export const metadata: Metadata = {
title: "AuraTrade // Institutional Quant Terminal",
description: "High-Frequency Trading Terminal & Sentinel Risk Firewall for Exness MT5",
description: "High-Frequency Quantitative Trading Terminal & Sentinel Risk Firewall for Exness MT5",
manifest: "/manifest.json",
appleWebApp: {
capable: true,
statusBarStyle: "black-translucent",
title: "AuraTrade",
},
icons: {
icon: "/icons/icon-192x192.png",
apple: "/icons/apple-touch-icon.png",
},
};
export default function RootLayout({
@@ -13,8 +31,30 @@ export default function RootLayout({
}) {
return (
<html lang="en" className="dark">
<body className="bg-darkBg text-gray-100 min-h-screen antialiased">
<head>
<link rel="manifest" href="/manifest.json" />
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="AuraTrade" />
<meta name="mobile-web-app-capable" content="yes" />
</head>
<body className="bg-darkBg text-gray-100 min-h-screen antialiased selection:bg-cyan-500/20">
{children}
<script
dangerouslySetInnerHTML={{
__html: `
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('/sw.js').then(
function(reg) { console.log('AuraTrade PWA ServiceWorker registered'); },
function(err) { console.log('AuraTrade PWA ServiceWorker registration failed: ', err); }
);
});
}
`,
}}
/>
</body>
</html>
);