Abmacode12 commited on
Commit
b169af1
·
verified ·
1 Parent(s): bc8543d

merci pour ton travail je voulais aussi te demander je t'ai fait une capture d'écran car je voudrais que dans ma deuxieme colonne quand j'envoie quelque chose que l'as IA ME REPONDE car la rien ne fonctionne , je veux aussi que le micro, le + , la trombone soit fonctionnel et cliquable s'il te plait je veux savoir parler avec l'ia et lui demander de créerdes images , vidéo , theme n-, plugin plein de chose peut tu le faire s'il te plait je compte sur toi merci

Browse files
Files changed (3) hide show
  1. index.html +3 -8
  2. script.js +87 -8
  3. style.css +23 -6
index.html CHANGED
@@ -91,15 +91,10 @@
91
  <span class="text-xs px-3 py-1 rounded-full bg-gray-800 border border-gray-700 text-gray-400">Projet</span>
92
  <span class="text-xs px-3 py-1 rounded-full bg-gray-800 border border-gray-700 text-gray-400">/</span>
93
  </div>
94
-
95
- <div class="flex-1 flex items-center justify-center">
96
- <div class="text-center max-w-md p-6">
97
- <h3 class="font-bold text-lg mb-1">Zone centrale vide</h3>
98
- <p class="text-gray-400">La barre de recherche / saisie reste en bas, comme demandé.</p>
99
- </div>
100
  </div>
101
-
102
- <div class="p-3 border-t border-gray-700 bg-gray-850">
103
  <div class="flex items-center gap-2 p-2 rounded-xl bg-gray-800 border border-gray-700">
104
  <button class="p-2 rounded-lg hover:bg-gray-700 text-gray-400 hover:text-gray-200">
105
  <i data-feather="plus" class="w-5 h-5"></i>
 
91
  <span class="text-xs px-3 py-1 rounded-full bg-gray-800 border border-gray-700 text-gray-400">Projet</span>
92
  <span class="text-xs px-3 py-1 rounded-full bg-gray-800 border border-gray-700 text-gray-400">/</span>
93
  </div>
94
+ <div class="flex-1 flex flex-col items-center justify-start p-4 overflow-y-auto">
95
+ <!-- Messages will appear here -->
 
 
 
 
96
  </div>
97
+ <div class="p-3 border-t border-gray-700 bg-gray-850">
 
98
  <div class="flex items-center gap-2 p-2 rounded-xl bg-gray-800 border border-gray-700">
99
  <button class="p-2 rounded-lg hover:bg-gray-700 text-gray-400 hover:text-gray-200">
100
  <i data-feather="plus" class="w-5 h-5"></i>
script.js CHANGED
@@ -1,3 +1,4 @@
 
