File size: 15,663 Bytes
add8d49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AI Meeting Simulator</title>
    <base target="_self">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://cdn.jsdelivr.net/npm/@preline/[email protected]/dist/preline.min.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }
        .speaking {
            animation: pulse 1s infinite;
            box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.5);
        }
        .chat-message {
            transition: all 0.3s ease;
        }
        .chat-message:hover {
            background-color: rgba(243, 244, 246, 0.5);
        }
    </style>
</head>
<body class="bg-gray-100 dark:bg-gray-900 text-gray-900 dark:text-gray-100">
    <div class="flex flex-col h-screen">
        <!-- Header -->
        <header class="bg-white dark:bg-gray-800 shadow-sm py-3 px-6 flex justify-between items-center">
            <div class="flex items-center space-x-4">
                <h1 class="text-xl font-bold">AI Meeting Simulator</h1>
                <span class="text-sm bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 px-2 py-1 rounded-full">Meeting in progress</span>
            </div>
            <div class="flex items-center space-x-4">
                <button id="downloadBtn" class="flex items-center space-x-1 bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg transition">
                    <i class="fas fa-download"></i>
                    <span>Download Minutes</span>
                </button>
                <button class="p-2 rounded-full hover:bg-gray-200 dark:hover:bg-gray-700">
                    <i class="fas fa-cog"></i>
                </button>
            </div>
        </header>

        <!-- Main Content -->
        <div class="flex flex-1 overflow-hidden">
            <!-- Video Grid -->
            <div class="flex-1 p-4 overflow-y-auto">
                <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
                    <!-- AI Participants will be inserted here -->
                </div>
            </div>

            <!-- Chat Panel -->
            <div class="w-80 border-l border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 flex flex-col">
                <div class="p-4 border-b border-gray-200 dark:border-gray-700">
                    <h2 class="font-semibold text-lg">Meeting Chat</h2>
                </div>
                <div id="chatMessages" class="flex-1 overflow-y-auto p-4 space-y-4">
                    <!-- Chat messages will be inserted here -->
                </div>
                <div class="p-4 border-t border-gray-200 dark:border-gray-700">
                    <div class="flex space-x-2">
                        <input id="messageInput" type="text" placeholder="Type a message..." 
                            class="flex-1 px-4 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500">
                        <button id="sendBtn" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg transition">
                            <i class="fas fa-paper-plane"></i>
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        // AI Participants Data
        const participants = [
            {
                id: 1,
                name: "Dr. Veronica Vetter",
                title: "AI Research Scientist",
                avatar: "https://images.unsplash.com/photo-1573496359142-b8d87734a5a2?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=200&h=200&q=80",
                responses: [
                    "From my research, I've found that the optimal approach would be to implement a multi-layered neural network.",
                    "The data suggests we should consider alternative methodologies to improve accuracy.",
                    "Have we considered the ethical implications of this approach?"
                ]
            },
            {
                id: 2,
                name: "Simple Sam",
                title: "AI Assistant",
                avatar: "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=200&h=200&q=80",
                responses: [
                    "I think we should keep it simple and straightforward.",
                    "Why complicate things when a basic solution would work?",
                    "Let me break this down into simpler terms for everyone."
                ]
            },
            {
                id: 3,
                name: "Dr. Evelyn Doubt",
                title: "AI Ethicist",
                avatar: "https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=200&h=200&q=80",
                responses: [
                    "I'm not entirely convinced this is the right path forward.",
                    "We need to consider the potential negative consequences of this approach.",
                    "Has anyone thought about the long-term implications of this decision?"
                ]
            },
            {
                id: 4,
                name: "Optimistic Olivia",
                title: "AI Strategist",
                avatar: "https://images.unsplash.com/photo-1544005313-94ddf0286df2?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=200&h=200&q=80",
                responses: [
                    "This is going to be amazing! I can already see the positive impact.",
                    "I'm so excited about the possibilities this opens up for us!",
                    "Every challenge is just an opportunity in disguise."
                ]
            },
            {
                id: 5,
                name: "Technical Tom",
                title: "AI Engineer",
                avatar: "https://images.unsplash.com/photo-1506794778202-cad84cf45f1d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=200&h=200&q=80",
                responses: [
                    "Let me explain the technical details behind this implementation.",
                    "The API documentation suggests we should use the following parameters...",
                    "I've identified a potential performance bottleneck we should address."
                ]
            }
        ];

        // Initialize the meeting
        document.addEventListener('DOMContentLoaded', function() {
            const videoGrid = document.querySelector('.grid');
            const chatMessages = document.getElementById('chatMessages');
            const messageInput = document.getElementById('messageInput');
            const sendBtn = document.getElementById('sendBtn');
            const downloadBtn = document.getElementById('downloadBtn');
            
            let meetingTranscript = [];
            let currentSpeaker = null;
            let speechTimeout;

            // Render participants
            participants.forEach(participant => {
                const participantEl = document.createElement('div');
                participantEl.className = 'bg-white dark:bg-gray-800 rounded-lg shadow overflow-hidden flex flex-col';
                participantEl.innerHTML = `
                    <div class="relative pt-[75%] bg-gray-200 dark:bg-gray-700">
                        <img src="${participant.avatar}" alt="${participant.name}" 
                            class="absolute top-0 left-0 w-full h-full object-cover">
                    </div>
                    <div class="p-3">
                        <h3 class="font-semibold">${participant.name}</h3>
                        <p class="text-sm text-gray-500 dark:text-gray-400">${participant.title}</p>
                    </div>
                `;
                videoGrid.appendChild(participantEl);
            });

            // Add welcome messages
            setTimeout(() => {
                addSystemMessage("Meeting started. All AI participants have joined.");
                
                participants.forEach((participant, index) => {
                    setTimeout(() => {
                        const message = participant.responses[0];
                        addParticipantMessage(participant, message);
                    }, (index + 1) * 1500);
                });
            }, 1000);

            // Send message function
            function sendMessage() {
                const message = messageInput.value.trim();
                if (message) {
                    addUserMessage(message);
                    messageInput.value = '';
                    
                    // Simulate AI responses
                    setTimeout(() => {
                        const randomParticipant = participants[Math.floor(Math.random() * participants.length)];
                        const randomResponse = randomParticipant.responses[Math.floor(Math.random() * randomParticipant.responses.length)];
                        addParticipantMessage(randomParticipant, randomResponse);
                    }, 1000 + Math.random() * 2000);
                }
            }

            // Add user message to chat
            function addUserMessage(message) {
                const timestamp = new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
                const messageEl = document.createElement('div');
                messageEl.className = 'chat-message flex justify-end';
                messageEl.innerHTML = `
                    <div class="max-w-xs md:max-w-md bg-blue-600 text-white rounded-lg p-3">
                        <p>${message}</p>
                        <p class="text-xs text-blue-200 text-right mt-1">${timestamp}</p>
                    </div>
                `;
                chatMessages.appendChild(messageEl);
                chatMessages.scrollTop = chatMessages.scrollHeight;
                
                // Add to transcript
                meetingTranscript.push({
                    speaker: "You",
                    message: message,
                    timestamp: new Date().toISOString()
                });
            }

            // Add participant message to chat
            function addParticipantMessage(participant, message) {
                const timestamp = new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
                const messageEl = document.createElement('div');
                messageEl.className = 'chat-message';
                messageEl.innerHTML = `
                    <div class="flex space-x-2">
                        <img src="${participant.avatar}" alt="${participant.name}" class="w-8 h-8 rounded-full object-cover">
                        <div>
                            <div class="font-semibold">${participant.name}</div>
                            <div class="bg-gray-200 dark:bg-gray-700 rounded-lg p-3 mt-1 max-w-xs md:max-w-md">
                                <p>${message}</p>
                                <p class="text-xs text-gray-500 dark:text-gray-400 mt-1">${timestamp}</p>
                            </div>
                        </div>
                    </div>
                `;
                chatMessages.appendChild(messageEl);
                chatMessages.scrollTop = chatMessages.scrollHeight;
                
                // Add to transcript
                meetingTranscript.push({
                    speaker: participant.name,
                    message: message,
                    timestamp: new Date().toISOString()
                });
                
                // Show speaking animation
                highlightSpeaker(participant.id);
            }

            // Add system message to chat
            function addSystemMessage(message) {
                const messageEl = document.createElement('div');
                messageEl.className = 'chat-message text-center';
                messageEl.innerHTML = `
                    <div class="text-xs text-gray-500 dark:text-gray-400 italic">${message}</div>
                `;
                chatMessages.appendChild(messageEl);
                chatMessages.scrollTop = chatMessages.scrollHeight;
                
                // Add to transcript
                meetingTranscript.push({
                    speaker: "System",
                    message: message,
                    timestamp: new Date().toISOString()
                });
            }

            // Highlight the current speaker
            function highlightSpeaker(participantId) {
                // Clear previous speaker
                if (currentSpeaker) {
                    const prevSpeakerEl = document.querySelector(`.grid > div:nth-child(${currentSpeaker})`);
                    if (prevSpeakerEl) {
                        prevSpeakerEl.classList.remove('speaking');
                    }
                }
                
                // Set new speaker
                currentSpeaker = participantId;
                const speakerEl = document.querySelector(`.grid > div:nth-child(${participantId})`);
                if (speakerEl) {
                    speakerEl.classList.add('speaking');
                }
                
                // Clear animation after delay
                clearTimeout(speechTimeout);
                speechTimeout = setTimeout(() => {
                    if (speakerEl) {
                        speakerEl.classList.remove('speaking');
                    }
                    currentSpeaker = null;
                }, 3000);
            }

            // Event listeners
            sendBtn.addEventListener('click', sendMessage);
            messageInput.addEventListener('keypress', function(e) {
                if (e.key === 'Enter') {
                    sendMessage();
                }
            });

            // Download meeting minutes
            downloadBtn.addEventListener('click', function() {
                let minutesContent = "AI Meeting Minutes\n\n";
                minutesContent += "Date: " + new Date().toLocaleString() + "\n\n";
                minutesContent += "Participants:\n";
                participants.forEach(p => {
                    minutesContent += `- ${p.name} (${p.title})\n`;
                });
                
                minutesContent += "\nTranscript:\n";
                meetingTranscript.forEach(entry => {
                    minutesContent += `[${new Date(entry.timestamp).toLocaleTimeString()}] ${entry.speaker}: ${entry.message}\n`;
                });
                
                const blob = new Blob([minutesContent], { type: 'text/plain' });
                const url = URL.createObjectURL(blob);
                const a = document.createElement('a');
                a.href = url;
                a.download = `meeting-minutes-${new Date().toISOString().split('T')[0]}.txt`;
                document.body.appendChild(a);
                a.click();
                document.body.removeChild(a);
                URL.revokeObjectURL(url);
            });
        });
    </script>
</body>
</html>