| | <!DOCTYPE html> |
| | <html lang="en"> |
| | <head> |
| | <meta charset="UTF-8"> |
| | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| | <meta name="theme-color" content="#6366f1"> |
| | <meta name="description" content="Smart email summarization for busy professionals"> |
| | <meta name="mobile-web-app-capable" content="yes"> |
| | <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="InboxDigest"> |
| | <title>InboxDigest - Smart Email Summarization</title> |
| | |
| | |
| | <link rel="manifest" href="/manifest.json"> |
| | |
| | |
| | <link rel="icon" href="/favicon.ico" sizes="32x32"> |
| | <link rel="apple-touch-icon" href="/icon-192.png"> |
| | |
| | |
| | <script src="https://cdn.tailwindcss.com"></script> |
| | <script> |
| | tailwind.config = { |
| | theme: { |
| | extend: { |
| | colors: { |
| | primary: { |
| | 50: '#f0f9ff', |
| | 100: '#e0f2fe', |
| | 200: '#bae6fd', |
| | 300: '#7dd3fc', |
| | 400: '#38bdf8', |
| | 500: '#0ea5e9', |
| | 600: '#0284c7', |
| | 700: '#0369a1', |
| | 800: '#075985', |
| | 900: '#0c4a6e', |
| | } |
| | } |
| | } |
| | } |
| | } |
| | </script> |
| | |
| | |
| | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> |
| | |
| | <style> |
| | @keyframes fadeIn { |
| | from { opacity: 0; transform: translateY(10px); } |
| | to { opacity: 1; transform: translateY(0); } |
| | } |
| | .animate-fade-in { |
| | animation: fadeIn 0.3s ease-out forwards; |
| | } |
| | .gradient-bg { |
| | background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); |
| | } |
| | .email-card:hover { |
| | transform: translateY(-3px); |
| | box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); |
| | } |
| | .summary-text { |
| | display: -webkit-box; |
| | -webkit-line-clamp: 3; |
| | -webkit-box-orient: vertical; |
| | overflow: hidden; |
| | } |
| | .slide-in { |
| | animation: slideIn 0.3s ease-out forwards; |
| | } |
| | @keyframes slideIn { |
| | from { transform: translateX(100%); opacity: 0; } |
| | to { transform: translateX(0); opacity: 1; } |
| | } |
| | .progress-bar { |
| | height: 4px; |
| | background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%); |
| | width: 0%; |
| | transition: width 0.3s ease; |
| | } |
| | |
| | |
| | body { |
| | -webkit-tap-highlight-color: transparent; |
| | overscroll-behavior-y: none; |
| | } |
| | .pwa-install-btn { |
| | display: none; |
| | } |
| | @media (display-mode: standalone) { |
| | header { |
| | padding-top: env(safe-area-inset-top); |
| | } |
| | .pwa-install-btn { |
| | display: none !important; |
| | } |
| | } |
| | </style> |
| | </head> |
| | <body class="bg-gray-50 min-h-screen font-sans antialiased"> |
| | |
| | <div id="install-container" class="fixed bottom-0 left-0 right-0 bg-white shadow-lg rounded-t-xl p-4 z-50 hidden"> |
| | <div class="flex items-center justify-between"> |
| | <div class="flex items-center space-x-3"> |
| | <div class="w-10 h-10 rounded-lg bg-indigo-100 flex items-center justify-center"> |
| | <i class="fas fa-download text-indigo-600"></i> |
| | </div> |
| | <div> |
| | <h3 class="font-medium text-gray-800">Install InboxDigest</h3> |
| | <p class="text-xs text-gray-500">Add to your home screen for faster access</p> |
| | </div> |
| | </div> |
| | <div class="flex space-x-2"> |
| | <button id="cancel-install" class="px-4 py-2 text-gray-700 rounded-lg">Not Now</button> |
| | <button id="install-btn" class="px-4 py-2 bg-indigo-600 text-white rounded-lg">Install</button> |
| | </div> |
| | </div> |
| | </div> |
| |
|
| | |
| | <div class="flex flex-col min-h-screen"> |
| | |
| | <div id="loading-bar" class="progress-bar fixed top-0 left-0 right-0 z-50"></div> |
| |
|
| | |
| | <header class="gradient-bg text-white shadow-lg"> |
| | <div class="container mx-auto px-4 py-4"> |
| | <div class="flex justify-between items-center"> |
| | <div class="flex items-center space-x-3"> |
| | <div class="w-10 h-10 rounded-lg bg-white/10 flex items-center justify-center"> |
| | <i class="fas fa-inbox text-xl"></i> |
| | </div> |
| | <h1 class="text-xl font-bold">InboxDigest</h1> |
| | </div> |
| | <div class="flex items-center space-x-4"> |
| | <button id="pwa-install-btn" class="pwa-install-btn p-2 rounded-full hover:bg-white/10 transition" title="Install"> |
| | <i class="fas fa-download"></i> |
| | </button> |
| | <button id="help-btn" class="p-2 rounded-full hover:bg-white/10 transition" title="Help"> |
| | <i class="fas fa-question-circle"></i> |
| | </button> |
| | <button id="settings-btn" class="p-2 rounded-full hover:bg-white/10 transition" title="Settings"> |
| | <i class="fas fa-cog"></i> |
| | </button> |
| | <div class="relative"> |
| | <button id="profile-btn" class="w-8 h-8 rounded-full bg-white/20 flex items-center justify-center"> |
| | <i class="fas fa-user"></i> |
| | </button> |
| | <div id="profile-dropdown" class="hidden absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 z-50"> |
| | <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">My Account</a> |
| | <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Sign Out</a> |
| | </div> |
| | </div> |
| | </div> |
| | </div> |
| | <div class="mt-2 flex items-center justify-between"> |
| | <div class="text-sm opacity-90"> |
| | <span id="account-status">No accounts connected</span> |
| | </div> |
| | <button id="add-account-btn" class="text-xs bg-white/20 hover:bg-white/30 px-3 py-1 rounded-full transition flex items-center"> |
| | <i class="fas fa-plus mr-1"></i> Add Account |
| | </button> |
| | </div> |
| | </div> |
| | </header> |
| |
|
| | |
| | <main class="flex-grow container mx-auto px-4 py-6"> |
| | |
| | <div id="onboarding" class="max-w-2xl mx-auto"> |
| | <div class="bg-white rounded-xl shadow-lg overflow-hidden"> |
| | <div class="gradient-bg text-white p-6 text-center"> |
| | <i class="fas fa-inbox text-5xl mb-4"></i> |
| | <h2 class="text-2xl font-bold mb-2">Welcome to InboxDigest</h2> |
| | <p class="opacity-90">Your smart email assistant that summarizes and organizes your inbox</p> |
| | </div> |
| | <div class="p-6 md:p-8"> |
| | <div class="mb-8"> |
| | <h3 class="font-semibold text-gray-800 mb-4">How it works</h3> |
| | <div class="grid grid-cols-1 md:grid-cols-3 gap-4"> |
| | <div class="bg-gray-50 rounded-lg p-4 text-center"> |
| | <div class="w-12 h-12 bg-indigo-100 text-indigo-600 rounded-full flex items-center justify-center mx-auto mb-3"> |
| | <i class="fas fa-plug"></i> |
| | </div> |
| | <h4 class="font-medium text-gray-800 mb-1">1. Connect</h4> |
| | <p class="text-sm text-gray-600">Securely link your email accounts</p> |
| | </div> |
| | <div class="bg-gray-50 rounded-lg p-4 text-center"> |
| | <div class="w-12 h-12 bg-indigo-100 text-indigo-600 rounded-full flex items-center justify-center mx-auto mb-3"> |
| | <i class="fas fa-robot"></i> |
| | </div> |
| | <h4 class="font-medium text-gray-800 mb-1">2. Analyze</h4> |
| | <p class="text-sm text-gray-600">We process and summarize your emails</p> |
| | </div> |
| | <div class="bg-gray-50 rounded-lg p-4 text-center"> |
| | <div class="w-12 h-12 bg-indigo-100 text-indigo-600 rounded-full flex items-center justify-center mx-auto mb-3"> |
| | <i class="fas fa-chart-line"></i> |
| | </div> |
| | <h4 class="font-medium text-gray-800 mb-1">3. Digest</h4> |
| | <p class="text-sm text-gray-600">Get concise daily summaries</p> |
| | </div> |
| | </div> |
| | </div> |
| | |
| | <div class="space-y-4"> |
| | <button id="connect-gmail" class="w-full bg-red-500 hover:bg-red-600 text-white font-medium py-3 px-6 rounded-lg flex items-center justify-center space-x-3 transition shadow-md"> |
| | <i class="fab fa-google text-xl"></i> |
| | <span>Connect with Gmail</span> |
| | </button> |
| | |
| | <button id="connect-outlook" class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-3 px-6 rounded-lg flex items-center justify-center space-x-3 transition shadow-md"> |
| | <i class="fab fa-microsoft text-xl"></i> |
| | <span>Connect with Outlook</span> |
| | </button> |
| |
|
| | <button id="connect-imap" class="w-full bg-gray-100 hover:bg-gray-200 text-gray-800 font-medium py-3 px-6 rounded-lg flex items-center justify-center space-x-3 transition"> |
| | <i class="fas fa-server text-xl"></i> |
| | <span>Advanced IMAP Setup</span> |
| | </button> |
| | </div> |
| | |
| | <div class="mt-8 pt-6 border-t border-gray-200 text-center"> |
| | <p class="text-xs text-gray-500"> |
| | <i class="fas fa-lock mr-1"></i> Your email credentials are never stored. We use secure OAuth connections. |
| | </p> |
| | </div> |
| | </div> |
| | </div> |
| | </div> |
| |
|
| | |
| | <div id="digest-view" class="hidden"> |
| | |
| | <div class="flex flex-col md:flex-row md:items-center md:justify-between mb-6 gap-4"> |
| | <div> |
| | <h2 class="text-2xl font-bold text-gray-800">Today's Digest</h2> |
| | <div class="flex items-center space-x-2 mt-1"> |
| | <span class="text-sm text-gray-500">Generated at 8:00 AM</span> |
| | <span class="text-xs bg-indigo-100 text-indigo-800 px-2 py-0.5 rounded-full">3 new</span> |
| | </div> |
| | </div> |
| | <div class="flex space-x-3"> |
| | <div class="relative"> |
| | <button id="filter-btn" class="bg-white hover:bg-gray-50 text-gray-700 font-medium py-2 px-4 border border-gray-300 rounded-lg flex items-center space-x-2 transition"> |
| | <i class="fas fa-filter"></i> |
| | <span>Filter</span> |
| | </button> |
| | <div id="filter-dropdown" class="hidden absolute right-0 mt-2 w-56 bg-white rounded-md shadow-lg py-1 z-50 border border-gray-200"> |
| | <div class="px-4 py-2 text-sm text-gray-700">Filter by:</div> |
| | <div class="border-t border-gray-200"></div> |
| | <label class="flex items-center px-4 py-2 text-sm text-gray-700 hover:bg-gray-100"> |
| | <input type="checkbox" class="mr-2" checked> |
| | <span>Important</span> |
| | </label> |
| | <label class="flex items-center px-4 py-2 text-sm text-gray-700 hover:bg-gray-100"> |
| | <input type="checkbox" class="mr-2" checked> |
| | <span>Unread</span> |
| | </label> |
| | <label class="flex items-center px-4 py-2 text-sm text-gray-700 hover:bg-gray-100"> |
| | <input type="checkbox" class="mr-2" checked> |
| | <span>Updates</span> |
| | </label> |
| | <div class="border-t border-gray-200"></div> |
| | <button id="apply-filters" class="w-full text-left px-4 py-2 text-sm text-indigo-600 hover:bg-gray-100"> |
| | Apply Filters |
| | </button> |
| | </div> |
| | </div> |
| | <button id="refresh-btn" class="bg-white hover:bg-gray-50 text-gray-700 font-medium py-2 px-4 border border-gray-300 rounded-lg flex items-center space-x-2 transition"> |
| | <i class="fas fa-sync-alt"></i> |
| | <span>Refresh</span> |
| | </button> |
| | </div> |
| | </div> |
| |
|
| | |
| | <div class="bg-white rounded-xl shadow-md overflow-hidden mb-6"> |
| | <div class="bg-indigo-50 px-6 py-4 border-b border-indigo-100"> |
| | <div class="flex items-center"> |
| | <div class="w-8 h-8 rounded-full bg-indigo-100 text-indigo-600 flex items-center justify-center mr-3"> |
| | <i class="fas fa-exclamation"></i> |
| | </div> |
| | <h3 class="font-semibold text-gray-800">Priority Summary</h3> |
| | </div> |
| | </div> |
| | <div class="p-6"> |
| | <div class="grid grid-cols-1 md:grid-cols-3 gap-6"> |
| | <div class="border border-gray-200 rounded-lg p-4 hover:shadow-md transition"> |
| | <div class="flex items-center mb-3"> |
| | <div class="w-10 h-10 rounded-full bg-red-100 text-red-600 flex items-center justify-center mr-3"> |
| | <i class="fas fa-calendar-times"></i> |
| | </div> |
| | <div> |
| | <h4 class="font-medium text-gray-800">Urgent</h4> |
| | <p class="text-xs text-gray-500">Requires immediate action</p> |
| | </div> |
| | </div> |
| | <div class="space-y-3"> |
| | <div class="flex items-start"> |
| | <div class="w-2 h-2 rounded-full bg-red-500 mt-1.5 mr-2"></div> |
| | <p class="text-sm text-gray-700">Meeting cancellation from <span class="font-medium">John Smith</span></p> |
| | </div> |
| | <div class="flex items-start"> |
| | <div class="w-2 h-2 rounded-full bg-red-500 mt=1.5 mr-2"></div> |
| | <p class="text-sm text-gray-700">Project deadline extension request</p> |
| | </div> |
| | </div> |
| | </div> |
| | |
| | <div class="border border-gray-200 rounded-lg p-4 hover:shadow-md transition"> |
| | <div class="flex items-center mb-3"> |
| | <div class="w-10 h-10 rounded-full bg-yellow-100 text-yellow-600 flex items-center justify-center mr=3"> |
| | <i class="fas fa-clock"></i> |
| | </div> |
| | <div> |
| | <h4 class="font-medium text-gray-800">Today</h4> |
| | <p class="text-xs text-gray=500">Action needed today</p> |
| | </div> |
| | </div> |
| | <div class="space-y-3"> |
| | <div class="flex items-start"> |
| | <div class="w-2 h-2 rounded-full bg-yellow-500 mt-1.5 mr-2"></div> |
| | <p class="text-sm text-gray-700">Team sync agenda from <span class="font-medium">Sarah</span></p> |
| | </div> |
| | <div class="flex items-start"> |
| | <div class="w-2 h-2 rounded-full bg-yellow-500 mt-1.5 mr-2"></div> |
| | <p class="text-sm text-gray-700">Expense report approval</p> |
| | </div> |
| | </div> |
| | </div> |
| | |
| | <div class="border border-gray-200 rounded-lg p-4 hover:shadow-md transition"> |
| | <div class="flex items-center mb-3"> |
| | <div class="w-10 h-10 rounded-full bg-green-100 text-green-600 flex items-center justify-center mr-3"> |
| | <i class="fas fa-calendar-week"></i> |
| | </div> |
| | <div> |
| | <h4 class="font-medium text-gray-800">This Week</h4> |
| | <p class="text-xs text-gray-500">Upcoming deadlines</p> |
| | </div> |
| | </div> |
| | <div class="space-y-3"> |
| | <div class="flex items-start"> |
| | <div class="w=2 h-2 rounded-full bg-green-500 mt-1.5 mr-2"></div> |
| | <p class="text-sm text-gray-700">Quarterly planning session invite</p> |
| | </div> |
| | <div class="flex items-start"> |
| | <div class="w-2 h-2 rounded-full bg-green-500 mt-1.5 mr-2"></div> |
| | <p class="text-sm text-gray-700">Performance review schedule</p> |
| | </div> |
| | </div> |
| | </div> |
| | </div> |
| | </div> |
| | </div> |
| |
|
| | |
| | <div class="mb-8"> |
| | <div class="flex items-center justify-between mb-4"> |
| | <h3 class="text-lg font-semibold text-gray-800">Email Categories</h3> |
| | <button id="view-all-btn" class="text-sm text-indigo-600 hover:text-indigo-800">View All</button> |
| | </div> |
| | |
| | <div class="grid grid-cols-2 md:grid-cols-4 gap-4"> |
| | <button class="category-btn bg-white rounded-lg shadow-sm p-4 text-center hover:shadow-md transition cursor-pointer" data-category="work"> |
| | <div class="w-12 h-12 bg-indigo-100 text-indigo-600 rounded-full flex items-center justify-center mx-auto mb-3"> |
| | <i class="fas fa-briefcase"></i> |
| | </div> |
| | <h4 class="font-medium text-gray-800 mb-1">Work</h4> |
| | <p class="text-xs text-gray-500">12 emails</p> |
| | </button> |
| | |
| | <button class="category-btn bg-white rounded-lg shadow-sm p-4 text-center hover:shadow-md transition cursor-pointer" data-category="social"> |
| | <div class="w-12 h-12 bg-blue-100 text-blue-600 rounded-full flex items-center justify-center mx-auto mb-3"> |
| | <i class="fas fa-users"></i> |
| | </div> |
| | <h4 class="font-medium text-gray-800 mb-1">Social</h4> |
| | <p class="text-xs text-gray-500">8 emails</p> |
| | </button> |
| | |
| | <button class="category-btn bg-white rounded-lg shadow-sm p-4 text-center hover:shadow-md transition cursor-pointer" data-category="promotions"> |
| | <div class="w-12 h-12 bg-green-100 text-green-600 rounded-full flex items-center justify-center mx-auto mb-3"> |
| | <i class="fas fa-tag"></i> |
| | </div> |
| | <h4 class="font-medium text-gray-800 mb-1">Promotions</h4> |
| | <p class="text-xs text-gray-500">14 emails</p> |
| | </button> |
| | |
| | <button class="category-btn bg-white rounded-lg shadow-sm p-4 text-center hover:shadow-md transition cursor-pointer" data-category="updates"> |
| | <div class="w-12 h-12 bg-purple-100 text-purple-600 rounded-full flex items-center justify-center mx-auto mb-3"> |
| | <i class="fas fa-newspaper"></i> |
| | </div> |
| | <h4 class="font-medium text-gray-800 mb-1">Updates</h4> |
| | <p class="text-xs text-gray-500">5 emails</p> |
| | </button> |
| | </div> |
| | </div> |
| |
|
| | |
| | <div> |
| | <div class="flex items-center justify-between mb-4"> |
| | <h3 class="text-lg font-semibold text-gray-800">Recent Emails</h3> |
| | <div class="flex items-center space-x-2"> |
| | <span class="text-sm text-gray-500">Sorted by:</span> |
| | <select id="sort-select" class="text-sm border border-gray-300 rounded-md px-2 py-1 bg-white"> |
| | <option>Most Recent</option> |
| | <option>Priority</option> |
| | <option>Unread First</option> |
| | </select> |
| | </div> |
| | </div> |
| | |
| | <div class="space-y-4" id="email-list"> |
| | |
| | <div class="email-card bg-white rounded-xl shadow-sm p-6 transition cursor-pointer hover:border-indigo-200 border border-transparent" data-id="1" data-category="work" data-priority="high" data-read="false"> |
| | <div class="flex items-start"> |
| | <div class="w-10 h-10 rounded-full bg-indigo-100 text-indigo-600 flex items-center justify-center mr-4 mt-1"> |
| | <i class="fas fa-briefcase"></i> |
| | </div> |
| | <div class="flex-grow"> |
| | <div class="flex items-center justify-between mb-1"> |
| | <h4 class="font-medium text-gray-800">John Smith</h4> |
| | <span class="text-xs text-gray-500">10:45 AM</span> |
| | </div> |
| | <h3 class="font-semibold text-gray-900 mb-2">Project Update: Q3 Marketing Campaign</h3> |
| | <p class="text-sm text-gray-600 summary-text"> |
| | Here's the latest update on our Q3 marketing campaign. We've seen a 15% increase in engagement since implementing the new strategy. The creative team has finalized the assets, and we're on track to launch next week. Please review the attached report and provide feedback by EOD. |
| | </p> |
| | <div class="flex items-center mt-3 space-x-3"> |
| | <span class="text-xs px-2 py-1 bg-indigo-100 text-indigo-800 rounded-full">Work</span> |
| | <span class="text-xs px-2 py-1 bg-yellow-100 text-yellow-800 rounded-full">Today</span> |
| | <i class="fas fa-paperclip text-gray-400 ml-auto"></i> |
| | </div> |
| | </div> |
| | </div> |
| | </div> |
| | |
| | |
| | <div class="email-card bg-white rounded-xl shadow-sm p-6 transition cursor-pointer hover:border-indigo-200 border border-transparent" data-id="2" data-category="social" data-priority="medium" data-read="true"> |
| | <div class="flex items-start"> |
| | <div class="w-10 h-10 rounded-full bg-blue-100 text-blue-600 flex items-center justify-center mr-4 mt-1"> |
| | <i class="fas fa-users"></i> |
| | </div> |
| | <div class="flex-grow"> |
| | <div class="flex items-center justify-between mb-1"> |
| | <h4 class="font-medium text-gray-800">LinkedIn</h4> |
| | <span class="text-xs text-gray-500">9:30 AM</span> |
| | </div> |
| | <h3 class="font-semibold text-gray-900 mb-2">You have 5 new connection requests</h3> |
| | <p class="text-sm text-gray-600 summary-text"> |
| | You have 5 new connection requests waiting for your response. People you may know include Sarah Johnson from TechCorp, Michael Brown from DesignHub, and 3 others. Growing your network can help you discover new opportunities and stay updated with industry trends. |
| | </p> |
| | <div class="flex items-center mt-3 space-x-3"> |
| | <span class="text-xs px-2 py-1 bg-blue-100 text-blue-800 rounded-full">Social</span> |
| | </div> |
| | </div> |
| | </div> |
| | </div> |
| | |
| | |
| | <div class="email-card bg-white rounded-xl shadow-sm p-6 transition cursor-pointer hover:border-indigo-200 border border-transparent" data-id="3" data-category="promotions" data-priority="low" data-read="true"> |
| | <div class="flex items-start"> |
| | <div class="w-10 h-10 rounded-full bg-green-100 text-green-600 flex items-center justify-center mr-4 mt-1"> |
| | <i class="fas fa-tag"></i> |
| | </div> |
| | <div class="flex-grow"> |
| | <div class="flex items-center justify-between mb-1"> |
| | <h4 class="font-medium text-gray-800">Amazon</h4> |
| | <span class="text-xs text-gray-500">Yesterday</span> |
| | </div> |
| | <h3 class="font-semibold text-gray-900 mb-2">Your order has shipped!</h3> |
| | <p class="text-sm text-gray-600 summary-text"> |
| | Your recent order #123-4567890 has shipped and is on its way to you. Expected delivery date is Friday, June 10. Track your package using the link below. We've also included some exclusive deals on similar products you might be interested in. |
| | </p> |
| | <div class="flex items-center mt-3 space-x-3"> |
| | <span class="text-xs px-2 py-1 bg-green-100 text-green-800 rounded-full">Promotions</span> |
| | </div> |
| | </div> |
| | </div> |
| | </div> |
| | </div> |
| | |
| | <div class="mt-6 flex justify-center"> |
| | <button id="load-more-btn" class="px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition"> |
| | Load More |
| | </button> |
| | </div> |
| | </div> |
| | </div> |
| | </main> |
| |
|
| | |
| | <footer class="bg-white border-t border-gray-200 py-4"> |
| | <div class="container mx-auto px-4"> |
| | <div class="flex flex-col md:flex-row justify-between items-center"> |
| | <div class="text-sm text-gray-500 mb-2 md:mb-0"> |
| | © 2023 InboxDigest. All rights reserved. |
| | </div> |
| | <div class="flex space-x-4"> |
| | <a href="#" class="text-sm text-gray-500 hover:text-indigo-600 transition">Privacy</a> |
| | <a href="#" class="text-sm text-gray-500 hover:text-indigo-600 transition">Terms</a> |
| | <a href="#" class="text-sm text-gray-500 hover:text-indigo-600 transition">Help</a> |
| | </div> |
| | </div> |
| | </div> |
| | </footer> |
| | </div> |
| |
|
| | |
| | <div id="settings-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"> |
| | <div class="bg-white rounded-xl shadow-xl w-full max-w-md max-h-[90vh] overflow-y-auto"> |
| | <div class="p-6 border-b border-gray-200"> |
| | <div class="flex items-center justify-between"> |
| | <h3 class="text-lg font-semibold text-gray-800">Settings</h3> |
| | <button id="close-settings" class="text-gray-500 hover:text-gray-700"> |
| | <i class="fas fa-times"></i> |
| | </button> |
| | </div> |
| | </div> |
| | <div class="p-6"> |
| | <div class="space-y-6"> |
| | <div> |
| | <h4 class="font-medium text-gray-800 mb-3">Notification Preferences</h4> |
| | <div class="space-y-3"> |
| | <label class="flex items-center"> |
| | <input type="checkbox" id="email-summaries" class="rounded text-indigo-600 mr-2" checked> |
| | <span class="text-sm text-gray-700">Email summaries</span> |
| | </label> |
| | <label class="flex items-center"> |
| | <input type="checkbox" id="priority-alerts" class="rounded text-indigo-600 mr-2" checked> |
| | <span class="text-sm text-gray-700">Priority alerts</span> |
| | </label> |
| | <label class="flex items-center"> |
| | <input type="checkbox" id="promotional-emails" class="rounded text-indigo-600 mr-2"> |
| | <span class="text-sm text-gray-700">Promotional emails</span> |
| | </label> |
| | </div> |
| | </div> |
| | |
| | <div> |
| | <h4 class="font-medium text-gray-800 mb-3">Digest Schedule</h4> |
| | <select id="digest-schedule" class="w-full border border-gray-300 rounded-md px-3 py-2 text-sm"> |
| | <option>Daily at 8:00 AM</option> |
| | <option>Daily at 7:00 AM</option> |
| | <option>Daily at 9:00 AM</option> |
| | <option>Twice a day</option> |
| | </select> |
| | </div> |
| | |
| | <div> |
| | <h4 class="font-medium text-gray-800 mb-3">Connected Accounts</h4> |
| | <div class="space-y-3"> |
| | <div class="flex items-center justify-between bg-gray-50 p-3 rounded-lg"> |
| | <div class="flex items-center"> |
| | <i class="fab fa-google text-red-500 mr-3"></i> |
| | <span class="text-sm text-gray-700">john.doe@gmail.com</span> |
| | </div> |
| | <button class="text-sm text-red-500 hover:text-red-700 remove-account">Remove</button> |
| | </div> |
| | </div> |
| | </div> |
| | </div> |
| | |
| | <div class="mt-8 pt-4 border-t border-gray-200"> |
| | <button id="save-settings" class="w-full py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition"> |
| | Save Changes |
| | </button> |
| | </div> |
| | </div> |
| | </div> |
| | </div> |
| |
|
| | |
| | <div id="help-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"> |
| | <div class="bg-white rounded-xl shadow-xl w-full max-w-md max-h-[90vh] overflow-y-auto"> |
| | <div class="p-6 border-b border-gray-200"> |
| | <div class="flex items-center justify-between"> |
| | <h3 class="text-lg font-semibold text-gray-800">Help & Support</h3> |
| | <button id="close-help" class="text-gray-500 hover:text-gray-700"> |
| | <i class="fas fa-times"></i> |
| | </button> |
| | </div> |
| | </div> |
| | <div class="p-6"> |
| | <div class="space-y-4"> |
| | <div> |
| | <h4 class="font-medium text-gray-800 mb-2">Getting Started</h4> |
| | <p class="text-sm text-gray-600"> |
| | Connect your email accounts to begin receiving daily digests. We support Gmail, Outlook, and other IMAP-compatible providers. |
| | </p> |
| | </div> |
| | |
| | <div> |
| | <h4 class="font-medium text-gray-800 mb-2">Frequently Asked Questions</h4> |
| | <div class="space-y-3"> |
| | <div class="border-b border-gray-100 pb-3"> |
| | <h5 class="text-sm font-medium text-gray-700">How secure is my data?</h5> |
| | <p class="text-xs text-gray-500 mt-1"> |
| | We use OAuth for authentication and never store your email credentials. All data is encrypted in transit and at rest. |
| | </p> |
| | </div> |
| | <div class="border-b border-gray-100 pb-3"> |
| | <h5 class="text-sm font-medium text-gray-700">Can I customize what's included in my digest?</h5> |
| | <p class="text-xs text-gray-500 mt-1"> |
| | Yes! Go to Settings to adjust your preferences for what types of emails are included and how they're categorized. |
| | </p> |
| | </div> |
| | </div> |
| | </div> |
| | |
| | <div> |
| | <h4 class="font-medium text-gray-800 mb-2">Contact Support</h4> |
| | <p class="text-sm text-gray-600 mb-3"> |
| | Need more help? Our team is available 24/7 to assist you. |
| | </p> |
| | <button id="contact-support" class="w-full py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition"> |
| | <i class="fas fa-envelope mr-2"></i> Email Support |
| | </button> |
| | </div> |
| | </div> |
| | </div> |
| | </div> |
| | </div> |
| |
|
| | |
| | <div id="add-account-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"> |
| | <div class="bg-white rounded-xl shadow-xl w-full max-w-md max-h-[90vh] overflow-y-auto"> |
| | <div class="p-6 border-b border-gray-200"> |
| | <div class="flex items-center justify-between"> |
| | <h3 class="text-lg font-semibold text-gray-800">Add Email Account</h3> |
| | <button id="close-add-account" class="text-gray-500 hover:text-gray-700"> |
| | <i class="fas fa-times"></i> |
| | </button> |
| | </div> |
| | </div> |
| | <div class="p-6"> |
| | <div class="space-y-4"> |
| | <button id="modal-connect-gmail" class="w-full bg-red-500 hover:bg-red-600 text-white font-medium py-3 px-6 rounded-lg flex items-center justify-center space-x-3 transition shadow-md"> |
| | <i class="fab fa-google text-xl"></i> |
| | <span>Connect with Gmail</span> |
| | </button> |
| | |
| | <button id="modal-connect-outlook" class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-3 px-6 rounded-lg flex items-center justify-center space-x-3 transition shadow-md"> |
| | <i class="fab fa-microsoft text-xl"></i> |
| | <span>Connect with Outlook</span> |
| | </button> |
| |
|
| | <button id="modal-connect-imap" class="w-full bg-gray-100 hover:bg-gray-200 text-gray-800 font-medium py-3 px-6 rounded-lg flex items-center justify-center space-x-3 transition"> |
| | <i class="fas fa-server text-xl"></i> |
| | <span>Advanced IMAP Setup</span> |
| | </button> |
| | </div> |
| | |
| | <div class="mt-6 pt-4 border-t border-gray-200 text-center"> |
| | <p class="text-xs text-gray-500"> |
| | <i class="fas fa-lock mr-1"></i> Your email credentials are never stored. We use secure OAuth connections. |
| | </p> |
| | </div> |
| | </div> |
| | </div> |
| | </div> |
| |
|
| | |
| | <div id="email-detail-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"> |
| | <div class="bg-white rounded-xl shadow-xl w-full max-w-3xl max-h-[90vh] overflow-y-auto"> |
| | <div class="p-6 border-b border-gray-200"> |
| | <div class="flex items-center justify-between"> |
| | <h3 id="email-detail-subject" class="text-lg font-semibold text-gray-800">Email Details</h3> |
| | <button id="close-email-detail" class="text-gray-500 hover:text-gray-700"> |
| | <i class="fas fa-times"></i> |
| | </button> |
| | </div> |
| | </div> |
| | <div class="p-6"> |
| | <div class="flex items-start mb-6"> |
| | <div class="w-12 h-12 rounded-full bg-indigo-100 text-indigo-600 flex items-center justify-center mr-4"> |
| | <i id="email-detail-icon" class="fas fa-envelope"></i> |
| | </div> |
| | <div class="flex-grow"> |
| | <div class="flex items-center justify-between mb-1"> |
| | <h4 id="email-detail-from" class="font-medium text-gray-800">From: John Smith</h4> |
| | <span id="email-detail-time" class="text-xs text-gray-500">10:45 AM</span> |
| | </div> |
| | <div class="flex items-center space-x-2 mb-4"> |
| | <span id="email-detail-category" class="text-xs px-2 py-1 bg-indigo-100 text-indigo-800 rounded-full">Work</span> |
| | <span id="email-detail-priority" class="text-xs px-2 py-1 bg-yellow-100 text-yellow-800 rounded-full">Today</span> |
| | </div> |
| | </div> |
| | </div> |
| | |
| | <div id="email-detail-body" class="prose max-w-none text-gray-700"> |
| | <p>Here's the full content of the email...</p> |
| | </div> |
| | |
| | <div id="email-detail-attachments" class="mt-6 pt-4 border-t border-gray-200 hidden"> |
| | <h4 class="text-sm font-medium text-gray-800 mb-3">Attachments</h4> |
| | <div class="flex space-x-3"> |
| | <div class="flex items-center bg-gray-50 rounded-lg p-3"> |
| | <i class="fas fa-file-pdf text-red-500 mr-2"></i> |
| | <span class="text-sm">Marketing_Report.pdf</span> |
| | </div> |
| | </div> |
| | </div> |
| | |
| | <div class="mt-6 pt-4 border-t border-gray-200 flex space-x-3"> |
| | <button class="px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition"> |
| | <i class="fas fa-reply mr-2"></i> Reply |
| | </button> |
| | <button class="px-4 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition"> |
| | <i class="fas fa-forward mr-2"></i> Forward |
| | </button> |
| | </div> |
| | </div> |
| | </div> |
| | </div> |
| |
|
| | |
| | <script> |
| | |
| | if ('serviceWorker' in navigator) { |
| | window.addEventListener('load', () => { |
| | navigator.serviceWorker.register('/sw.js') |
| | .then(registration => { |
| | console.log('ServiceWorker registration successful'); |
| | }) |
| | .catch(err => { |
| | console.log('ServiceWorker registration failed: ', err); |
| | }); |
| | }); |
| | } |
| | </script> |
| |
|
| | |
| | <script> |
| | |
| | const onboarding = document.getElementById('onboarding'); |
| | const digestView = document.getElementById('digest-view'); |
| | const accountStatus = document.getElementById('account-status'); |
| | const addAccountBtn = document.getElementById('add-account-btn'); |
| | const settingsBtn = document.getElementById('settings-btn'); |
| | const helpBtn = document.getElementById('help-btn'); |
| | const profileBtn = document.getElementById('profile-btn'); |
| | const profileDropdown = document.getElementById('profile-dropdown'); |
| | const settingsModal = document.getElementById('settings-modal'); |
| | const helpModal = document.getElementById('help-modal'); |
| | const addAccountModal = document.getElementById('add-account-modal'); |
| | const emailDetailModal = document.getElementById('email-detail-modal'); |
| | const closeSettings = document.getElementById('close-settings'); |
| | const closeHelp = document.getElementById('close-help'); |
| | const closeAddAccount = document.getElementById('close-add-account'); |
| | const closeEmailDetail = document.getElementById('close-email-detail'); |
| | const connectGmail = document.getElementById('connect-gmail'); |
| | const connectOutlook = document.getElementById('connect-outlook'); |
| | const connectImap = document.getElementById('connect-imap'); |
| | const modalConnectGmail = document.getElementById('modal-connect-gmail'); |
| | const modalConnectOutlook = document.getElementById('modal-connect-outlook'); |
| | const modalConnectImap = document.getElementById('modal-connect-imap'); |
| | const filterBtn = document.getElementById('filter-btn'); |
| | const filterDropdown = document.getElementById('filter-dropdown'); |
| | const applyFilters = document.getElementById('apply-filters'); |
| | const refreshBtn = document.getElementById('refresh-btn'); |
| | const loadingBar = document.getElementById('loading-bar'); |
| | const installContainer = document.getElementById('install-container'); |
| | const installBtn = document.getElementById('install-btn'); |
| | const cancelInstall = document.getElementById('cancel-install'); |
| | const pwaInstallBtn = document.getElementById('pwa-install-btn'); |
| | const emailSummaries = document.getElementById('email-summaries'); |
| | const priorityAlerts = document.getElementById('priority-alerts'); |
| | const promotionalEmails = document.getElementById('promotional-emails'); |
| | const digestSchedule = document.getElementById('digest-schedule'); |
| | const saveSettings = document.getElementById('save-settings'); |
| | const removeAccount = document.querySelector('.remove-account'); |
| | const contactSupport = document.getElementById('contact-support'); |
| | const viewAllBtn = document.getElementById('view-all-btn'); |
| | const categoryBtns = document.querySelectorAll('.category-btn'); |
| | const sortSelect = document.getElementById('sort-select'); |
| | const emailList = document.getElementById('email-list'); |
| | const loadMoreBtn = document.getElementById('load-more-btn'); |
| | const emailCards = document.querySelectorAll('.email-card'); |
| | const emailDetailSubject = document.getElementById('email-detail-subject'); |
| | const emailDetailFrom = document.getElementById('email-detail-from'); |
| | const emailDetailTime = document.getElementById('email-detail-time'); |
| | const emailDetailCategory = document.getElementById('email-detail-category'); |
| | const emailDetailPriority = document.getElementById('email-detail-priority'); |
| | const emailDetailBody = document.getElementById('email-detail-body'); |
| | const emailDetailAttachments = document.getElementById('email-detail-attachments'); |
| | const emailDetailIcon = document.getElementById('email-detail-icon'); |
| | |
| | |
| | let hasAccounts = false; |
| | let deferredPrompt = null; |
| | let currentFilter = 'all'; |
| | let currentSort = 'most-recent'; |
| | let displayedEmails = 3; |
| | const totalEmails = 10; |
| | |
| | |
| | const emailData = { |
| | 1: { |
| | from: "John Smith", |
| | subject: "Project Update: Q3 Marketing Campaign", |
| | time: "10:45 AM", |
| | category: "Work", |
| | priority: "Today", |
| | icon: "briefcase", |
| | body: ` |
| | <p>Hi Team,</p> |
| | <p>Here's the latest update on our Q3 marketing campaign. We've seen a 15% increase in engagement since implementing the new strategy.</p> |
| | <p>The creative team has finalized the assets, and we're on track to launch next week. Please review the attached report and provide feedback by EOD.</p> |
| | <p>Key highlights:</p> |
| | <ul> |
| | <li>15% increase in engagement metrics</li> |
| | <li>Creative assets finalized and approved</li> |
| | <li>Launch scheduled for next Monday</li> |
| | <li>Budget tracking on target</li> |
| | </ul> |
| | <p>Let me know if you have any questions.</p> |
| | <p>Best regards,<br>John</p> |
| | `, |
| | hasAttachment: true |
| | }, |
| | 2: { |
| | from: "LinkedIn", |
| | subject: "You have 5 new connection requests", |
| | time: "9:30 AM", |
| | category: "Social", |
| | priority: "Low", |
| | icon: "users", |
| | body: ` |
| | <p>You have 5 new connection requests waiting for your response:</p> |
| | <p><strong>Sarah Johnson</strong> - Marketing Director at TechCorp<br> |
| | <strong>Michael Brown</strong> - UX Designer at DesignHub<br> |
| | <strong>Lisa Wong</strong> - Product Manager at Innovate Inc.<br> |
| | <strong>David Kim</strong> - CTO at Startup Labs<br> |
| | <strong>Emma Wilson</strong> - Senior Developer at CodeCraft</p> |
| | <p>Growing your network can help you discover new opportunities and stay updated with industry trends.</p> |
| | <p>Click below to view and respond to these requests:</p> |
| | <button class="mt-4 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition"> |
| | View Connection Requests |
| | </button> |
| | `, |
| | hasAttachment: false |
| | }, |
| | 3: { |
| | from: "Amazon", |
| | subject: "Your order has shipped!", |
| | time: "Yesterday", |
| | category: "Promotions", |
| | priority: "Low", |
| | icon: "tag", |
| | body: ` |
| | <p>Hello,</p> |
| | <p>Your recent order <strong>#123-4567890</strong> has shipped and is on its way to you.</p> |
| | <p><strong>Expected delivery date:</strong> Friday, June 10</p> |
| | <p><strong>Tracking number:</strong> 1Z23456X8901234567</p> |
| | <p>Track your package using the link below:</p> |
| | <button class="mt-4 px-4 py-2 bg-yellow-400 text-gray-800 rounded-lg hover:bg-yellow-500 transition"> |
| | Track Package |
| | </button> |
| | <p class="mt-4">We've also included some exclusive deals on similar products you might be interested in:</p> |
| | <div class="grid grid-cols-2 gap-4 mt-4"> |
| | <div class="border border-gray-200 rounded-lg p-3"> |
| | <div class="h-24 bg-gray-100 mb-2"></div> |
| | <p class="text-sm">Wireless Earbuds</p> |
| | <p class="text-xs text-gray-500">$59.99</p> |
| | </div> |
| | <div class="border border-gray-200 rounded-lg p-3"> |
| | <div class="h-24 bg-gray-100 mb-2"></div> |
| | <p class="text-sm">Phone Stand</p> |
| | <p class="text-xs text-gray-500">$12.99</p> |
| | </div> |
| | </div> |
| | `, |
| | hasAttachment: false |
| | } |
| | }; |
| | |
| | |
| | function initUI() { |
| | |
| | if (hasAccounts) { |
| | onboarding.classList.add('hidden'); |
| | digestView.classList.remove('hidden'); |
| | accountStatus.textContent = "1 account connected"; |
| | } else { |
| | onboarding.classList.remove('hidden'); |
| | digestView.classList.add('hidden'); |
| | accountStatus.textContent = "No accounts connected"; |
| | } |
| | } |
| | |
| | |
| | addAccountBtn.addEventListener('click', () => { |
| | addAccountModal.classList.remove('hidden'); |
| | }); |
| | |
| | settingsBtn.addEventListener('click', () => { |
| | settingsModal.classList.remove('hidden'); |
| | }); |
| | |
| | helpBtn.addEventListener('click', () => { |
| | helpModal.classList.remove('hidden'); |
| | }); |
| | |
| | profileBtn.addEventListener('click', () => { |
| | profileDropdown.classList.toggle('hidden'); |
| | }); |
| | |
| | closeSettings.addEventListener('click', () => { |
| | settingsModal.classList.add('hidden'); |
| | }); |
| | |
| | closeHelp.addEventListener('click', () => { |
| | helpModal.classList.add('hidden'); |
| | }); |
| | |
| | closeAddAccount.addEventListener('click', () => { |
| | addAccountModal.classList.add('hidden'); |
| | }); |
| | |
| | closeEmailDetail.addEventListener('click', () => { |
| | emailDetailModal.classList.add('hidden'); |
| | }); |
| | |
| | filterBtn.addEventListener('click', () => { |
| | filterDropdown.classList.toggle('hidden'); |
| | }); |
| | |
| | refreshBtn.addEventListener('click', () => { |
| | loadingBar.style.width = '100%'; |
| | setTimeout(() => { |
| | loadingBar.style.width = '0%'; |
| | |
| | showToast('Emails refreshed successfully'); |
| | }, 1000); |
| | }); |
| | |
| | |
| | connectGmail.addEventListener('click', () => { |
| | simulateAccountConnection('Gmail'); |
| | }); |
| | |
| | connectOutlook.addEventListener('click', () => { |
| | simulateAccountConnection('Outlook'); |
| | }); |
| | |
| | connectImap.addEventListener('click', () => { |
| | simulateAccountConnection('IMAP'); |
| | }); |
| | |
| | modalConnectGmail.addEventListener('click', () => { |
| | simulateAccountConnection('Gmail'); |
| | }); |
| | |
| | modalConnectOutlook.addEventListener('click', () => { |
| | simulateAccountConnection('Outlook'); |
| | }); |
| | |
| | modalConnectImap.addEventListener('click', () => { |
| | simulateAccountConnection('IMAP'); |
| | }); |
| | |
| | |
| | applyFilters.addEventListener('click', () => { |
| | filterDropdown.classList.add('hidden'); |
| | showToast('Filters applied successfully'); |
| | }); |
| | |
| | |
| | saveSettings.addEventListener('click', () => { |
| | settingsModal.classList.add('hidden'); |
| | showToast('Settings saved successfully'); |
| | }); |
| | |
| | |
| | removeAccount.addEventListener('click', () => { |
| | if (confirm('Are you sure you want to remove this account?')) { |
| | hasAccounts = false; |
| | initUI(); |
| | showToast('Account removed successfully'); |
| | } |
| | }); |
| | |
| | |
| | contactSupport.addEventListener('click', () => { |
| | window.location.href = 'mailto:support@inboxdigest.com'; |
| | }); |
| | |
| | |
| | viewAllBtn.addEventListener('click', () => { |
| | currentFilter = 'all'; |
| | filterEmails(); |
| | }); |
| | |
| | |
| | categoryBtns.forEach(btn => { |
| | btn.addEventListener('click', () => { |
| | currentFilter = btn.dataset.category; |
| | filterEmails(); |
| | }); |
| | }); |
| | |
| | |
| | sortSelect.addEventListener('change', () => { |
| | currentSort = sortSelect.value.toLowerCase().replace(' ', '-'); |
| | sortEmails(); |
| | }); |
| | |
| | |
| | emailCards.forEach(card => { |
| | card.addEventListener('click', () => { |
| | const emailId = card.dataset.id; |
| | showEmailDetail(emailId); |
| | |
| | card.dataset.read = 'true'; |
| | }); |
| | }); |
| | |
| | |
| | loadMoreBtn.addEventListener('click', () => { |
| | if (displayedEmails < totalEmails) { |
| | displayedEmails += 3; |
| | |
| | showToast(`Loaded ${Math.min(3, totalEmails - displayedEmails + 3)} more emails`); |
| | |
| | if (displayedEmails >= totalEmails) { |
| | loadMoreBtn.disabled = true; |
| | loadMoreBtn.textContent = 'No more emails'; |
| | } |
| | } |
| | }); |
| | |
| | |
| | function showEmailDetail(emailId) { |
| | const email = emailData[emailId]; |
| | if (!email) return; |
| | |
| | emailDetailSubject.textContent = email.subject; |
| | emailDetailFrom.textContent = `From: ${email.from}`; |
| | emailDetailTime.textContent = email.time; |
| | emailDetailCategory.textContent = email.category; |
| | emailDetailPriority.textContent = email.priority; |
| | emailDetailBody.innerHTML = email.body; |
| | emailDetailIcon.className = `fas fa-${email.icon}`; |
| | |
| | |
| | const categoryColors = { |
| | 'Work': 'bg-indigo-100 text-indigo-800', |
| | 'Social': 'bg-blue-100 text-blue-800', |
| | 'Promotions': 'bg-green-100 text-green-800', |
| | 'Updates': 'bg-purple-100 text-purple-800' |
| | }; |
| | emailDetailCategory.className = `text-xs px-2 py-1 rounded-full ${categoryColors[email.category] || 'bg-gray-100 text-gray-800'}`; |
| | |
| | |
| | const priorityColors = { |
| | 'Urgent': 'bg-red-100 text-red-800', |
| | 'Today': 'bg-yellow-100 text-yellow-800', |
| | 'This Week': 'bg-green-100 text-green-800', |
| | 'Low': 'bg-gray-100 text-gray-800' |
| | }; |
| | emailDetailPriority.className = `text-xs px-2 py-1 rounded-full ${priorityColors[email.priority] || 'bg-gray-100 text-gray-800'}`; |
| | |
| | |
| | if (email.hasAttachment) { |
| | emailDetailAttachments.classList.remove('hidden'); |
| | } else { |
| | emailDetailAttachments.classList.add('hidden'); |
| | } |
| | |
| | emailDetailModal.classList.remove('hidden'); |
| | } |
| | |
| | |
| | function filterEmails() { |
| | emailCards.forEach(card => { |
| | if (currentFilter === 'all' || card.dataset.category === currentFilter) { |
| | card.style.display = 'block'; |
| | } else { |
| | card.style.display = 'none'; |
| | } |
| | }); |
| | showToast(`Showing ${currentFilter === 'all' ? 'all' : currentFilter} emails`); |
| | } |
| | |
| | |
| | function sortEmails() { |
| | const cards = Array.from(emailCards); |
| | |
| | cards.sort((a, b) => { |
| | if (currentSort === 'most-recent') { |
| | return new Date(b.dataset.time) - new Date(a.dataset.time); |
| | } else if (currentSort === 'priority') { |
| | const priorityOrder = { high: 3, medium: 2, low: 1 }; |
| | return priorityOrder[b.dataset.priority] - priorityOrder[a.dataset.priority]; |
| | } else if (currentSort === 'unread-first') { |
| | return a.dataset.read === 'false' ? -1 : 1; |
| | } |
| | return 0; |
| | }); |
| | |
| | |
| | cards.forEach(card => emailList.appendChild(card)); |
| | showToast(`Sorted by ${currentSort.replace('-', ' ')}`); |
| | } |
| | |
| | |
| | function simulateAccountConnection(provider) { |
| | loadingBar.style.width = '30%'; |
| | |
| | setTimeout(() => { |
| | loadingBar.style.width = '70%'; |
| | |
| | setTimeout(() => { |
| | loadingBar.style.width = '100%'; |
| | hasAccounts = true; |
| | initUI(); |
| | addAccountModal.classList.add('hidden'); |
| | |
| | setTimeout(() => { |
| | loadingBar.style.width = '0%'; |
| | showToast(`${provider} account connected successfully`); |
| | }, 300); |
| | }, 500); |
| | }, 500); |
| | } |
| | |
| | |
| | function showToast(message) { |
| | const toast = document.createElement('div'); |
| | toast.className = 'fixed bottom-4 left-1/2 transform -translate-x-1/2 bg-gray-800 text-white px-4 py-2 rounded-lg shadow-lg animate-fade-in'; |
| | toast.textContent = message; |
| | document.body.appendChild(toast); |
| | |
| | setTimeout(() => { |
| | toast.remove(); |
| | }, 3000); |
| | } |
| | |
| | |
| | window.addEventListener('beforeinstallprompt', (e) => { |
| | e.preventDefault(); |
| | deferredPrompt = e; |
| | |
| | |
| | if (window.matchMedia('(display-mode: standalone)').matches) { |
| | pwaInstallBtn.style.display = 'none'; |
| | } else { |
| | pwaInstallBtn.style.display = 'block'; |
| | } |
| | }); |
| | |
| | pwaInstallBtn.addEventListener('click', () => { |
| | if (deferredPrompt) { |
| | deferredPrompt.prompt(); |
| | |
| | deferredPrompt.userChoice.then((choiceResult) => { |
| | if (choiceResult.outcome === 'accepted') { |
| | showToast('InboxDigest installed successfully'); |
| | } else { |
| | showToast('Installation cancelled'); |
| | } |
| | deferredPrompt = null; |
| | }); |
| | } |
| | }); |
| | |
| | |
| | function showInstallPrompt() { |
| | if (deferredPrompt && !window.matchMedia('(display-mode: standalone)').matches) { |
| | installContainer.classList.remove('hidden'); |
| | } |
| | } |
| | |
| | installBtn.addEventListener('click', () => { |
| | if (deferredPrompt) { |
| | deferredPrompt.prompt(); |
| | installContainer.classList.add('hidden'); |
| | } |
| | }); |
| | |
| | cancelInstall.addEventListener('click', () => { |
| | installContainer.classList.add('hidden'); |
| | }); |
| | |
| | |
| | setTimeout(showInstallPrompt, 10000); |
| | |
| | |
| | document.addEventListener('click', (e) => { |
| | if (!profileBtn.contains(e.target) && !profileDropdown.contains(e.target)) { |
| | profileDropdown.classList.add('hidden'); |
| | } |
| | |
| | if (!filterBtn.contains(e.target) && !filterDropdown.contains(e.target)) { |
| | filterDropdown.classList.add('hidden'); |
| | } |
| | }); |
| | |
| | |
| | initUI(); |
| | </script> |
| | <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Ziantech/ziantech" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> |
| | </html> |