1
  document.addEventListener('DOMContentLoaded', () => {
2
  // Initialize tooltips for icons
3
  const initTooltips = () => {
@@ -11,19 +12,97 @@ document.addEventListener('DOMContentLoaded', () => {
11
  });
12
  };
13
 
14
- // Handle message sending
15
  const setupMessageInput = () => {
16
  const input = document.querySelector('main input');
17
  const sendBtn = document.querySelector('main button:disabled');
 
 
 
 
18
 
19
- input.addEventListener('keydown', (e) => {
20
- if (e.key === 'Enter' && input.value.trim() !== '') {
21
- e.preventDefault();
22
- console.log('Message sent:', input.value.trim());
23
- input.value = '';
24
- sendBtn.disabled = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  };
28
 
29
  // Initialize all functionality
@@ -33,4 +112,4 @@ document.addEventListener('DOMContentLoaded', () => {
33
  };
34
 
35
  init();
36
- });
 
1
+
2
  document.addEventListener('DOMContentLoaded', () => {
3
  // Initialize tooltips for icons
4
  const initTooltips = () => {
 
12
  });
13
  };
14
 
15
+ // Handle message sending and AI responses
16
  const setupMessageInput = () => {
17
  const input = document.querySelector('main input');
18
  const sendBtn = document.querySelector('main button:disabled');
19
+ const micBtn = document.querySelector('main button[data-feather="mic"]');
20
+ const plusBtn = document.querySelector('main button[data-feather="plus"]');
21
+ const paperclipBtn = document.querySelector('main button[data-feather="paperclip"]');
22
+ const messageContainer = document.querySelector('.flex-1.flex.items-center.justify-center');
23
 
24
+ // AI response logic
25
+ const getAIResponse = (message) => {
26
+ const lowerMsg = message.toLowerCase();
27
+
28
+ if (lowerMsg.includes('image') || lowerMsg.includes('photo') || lowerMsg.includes('picture')) {
29
+ return `Je peux générer des images pour toi. Voici un exemple :
30
+ <a href="baleine.html" class="text-blue-400 hover:underline">Ouvrir le générateur d'images La Baleine IA</a>`;
31
+ }
32
+ else if (lowerMsg.includes('vidéo') || lowerMsg.includes('video')) {
33
+ return "Pour les vidéos, je peux te conseiller sur le format, la durée et le style. Quel type de vidéo veux-tu créer ?";
34
+ }
35
+ else if (lowerMsg.includes('thème') || lowerMsg.includes('theme')) {
36
+ return "Je peux t'aider à concevoir un thème. Dis-moi pour quelle plateforme (Shopify, WordPress, etc.) et quel style tu recherches.";
37
+ }
38
+ else if (lowerMsg.includes('plugin')) {
39
+ return "Les plugins peuvent étendre les fonctionnalités. Quel type de plugin veux-tu développer ? (pour WordPress, Shopify, etc.)";
40
+ }
41
+ else {
42
+ return "Je peux t'aider avec des images, vidéos, thèmes et plugins. Dis-moi plus précisément ce que tu veux créer !";
43
+ }
44
+ };
45
+
46
+ // Display message in chat
47
+ const displayMessage = (text, isUser = false) => {
48
+ if (!messageContainer) return;
49
+
50
+ const messageDiv = document.createElement('div');
51
+ messageDiv.className = `p-4 mb-2 rounded-lg max-w-[80%] ${isUser ? 'ml-auto bg-blue-900/30 text-blue-100' : 'bg-gray-700/50 text-gray-100'}`;
52
+ messageDiv.innerHTML = text;
53
+
54
+ if (isUser) {
55
+ messageContainer.insertBefore(messageDiv, messageContainer.firstChild);
56
+ } else {
57
+ messageContainer.appendChild(messageDiv);
58
  }
59
+ };
60
+
61
+ // Handle send message
62
+ const handleSend = () => {
63
+ const message = input.value.trim();
64
+ if (!message) return;
65
+
66
+ displayMessage(message, true);
67
+ input.value = '';
68
+ sendBtn.disabled = true;
69
+
70
+ // Simulate AI thinking
71
+ setTimeout(() => {
72
+ const response = getAIResponse(message);
73
+ displayMessage(response);
74
+ }, 1000);
75
+ };
76
+
77
+ // Event listeners
78
+ input.addEventListener('keydown', (e) => {
79
+ if (e.key === 'Enter') handleSend();
80
  });
81
+
82
+ sendBtn.addEventListener('click', handleSend);
83
+
84
+ // Microphone functionality
85
+ if (micBtn) {
86
+ micBtn.addEventListener('click', () => {
87
+ alert("Fonctionnalité microphone activée. Parle maintenant !");
88
+ // In a real implementation, we would use the Web Speech API here
89
+ });
90
+ }
91
+
92
+ // Plus button functionality
93
+ if (plusBtn) {
94
+ plusBtn.addEventListener('click', () => {
95
+ window.location.href = "baleine.html";
96
+ });
97
+ }
98
+
99
+ // Paperclip button functionality
100
+ if (paperclipBtn) {
101
+ paperclipBtn.addEventListener('click', () => {
102
+ alert("Fonctionnalité d'ajout de fichier activée");
103
+ // In a real implementation, we would use a file input here
104
+ });
105
+ }
106
  };
107
 
108
  // Initialize all functionality
 
112
  };
113
 
114
  init();
115
+ });
style.css CHANGED
@@ -82,16 +82,33 @@ input:focus, button:focus {
82
  background: rgba(255, 255, 255, 0.04);
83
  font-size: 0.875rem;
84
  }
85
- /* Animation for empty state */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  @keyframes pulse {
87
  0%, 100% {
88
- opacity: 0.6;
 
89
  }
90
  50% {
91
- opacity: 0.3;
 
92
  }
93
  }
94
 
95
- .empty-state {
96
- animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
97
- }
 
 
82
  background: rgba(255, 255, 255, 0.04);
83
  font-size: 0.875rem;
84
  }
85
+ /* Chat message styles */
86
+ .flex-1.flex.flex-col.items-center.justify-start {
87
+ gap: 1rem;
88
+ padding: 1rem;
89
+ width: 100%;
90
+ }
91
+
92
+ .flex-1.flex.flex-col.items-center.justify-start > div {
93
+ padding: 0.75rem 1rem;
94
+ border-radius: 0.75rem;
95
+ max-width: 80%;
96
+ word-wrap: break-word;
97
+ }
98
+
99
+ /* Microphone animation */
100
  @keyframes pulse {
101
  0%, 100% {
102
+ transform: scale(1);
103
+ opacity: 1;
104
  }
105
  50% {
106
+ transform: scale(1.05);
107
+ opacity: 0.8;
108
  }
109
  }
110
 
111
+ .listening {
112
+ animation: pulse 1.5s infinite;
113
+ background-color: rgba(239, 68, 68, 0.2) !important;
114
+ }