File size: 5,556 Bytes
ab9f226
dd1b723
 
9bb6072
 
 
 
dd1b723
 
9bb6072
 
 
 
 
 
 
 
 
 
 
 
dd1b723
9bb6072
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dd1b723
9bb6072
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dd1b723
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Video Caption AI</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div id="app">
        <!-- Video Container -->
        <div class="video-container">
            <video id="videoPlayer" class="video-player" controls></video>
            <div class="video-placeholder">
                <svg width="120" height="120" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
                    <rect x="2" y="5" width="20" height="14" rx="2" ry="2"></rect>
                    <polygon points="10 9 15 12 10 15"></polygon>
                </svg>
                <p>Upload a video to begin</p>
            </div>
        </div>

        <!-- Overlay UI -->
        <div class="overlay-ui">
            <!-- Top Bar -->
            <div class="top-bar">
                <div class="app-title">
                    <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                        <rect x="2" y="5" width="20" height="14" rx="2" ry="2"></rect>
                        <polygon points="10 9 15 12 10 15"></polygon>
                    </svg>
                    <span>Video Caption AI</span>
                </div>
                <div class="top-controls">
                    <button class="icon-button" id="toggleDevice" title="Toggle CPU/GPU">
                        <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                            <rect x="4" y="4" width="16" height="16" rx="2" ry="2"></rect>
                            <rect x="9" y="9" width="6" height="6"></rect>
                            <line x1="9" y1="1" x2="9" y2="4"></line>
                            <line x1="15" y1="1" x2="15" y2="4"></line>
                            <line x1="9" y1="20" x2="9" y2="23"></line>
                            <line x1="15" y1="20" x2="15" y2="23"></line>
                            <line x1="20" y1="9" x2="23" y2="9"></line>
                            <line x1="20" y1="14" x2="23" y2="14"></line>
                            <line x1="1" y1="9" x2="4" y2="9"></line>
                            <line x1="1" y1="14" x2="4" y2="14"></line>
                        </svg>
                        <span class="device-label">CPU</span>
                    </button>
                    <button class="icon-button" id="uploadBtn">
                        <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                            <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
                            <polyline points="17 8 12 3 7 8"></polyline>
                            <line x1="12" y1="3" x2="12" y2="15"></line>
                        </svg>
                        Upload Video
                    </button>
                </div>
            </div>

            <!-- Caption Panel -->
            <div class="caption-panel" id="captionPanel">
                <div class="panel-header">
                    <h2>Video Analysis</h2>
                    <button class="close-btn" id="closePanel">
                        <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                            <line x1="18" y1="6" x2="6" y2="18"></line>
                            <line x1="6" y1="6" x2="18" y2="18"></line>
                        </svg>
                    </button>
                </div>
                
                <div class="analysis-settings">
                    <div class="setting-group">
                        <label>Frames to Analyze</label>
                        <input type="range" id="frameCount" min="4" max="16" value="8" class="slider">
                        <span id="frameCountValue">8</span>
                    </div>
                    <div class="setting-group">
                        <label>Max Duration (seconds)</label>
                        <input type="range" id="maxDuration" min="5" max="30" value="15" class="slider">
                        <span id="maxDurationValue">15</span>
                    </div>
                </div>

                <button class="analyze-btn" id="analyzeBtn">
                    <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                        <circle cx="11" cy="11" r="8"></circle>
                        <path d="m21 21-4.35-4.35"></path>
                    </svg>
                    Analyze Video
                </button>

                <div class="results-container" id="resultsContainer">
                    <!-- Results will be populated here -->
                </div>
            </div>

            <!-- Loading Overlay -->
            <div class="loading-overlay" id="loadingOverlay">
                <div class="loading-content">
                    <div class="spinner"></div>
                    <p id="loadingText">Processing video...</p>
                    <div class="progress-bar">
                        <div class="progress-fill" id="progressFill"></div>
                    </div>
                </div>
            </div>
        </div>

        <!-- Hidden file input -->
        <input type="file" id="fileInput" accept="video/*" style="display: none;">
    </div>

    <script type="module" src="index.js"></script>
</body>
</html>