Redsputnik commited on
Commit
e0d7c58
·
verified ·
1 Parent(s): 8c64ce8

Es ist noch nicht komplett richtig zentriert. Es soll alles relativ gemeinsam sein. Wenn der red mode aktiviert wird, soll das Themen in roter Farbe wechseln. Unter der chatbar sollen vorgefertigte promts hinterlegt sein, wenn man diese drückt. Also icons. Die mit dem promt zu tun haben. Wie zB sociql media Experte, marketing Experte, coding Experte, upload Möglichkeit um zB PDF hochzuladen und dann fragen stellen zu können. Während des chats auch ein Mikrofon icon um anstatt Tastatur auf Sprache sprechen zu können.

Browse files
Files changed (3) hide show
  1. index.html +80 -57
  2. script.js +78 -1
  3. style.css +114 -8
index.html CHANGED
@@ -28,74 +28,97 @@
28
  </head>
29
  <body class="bg-gray-100 dark:bg-gray-900 min-h-screen transition-colors duration-200">
30
  <custom-navbar></custom-navbar>
31
-
32
- <main class="container mx-auto px-4 py-8 max-w-4xl">
33
-
34
- <div class="flex justify-between items-center mb-6">
35
- <h1 class="text-3xl font-bold text-gray-800 dark:text-gray-100">
36
- <i data-feather="satellite" class="inline mr-2"></i> RedSputnik
37
- </h1>
38
- <div class="flex gap-2">
39
- <button id="theme-toggle" class="p-2 rounded-full bg-gray-200 dark:bg-gray-700">
40
- <i data-feather="moon" class="dark:hidden"></i>
41
- <i data-feather="sun" class="hidden dark:block"></i>
42
- </button>
43
- <button id="red-mode-toggle" class="p-2 rounded-full bg-gray-200 dark:bg-gray-700" title="Red Mode">
44
- <i data-feather="alert-triangle" class="text-red-500"></i>
45
- </button>
46
- </div>
47
- </div>
48
- <div class="flex gap-4">
49
- <div class="w-64 bg-white dark:bg-gray-800 rounded-xl shadow-lg overflow-hidden">
50
- <div class="p-4 border-b border-gray-200 dark:border-gray-700">
51
- <h2 class="font-semibold flex items-center gap-2">
52
- <i data-feather="lock" class="w-4 h-4"></i> Chat History
53
- </h2>
54
- </div>
55
- <div id="chat-history" class="h-96 overflow-y-auto p-2 space-y-1">
56
- <!-- Chat history items will appear here -->
57
  </div>
58
- <div class="p-4 border-t border-gray-200 dark:border-gray-700">
59
- <button id="clear-history" class="w-full text-sm text-red-500 hover:text-red-600 flex items-center justify-center gap-1">
60
- <i data-feather="trash-2" class="w-3 h-3"></i> Clear All
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  </button>
62
  </div>
 
 
 
 
 
 
 
 
 
 
63
  </div>
64
- <div class="flex-1 bg-white dark:bg-gray-800 rounded-xl shadow-lg overflow-hidden">
65
- <div id="chat-container" class="h-96 overflow-y-auto p-4 space-y-4">
 
 
 
 
 
 
66
  <!-- Chat messages will appear here -->
67
  <div class="text-center py-8 text-gray-500 dark:text-gray-400">
68
- <i data-feather="message-circle" class="w-12 h-12 mx-auto mb-2"></i>
69
- <p>Start chatting with your NAS assistant</p>
70
- </div>
71
  </div>
 
72
 
73
- <div class="border-t border-gray-200 dark:border-gray-700 p-4">
74
- <form id="chat-form" class="flex gap-2">
75
- <div class="flex-1 flex gap-2">
76
- <input
77
- type="text"
78
- id="message-input"
79
- placeholder="Secure message..."
80
- class="flex-1 px-4 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-800 dark:text-gray-200 focus:outline-none focus:ring-2 focus:ring-primary-500"
81
- autocomplete="off"
82
- required
83
- >
84
- <label class="flex items-center justify-center px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 cursor-pointer">
85
- <input type="file" id="file-upload" class="hidden" accept=".txt,.pdf,.doc,.docx">
86
- <i data-feather="upload" class="w-4 h-4"></i>
87
- </label>
88
- </div>
89
- <button
90
- type="submit"
91
- class="bg-primary-500 hover:bg-primary-600 text-white px-4 py-2 rounded-lg flex items-center gap-2 transition-colors"
92
  >
93
- <i data-feather="send" class="w-4 h-4"></i> Send
 
 
 
 
 
94
  </button>
95
- </form>
96
- </div>
 
 
 
 
 
 
97
  </div>
98
- <div class="mt-6 text-sm text-gray-500 dark:text-gray-400 flex justify-between items-center">
 
99
  <p><i data-feather="shield" class="w-4 h-4 inline mr-1"></i> Secure E2E encrypted | IP protected</p>
100
  <p><i data-feather="hard-drive" class="w-4 h-4 inline mr-1"></i> Stored locally on your NAS</p>
101
  </div>
 
28
  </head>
29
  <body class="bg-gray-100 dark:bg-gray-900 min-h-screen transition-colors duration-200">
30
  <custom-navbar></custom-navbar>
31
+ <main class="container mx-auto px-4 py-8 max-w-6xl">
32
+ <div class="flex flex-col items-center mb-8">
33
+ <div class="flex justify-between items-center w-full max-w-4xl mb-6">
34
+ <h1 class="text-3xl font-bold text-gray-800 dark:text-gray-100">
35
+ <i data-feather="satellite" class="inline mr-2"></i> RedSputnik
36
+ </h1>
37
+ <div class="flex gap-2">
38
+ <button id="theme-toggle" class="p-2 rounded-full bg-gray-200 dark:bg-gray-700">
39
+ <i data-feather="moon" class="dark:hidden"></i>
40
+ <i data-feather="sun" class="hidden dark:block"></i>
41
+ </button>
42
+ <button id="red-mode-toggle" class="p-2 rounded-full bg-gray-200 dark:bg-gray-700" title="Red Mode">
43
+ <i data-feather="alert-triangle" class="text-red-500"></i>
44
+ </button>
45
+ </div>
 
 
 
 
 
 
 
 
 
 
 
46
  </div>
47
+
48
+ <!-- Prompt Buttons -->
49
+ <div class="prompt-grid w-full max-w-4xl mb-6">
50
+ <button class="prompt-button" data-prompt="social-media">
51
+ <i data-feather="users"></i>
52
+ <span>Social Media Expert</span>
53
+ </button>
54
+ <button class="prompt-button" data-prompt="marketing">
55
+ <i data-feather="trending-up"></i>
56
+ <span>Marketing Expert</span>
57
+ </button>
58
+ <button class="prompt-button" data-prompt="coding">
59
+ <i data-feather="code"></i>
60
+ <span>Coding Expert</span>
61
+ </button>
62
+ <button class="prompt-button" data-prompt="upload">
63
+ <i data-feather="upload"></i>
64
+ <span>Upload PDF</span>
65
  </button>
66
  </div>
67
+
68
+ <div class="flex gap-4 w-full max-w-4xl">
69
+ <div class="w-64 bg-white dark:bg-gray-800 rounded-xl shadow-lg overflow-hidden">
70
+ <div class="p-4 border-b border-gray-200 dark:border-gray-700">
71
+ <h2 class="font-semibold flex items-center gap-2">
72
+ <i data-feather="lock" class="w-4 h-4"></i> Chat History
73
+ </h2>
74
+ </div>
75
+ <div id="chat-history" class="h-96 overflow-y-auto p-2 space-y-1">
76
+ <!-- Chat history items will appear here -->
77
  </div>
78
+ <div class="p-4 border-t border-gray-200 dark:border-gray-700">
79
+ <button id="clear-history" class="w-full text-sm text-red-500 hover:text-red-600 flex items-center justify-center gap-1">
80
+ <i data-feather="trash-2" class="w-3 h-3"></i> Clear All
81
+ </button>
82
+ </div>
83
+ </div>
84
+ <div class="flex-1 bg-white dark:bg-gray-800 rounded-xl shadow-lg overflow-hidden">
85
+ <div id="chat-container" class="h-96 overflow-y-auto p-4 space-y-4">
86
  <!-- Chat messages will appear here -->
87
  <div class="text-center py-8 text-gray-500 dark:text-gray-400">
88
+ <i data-feather="message-circle" class="w-12 h-12 mx-auto mb-2"></i>
89
+ <p>Start chatting with your NAS assistant</p>
 
90
  </div>
91
+ </div>
92
 
93
+ <div class="border-t border-gray-200 dark:border-gray-700 p-4">
94
+ <form id="chat-form" class="flex gap-2">
95
+ <div class="flex-1 flex gap-2">
96
+ <input
97
+ type="text"
98
+ id="message-input"
99
+ placeholder="Secure message..."
100
+ class="flex-1 px-4 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-800 dark:text-gray-200 focus:outline-none focus:ring-2 focus:ring-primary-500"
101
+ autocomplete="off"
102
+ required
 
 
 
 
 
 
 
 
 
103
  >
104
+ <label class="flex items-center justify-center px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 cursor-pointer">
105
+ <input type="file" id="file-upload" class="hidden" accept=".txt,.pdf,.doc,.docx">
106
+ <i data-feather="upload" class="w-4 h-4"></i>
107
+ </label>
108
+ <button type="button" id="voice-record" class="flex items-center justify-center px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 cursor-pointer">
109
+ <i data-feather="mic" class="w-4 h-4"></i>
110
  </button>
111
+ </div>
112
+ <button
113
+ type="submit"
114
+ class="bg-primary-500 hover:bg-primary-600 text-white px-4 py-2 rounded-lg flex items-center gap-2 transition-colors"
115
+ >
116
+ <i data-feather="send" class="w-4 h-4"></i> Send
117
+ </button>
118
+ </form>
119
  </div>
120
+ </div>
121
+ <div class="mt-6 text-sm text-gray-500 dark:text-gray-400 flex justify-between items-center">
122
  <p><i data-feather="shield" class="w-4 h-4 inline mr-1"></i> Secure E2E encrypted | IP protected</p>
123
  <p><i data-feather="hard-drive" class="w-4 h-4 inline mr-1"></i> Stored locally on your NAS</p>
124
  </div>
script.js CHANGED
@@ -14,7 +14,6 @@ document.addEventListener('DOMContentLoaded', () => {
14
  }
15
  localStorage.setItem('theme', theme);
16
  };
17
-
18
  // Red mode toggle functionality
19
  const setRedMode = (enabled) => {
20
  if (enabled) {
@@ -23,17 +22,20 @@ document.addEventListener('DOMContentLoaded', () => {
23
  html.classList.remove('red-mode');
24
  }
25
  localStorage.setItem('redMode', enabled ? '1' : '0');
 
26
  };
27
 
28
  themeToggle.addEventListener('click', () => {
29
  const isDark = html.classList.contains('dark');
30
  setTheme(isDark ? 'light' : 'dark');
 
31
  });
32
 
33
  redModeToggle.addEventListener('click', () => {
34
  const isRed = html.classList.contains('red-mode');
35
  setRedMode(!isRed);
36
  alert(`Red Mode ${!isRed ? 'activated' : 'deactivated'}\nResponses will now be ${!isRed ? 'uncensored' : 'filtered'}`);
 
37
  });
38
 
39
  // Load saved preferences
@@ -52,8 +54,83 @@ document.addEventListener('DOMContentLoaded', () => {
52
  uploadedFileName = file.name;
53
  // In a real implementation, you would send the file to your NAS
54
  alert(`File "${file.name}" ready for secure upload`);
 
 
 
 
 
 
 
55
  }
56
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  // Chat functionality
58
  const chatForm = document.getElementById('chat-form');
59
  const messageInput = document.getElementById('message-input');
 
14
  }
15
  localStorage.setItem('theme', theme);
16
  };
 
17
  // Red mode toggle functionality
18
  const setRedMode = (enabled) => {
19
  if (enabled) {
 
22
  html.classList.remove('red-mode');
23
  }
24
  localStorage.setItem('redMode', enabled ? '1' : '0');
25
+ feather.replace();
26
  };
27
 
28
  themeToggle.addEventListener('click', () => {
29
  const isDark = html.classList.contains('dark');
30
  setTheme(isDark ? 'light' : 'dark');
31
+ feather.replace();
32
  });
33
 
34
  redModeToggle.addEventListener('click', () => {
35
  const isRed = html.classList.contains('red-mode');
36
  setRedMode(!isRed);
37
  alert(`Red Mode ${!isRed ? 'activated' : 'deactivated'}\nResponses will now be ${!isRed ? 'uncensored' : 'filtered'}`);
38
+ feather.replace();
39
  });
40
 
41
  // Load saved preferences
 
54
  uploadedFileName = file.name;
55
  // In a real implementation, you would send the file to your NAS
56
  alert(`File "${file.name}" ready for secure upload`);
57
+ // Auto-send file info to chat
58
+ addMessageToChat('user', file.name, true);
59
+
60
+ // Simulate assistant response for uploaded file
61
+ setTimeout(() => {
62
+ addMessageToChat('assistant', `I've received your file "${file.name}". You can now ask questions about its content.`);
63
+ }, 1000);
64
  }
65
  });
66
+
67
+ // Voice recording functionality
68
+ const voiceRecordBtn = document.getElementById('voice-record');
69
+ let isRecording = false;
70
+
71
+ voiceRecordBtn.addEventListener('click', () => {
72
+ if (!isRecording) {
73
+ // Start recording
74
+ isRecording = true;
75
+ voiceRecordBtn.classList.add('voice-recording');
76
+ voiceRecordBtn.innerHTML = '<i data-feather="mic-off" class="w-4 h-4 text-red-500"></i>';
77
+ feather.replace();
78
+
79
+ // Simulate voice recording (in a real app, use Web Speech API)
80
+ setTimeout(() => {
81
+ // Stop recording and process
82
+ isRecording = false;
83
+ voiceRecordBtn.classList.remove('voice-recording');
84
+ voiceRecordBtn.innerHTML = '<i data-feather="mic" class="w-4 h-4"></i>';
85
+ feather.replace();
86
+
87
+ const voiceMessage = "This is a simulated voice message transcription.";
88
+ addMessageToChat('user', voiceMessage);
89
+
90
+ // Simulate assistant response
91
+ setTimeout(() => {
92
+ addMessageToChat('assistant', `I heard: "${voiceMessage}". In a real implementation, this would be transcribed from your voice input.");
93
+ }, 1000);
94
+ }, 3000);
95
+ } else {
96
+ // Stop recording
97
+ isRecording = false;
98
+ voiceRecordBtn.classList.remove('voice-recording');
99
+ voiceRecordBtn.innerHTML = '<i data-feather="mic" class="w-4 h-4"></i>';
100
+ feather.replace();
101
+ }
102
+ });
103
+
104
+ // Prompt buttons functionality
105
+ document.querySelectorAll('.prompt-button').forEach(button => {
106
+ button.addEventListener('click', (e) => {
107
+ const promptType = e.currentTarget.dataset.prompt;
108
+ let message = '';
109
+
110
+ switch(promptType) {
111
+ case 'social-media':
112
+ message = "Act as a social media expert. Help me create engaging content strategies, analyze trends, and optimize my social media presence across different platforms.";
113
+ break;
114
+ case 'marketing':
115
+ message = "Act as a marketing expert. Provide insights on customer acquisition, branding strategies, digital marketing campaigns, and market analysis.";
116
+ break;
117
+ case 'coding':
118
+ message = "Act as a coding expert. Help with programming challenges, code reviews, debugging, and learning new technologies.";
119
+ break;
120
+ case 'upload':
121
+ // Trigger file upload
122
+ fileUpload.click();
123
+ return;
124
+ }
125
+
126
+ addMessageToChat('user', message);
127
+
128
+ // Simulate assistant response
129
+ setTimeout(() => {
130
+ addMessageToChat('assistant', `I'm now acting as your ${promptType.replace('-', ' ')} expert. How can I assist you specifically?`);
131
+ }, 1000);
132
+ });
133
+ });
134
  // Chat functionality
135
  const chatForm = document.getElementById('chat-form');
136
  const messageInput = document.getElementById('message-input');
style.css CHANGED
@@ -1,3 +1,4 @@
 
1
  /* Custom scrollbar */
2
  #chat-container::-webkit-scrollbar {
3
  width: 8px;
@@ -20,12 +21,63 @@
20
  .dark #chat-container::-webkit-scrollbar-thumb {
21
  background: #4b5563;
22
  }
23
- :root {
24
- --red-mode: 0;
25
- }
26
 
 
27
  .red-mode {
28
- --red-mode: 1;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  }
30
 
31
  /* Chat message animations */
@@ -34,10 +86,10 @@
34
  to { opacity: 1; transform: translateY(0); }
35
  }
36
 
37
- /* Red mode styles */
38
  .red-mode .chat-message.assistant {
39
- background-color: rgba(239, 68, 68, 0.1) !important;
40
- border-left: 3px solid rgba(239, 68, 68, 0.5);
41
  }
42
 
43
  #chat-history-item {
@@ -63,6 +115,60 @@
63
  font-size: 0.75rem;
64
  color: #10b981;
65
  }
 
66
  .chat-message {
67
  animation: fadeIn 0.3s ease-out forwards;
68
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
  /* Custom scrollbar */
3
  #chat-container::-webkit-scrollbar {
4
  width: 8px;
 
21
  .dark #chat-container::-webkit-scrollbar-thumb {
22
  background: #4b5563;
23
  }
 
 
 
24
 
25
+ /* Red mode styles */
26
  .red-mode {
27
+ --nav-bg: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
28
+ --footer-bg: #450a0a;
29
+ }
30
+
31
+ .red-mode body {
32
+ background: #0c0a09 !important;
33
+ }
34
+
35
+ .red-mode .bg-white {
36
+ background-color: #1c1917 !important;
37
+ }
38
+
39
+ .red-mode .bg-gray-100 {
40
+ background-color: #0c0a09 !important;
41
+ }
42
+
43
+ .red-mode .dark\:bg-gray-900 {
44
+ background-color: #0c0a09 !important;
45
+ }
46
+
47
+ .red-mode .dark\:bg-gray-800 {
48
+ background-color: #292524 !important;
49
+ }
50
+
51
+ .red-mode .border-gray-200 {
52
+ border-color: #44403c !important;
53
+ }
54
+
55
+ .red-mode .dark\:border-gray-700 {
56
+ border-color: #44403c !important;
57
+ }
58
+
59
+ .red-mode .text-gray-800 {
60
+ color: #f5f5f4 !important;
61
+ }
62
+
63
+ .red-mode .dark\:text-gray-200 {
64
+ color: #f5f5f4 !important;
65
+ }
66
+
67
+ .red-mode .text-gray-500 {
68
+ color: #d6d3d1 !important;
69
+ }
70
+
71
+ .red-mode .dark\:text-gray-400 {
72
+ color: #d6d3d1 !important;
73
+ }
74
+
75
+ .red-mode .bg-primary-500 {
76
+ background-color: #dc2626 !important;
77
+ }
78
+
79
+ .red-mode .hover\:bg-primary-600:hover {
80
+ background-color: #b91c1c !important;
81
  }
82
 
83
  /* Chat message animations */
 
86
  to { opacity: 1; transform: translateY(0); }
87
  }
88
 
89
+ /* Red mode chat styles */
90
  .red-mode .chat-message.assistant {
91
+ background-color: rgba(220, 38, 38, 0.1) !important;
92
+ border-left: 3px solid rgba(220, 38, 38, 0.5);
93
  }
94
 
95
  #chat-history-item {
 
115
  font-size: 0.75rem;
116
  color: #10b981;
117
  }
118
+
119
  .chat-message {
120
  animation: fadeIn 0.3s ease-out forwards;
121
+ }
122
+
123
+ /* Prompt buttons grid */
124
+ .prompt-grid {
125
+ display: grid;
126
+ grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
127
+ gap: 0.5rem;
128
+ margin-top: 1rem;
129
+ }
130
+
131
+ .prompt-button {
132
+ display: flex;
133
+ flex-direction: column;
134
+ align-items: center;
135
+ justify-content: center;
136
+ padding: 0.75rem;
137
+ background: white;
138
+ border: 1px solid #e5e7eb;
139
+ border-radius: 0.5rem;
140
+ cursor: pointer;
141
+ transition: all 0.2s;
142
+ text-align: center;
143
+ font-size: 0.75rem;
144
+ }
145
+
146
+ .dark .prompt-button {
147
+ background: #374151;
148
+ border-color: #4b5563;
149
+ }
150
+
151
+ .prompt-button:hover {
152
+ transform: translateY(-2px);
153
+ box-shadow: 0 4px 12px rgba(0,0,0,0.1);
154
+ }
155
+
156
+ .red-mode .prompt-button {
157
+ background: #292524;
158
+ border-color: #44403c;
159
+ }
160
+
161
+ .prompt-button i {
162
+ margin-bottom: 0.25rem;
163
+ }
164
+
165
+ /* Voice recording */
166
+ .voice-recording {
167
+ animation: pulse 1.5s infinite;
168
+ }
169
+
170
+ @keyframes pulse {
171
+ 0% { opacity: 1; }
172
+ 50% { opacity: 0.7; }
173
+ 100% { opacity: 1; }
174
+ }