File size: 8,371 Bytes
2251ba3
 
 
 
e01254e
2251ba3
 
e01254e
 
 
 
 
 
 
 
 
 
 
 
 
 
2251ba3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>PodCraft - AI Podcast Generator</title>
    <script type="text/javascript">
        // Set the API base URL dynamically based on the current domain
        window.API_BASE_URL = '';  // Empty string means use current domain
        
        // Override fetch to rewrite localhost:8000 URLs
        const originalFetch = window.fetch;
        window.fetch = function(url, options) {
            if (typeof url === 'string' && url.includes('localhost:8000')) {
                // Replace localhost:8000 with current origin (empty string)
                url = url.replace('http://localhost:8000', '');
            }
            return originalFetch.call(this, url, options);
        };
    </script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" />
    <style>
        body {
            margin: 0;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
                'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            background-color: #1a1a2e;
            color: #ffffff;
        }
        
        * {
            box-sizing: border-box;
        }
        
        .App {
            text-align: center;
        }
        
        .App-header {
            background-color: #0f0f1a;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            padding: 2rem;
        }
        
        .logo {
            display: flex;
            align-items: center;
            margin-bottom: 1rem;
        }
        
        .logo i {
            font-size: 3rem;
            color: #6366F1;
            margin-right: 1rem;
        }
        
        .logo h1 {
            font-size: 3rem;
            margin: 0;
            background: linear-gradient(90deg, #6366F1, #8B5CF6);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        
        .tagline {
            font-size: 1.5rem;
            margin-bottom: 3rem;
            color: #94a3b8;
        }
        
        .status-container {
            width: 100%;
            max-width: 800px;
            margin-bottom: 3rem;
        }
        
        .status-card {
            background-color: #1e1e2d;
            border-radius: 0.5rem;
            padding: 1.5rem;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        
        .status-header {
            display: flex;
            align-items: center;
            margin-bottom: 1rem;
        }
        
        .status-header i {
            font-size: 1.5rem;
            color: #6366F1;
            margin-right: 0.5rem;
        }
        
        .status-header h3 {
            margin: 0;
            font-size: 1.2rem;
        }
        
        .status-content {
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        
        .status-indicator {
            padding: 0.5rem 1.5rem;
            border-radius: 2rem;
            font-weight: bold;
            margin-bottom: 1rem;
        }
        
        .status-indicator.checking {
            background-color: #374151;
            color: #d1d5db;
        }
        
        .status-indicator.online {
            background-color: #065f46;
            color: #a7f3d0;
        }
        
        .status-indicator.offline {
            background-color: #991b1b;
            color: #fecaca;
        }
        
        .status-message {
            font-style: italic;
            color: #94a3b8;
        }
        
        .features {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 2rem;
            margin-bottom: 3rem;
            width: 100%;
            max-width: 1000px;
        }
        
        .feature {
            background-color: #1e1e2d;
            border-radius: 0.5rem;
            padding: 1.5rem;
            width: 100%;
            max-width: 300px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            transition: transform 0.3s ease;
        }
        
        .feature:hover {
            transform: translateY(-5px);
        }
        
        .feature i {
            font-size: 2.5rem;
            color: #8B5CF6;
            margin-bottom: 1rem;
        }
        
        .feature h3 {
            margin: 0;
            margin-bottom: 0.5rem;
            font-size: 1.2rem;
        }
        
        .feature p {
            margin: 0;
            color: #94a3b8;
            font-size: 0.9rem;
        }
        
        .note {
            margin-top: 2rem;
            padding: 1rem;
            background-color: #1e1e2d;
            border-radius: 0.5rem;
            width: 100%;
            max-width: 800px;
        }
        
        .note p {
            margin: 0.5rem 0;
            color: #94a3b8;
            font-size: 0.9rem;
        }
    </style>
</head>
<body>
    <div class="App">
        <header class="App-header">
            <div class="logo">
                <i class="fas fa-microphone-alt"></i>
                <h1>PodCraft</h1>
            </div>
            <p class="tagline">AI-Powered Podcast Generator</p>
            
            <div class="status-container">
                <div class="status-card">
                    <div class="status-header">
                        <i class="fas fa-server"></i>
                        <h3>API Status</h3>
                    </div>
                    <div class="status-content">
                        <div id="status-indicator" class="status-indicator checking">
                            Checking...
                        </div>
                        <p id="status-message" class="status-message"></p>
                    </div>
                </div>
            </div>
            
            <div class="features">
                <div class="feature">
                    <i class="fas fa-robot"></i>
                    <h3>AI Debate</h3>
                    <p>Create engaging debates between AI personalities</p>
                </div>
                <div class="feature">
                    <i class="fas fa-podcast"></i>
                    <h3>Podcast Generation</h3>
                    <p>Convert debates into audio podcasts</p>
                </div>
                <div class="feature">
                    <i class="fas fa-cogs"></i>
                    <h3>Workflow Editor</h3>
                    <p>Customize the podcast creation process</p>
                </div>
            </div>
            
            <div class="note">
                <p>Note: This is a simplified UI for the application.</p>
                <p>Access the API at <a href="/docs" style="color: #8B5CF6;">/docs</a> for full functionality.</p>
                <p>Check API status at <a href="/api/status" style="color: #8B5CF6;">/api/status</a>.</p>
            </div>
        </header>
    </div>

    <script>
        // Check API status on load
        document.addEventListener('DOMContentLoaded', function() {
            const statusIndicator = document.getElementById('status-indicator');
            const statusMessage = document.getElementById('status-message');
            
            fetch('/api/status')
                .then(response => response.json())
                .then(data => {
                    statusIndicator.className = 'status-indicator online';
                    statusIndicator.textContent = 'Online';
                    statusMessage.textContent = data.message || 'API is running';
                })
                .catch(error => {
                    statusIndicator.className = 'status-indicator offline';
                    statusIndicator.textContent = 'Offline';
                    statusMessage.textContent = 'Could not connect to API';
                    console.error('API Error:', error);
                });
        });
    </script>
</body>
</html>