-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclient.html
More file actions
280 lines (267 loc) · 13.2 KB
/
client.html
File metadata and controls
280 lines (267 loc) · 13.2 KB
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
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ZPMS - Ephemeral Chat</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.socket.io/4.6.1/socket.io.min.js"></script>
<style>
.message-self {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
margin-left: auto;
max-width: 70%;
border-radius: 18px 18px 4px 18px;
}
.message-partner {
background: #f3f4f6;
color: #1f2937;
margin-right: auto;
max-width: 70%;
border-radius: 18px 18px 18px 4px;
}
.notification {
position: fixed;
top: 20px;
right: 20px;
padding: 16px 24px;
border-radius: 8px;
box-shadow: 0 10px 25px rgba(0,0,0,0.1);
animation: slideIn 0.3s ease-out;
z-index: 1000;
}
.notification-error {
background: #fee2e2;
color: #991b1b;
border-left: 4px solid #dc2626;
}
.notification-success {
background: #d1fae5;
color: #065f46;
border-left: 4px solid #10b981;
}
.notification-info {
background: #dbeafe;
color: #1e40af;
border-left: 4px solid #3b82f6;
}
@keyframes slideIn {
from {
transform: translateX(400px);
opacity: 0;
}
to {
transform: translateX(0);
opacity: 1;
}
}
.pulse {
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
0%, 100% {
opacity: 1;
}
50% {
opacity: .5;
}
}
#message-list::-webkit-scrollbar {
width: 8px;
}
#message-list::-webkit-scrollbar-track {
background: #f1f1f1;
}
#message-list::-webkit-scrollbar-thumb {
background: #888;
border-radius: 4px;
}
#message-list::-webkit-scrollbar-thumb:hover {
background: #555;
}
#session-list::-webkit-scrollbar {
width: 6px;
}
#session-list::-webkit-scrollbar-track {
background: #f9fafb;
}
#session-list::-webkit-scrollbar-thumb {
background: #d1d5db;
border-radius: 3px;
}
#session-list::-webkit-scrollbar-thumb:hover {
background: #555;
}
</style>
</head>
<body class="bg-gradient-to-br from-purple-50 via-blue-50 to-pink-50 min-h-screen">
<!-- Setup Screen -->
<div id="setup-screen" class="container mx-auto p-4 max-w-md">
<div class="bg-white rounded-2xl shadow-2xl p-8 mt-10">
<!-- Header -->
<div class="text-center mb-8">
<div class="inline-block p-4 bg-gradient-to-br from-purple-500 to-pink-500 rounded-full mb-4">
<svg class="w-12 h-12 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"></path>
</svg>
</div>
<h1 class="text-3xl font-bold text-gray-800 mb-2">ZPMS Chat</h1>
<p class="text-gray-600 text-sm">Zero-Persistence Messaging System</p>
<p class="text-gray-500 text-xs mt-2">🔒 End-to-End verschlüsselt • 🗑️ Keine Speicherung</p>
<a href="index.html" class="inline-block mt-3 text-purple-600 hover:text-purple-800 text-sm font-medium transition-colors">
📄 Zum Whitepaper →
</a>
</div>
<!-- Create Session -->
<button id="create-session-btn" class="w-full bg-gradient-to-r from-purple-500 to-pink-500 text-white p-4 rounded-xl font-semibold hover:from-purple-600 hover:to-pink-600 transition-all shadow-lg hover:shadow-xl mb-4">
<svg class="inline-block w-5 h-5 mr-2 mb-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"></path>
</svg>
Neue Chat-Session erstellen
</button>
<!-- Join Session -->
<div class="relative mb-4">
<div class="absolute inset-0 flex items-center">
<div class="w-full border-t border-gray-300"></div>
</div>
<div class="relative flex justify-center text-sm">
<span class="px-2 bg-white text-gray-500">oder</span>
</div>
</div>
<div class="flex gap-2 mb-6">
<input
id="session-id-input"
type="text"
placeholder="Session-ID eingeben"
class="flex-1 border-2 border-gray-300 p-3 rounded-xl focus:border-purple-500 focus:outline-none transition-colors"
/>
<button id="join-session-btn" class="bg-green-500 text-white px-6 rounded-xl font-semibold hover:bg-green-600 transition-colors shadow-md">
Beitreten
</button>
</div>
<!-- Session Created State -->
<div id="session-created" class="hidden bg-gradient-to-br from-blue-50 to-purple-50 rounded-xl p-6 border-2 border-blue-200">
<p class="font-bold text-blue-900 mb-3 flex items-center">
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
Session erstellt!
</p>
<div class="flex gap-2 mb-3">
<input
id="session-id-display"
type="text"
readonly
class="flex-1 border-2 border-blue-300 p-3 rounded-lg bg-white font-mono text-sm"
/>
<button id="copy-btn" class="bg-blue-500 text-white px-4 rounded-lg hover:bg-blue-600 transition-colors">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"></path>
</svg>
</button>
</div>
<div class="flex items-center text-sm text-blue-700">
<svg class="w-4 h-4 mr-2 pulse" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z" clip-rule="evenodd"></path>
</svg>
Warte auf Partner...
</div>
</div>
<!-- Info -->
<div class="mt-6 p-4 bg-amber-50 rounded-lg border border-amber-200">
<p class="text-xs text-amber-800">
<strong>⚠️ Wichtig:</strong> Alle Nachrichten werden nach dem Schließen unwiederbringlich gelöscht. Der Server speichert keine Daten.
</p>
</div>
</div>
</div>
<!-- Chat Screen -->
<div id="chat-screen" class="hidden h-screen flex">
<!-- Session History Sidebar -->
<div id="history-sidebar" class="w-80 bg-gray-50 border-r-2 border-gray-200 flex flex-col hidden lg:flex">
<div class="p-4 bg-white border-b-2 border-gray-200">
<h3 class="font-bold text-lg text-gray-800 flex items-center justify-between">
<span>📋 Meine Sessions</span>
<button id="toggle-history" class="text-gray-500 hover:text-gray-700 lg:hidden">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
</svg>
</button>
</h3>
</div>
<div id="session-list" class="flex-1 overflow-y-auto p-4 space-y-2">
<div class="text-sm text-gray-500 text-center py-8">
Keine Sessions vorhanden
</div>
</div>
<div class="p-4 bg-white border-t-2 border-gray-200">
<button id="clear-history-btn" class="w-full bg-gray-200 hover:bg-gray-300 text-gray-700 py-2 px-4 rounded-lg text-sm font-medium transition-colors">
🗑️ Historie löschen
</button>
<p class="text-xs text-gray-500 mt-2 text-center">
RAM-only • Verschwindet nach Reload
</p>
</div>
</div>
<!-- Main Chat Area -->
<div class="flex-1 flex flex-col">
<!-- Header -->
<div class="bg-gradient-to-r from-purple-600 to-pink-600 text-white p-4 shadow-lg">
<div class="container mx-auto max-w-4xl flex justify-between items-center">
<div class="flex items-center gap-4">
<button id="toggle-history-mobile" class="lg:hidden">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
</svg>
</button>
<div>
<h2 class="font-bold text-xl flex items-center">
<svg class="w-6 h-6 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"></path>
</svg>
Ephemeral Chat
</h2>
<p id="connection-status" class="text-xs opacity-90 flex items-center mt-1">
<span class="inline-block w-2 h-2 bg-green-400 rounded-full mr-2"></span>
Verbunden & Verschlüsselt
</p>
</div>
<div class="flex gap-2 items-center">
<a href="index.html" class="bg-purple-500 bg-opacity-50 px-4 py-2 rounded-lg text-sm font-semibold hover:bg-opacity-70 transition-colors shadow-md" title="Zum Whitepaper">
📄
</a>
<button id="disconnect-btn" class="bg-red-500 px-6 py-2 rounded-lg text-sm font-semibold hover:bg-red-600 transition-colors shadow-md">
Beenden
</button>
</div>
</div>
<!-- Messages -->
<div class="flex-1 overflow-hidden bg-gradient-to-br from-purple-50 via-blue-50 to-pink-50">
<div class="container mx-auto max-w-4xl h-full py-4">
<div id="message-list" class="h-full overflow-y-auto px-4 space-y-3">
<!-- Messages werden dynamisch eingefügt -->
</div>
</div>
</div>
<!-- Input -->
<div class="bg-white border-t-2 border-gray-200 p-4 shadow-2xl">
<div class="container mx-auto max-w-4xl flex gap-3">
<textarea
id="message-input"
placeholder="Nachricht eingeben... (Enter zum Senden, Shift+Enter für neue Zeile)"
class="flex-1 border-2 border-gray-300 p-3 rounded-xl resize-none focus:border-purple-500 focus:outline-none transition-colors"
rows="2"
></textarea>
<button id="send-button" class="bg-gradient-to-r from-purple-500 to-pink-500 text-white px-8 rounded-xl font-semibold hover:from-purple-600 hover:to-pink-600 transition-all shadow-lg hover:shadow-xl">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8"></path>
</svg>
</button>
</div>
</div>
</div>
</div>
<script src="app.js"></script>
</body>
</html>