Download index.html from Deflook/defapp: direct link, hf CLI and curl.
- Browser
- Download file 27.3 kB
-
https://huggingface.co/spaces/Deflook/defapp/resolve/main/index.html
- Command line
-
hf download hf://spaces/Deflook/defapp/index.html
-
curl -L -o index.html https://huggingface.co/spaces/Deflook/defapp/resolve/main/index.html
27.3 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>PurpleHoop - Basketball Training</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/hotkeys-js/dist/hotkeys.min.js"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <style> | |
| .heatmap { | |
| background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><rect width="100%" height="100%" fill="black"/></svg>'); | |
| position: relative; | |
| } | |
| .heat-point { | |
| position: absolute; | |
| border-radius: 50%; | |
| transform: translate(-50%, -50%); | |
| opacity: 0.7; | |
| transition: all 0.3s ease; | |
| } | |
| .court { | |
| background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="280" viewBox="0 0 300 280"><rect x="0" y="0" width="300" height="280" fill="none" stroke="%23a855f7" stroke-width="2"/><circle cx="150" cy="140" r="60" fill="none" stroke="%23a855f7" stroke-width="2"/><line x1="0" y1="140" x2="300" y2="140" stroke="%23a855f7" stroke-width="2"/><rect x="0" y="100" width="60" height="80" fill="none" stroke="%23a855f7" stroke-width="2"/><rect x="240" y="100" width="60" height="80" fill="none" stroke="%23a855f7" stroke-width="2"/></svg>'); | |
| background-repeat: no-repeat; | |
| background-position: center; | |
| background-size: contain; | |
| } | |
| .gradient-bg { | |
| background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%); | |
| } | |
| .pulse-animation { | |
| animation: pulse 2s infinite; | |
| } | |
| @keyframes pulse { | |
| 0% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7); } | |
| 70% { box-shadow: 0 0 0 10px rgba(168, 85, 247, 0); } | |
| 100% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); } | |
| } | |
| .shot-trail { | |
| position: absolute; | |
| background: #a855f7; | |
| height: 2px; | |
| transform-origin: left center; | |
| z-index: 10; | |
| } | |
| </style> | |
| </head> | |
| <body class="gradient-bg text-white min-h-screen"> | |
| <div class="container mx-auto px-4 py-8"> | |
| <!-- Header --> | |
| <header class="flex justify-between items-center mb-8"> | |
| <div class="flex items-center"> | |
| <i class="fas fa-basketball-ball text-4xl text-purple-500 mr-3"></i> | |
| <h1 class="text-3xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-purple-400 to-purple-600"> | |
| PurpleHoop | |
| </h1> | |
| </div> | |
| <div class="flex space-x-4"> | |
| <button class="bg-purple-600 hover:bg-purple-700 px-4 py-2 rounded-lg flex items-center"> | |
| <i class="fas fa-user mr-2"></i> Profile | |
| </button> | |
| <button class="bg-gray-800 hover:bg-gray-700 px-4 py-2 rounded-lg flex items-center"> | |
| <i class="fas fa-cog mr-2"></i> Settings | |
| </button> | |
| </div> | |
| </header> | |
| <!-- Main Content --> | |
| <div class="grid grid-cols-1 lg:grid-cols-3 gap-8"> | |
| <!-- Camera Feed and Tracking --> | |
| <div class="lg:col-span-2 space-y-6"> | |
| <div class="bg-black rounded-xl overflow-hidden shadow-2xl"> | |
| <div class="p-4 bg-gray-900 flex justify-between items-center"> | |
| <h2 class="text-xl font-semibold text-purple-400"> | |
| <i class="fas fa-video mr-2"></i> Shot Tracking | |
| </h2> | |
| <div class="flex space-x-2"> | |
| <button id="startTracking" class="bg-purple-600 hover:bg-purple-700 px-3 py-1 rounded-lg flex items-center pulse-animation"> | |
| <i class="fas fa-play mr-2"></i> Start Session | |
| </button> | |
| <button id="toggleCamera" class="bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded-lg flex items-center"> | |
| <i class="fas fa-camera mr-2"></i> Switch Camera | |
| </button> | |
| </div> | |
| </div> | |
| <div class="relative" style="padding-bottom: 56.25%;"> | |
| <!-- Camera Feed Placeholder --> | |
| <div id="cameraFeed" class="absolute inset-0 bg-gray-800 flex items-center justify-center"> | |
| <div class="text-center"> | |
| <i class="fas fa-basketball-ball text-6xl text-gray-600 mb-4"></i> | |
| <p class="text-gray-400">Camera feed will appear here</p> | |
| <button id="enableCamera" class="mt-4 bg-purple-600 hover:bg-purple-700 px-4 py-2 rounded-lg"> | |
| Enable Camera | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Overlay for computer vision tracking --> | |
| <canvas id="trackingOverlay" class="absolute inset-0 w-full h-full pointer-events-none" style="display: none;"></canvas> | |
| <!-- Shot trails container --> | |
| <div id="shotTrails" class="absolute inset-0 w-full h-full pointer-events-none"></div> | |
| </div> | |
| <div class="p-4 bg-gray-900 flex justify-between items-center"> | |
| <div class="text-sm text-gray-400"> | |
| <span id="shotCount">0</span> shots tracked | |
| </div> | |
| <div class="flex space-x-2"> | |
| <button id="showHeatmap" class="bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded-lg flex items-center"> | |
| <i class="fas fa-fire mr-2"></i> Heatmap | |
| </button> | |
| <button id="showTrajectory" class="bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded-lg flex items-center"> | |
| <i class="fas fa-project-diagram mr-2"></i> Trajectories | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Session Stats --> | |
| <div class="bg-gray-900 rounded-xl p-6 shadow-2xl"> | |
| <h2 class="text-xl font-semibold text-purple-400 mb-4"> | |
| <i class="fas fa-chart-line mr-2"></i> Session Statistics | |
| </h2> | |
| <div class="grid grid-cols-2 md:grid-cols-4 gap-4"> | |
| <div class="bg-gray-800 p-4 rounded-lg"> | |
| <div class="text-sm text-gray-400">Made Shots</div> | |
| <div class="text-2xl font-bold text-purple-400">12</div> | |
| <div class="text-xs text-gray-500">+2 from last</div> | |
| </div> | |
| <div class="bg-gray-800 p-4 rounded-lg"> | |
| <div class="text-sm text-gray-400">Shot %</div> | |
| <div class="text-2xl font-bold text-purple-400">48%</div> | |
| <div class="text-xs text-gray-500">3% improvement</div> | |
| </div> | |
| <div class="bg-gray-800 p-4 rounded-lg"> | |
| <div class="text-sm text-gray-400">Avg Arc</div> | |
| <div class="text-2xl font-bold text-purple-400">47°</div> | |
| <div class="text-xs text-gray-500">Ideal: 45-50°</div> | |
| </div> | |
| <div class="bg-gray-800 p-4 rounded-lg"> | |
| <div class="text-sm text-gray-400">Release Time</div> | |
| <div class="text-2xl font-bold text-purple-400">0.8s</div> | |
| <div class="text-xs text-gray-500">Consistent</div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Sidebar with Heatmap and Analytics --> | |
| <div class="space-y-6"> | |
| <!-- Heatmap Visualization --> | |
| <div class="bg-gray-900 rounded-xl p-6 shadow-2xl"> | |
| <h2 class="text-xl font-semibold text-purple-400 mb-4"> | |
| <i class="fas fa-fire mr-2"></i> Shot Heatmap | |
| </h2> | |
| <div class="heatmap court relative" style="height: 280px; width: 100%;"> | |
| <!-- Heatmap points will be added here by JavaScript --> | |
| </div> | |
| <div class="mt-4 flex justify-between text-xs text-gray-400"> | |
| <span>Fewer shots</span> | |
| <span>More shots</span> | |
| </div> | |
| <div class="h-2 mt-1 rounded-full bg-gradient-to-r from-gray-800 via-purple-600 to-purple-400"></div> | |
| </div> | |
| <!-- Shot Chart --> | |
| <div class="bg-gray-900 rounded-xl p-6 shadow-2xl"> | |
| <h2 class="text-xl font-semibold text-purple-400 mb-4"> | |
| <i class="fas fa-bullseye mr-2"></i> Shot Accuracy | |
| </h2> | |
| <canvas id="shotChart" height="200"></canvas> | |
| </div> | |
| <!-- Shot Types --> | |
| <div class="bg-gray-900 rounded-xl p-6 shadow-2xl"> | |
| <h2 class="text-xl font-semibold text-purple-400 mb-4"> | |
| <i class="fas fa-tags mr-2"></i> Shot Types | |
| </h2> | |
| <div class="space-y-3"> | |
| <div> | |
| <div class="flex justify-between text-sm mb-1"> | |
| <span>3-Pointers</span> | |
| <span>8/20 (40%)</span> | |
| </div> | |
| <div class="w-full bg-gray-800 rounded-full h-2"> | |
| <div class="bg-purple-500 h-2 rounded-full" style="width: 40%"></div> | |
| </div> | |
| </div> | |
| <div> | |
| <div class="flex justify-between text-sm mb-1"> | |
| <span>Mid-Range</span> | |
| <span>12/15 (80%)</span> | |
| </div> | |
| <div class="w-full bg-gray-800 rounded-full h-2"> | |
| <div class="bg-purple-500 h-2 rounded-full" style="width: 80%"></div> | |
| </div> | |
| </div> | |
| <div> | |
| <div class="flex justify-between text-sm mb-1"> | |
| <span>Layups</span> | |
| <span>10/12 (83%)</span> | |
| </div> | |
| <div class="w-full bg-gray-800 rounded-full h-2"> | |
| <div class="bg-purple-500 h-2 rounded-full" style="width: 83%"></div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Session History --> | |
| <div class="mt-12 bg-gray-900 rounded-xl p-6 shadow-2xl"> | |
| <h2 class="text-xl font-semibold text-purple-400 mb-4"> | |
| <i class="fas fa-history mr-2"></i> Recent Sessions | |
| </h2> | |
| <div class="overflow-x-auto"> | |
| <table class="min-w-full divide-y divide-gray-800"> | |
| <thead> | |
| <tr> | |
| <th class="px-4 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider">Date</th> | |
| <th class="px-4 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider">Duration</th> | |
| <th class="px-4 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider">Shots</th> | |
| <th class="px-4 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider">Accuracy</th> | |
| <th class="px-4 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider">Trend</th> | |
| </tr> | |
| </thead> | |
| <tbody class="divide-y divide-gray-800"> | |
| <tr> | |
| <td class="px-4 py-3 whitespace-nowrap text-sm">Today</td> | |
| <td class="px-4 py-3 whitespace-nowrap text-sm">45 min</td> | |
| <td class="px-4 py-3 whitespace-nowrap text-sm">120</td> | |
| <td class="px-4 py-3 whitespace-nowrap text-sm">68%</td> | |
| <td class="px-4 py-3 whitespace-nowrap text-sm text-green-400"><i class="fas fa-arrow-up mr-1"></i> 5%</td> | |
| </tr> | |
| <tr> | |
| <td class="px-4 py-3 whitespace-nowrap text-sm">Yesterday</td> | |
| <td class="px-4 py-3 whitespace-nowrap text-sm">30 min</td> | |
| <td class="px-4 py-3 whitespace-nowrap text-sm">85</td> | |
| <td class="px-4 py-3 whitespace-nowrap text-sm">63%</td> | |
| <td class="px-4 py-3 whitespace-nowrap text-sm text-red-400"><i class="fas fa-arrow-down mr-1"></i> 2%</td> | |
| </tr> | |
| <tr> | |
| <td class="px-4 py-3 whitespace-nowrap text-sm">May 15</td> | |
| <td class="px-4 py-3 whitespace-nowrap text-sm">60 min</td> | |
| <td class="px-4 py-3 whitespace-nowrap text-sm">150</td> | |
| <td class="px-4 py-3 whitespace-nowrap text-sm">65%</td> | |
| <td class="px-4 py-3 whitespace-nowrap text-sm text-green-400"><i class="fas fa-arrow-up mr-1"></i> 8%</td> | |
| </tr> | |
| </tbody> | |
| </table> | |
| </div> | |
| </div> | |
| </div> | |
| <script> | |
| // Simulate computer vision tracking | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Initialize shot chart | |
| const shotCtx = document.getElementById('shotChart').getContext('2d'); | |
| const shotChart = new Chart(shotCtx, { | |
| type: 'line', | |
| data: { | |
| labels: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'], | |
| datasets: [ | |
| { | |
| label: 'Made', | |
| data: [3, 5, 7, 8, 10, 12, 14, 15, 17, 20], | |
| borderColor: '#a855f7', | |
| backgroundColor: 'rgba(168, 85, 247, 0.1)', | |
| tension: 0.3, | |
| fill: true | |
| }, | |
| { | |
| label: 'Missed', | |
| data: [2, 3, 3, 4, 5, 5, 6, 6, 7, 8], | |
| borderColor: '#6b7280', | |
| backgroundColor: 'rgba(107, 114, 128, 0.1)', | |
| tension: 0.3, | |
| fill: true | |
| } | |
| ] | |
| }, | |
| options: { | |
| responsive: true, | |
| plugins: { | |
| legend: { | |
| position: 'top', | |
| labels: { | |
| color: '#e5e7eb' | |
| } | |
| } | |
| }, | |
| scales: { | |
| y: { | |
| beginAtZero: true, | |
| grid: { | |
| color: 'rgba(255, 255, 255, 0.1)' | |
| }, | |
| ticks: { | |
| color: '#9ca3af' | |
| } | |
| }, | |
| x: { | |
| grid: { | |
| color: 'rgba(255, 255, 255, 0.1)' | |
| }, | |
| ticks: { | |
| color: '#9ca3af' | |
| } | |
| } | |
| } | |
| } | |
| }); | |
| // Generate heatmap points | |
| const heatmap = document.querySelector('.heatmap'); | |
| const heatmapWidth = heatmap.offsetWidth; | |
| const heatmapHeight = heatmap.offsetHeight; | |
| // Common shooting spots with different intensities | |
| const shootingSpots = [ | |
| { x: 0.2, y: 0.7, intensity: 8 }, // Left corner | |
| { x: 0.8, y: 0.7, intensity: 7 }, // Right corner | |
| { x: 0.5, y: 0.6, intensity: 15 }, // Top of the key | |
| { x: 0.3, y: 0.5, intensity: 5 }, // Left wing | |
| { x: 0.7, y: 0.5, intensity: 6 }, // Right wing | |
| { x: 0.5, y: 0.8, intensity: 10 }, // Free throw | |
| { x: 0.15, y: 0.9, intensity: 3 }, // Left baseline | |
| { x: 0.85, y: 0.9, intensity: 4 } // Right baseline | |
| ]; | |
| shootingSpots.forEach(spot => { | |
| for (let i = 0; i < spot.intensity; i++) { | |
| // Add some randomness to the position | |
| const xVar = (Math.random() * 0.1) - 0.05; | |
| const yVar = (Math.random() * 0.1) - 0.05; | |
| const point = document.createElement('div'); | |
| point.className = 'heat-point'; | |
| // Position the point | |
| const xPos = (spot.x + xVar) * 100; | |
| const yPos = (spot.y + yVar) * 100; | |
| point.style.left = `${xPos}%`; | |
| point.style.top = `${yPos}%`; | |
| // Size and color based on intensity | |
| const size = 10 + (Math.random() * 10); | |
| const opacity = 0.3 + (Math.random() * 0.5); | |
| const hue = 270 + (Math.random() * 20 - 10); // Purple variations | |
| point.style.width = `${size}px`; | |
| point.style.height = `${size}px`; | |
| point.style.backgroundColor = `hsla(${hue}, 80%, 60%, ${opacity})`; | |
| heatmap.appendChild(point); | |
| } | |
| }); | |
| // Simulate camera feed and tracking | |
| const enableCameraBtn = document.getElementById('enableCamera'); | |
| const startTrackingBtn = document.getElementById('startTracking'); | |
| const cameraFeed = document.getElementById('cameraFeed'); | |
| const trackingOverlay = document.getElementById('trackingOverlay'); | |
| const shotTrails = document.getElementById('shotTrails'); | |
| const shotCount = document.getElementById('shotCount'); | |
| let shotCounter = 0; | |
| let trackingInterval; | |
| enableCameraBtn.addEventListener('click', function() { | |
| // Simulate camera activation | |
| cameraFeed.innerHTML = ` | |
| <div class="absolute inset-0 bg-gray-900 flex items-center justify-center"> | |
| <div class="text-center"> | |
| <div class="court w-full h-full"></div> | |
| </div> | |
| </div> | |
| `; | |
| trackingOverlay.style.display = 'block'; | |
| enableCameraBtn.style.display = 'none'; | |
| startTrackingBtn.disabled = false; | |
| // Initialize tracking overlay | |
| trackingOverlay.width = trackingOverlay.offsetWidth; | |
| trackingOverlay.height = trackingOverlay.offsetHeight; | |
| const ctx = trackingOverlay.getContext('2d'); | |
| // Draw some initial tracking markers | |
| ctx.strokeStyle = '#a855f7'; | |
| ctx.lineWidth = 2; | |
| // Court lines | |
| ctx.beginPath(); | |
| ctx.arc(trackingOverlay.width/2, trackingOverlay.height/2, trackingOverlay.width/5, 0, Math.PI * 2); | |
| ctx.stroke(); | |
| ctx.beginPath(); | |
| ctx.moveTo(0, trackingOverlay.height/2); | |
| ctx.lineTo(trackingOverlay.width, trackingOverlay.height/2); | |
| ctx.stroke(); | |
| }); | |
| startTrackingBtn.addEventListener('click', function() { | |
| if (startTrackingBtn.textContent.includes('Start')) { | |
| startTrackingBtn.innerHTML = '<i class="fas fa-stop mr-2"></i> Stop Session'; | |
| startTrackingBtn.classList.remove('bg-purple-600'); | |
| startTrackingBtn.classList.add('bg-red-600'); | |
| startTrackingBtn.classList.remove('pulse-animation'); | |
| // Start simulated tracking | |
| trackingInterval = setInterval(simulateShotTracking, 3000); | |
| } else { | |
| startTrackingBtn.innerHTML = '<i class="fas fa-play mr-2"></i> Start Session'; | |
| startTrackingBtn.classList.add('bg-purple-600'); | |
| startTrackingBtn.classList.remove('bg-red-600'); | |
| clearInterval(trackingInterval); | |
| } | |
| }); | |
| function simulateShotTracking() { | |
| shotCounter++; | |
| shotCount.textContent = shotCounter; | |
| // Random shot result (60% make rate) | |
| const madeShot = Math.random() < 0.6; | |
| // Random shot position | |
| const startX = 50 + (Math.random() * 40 - 20); | |
| const startY = 80 + (Math.random() * 10); | |
| const endX = 45 + (Math.random() * 10); | |
| const endY = 40 + (Math.random() * 10); | |
| // Create shot trail | |
| const trail = document.createElement('div'); | |
| trail.className = 'shot-trail'; | |
| // Position the trail | |
| const startPosX = (startX / 100) * trackingOverlay.offsetWidth; | |
| const startPosY = (startY / 100) * trackingOverlay.offsetHeight; | |
| const endPosX = (endX / 100) * trackingOverlay.offsetWidth; | |
| const endPosY = (endY / 100) * trackingOverlay.offsetHeight; | |
| trail.style.left = `${startPosX}px`; | |
| trail.style.top = `${startPosY}px`; | |
| // Calculate length and angle | |
| const dx = endPosX - startPosX; | |
| const dy = endPosY - startPosY; | |
| const length = Math.sqrt(dx * dx + dy * dy); | |
| const angle = Math.atan2(dy, dx) * 180 / Math.PI; | |
| trail.style.width = `${length}px`; | |
| trail.style.transform = `rotate(${angle}deg)`; | |
| // Add to DOM | |
| shotTrails.appendChild(trail); | |
| // Animate the shot | |
| setTimeout(() => { | |
| trail.style.width = '0'; | |
| trail.style.opacity = '0'; | |
| trail.style.transition = 'width 0.5s ease-out, opacity 0.5s ease-out'; | |
| // Add shot marker | |
| setTimeout(() => { | |
| const marker = document.createElement('div'); | |
| marker.className = 'absolute w-4 h-4 rounded-full'; | |
| marker.style.left = `${endPosX}px`; | |
| marker.style.top = `${endPosY}px`; | |
| marker.style.backgroundColor = madeShot ? '#a855f7' : '#6b7280'; | |
| marker.style.transform = 'translate(-50%, -50%)'; | |
| marker.style.boxShadow = '0 0 10px ' + (madeShot ? '#a855f7' : '#6b7280'); | |
| shotTrails.appendChild(marker); | |
| // Remove elements after animation | |
| setTimeout(() => { | |
| trail.remove(); | |
| marker.remove(); | |
| }, 3000); | |
| }, 500); | |
| }, 100); | |
| // Update chart data periodically | |
| if (shotCounter % 5 === 0) { | |
| const madeData = shotChart.data.datasets[0].data; | |
| const missedData = shotChart.data.datasets[1].data; | |
| madeData.push(madeData[madeData.length-1] + (madeShot ? 1 : 0)); | |
| missedData.push(missedData[missedData.length-1] + (madeShot ? 0 : 1)); | |
| if (madeData.length > 10) { | |
| madeData.shift(); | |
| missedData.shift(); | |
| } | |
| shotChart.update(); | |
| } | |
| } | |
| // Toggle heatmap visibility | |
| const showHeatmapBtn = document.getElementById('showHeatmap'); | |
| const showTrajectoryBtn = document.getElementById('showTrajectory'); | |
| showHeatmapBtn.addEventListener('click', function() { | |
| heatmap.style.display = heatmap.style.display === 'none' ? 'block' : 'none'; | |
| }); | |
| showTrajectoryBtn.addEventListener('click', function() { | |
| shotTrails.style.display = shotTrails.style.display === 'none' ? 'block' : 'none'; | |
| }); | |
| }); | |
| </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=Deflook/defapp" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |