Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>ESP32-CAM Dashboard</title> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <style> | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | |
| } | |
| :root { | |
| --primary: #3498db; | |
| --secondary: #2c3e50; | |
| --success: #27ae60; | |
| --warning: #f39c12; | |
| --danger: #e74c3c; | |
| --dark: #34495e; | |
| --light: #ecf0f1; | |
| --gray: #95a5a6; | |
| } | |
| body { | |
| background: linear-gradient(135deg, #1a2a6c, #2c3e50); | |
| color: var(--light); | |
| min-height: 100vh; | |
| padding: 20px; | |
| } | |
| .container { | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| } | |
| header { | |
| text-align: center; | |
| padding: 30px 0; | |
| margin-bottom: 30px; | |
| } | |
| header h1 { | |
| font-size: 2.8rem; | |
| margin-bottom: 10px; | |
| background: linear-gradient(to right, #3498db, #2ecc71); | |
| -webkit-background-clip: text; | |
| -webkit-text-fill-color: transparent; | |
| text-shadow: 0 2px 4px rgba(0,0,0,0.1); | |
| } | |
| header p { | |
| font-size: 1.2rem; | |
| color: var(--light); | |
| max-width: 800px; | |
| margin: 0 auto; | |
| line-height: 1.6; | |
| } | |
| .dashboard { | |
| display: grid; | |
| grid-template-columns: 1fr 1fr; | |
| gap: 25px; | |
| margin-bottom: 30px; | |
| } | |
| @media (max-width: 768px) { | |
| .dashboard { | |
| grid-template-columns: 1fr; | |
| } | |
| } | |
| .card { | |
| background: rgba(255, 255, 255, 0.08); | |
| border-radius: 15px; | |
| padding: 25px; | |
| box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); | |
| backdrop-filter: blur(10px); | |
| border: 1px solid rgba(255, 255, 255, 0.1); | |
| transition: transform 0.3s ease, box-shadow 0.3s ease; | |
| } | |
| .card:hover { | |
| transform: translateY(-5px); | |
| box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4); | |
| } | |
| .card-header { | |
| display: flex; | |
| align-items: center; | |
| margin-bottom: 20px; | |
| padding-bottom: 15px; | |
| border-bottom: 2px solid rgba(255, 255, 255, 0.1); | |
| } | |
| .card-header i { | |
| font-size: 1.8rem; | |
| margin-right: 15px; | |
| color: var(--primary); | |
| } | |
| .card-header h2 { | |
| font-size: 1.5rem; | |
| font-weight: 600; | |
| } | |
| .camera-feed { | |
| position: relative; | |
| width: 100%; | |
| height: 300px; | |
| background: #000; | |
| border-radius: 10px; | |
| overflow: hidden; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| } | |
| .camera-placeholder { | |
| text-align: center; | |
| color: var(--gray); | |
| } | |
| .camera-placeholder i { | |
| font-size: 4rem; | |
| margin-bottom: 15px; | |
| opacity: 0.5; | |
| } | |
| .status-grid { | |
| display: grid; | |
| grid-template-columns: repeat(2, 1fr); | |
| gap: 15px; | |
| } | |
| .status-item { | |
| background: rgba(255, 255, 255, 0.1); | |
| padding: 15px; | |
| border-radius: 10px; | |
| text-align: center; | |
| } | |
| .status-item h3 { | |
| font-size: 0.9rem; | |
| color: var(--gray); | |
| margin-bottom: 8px; | |
| } | |
| .status-value { | |
| font-size: 1.4rem; | |
| font-weight: 600; | |
| } | |
| .connected { | |
| color: var(--success); | |
| } | |
| .disconnected { | |
| color: var(--danger); | |
| } | |
| .controls { | |
| display: flex; | |
| gap: 15px; | |
| flex-wrap: wrap; | |
| } | |
| .btn { | |
| padding: 12px 25px; | |
| border: none; | |
| border-radius: 8px; | |
| font-size: 1rem; | |
| font-weight: 600; | |
| cursor: pointer; | |
| transition: all 0.3s ease; | |
| display: flex; | |
| align-items: center; | |
| gap: 8px; | |
| } | |
| .btn-primary { | |
| background: var(--primary); | |
| color: white; | |
| } | |
| .btn-success { | |
| background: var(--success); | |
| color: white; | |
| } | |
| .btn-warning { | |
| background: var(--warning); | |
| color: white; | |
| } | |
| .btn-danger { | |
| background: var(--danger); | |
| color: white; | |
| } | |
| .btn:hover { | |
| transform: translateY(-2px); | |
| box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); | |
| } | |
| .btn:active { | |
| transform: translateY(0); | |
| } | |
| .image-history { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); | |
| gap: 15px; | |
| margin-top: 20px; | |
| } | |
| .image-item { | |
| aspect-ratio: 4/3; | |
| background: rgba(255, 255, 255, 0.1); | |
| border-radius: 8px; | |
| overflow: hidden; | |
| position: relative; | |
| cursor: pointer; | |
| transition: transform 0.3s ease; | |
| } | |
| .image-item:hover { | |
| transform: scale(1.05); | |
| } | |
| .image-placeholder { | |
| width: 100%; | |
| height: 100%; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| color: var(--gray); | |
| } | |
| .image-placeholder i { | |
| font-size: 2rem; | |
| } | |
| .features { | |
| margin-top: 40px; | |
| } | |
| .features-grid { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); | |
| gap: 25px; | |
| margin-top: 25px; | |
| } | |
| .feature-card { | |
| background: rgba(255, 255, 255, 0.05); | |
| padding: 25px; | |
| border-radius: 15px; | |
| text-align: center; | |
| transition: all 0.3s ease; | |
| } | |
| .feature-card:hover { | |
| background: rgba(255, 255, 255, 0.1); | |
| transform: translateY(-5px); | |
| } | |
| .feature-icon { | |
| font-size: 3rem; | |
| margin-bottom: 20px; | |
| color: var(--primary); | |
| } | |
| .feature-card h3 { | |
| font-size: 1.4rem; | |
| margin-bottom: 15px; | |
| } | |
| .feature-card p { | |
| color: var(--light); | |
| line-height: 1.6; | |
| } | |
| footer { | |
| text-align: center; | |
| padding: 30px 0; | |
| margin-top: 40px; | |
| color: var(--gray); | |
| border-top: 1px solid rgba(255, 255, 255, 0.1); | |
| } | |
| .device-info { | |
| display: flex; | |
| align-items: center; | |
| gap: 10px; | |
| margin-top: 15px; | |
| padding: 12px; | |
| background: rgba(255, 255, 255, 0.05); | |
| border-radius: 8px; | |
| } | |
| .device-info i { | |
| color: var(--success); | |
| } | |
| .notification { | |
| position: fixed; | |
| top: 20px; | |
| right: 20px; | |
| padding: 15px 25px; | |
| background: var(--success); | |
| color: white; | |
| border-radius: 8px; | |
| box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); | |
| transform: translateX(200%); | |
| transition: transform 0.3s ease; | |
| z-index: 1000; | |
| } | |
| .notification.show { | |
| transform: translateX(0); | |
| } | |
| .loading { | |
| display: inline-block; | |
| width: 20px; | |
| height: 20px; | |
| border: 3px solid rgba(255,255,255,.3); | |
| border-radius: 50%; | |
| border-top-color: white; | |
| animation: spin 1s ease-in-out infinite; | |
| } | |
| @keyframes spin { | |
| to { transform: rotate(360deg); } | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="container"> | |
| <header> | |
| <h1><i class="fas fa-camera"></i> ESP32-CAM Dashboard</h1> | |
| <p>A user-friendly web application for monitoring and controlling ESP32-CAM devices through a browser interface</p> | |
| </header> | |
| <div class="dashboard"> | |
| <div class="card"> | |
| <div class="card-header"> | |
| <i class="fas fa-video"></i> | |
| <h2>Live Camera Feed</h2> | |
| </div> | |
| <div class="camera-feed"> | |
| <div class="camera-placeholder"> | |
| <i class="fas fa-video-slash"></i> | |
| <p>Camera feed not available</p> | |
| <small>Connect your ESP32-CAM device to view live stream</small> | |
| </div> | |
| </div> | |
| <div class="device-info"> | |
| <i class="fas fa-check-circle"></i> | |
| <div> | |
| <div>Device Status: <span class="connected">Connected</span></div> | |
| <small>ESP32-CAM-001 • 192.168.1.105</small> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="card"> | |
| <div class="card-header"> | |
| <i class="fas fa-sliders-h"></i> | |
| <h2>Device Controls</h2> | |
| </div> | |
| <div class="status-grid"> | |
| <div class="status-item"> | |
| <h3>CONNECTION</h3> | |
| <div class="status-value connected">Online</div> | |
| </div> | |
| <div class="status-item"> | |
| <h3>QUALITY</h3> | |
| <div class="status-value">720p</div> | |
| </div> | |
| <div class="status-item"> | |
| <h3>FPS</h3> | |
| <div class="status-value">30</div> | |
| </div> | |
| <div class="status-item"> | |
| <h3>UPTIME</h3> | |
| <div class="status-value">2h 15m</div> | |
| </div> | |
| </div> | |
| <div class="controls" style="margin-top: 25px;"> | |
| <button class="btn btn-primary" id="captureBtn"> | |
| <i class="fas fa-camera"></i> Capture Image | |
| </button> | |
| <button class="btn btn-success"> | |
| <i class="fas fa-sync-alt"></i> Refresh Feed | |
| </button> | |
| <button class="btn btn-warning"> | |
| <i class="fas fa-cog"></i> Settings | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="card"> | |
| <div class="card-header"> | |
| <i class="fas fa-images"></i> | |
| <h2>Image History</h2> | |
| </div> | |
| <div class="image-history"> | |
| <div class="image-item"> | |
| <div class="image-placeholder"> | |
| <i class="fas fa-image"></i> | |
| </div> | |
| </div> | |
| <div class="image-item"> | |
| <div class="image-placeholder"> | |
| <i class="fas fa-image"></i> | |
| </div> | |
| </div> | |
| <div class="image-item"> | |
| <div class="image-placeholder"> | |
| <i class="fas fa-image"></i> | |
| </div> | |
| </div> | |
| <div class="image-item"> | |
| <div class="image-placeholder"> | |
| <i class="fas fa-image"></i> | |
| </div> | |
| </div> | |
| <div class="image-item"> | |
| <div class="image-placeholder"> | |
| <i class="fas fa-image"></i> | |
| </div> | |
| </div> | |
| <div class="image-item"> | |
| <div class="image-placeholder"> | |
| <i class="fas fa-image"></i> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="features"> | |
| <h2 style="text-align: center; margin-bottom: 30px; font-size: 2rem;">Core Features</h2> | |
| <div class="features-grid"> | |
| <div class="feature-card"> | |
| <div class="feature-icon"> | |
| <i class="fas fa-video"></i> | |
| </div> | |
| <h3>Live Camera Feed</h3> | |
| <p>View real-time video stream directly from your connected ESP32-CAM devices with minimal latency.</p> | |
| </div> | |
| <div class="feature-card"> | |
| <div class="feature-icon"> | |
| <i class="fas fa-heartbeat"></i> | |
| </div> | |
| <h3>Device Status Monitoring</h3> | |
| <p>Get instant insights into the status of your ESP32-CAM, including connection status and device health.</p> | |
| </div> | |
| <div class="feature-card"> | |
| <div class="feature-icon"> | |
| <i class="fas fa-camera-retro"></i> | |
| </div> | |
| <h3>Basic Camera Controls</h3> | |
| <p>Easily capture still images with a simple click and manage your camera settings remotely.</p> | |
| </div> | |
| </div> | |
| </div> | |
| <footer> | |
| <p>ESP32-CAM Dashboard © 2023 | Your Own Private Eyes: A Web Dashboard for ESP32-CAM Devices</p> | |
| <p style="margin-top: 10px; font-size: 0.9rem;"> | |
| <a href="#" style="color: var(--primary); text-decoration: none;">GitHub Repository</a> | | |
| <a href="#" style="color: var(--primary); text-decoration: none;">Documentation</a> | | |
| <a href="#" style="color: var(--primary); text-decoration: none;">Support</a> | |
| </p> | |
| </footer> | |
| </div> | |
| <div class="notification" id="notification"> | |
| Image captured successfully! | |
| </div> | |
| <script> | |
| document.addEventListener('DOMContentLoaded', function() { | |
| const captureBtn = document.getElementById('captureBtn'); | |
| const notification = document.getElementById('notification'); | |
| captureBtn.addEventListener('click', function() { | |
| // Show loading state | |
| const originalHTML = captureBtn.innerHTML; | |
| captureBtn.innerHTML = '<div class="loading"></div> Capturing...'; | |
| captureBtn.disabled = true; | |
| // Simulate capture process | |
| setTimeout(function() { | |
| // Reset button | |
| captureBtn.innerHTML = originalHTML; | |
| captureBtn.disabled = false; | |
| // Show notification | |
| notification.classList.add('show'); | |
| setTimeout(function() { | |
| notification.classList.remove('show'); | |
| }, 3000); | |
| }, 2000); | |
| }); | |
| }); | |
| </script> | |
| </body> | |
| </html> |