"use client" import { useState, useEffect } from 'react' import { motion } from 'framer-motion' import { Wifi, WifiOff, Download, Shield, CheckCircle, AlertCircle, Smartphone, Monitor } from 'lucide-react' export default function OfflinePage() { const [isOnline, setIsOnline] = useState(true) const [isInstallable, setIsInstallable] = useState(false) const [deferredPrompt, setDeferredPrompt] = useState(null) useEffect(() => { setIsOnline(navigator.onLine) const handleOnline = () => setIsOnline(true) const handleOffline = () => setIsOnline(false) window.addEventListener('online', handleOnline) window.addEventListener('offline', handleOffline) // PWA install prompt const handleBeforeInstallPrompt = (e: any) => { e.preventDefault() setDeferredPrompt(e) setIsInstallable(true) } window.addEventListener('beforeinstallprompt', handleBeforeInstallPrompt) return () => { window.removeEventListener('online', handleOnline) window.removeEventListener('offline', handleOffline) window.removeEventListener('beforeinstallprompt', handleBeforeInstallPrompt) } }, []) const handleInstallClick = async () => { if (deferredPrompt) { deferredPrompt.prompt() const { outcome } = await deferredPrompt.userChoice if (outcome === 'accepted') { setDeferredPrompt(null) setIsInstallable(false) } } } const offlineFeatures = [ { icon: Shield, title: "Complete Offline Functionality", description: "All password generation features work without internet connection. Service Worker ensures local availability." }, { icon: WifiOff, title: "No Data Transmission", description: "100% client-side processing. Your passwords never leave your device, even in online mode." }, { icon: Download, title: "PWA Installation", description: "Install PassMaster as a native app. Works on desktop, tablet and smartphone." } ] const installSteps = [ { step: 1, title: "Browser Installation", description: "Click 'Install App' in the address bar or use the button below." }, { step: 2, title: "Offline Test", description: "Disable your internet connection and test password generation." }, { step: 3, title: "App Icon", description: "PassMaster appears as an app icon on your home screen or in the app list." } ] return (
{/* Header */}
{isOnline ? ( ) : ( )}

Offline Password Generator (PWA)

Install and use PassMaster completely offline. Service Worker and local storage for maximum independence.

{/* Connection Status */}
{isOnline ? ( <> Online - Ready for Installation ) : ( <> Offline Mode Active )}
{/* Install Button */} {isInstallable && ( )} {/* Features */}

Service Worker & Installation | FAQ | Security

{offlineFeatures.map((feature, index) => (

{feature.title}

{feature.description}

))}
{/* Installation Steps */}

PWA Installation in 3 Steps

{installSteps.map((step, index) => (
{step.step}

{step.title}

{step.description}

))}
{/* Platform Support */}

Platform Support

Desktop Browser

Chrome, Firefox, Safari, Edge - All modern browsers support PWA installation

Mobile Devices

iOS Safari, Android Chrome - Installation via "Add to Home Screen"

{/* FAQ Section */}

Offline FAQ

How do I install PassMaster as a PWA?

On supported browsers, an installation icon automatically appears in the address bar. Alternatively, use the "Install App" button on this page.

What offline features are available?

All main functions: password generation, parameter customization, entropy calculation, and copying to clipboard work completely offline.

What is stored locally?

Only app files (HTML, CSS, JavaScript) are stored in the browser cache. No passwords or personal data are ever stored.

{/* JSON-LD for FAQ */}