privateuserh commited on
Commit
f9b3e8c
·
verified ·
1 Parent(s): 812b225

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +1243 -19
  3. prompts.txt +1 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Honeycombxhat Beta1 04
3
- emoji: 🚀
4
- colorFrom: blue
5
- colorTo: pink
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: honeycombxhat-beta1-04
3
+ emoji: 🐳
4
+ colorFrom: gray
5
+ colorTo: yellow
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,1243 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <meta name="description" content="Honeycomb Chat - Synchronized communication between prefectures">
7
+ <meta name="theme-color" content="#3b82f6">
8
+ <meta property="og:title" content="Honeycomb Chat">
9
+ <meta property="og:description" content="Real-time synchronized communication with geometric prefectures">
10
+ <meta property="og:type" content="website">
11
+ <meta property="og:url" content="https://example.com">
12
+ <meta property="og:image" content="https://example.com/honeycomb-chat-preview.png">
13
+ <title>Honeycomb Chat</title>
14
+ <script src="https://cdn.tailwindcss.com"></script>
15
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
16
+ <style>
17
+ @keyframes float {
18
+ 0%, 100% { transform: translateY(0); }
19
+ 50% { transform: translateY(-10px); }
20
+ }
21
+ .floating {
22
+ animation: float 6s ease-in-out infinite;
23
+ }
24
+ .shape-transition {
25
+ transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
26
+ }
27
+ .chat-bubble {
28
+ clip-path: polygon(0% 0%, 100% 0%, 100% 75%, 75% 75%, 75% 100%, 50% 75%, 0% 75%);
29
+ }
30
+ .triangle {
31
+ clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
32
+ }
33
+ .hexagon {
34
+ clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
35
+ }
36
+ .pentagon {
37
+ clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
38
+ }
39
+ .octagon {
40
+ clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
41
+ }
42
+ .diamond {
43
+ clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
44
+ }
45
+ .pennant {
46
+ clip-path: polygon(0% 0%, 100% 50%, 0% 100%);
47
+ }
48
+ .swallowtail {
49
+ clip-path: polygon(0% 0%, 100% 0%, 100% 70%, 50% 100%, 0% 70%);
50
+ }
51
+ .burgee {
52
+ clip-path: polygon(0% 25%, 50% 0%, 100% 25%, 50% 100%);
53
+ }
54
+ .houseflag {
55
+ clip-path: polygon(0% 0%, 100% 0%, 80% 50%, 100% 100%, 0% 100%, 20% 50%);
56
+ }
57
+ .honeycomb-bg {
58
+ background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 0L84 25V75L50 100L16 75V25L50 0Z' fill='none' stroke='%23e5e7eb' stroke-width='0.5'/%3E%3C/svg%3E");
59
+ background-size: 60px 60px;
60
+ }
61
+ .honeycomb-cell {
62
+ clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
63
+ }
64
+ .prefecture-diligence {
65
+ background: linear-gradient(135deg, #f59e0b, #d97706);
66
+ }
67
+ .prefecture-industry {
68
+ background: linear-gradient(135deg, #10b981, #059669);
69
+ }
70
+ .prefecture-harmony {
71
+ background: linear-gradient(135deg, #3b82f6, #2563eb);
72
+ }
73
+ .prefecture-aquapod {
74
+ background: linear-gradient(135deg, #06b6d4, #0891b2);
75
+ }
76
+ .prefecture-archive {
77
+ background: linear-gradient(135deg, #8b5cf6, #7c3aed);
78
+ }
79
+ .message-diligence {
80
+ background-color: #f59e0b;
81
+ color: white;
82
+ }
83
+ .message-industry {
84
+ background-color: #10b981;
85
+ color: white;
86
+ }
87
+ .message-harmony {
88
+ background-color: #3b82f6;
89
+ color: white;
90
+ }
91
+ .message-aquapod {
92
+ background-color: #06b6d4;
93
+ color: white;
94
+ }
95
+ .message-archive {
96
+ background-color: #8b5cf6;
97
+ color: white;
98
+ }
99
+ .flag-alpha {
100
+ background: linear-gradient(135deg, white 50%, blue 50%);
101
+ }
102
+ .flag-bravo {
103
+ background: linear-gradient(red 50%, white 50%);
104
+ }
105
+ .flag-charlie {
106
+ background: linear-gradient(blue 33%, white 33%, white 66%, red 66%);
107
+ }
108
+ .flag-delta {
109
+ background: linear-gradient(90deg, yellow 50%, blue 50%);
110
+ }
111
+ .flag-echo {
112
+ background: linear-gradient(blue 33%, red 33%, red 66%, blue 66%);
113
+ }
114
+ .flag-foxtrot {
115
+ background: linear-gradient(white 50%, red 50%);
116
+ }
117
+ .wave-animation {
118
+ position: relative;
119
+ overflow: hidden;
120
+ }
121
+ .wave-animation::after {
122
+ content: "";
123
+ position: absolute;
124
+ top: 0;
125
+ left: 0;
126
+ right: 0;
127
+ bottom: 0;
128
+ background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
129
+ animation: wave 2s linear infinite;
130
+ }
131
+ @keyframes wave {
132
+ 0% { transform: translateX(-100%); }
133
+ 100% { transform: translateX(100%); }
134
+ }
135
+ .pulse {
136
+ animation: pulse 2s infinite;
137
+ }
138
+ @keyframes pulse {
139
+ 0% { transform: scale(1); }
140
+ 50% { transform: scale(1.05); }
141
+ 100% { transform: scale(1); }
142
+ }
143
+ .recipient-chip {
144
+ display: inline-flex;
145
+ align-items: center;
146
+ background-color: #e5e7eb;
147
+ border-radius: 9999px;
148
+ padding: 0.25rem 0.75rem;
149
+ margin-right: 0.5rem;
150
+ margin-bottom: 0.5rem;
151
+ font-size: 0.875rem;
152
+ }
153
+ .recipient-chip button {
154
+ margin-left: 0.5rem;
155
+ color: #6b7280;
156
+ background: none;
157
+ border: none;
158
+ cursor: pointer;
159
+ }
160
+ .recipient-chip button:hover {
161
+ color: #ef4444;
162
+ }
163
+ .bell-animation {
164
+ animation: ring 0.5s ease-in-out;
165
+ }
166
+ @keyframes ring {
167
+ 0% { transform: rotate(-15deg); }
168
+ 25% { transform: rotate(15deg); }
169
+ 50% { transform: rotate(-10deg); }
170
+ 75% { transform: rotate(10deg); }
171
+ 100% { transform: rotate(0deg); }
172
+ }
173
+ .bell-count {
174
+ position: absolute;
175
+ top: -5px;
176
+ right: -5px;
177
+ background-color: #f59e0b;
178
+ color: white;
179
+ border-radius: 50%;
180
+ width: 20px;
181
+ height: 20px;
182
+ display: flex;
183
+ align-items: center;
184
+ justify-content: center;
185
+ font-size: 12px;
186
+ font-weight: bold;
187
+ }
188
+ </style>
189
+ </head>
190
+ <body class="bg-gradient-to-br from-gray-50 to-blue-50 min-h-screen">
191
+ <div class="container mx-auto px-4 py-8">
192
+ <!-- Header -->
193
+ <header class="flex flex-col items-center mb-8">
194
+ <div class="flex items-center justify-center mb-4">
195
+ <div class="honeycomb-cell bg-blue-500 w-12 h-12 flex items-center justify-center mr-3">
196
+ <i class="fas fa-comment-alt text-white text-xl"></i>
197
+ </div>
198
+ <h1 class="text-3xl font-bold text-gray-800">Honeycomb Chat</h1>
199
+ </div>
200
+ <p class="text-gray-600 text-center max-w-md">Synchronized communication between prefectures. No records stored.</p>
201
+ </header>
202
+
203
+ <!-- Connection Status -->
204
+ <div class="flex justify-center mb-6">
205
+ <div id="connectionStatus" class="flex items-center bg-white rounded-full px-4 py-2 shadow-md">
206
+ <div class="w-3 h-3 rounded-full bg-gray-400 mr-2"></div>
207
+ <span class="text-sm font-medium text-gray-600">Disconnected</span>
208
+ </div>
209
+ </div>
210
+
211
+ <!-- Chat Container -->
212
+ <div class="max-w-2xl mx-auto bg-white rounded-2xl shadow-xl overflow-hidden">
213
+ <!-- Chat Header -->
214
+ <div class="bg-gradient-to-r from-blue-500 to-indigo-600 p-4 flex items-center honeycomb-bg">
215
+ <div class="octagon bg-white w-8 h-8 flex items-center justify-center mr-3">
216
+ <i class="fas fa-users text-blue-500 text-sm"></i>
217
+ </div>
218
+ <h2 class="text-white font-semibold">Prefecture Channel</h2>
219
+ <div class="ml-auto flex space-x-2">
220
+ <button id="clearBtn" class="p-1 rounded-full hover:bg-blue-400 transition">
221
+ <i class="fas fa-trash-alt text-white"></i>
222
+ </button>
223
+ <button id="syncBtn" class="p-1 rounded-full hover:bg-blue-400 transition">
224
+ <i class="fas fa-sync-alt text-white"></i>
225
+ </button>
226
+ </div>
227
+ </div>
228
+
229
+ <!-- Messages Area -->
230
+ <div id="messages" class="h-96 overflow-y-auto p-4 space-y-4 bg-gray-50 honeycomb-bg">
231
+ <div class="flex justify-center">
232
+ <div class="bg-blue-100 text-blue-800 px-4 py-2 rounded-lg max-w-xs text-center">
233
+ <p>Welcome to Honeycomb Chat! Messages disappear when you close the window.</p>
234
+ </div>
235
+ </div>
236
+ </div>
237
+
238
+ <!-- Input Area -->
239
+ <div class="p-4 border-t border-gray-200 bg-white">
240
+ <div class="flex items-center">
241
+ <div class="flex-1 relative">
242
+ <input id="messageInput" type="text" placeholder="Type a message..."
243
+ class="w-full px-4 py-3 rounded-full border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent">
244
+ <button id="sendBtn" class="absolute right-2 top-1/2 transform -translate-y-1/2 bg-blue-500 text-white rounded-full p-2 hover:bg-blue-600 transition">
245
+ <i class="fas fa-paper-plane"></i>
246
+ </button>
247
+ </div>
248
+ <div class="ml-3 flex space-x-2">
249
+ <button id="shapeBtn" class="p-2 rounded-full bg-gray-100 hover:bg-gray-200 transition">
250
+ <i class="fas fa-shapes text-gray-700"></i>
251
+ </button>
252
+ <button id="prefectureBtn" class="p-2 rounded-full bg-gray-100 hover:bg-gray-200 transition">
253
+ <i class="fas fa-flag text-gray-700"></i>
254
+ </button>
255
+ <button id="aquapodBroadcastBtn" class="p-2 rounded-full bg-cyan-100 hover:bg-cyan-200 transition hidden">
256
+ <i class="fas fa-bullhorn text-cyan-700"></i>
257
+ </button>
258
+ </div>
259
+ </div>
260
+ <div id="shapeOptions" class="hidden mt-3 grid grid-cols-4 gap-3">
261
+ <button data-shape="circle" class="w-10 h-10 rounded-full bg-blue-500 hover:bg-blue-600 transition"></button>
262
+ <button data-shape="triangle" class="w-10 h-10 bg-green-500 hover:bg-green-600 transition triangle"></button>
263
+ <button data-shape="square" class="w-10 h-10 bg-purple-500 hover:bg-purple-600 transition"></button>
264
+ <button data-shape="hexagon" class="w-10 h-10 bg-yellow-500 hover:bg-yellow-600 transition hexagon"></button>
265
+ <button data-shape="pentagon" class="w-10 h-10 bg-red-500 hover:bg-red-600 transition pentagon"></button>
266
+ <button data-shape="octagon" class="w-10 h-10 bg-pink-500 hover:bg-pink-600 transition octagon"></button>
267
+ <button data-shape="diamond" class="w-10 h-10 bg-indigo-500 hover:bg-indigo-600 transition diamond"></button>
268
+ <button data-shape="pennant" class="w-10 h-10 bg-orange-500 hover:bg-orange-600 transition pennant"></button>
269
+ <button data-shape="swallowtail" class="w-10 h-10 bg-teal-500 hover:bg-teal-600 transition swallowtail"></button>
270
+ <button data-shape="burgee" class="w-10 h-10 bg-rose-500 hover:bg-rose-600 transition burgee"></button>
271
+ <button data-shape="houseflag" class="w-10 h-10 bg-lime-500 hover:bg-lime-600 transition houseflag"></button>
272
+ <button data-shape="flag-alpha" class="w-10 h-10 flag-alpha hover:opacity-90 transition"></button>
273
+ <button data-shape="flag-bravo" class="w-10 h-10 flag-bravo hover:opacity-90 transition"></button>
274
+ <button data-shape="flag-charlie" class="w-10 h-10 flag-charlie hover:opacity-90 transition"></button>
275
+ <button data-shape="flag-delta" class="w-10 h-10 flag-delta hover:opacity-90 transition"></button>
276
+ <button data-shape="flag-echo" class="w-10 h-10 flag-echo hover:opacity-90 transition"></button>
277
+ <button data-shape="flag-foxtrot" class="w-10 h-10 flag-foxtrot hover:opacity-90 transition"></button>
278
+ <button data-shape="bell" class="w-10 h-10 bg-amber-500 hover:bg-amber-600 transition rounded-full relative">
279
+ <i class="fas fa-bell text-white"></i>
280
+ </button>
281
+ <button data-shape="food" class="w-10 h-10 bg-emerald-500 hover:bg-emerald-600 transition rounded-full">
282
+ <i class="fas fa-utensils text-white"></i>
283
+ </button>
284
+ <button data-shape="work" class="w-10 h-10 bg-slate-500 hover:bg-slate-600 transition rounded-full">
285
+ <i class="fas fa-briefcase text-white"></i>
286
+ </button>
287
+ </div>
288
+ <div id="prefectureOptions" class="hidden mt-3 grid grid-cols-5 gap-2">
289
+ <button data-prefecture="diligence" class="px-3 py-2 rounded-md prefecture-diligence text-white text-sm font-medium">Diligence</button>
290
+ <button data-prefecture="industry" class="px-3 py-2 rounded-md prefecture-industry text-white text-sm font-medium">Industry</button>
291
+ <button data-prefecture="harmony" class="px-3 py-2 rounded-md prefecture-harmony text-white text-sm font-medium">Harmony</button>
292
+ <button data-prefecture="aquapod" class="px-3 py-2 rounded-md prefecture-aquapod text-white text-sm font-medium">Aquapod</button>
293
+ <button data-prefecture="archive" class="px-3 py-2 rounded-md prefecture-archive text-white text-sm font-medium">Archive</button>
294
+ </div>
295
+ <div id="aquapodBroadcastOptions" class="hidden mt-3 bg-cyan-50 p-3 rounded-lg">
296
+ <h4 class="text-sm font-medium text-cyan-800 mb-2">Aquapod Broadcast</h4>
297
+ <div class="grid grid-cols-3 gap-2">
298
+ <button data-broadcast="alert" class="px-2 py-1 rounded-md bg-amber-100 hover:bg-amber-200 text-amber-800 text-xs font-medium">
299
+ <i class="fas fa-exclamation-triangle mr-1"></i> Alert
300
+ </button>
301
+ <button data-bbroadcast="resources" class="px-2 py-1 rounded-md bg-emerald-100 hover:bg-emerald-200 text-emerald-800 text-xs font-medium">
302
+ <i class="fas fa-fish mr-1"></i> Resources
303
+ </button>
304
+ <button data-broadcast="meeting" class="px-2 py-1 rounded-md bg-blue-100 hover:bg-blue-200 text-blue-800 text-xs font-medium">
305
+ <i class="fas fa-users mr-1"></i> Meeting
306
+ </button>
307
+ <button data-broadcast="emergency" class="px-2 py-1 rounded-md bg-red-100 hover:bg-red-200 text-red-800 text-xs font-medium">
308
+ <i class="fas fa-sos mr-1"></i> Emergency
309
+ </button>
310
+ <button data-broadcast="maintenance" class="px-2 py-1 rounded-md bg-slate-100 hover:bg-slate-200 text-slate-800 text-xs font-medium">
311
+ <i class="fas fa-tools mr-1"></i> Maintenance
312
+ </button>
313
+ <button data-broadcast="custom" class="px-2 py-1 rounded-md bg-cyan-100 hover:bg-cyan-200 text-cyan-800 text-xs font-medium">
314
+ <i class="fas fa-edit mr-1"></i> Custom
315
+ </button>
316
+ </div>
317
+ </div>
318
+ <!-- Bell Input Modal -->
319
+ <div id="bellModal" class="hidden fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
320
+ <div class="bg-white rounded-lg p-6 max-w-sm w-full">
321
+ <h3 class="text-lg font-medium text-gray-900 mb-4">Send Bells</h3>
322
+ <div class="mb-4">
323
+ <label for="bellCount" class="block text-sm font-medium text-gray-700 mb-2">Number of Bells (1-8)</label>
324
+ <input type="number" id="bellCount" min="1" max="8" value="1"
325
+ class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-amber-500">
326
+ </div>
327
+ <div class="mb-4">
328
+ <label for="bellMessage" class="block text-sm font-medium text-gray-700 mb-2">Optional Message</label>
329
+ <input type="text" id="bellMessage" placeholder="What are the bells for?"
330
+ class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-amber-500">
331
+ </div>
332
+ <div class="flex justify-end space-x-3">
333
+ <button id="cancelBellBtn" class="px-4 py-2 bg-gray-200 text-gray-800 rounded-md hover:bg-gray-300 transition">
334
+ Cancel
335
+ </button>
336
+ <button id="confirmBellBtn" class="px-4 py-2 bg-amber-500 text-white rounded-md hover:bg-amber-600 transition">
337
+ Send Bells
338
+ </button>
339
+ </div>
340
+ </div>
341
+ </div>
342
+ </div>
343
+ </div>
344
+
345
+ <!-- User Identification -->
346
+ <div class="mt-6 flex justify-center">
347
+ <div class="bg-white rounded-lg shadow-md p-4 max-w-md w-full">
348
+ <h3 class="font-medium text-gray-700 mb-3">Prefecture Identification</h3>
349
+
350
+ <!-- Sender Information -->
351
+ <div class="mb-4 border-b pb-4">
352
+ <h4 class="text-sm font-medium text-gray-600 mb-2">Your Information</h4>
353
+ <div class="flex items-center space-x-3 mb-3">
354
+ <div id="userShape" class="w-10 h-10 rounded-full bg-blue-500 flex items-center justify-center">
355
+ <i class="fas fa-user text-white"></i>
356
+ </div>
357
+ <input id="usernameInput" type="text" placeholder="Your name"
358
+ class="flex-1 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent">
359
+ </div>
360
+ <div class="mb-3">
361
+ <label for="mmsiInput" class="block text-sm font-medium text-gray-700 mb-1">Your MMSI (Optional)</label>
362
+ <div class="relative">
363
+ <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
364
+ <i class="fas fa-ship text-gray-400"></i>
365
+ </div>
366
+ <input id="mmsiInput" type="text" placeholder="123456789"
367
+ class="pl-10 w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
368
+ maxlength="9" pattern="\d*">
369
+ </div>
370
+ <p class="mt-1 text-xs text-gray-500">9-digit Maritime Mobile Service Identity</p>
371
+ </div>
372
+ <div id="currentPrefecture" class="text-sm font-medium text-gray-600">
373
+ Current Prefecture: <span class="text-blue-500">None selected</span>
374
+ </div>
375
+ </div>
376
+
377
+ <!-- Recipient Selection -->
378
+ <div>
379
+ <h4 class="text-sm font-medium text-gray-600 mb-2">Recipient Selection</h4>
380
+
381
+ <!-- Recipient Prefecture -->
382
+ <div class="mb-3">
383
+ <label class="block text-sm font-medium text-gray-700 mb-1">Recipient Prefecture</label>
384
+ <div class="grid grid-cols-5 gap-2">
385
+ <button data-recipient-prefecture="diligence" class="px-2 py-1 rounded-md bg-orange-100 hover:bg-orange-200 text-orange-800 text-xs font-medium">Diligence</button>
386
+ <button data-recipient-prefecture="industry" class="px-2 py-1 rounded-md bg-emerald-100 hover:bg-emerald-200 text-emerald-800 text-xs font-medium">Industry</button>
387
+ <button data-recipient-prefecture="harmony" class="px-2 py-1 rounded-md bg-blue-100 hover:bg-blue-200 text-blue-800 text-xs font-medium">Harmony</button>
388
+ <button data-recipient-prefecture="aquapod" class="px-2 py-1 rounded-md bg-cyan-100 hover:bg-cyan-200 text-cyan-800 text-xs font-medium">Aquapod</button>
389
+ <button data-recipient-prefecture="archive" class="px-2 py-1 rounded-md bg-violet-100 hover:bg-violet-200 text-violet-800 text-xs font-medium">Archive</button>
390
+ <button data-recipient-prefecture="all" class="px-2 py-1 rounded-md bg-gray-100 hover:bg-gray-200 text-gray-800 text-xs font-medium col-span-5">All Prefectures</button>
391
+ </div>
392
+ </div>
393
+
394
+ <!-- Specific Recipients -->
395
+ <div class="mb-3">
396
+ <label class="block text-sm font-medium text-gray-700 mb-1">Specific Recipients</label>
397
+ <div class="flex items-center space-x-2 mb-2">
398
+ <input id="recipientNameInput" type="text" placeholder="Recipient name"
399
+ class="flex-1 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm">
400
+ <input id="recipientMmsiInput" type="text" placeholder="MMSI"
401
+ class="w-24 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm"
402
+ maxlength="9" pattern="\d*">
403
+ <button id="addRecipientBtn" class="px-3 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 transition">
404
+ <i class="fas fa-plus"></i>
405
+ </button>
406
+ </div>
407
+ <div id="recipientsList" class="flex flex-wrap"></div>
408
+ </div>
409
+
410
+ <!-- Current Recipients -->
411
+ <div class="text-sm font-medium text-gray-600">
412
+ Sending to: <span id="currentRecipients" class="text-blue-500">All prefectures</span>
413
+ </div>
414
+ </div>
415
+ </div>
416
+ </div>
417
+
418
+ <!-- Bell Totals Display -->
419
+ <div id="bellTotals" class="hidden fixed bottom-4 right-4 bg-white rounded-lg shadow-lg p-4 z-40">
420
+ <h3 class="font-medium text-gray-700 mb-2">Your Bell Totals</h3>
421
+ <div id="bellTotalsList" class="space-y-2">
422
+ <!-- Will be populated dynamically -->
423
+ </div>
424
+ <button id="closeBellTotals" class="mt-3 text-sm text-blue-500 hover:text-blue-700">
425
+ Close
426
+ </button>
427
+ </div>
428
+
429
+ <!-- Floating Shapes -->
430
+ <div class="fixed top-0 left-0 w-full h-full pointer-events-none overflow-hidden z-0">
431
+ <div class="absolute top-1/4 left-1/6 w-16 h-16 bg-blue-200 opacity-20 rounded-full floating shape-transition"></div>
432
+ <div class="absolute top-1/3 right-1/5 w-12 h-12 bg-indigo-200 opacity-20 triangle floating shape-transition" style="animation-delay: 1s;"></div>
433
+ <div class="absolute bottom-1/4 left-1/4 w-20 h-20 bg-purple-200 opacity-20 hexagon floating shape-transition" style="animation-delay: 2s;"></div>
434
+ <div class="absolute bottom-1/3 right-1/4 w-14 h-14 bg-pink-200 opacity-20 pentagon floating shape-transition" style="animation-delay: 3s;"></div>
435
+ <div class="absolute top-1/5 right-1/6 w-18 h-18 bg-yellow-200 opacity-20 octagon floating shape-transition" style="animation-delay: 1.5s;"></div>
436
+ <div class="absolute bottom-1/5 left-1/5 w-16 h-16 bg-green-200 opacity-20 diamond floating shape-transition" style="animation-delay: 2.5s;"></div>
437
+ <div class="absolute top-1/6 right-1/4 w-14 h-14 bg-orange-200 opacity-20 pennant floating shape-transition" style="animation-delay: 0.5s;"></div>
438
+ <div class="absolute bottom-1/6 left-1/3 w-16 h-16 bg-teal-200 opacity-20 swallowtail floating shape-transition" style="animation-delay: 1.8s;"></div>
439
+ </div>
440
+ </div>
441
+
442
+ <script>
443
+ document.addEventListener('DOMContentLoaded', function() {
444
+ // Elements
445
+ const messageInput = document.getElementById('messageInput');
446
+ const sendBtn = document.getElementById('sendBtn');
447
+ const messages = document.getElementById('messages');
448
+ const clearBtn = document.getElementById('clearBtn');
449
+ const syncBtn = document.getElementById('syncBtn');
450
+ const shapeBtn = document.getElementById('shapeBtn');
451
+ const shapeOptions = document.getElementById('shapeOptions');
452
+ const prefectureBtn = document.getElementById('prefectureBtn');
453
+ const prefectureOptions = document.getElementById('prefectureOptions');
454
+ const aquapodBroadcastBtn = document.getElementById('aquapodBroadcastBtn');
455
+ const aquapodBroadcastOptions = document.getElementById('aquapodBroadcastOptions');
456
+ const userShape = document.getElementById('userShape');
457
+ const usernameInput = document.getElementById('usernameInput');
458
+ const mmsiInput = document.getElementById('mmsiInput');
459
+ const connectionStatus = document.getElementById('connectionStatus');
460
+ const currentPrefectureDisplay = document.getElementById('currentPrefecture').querySelector('span');
461
+ const recipientNameInput = document.getElementById('recipientNameInput');
462
+ const recipientMmsiInput = document.getElementById('recipientMmsiInput');
463
+ const addRecipientBtn = document.getElementById('addRecipientBtn');
464
+ const recipientsList = document.getElementById('recipientsList');
465
+ const currentRecipientsDisplay = document.getElementById('currentRecipients');
466
+ const bellModal = document.getElementById('bellModal');
467
+ const bellCountInput = document.getElementById('bellCount');
468
+ const bellMessageInput = document.getElementById('bellMessage');
469
+ const confirmBellBtn = document.getElementById('confirmBellBtn');
470
+ const cancelBellBtn = document.getElementById('cancelBellBtn');
471
+ const bellTotals = document.getElementById('bellTotals');
472
+ const bellTotalsList = document.getElementById('bellTotalsList');
473
+ const closeBellTotals = document.getElementById('closeBellTotals');
474
+
475
+ // State
476
+ let currentShape = 'circle';
477
+ let currentPrefecture = null;
478
+ let username = 'User' + Math.floor(Math.random() * 1000);
479
+ let mmsi = '';
480
+ let isConnected = false;
481
+ let channel = null;
482
+ let recipientPrefecture = 'all';
483
+ let specificRecipients = [];
484
+ let bellTransactions = []; // Stores all bell transactions
485
+ let bellBalances = {}; // Stores current bell balances by recipient MMSI
486
+
487
+ // Initialize
488
+ usernameInput.value = username;
489
+ updateConnectionStatus(false);
490
+ updateRecipientsDisplay();
491
+
492
+ // Event Listeners
493
+ sendBtn.addEventListener('click', sendMessage);
494
+ messageInput.addEventListener('keypress', function(e) {
495
+ if (e.key === 'Enter') sendMessage();
496
+ });
497
+
498
+ clearBtn.addEventListener('click', clearMessages);
499
+ syncBtn.addEventListener('click', toggleConnection);
500
+ shapeBtn.addEventListener('click', toggleShapeOptions);
501
+ prefectureBtn.addEventListener('click', togglePrefectureOptions);
502
+ aquapodBroadcastBtn.addEventListener('click', toggleAquapodBroadcastOptions);
503
+ addRecipientBtn.addEventListener('click', addRecipient);
504
+ confirmBellBtn.addEventListener('click', confirmBellTransaction);
505
+ cancelBellBtn.addEventListener('click', cancelBellTransaction);
506
+ closeBellTotals.addEventListener('click', () => bellTotals.classList.add('hidden'));
507
+
508
+ // Toggle bell totals display when clicking on bell shape
509
+ document.querySelector('[data-shape="bell"]').addEventListener('click', function() {
510
+ if (currentShape === 'bell') {
511
+ updateBellTotalsDisplay();
512
+ bellTotals.classList.toggle('hidden');
513
+ }
514
+ });
515
+
516
+ // Recipient prefecture selection
517
+ document.querySelectorAll('[data-recipient-prefecture]').forEach(btn => {
518
+ btn.addEventListener('click', function() {
519
+ recipientPrefecture = this.dataset.recipientPrefecture;
520
+ specificRecipients = []; // Clear specific recipients when changing prefecture
521
+ updateRecipientsList();
522
+ updateRecipientsDisplay();
523
+
524
+ // Update active state
525
+ document.querySelectorAll('[data-recipient-prefecture]').forEach(b => {
526
+ b.classList.remove('bg-gray-200', 'text-gray-800');
527
+ const color = getColorForPrefecture(b.dataset.recipientPrefecture);
528
+ if (b.dataset.recipientPrefecture === 'all') {
529
+ b.classList.add('bg-gray-100', 'hover:bg-gray-200', 'text-gray-800');
530
+ } else {
531
+ b.classList.add(`bg-${color}-100`, `hover:bg-${color}-200`, `text-${color}-800`);
532
+ }
533
+ });
534
+
535
+ // Set active state for selected button
536
+ if (recipientPrefecture === 'all') {
537
+ this.classList.add('bg-gray-200', 'text-gray-800');
538
+ } else {
539
+ const color = getColorForPrefecture(recipientPrefecture);
540
+ this.classList.add(`bg-${color}-200`, `text-${color}-900`);
541
+ }
542
+ });
543
+ });
544
+
545
+ // Shape selection
546
+ document.querySelectorAll('#shapeOptions button').forEach(btn => {
547
+ btn.addEventListener('click', function() {
548
+ currentShape = this.dataset.shape;
549
+
550
+ // Special handling for bell shape
551
+ if (currentShape === 'bell') {
552
+ showBellModal();
553
+ } else {
554
+ updateUserShape();
555
+ toggleShapeOptions();
556
+ }
557
+ });
558
+ });
559
+
560
+ // Prefecture selection
561
+ document.querySelectorAll('#prefectureOptions button').forEach(btn => {
562
+ btn.addEventListener('click', function() {
563
+ currentPrefecture = this.dataset.prefecture;
564
+ currentPrefectureDisplay.textContent = this.textContent;
565
+ currentPrefectureDisplay.className = `text-${getColorForPrefecture(currentPrefecture)}-500`;
566
+
567
+ // Show/hide Aquapod broadcast button based on selected prefecture
568
+ if (currentPrefecture === 'aquapod') {
569
+ aquapodBroadcastBtn.classList.remove('hidden');
570
+ } else {
571
+ aquapodBroadcastBtn.classList.add('hidden');
572
+ aquapodBroadcastOptions.classList.add('hidden');
573
+ }
574
+
575
+ togglePrefectureOptions();
576
+ });
577
+ });
578
+
579
+ // Aquapod broadcast selection
580
+ document.querySelectorAll('#aquapodBroadcastOptions button').forEach(btn => {
581
+ btn.addEventListener('click', function() {
582
+ const broadcastType = this.dataset.broadcast;
583
+ let message = '';
584
+
585
+ switch(broadcastType) {
586
+ case 'alert':
587
+ message = "Aquapod Alert: All prefectures please be advised of potential marine disturbances in sector 4.";
588
+ break;
589
+ case 'resources':
590
+ message = "Aquapod Resource Update: New marine resources available for collection at buoy markers 12-15.";
591
+ break;
592
+ case 'meeting':
593
+ message = "Aquapod Meeting: All prefecture representatives required for monthly coordination at the central hub.";
594
+ break;
595
+ case 'emergency':
596
+ message = "Aquapod Emergency: Immediate assistance required at coordinates 34.5°N, 72.1°W. All available units respond.";
597
+ break;
598
+ case 'maintenance':
599
+ message = "Aquapod Maintenance: Desalination systems will be offline for scheduled maintenance tomorrow 0800-1200.";
600
+ break;
601
+ case 'custom':
602
+ message = prompt("Enter your broadcast message:", "Aquapod Broadcast: ");
603
+ if (!message) return;
604
+ break;
605
+ }
606
+
607
+ // Send to all prefectures
608
+ sendBroadcastMessage(message);
609
+ toggleAquapodBroadcastOptions();
610
+ });
611
+ });
612
+
613
+ usernameInput.addEventListener('change', function() {
614
+ username = this.value || 'Anonymous';
615
+ });
616
+
617
+ mmsiInput.addEventListener('input', function() {
618
+ // Validate MMSI input (only numbers, max 9 digits)
619
+ this.value = this.value.replace(/\D/g, '').slice(0, 9);
620
+ mmsi = this.value;
621
+ });
622
+
623
+ recipientMmsiInput.addEventListener('input', function() {
624
+ // Validate MMSI input (only numbers, max 9 digits)
625
+ this.value = this.value.replace(/\D/g, '').slice(0, 9);
626
+ });
627
+
628
+ // Functions
629
+ function sendMessage() {
630
+ const message = messageInput.value.trim();
631
+ if (!message) return;
632
+
633
+ // Create and display message with recipient info
634
+ let recipientInfo = '';
635
+ if (recipientPrefecture !== 'all' || specificRecipients.length > 0) {
636
+ recipientInfo = ` [To: ${getRecipientDescription()}]`;
637
+ }
638
+
639
+ displayMessage(message + recipientInfo, username, currentShape, currentPrefecture, true, mmsi);
640
+
641
+ // In a real app, this would broadcast to the selected recipients
642
+ // For demo purposes, we'll simulate responses from the selected prefecture(s)
643
+ setTimeout(() => {
644
+ if (isConnected) {
645
+ const respondingPrefectures = getRespondingPrefectures();
646
+
647
+ respondingPrefectures.forEach((prefecture, index) => {
648
+ setTimeout(() => {
649
+ displayMessage(
650
+ `${getPrefectureResponse(message, prefecture)}`,
651
+ `Prefecture ${prefecture.charAt(0).toUpperCase() + prefecture.slice(1)}`,
652
+ getRandomShape(),
653
+ prefecture,
654
+ false,
655
+ generateRandomMMSI()
656
+ );
657
+ }, 1000 + (index * 800));
658
+ });
659
+ }
660
+ }, 1000);
661
+
662
+ // Clear input
663
+ messageInput.value = '';
664
+ }
665
+
666
+ function sendBroadcastMessage(message) {
667
+ if (!message) return;
668
+
669
+ // Display the broadcast message with special styling
670
+ displayMessage(message, "Aquapod Broadcast", "wave", "aquapod", true, mmsi);
671
+
672
+ // Simulate responses from all prefectures
673
+ if (isConnected) {
674
+ const prefectures = ['diligence', 'industry', 'harmony', 'archive'];
675
+
676
+ prefectures.forEach((prefecture, index) => {
677
+ setTimeout(() => {
678
+ displayMessage(
679
+ `Prefecture ${prefecture.charAt(0).toUpperCase() + prefecture.slice(1)} acknowledges broadcast.`,
680
+ `Prefecture ${prefecture.charAt(0).toUpperCase() + prefecture.slice(1)}`,
681
+ getRandomShape(),
682
+ prefecture,
683
+ false,
684
+ generateRandomMMSI()
685
+ );
686
+ }, 1500 + (index * 800));
687
+ });
688
+ }
689
+ }
690
+
691
+ function addRecipient() {
692
+ const name = recipientNameInput.value.trim();
693
+ const mmsi = recipientMmsiInput.value.trim();
694
+
695
+ if (!name) return;
696
+
697
+ specificRecipients.push({
698
+ name: name,
699
+ mmsi: mmsi
700
+ });
701
+
702
+ recipientNameInput.value = '';
703
+ recipientMmsiInput.value = '';
704
+
705
+ updateRecipientsList();
706
+ updateRecipientsDisplay();
707
+
708
+ // If we have specific recipients, switch to "specific" mode
709
+ if (specificRecipients.length > 0 && recipientPrefecture !== 'specific') {
710
+ recipientPrefecture = 'specific';
711
+ updateRecipientsDisplay();
712
+ }
713
+ }
714
+
715
+ function removeRecipient(index) {
716
+ specificRecipients.splice(index, 1);
717
+ updateRecipientsList();
718
+ updateRecipientsDisplay();
719
+
720
+ // If no more specific recipients, switch back to "all"
721
+ if (specificRecipients.length === 0 && recipientPrefecture === 'specific') {
722
+ recipientPrefecture = 'all';
723
+ updateRecipientsDisplay();
724
+ }
725
+ }
726
+
727
+ function updateRecipientsList() {
728
+ recipientsList.innerHTML = '';
729
+
730
+ specificRecipients.forEach((recipient, index) => {
731
+ const chip = document.createElement('div');
732
+ chip.className = 'recipient-chip';
733
+
734
+ let chipText = recipient.name;
735
+ if (recipient.mmsi) {
736
+ chipText += ` (MMSI: ${recipient.mmsi})`;
737
+ }
738
+
739
+ chip.innerHTML = `
740
+ <span>${chipText}</span>
741
+ <button onclick="removeRecipient(${index})">
742
+ <i class="fas fa-times"></i>
743
+ </button>
744
+ `;
745
+
746
+ recipientsList.appendChild(chip);
747
+ });
748
+ }
749
+
750
+ function updateRecipientsDisplay() {
751
+ currentRecipientsDisplay.textContent = getRecipientDescription();
752
+ }
753
+
754
+ function getRecipientDescription() {
755
+ if (recipientPrefecture === 'all') {
756
+ return 'All prefectures';
757
+ } else if (recipientPrefecture === 'specific') {
758
+ if (specificRecipients.length === 0) {
759
+ return 'No recipients selected';
760
+ } else if (specificRecipients.length === 1) {
761
+ return specificRecipients[0].name + (specificRecipients[0].mmsi ? ` (MMSI: ${specificRecipients[0].mmsi})` : '');
762
+ } else {
763
+ return `${specificRecipients.length} specific recipients`;
764
+ }
765
+ } else {
766
+ return `Prefecture ${recipientPrefecture.charAt(0).toUpperCase() + recipientPrefecture.slice(1)}`;
767
+ }
768
+ }
769
+
770
+ function getRespondingPrefectures() {
771
+ if (recipientPrefecture === 'all') {
772
+ return ['diligence', 'industry', 'harmony', 'archive'];
773
+ } else if (recipientPrefecture === 'specific') {
774
+ return specificRecipients.length > 0 ?
775
+ [specificRecipients[0].name.toLowerCase().replace(/\s+/g, '-')] :
776
+ [];
777
+ } else {
778
+ return [recipientPrefecture];
779
+ }
780
+ }
781
+
782
+ function displayMessage(text, sender, shape, prefecture, isCurrentUser, mmsi = '') {
783
+ const messageDiv = document.createElement('div');
784
+ messageDiv.className = `flex ${isCurrentUser ? 'justify-end' : 'justify-start'}`;
785
+
786
+ const shapeDiv = document.createElement('div');
787
+ shapeDiv.className = `w-8 h-8 flex-shrink-0 flex items-center justify-center mr-2 ${isCurrentUser ? 'order-last ml-2' : 'mr-2'}`;
788
+
789
+ // Special case for Aquapod broadcast wave effect
790
+ if (shape === 'wave') {
791
+ shapeDiv.className += ' wave-animation bg-cyan-500 rounded-full';
792
+ const icon = document.createElement('i');
793
+ icon.className = 'fas fa-bullhorn text-white';
794
+ shapeDiv.appendChild(icon);
795
+ }
796
+ // Apply shape and special styling for flags and icons
797
+ else if (shape.startsWith('flag-')) {
798
+ shapeDiv.className += ` ${shape}`;
799
+ const icon = document.createElement('i');
800
+ icon.className = `fas fa-flag text-xs ${getFlagIconColor(shape)}`;
801
+ shapeDiv.appendChild(icon);
802
+ }
803
+ else if (shape === 'bell' || shape === 'food' || shape === 'work') {
804
+ shapeDiv.className += ` rounded-full bg-${getColorForShape(shape)}-500`;
805
+ const icon = document.createElement('i');
806
+ icon.className = `fas fa-${shape} text-white text-xs`;
807
+ shapeDiv.appendChild(icon);
808
+ }
809
+ else {
810
+ shapeDiv.classList.add('bg-' + getColorForShape(shape) + '-500');
811
+ if (shape !== 'circle') {
812
+ shapeDiv.classList.add(shape);
813
+ } else {
814
+ shapeDiv.classList.add('rounded-full');
815
+ }
816
+ const icon = document.createElement('i');
817
+ icon.className = `fas fa-${shape === 'circle' ? 'user' : 'shapes'} text-white text-xs`;
818
+ shapeDiv.appendChild(icon);
819
+ }
820
+
821
+ const contentDiv = document.createElement('div');
822
+ contentDiv.className = `max-w-xs ${isCurrentUser ? 'text-right' : 'text-left'}`;
823
+
824
+ const senderSpan = document.createElement('span');
825
+ senderSpan.className = `text-xs font-medium ${isCurrentUser ? 'text-blue-600' : 'text-gray-600'}`;
826
+
827
+ // Add MMSI to sender if provided
828
+ if (mmsi) {
829
+ senderSpan.innerHTML = `${sender} <span class="text-xs text-gray-500">(MMSI: ${mmsi})</span>`;
830
+ } else {
831
+ senderSpan.textContent = sender;
832
+ }
833
+
834
+ const textDiv = document.createElement('div');
835
+ textDiv.className = `mt-1 px-4 py-2 rounded-lg ${prefecture ? 'message-' + prefecture : 'bg-blue-500 text-white'} ${shape === 'wave' ? 'pulse' : ''}`;
836
+ textDiv.textContent = text;
837
+
838
+ contentDiv.appendChild(senderSpan);
839
+ contentDiv.appendChild(textDiv);
840
+
841
+ messageDiv.appendChild(isCurrentUser ? contentDiv : shapeDiv);
842
+ messageDiv.appendChild(isCurrentUser ? shapeDiv : contentDiv);
843
+
844
+ messages.appendChild(messageDiv);
845
+ messages.scrollTop = messages.scrollHeight;
846
+ }
847
+
848
+ function clearMessages() {
849
+ messages.innerHTML = `
850
+ <div class="flex justify-center">
851
+ <div class="bg-blue-100 text-blue-800 px-4 py-2 rounded-lg max-w-xs text-center">
852
+ <p>Chat cleared. Start a new conversation!</p>
853
+ </div>
854
+ </div>
855
+ `;
856
+ }
857
+
858
+ function toggleConnection() {
859
+ isConnected = !isConnected;
860
+ updateConnectionStatus(isConnected);
861
+
862
+ if (isConnected) {
863
+ // In a real app, this would establish a connection
864
+ displaySystemMessage('Connected to prefecture network. Messages are now synchronized.');
865
+ } else {
866
+ displaySystemMessage('Disconnected from prefecture network. Messages are no longer synchronized.');
867
+ }
868
+ }
869
+
870
+ function updateConnectionStatus(connected) {
871
+ const statusDot = connectionStatus.querySelector('div');
872
+ const statusText = connectionStatus.querySelector('span');
873
+
874
+ if (connected) {
875
+ statusDot.className = 'w-3 h-3 rounded-full bg-green-500 mr-2';
876
+ statusText.textContent = 'Connected';
877
+ syncBtn.innerHTML = '<i class="fas fa-unlink text-white"></i>';
878
+ } else {
879
+ statusDot.className = 'w-3 h-3 rounded-full bg-gray-400 mr-2';
880
+ statusText.textContent = 'Disconnected';
881
+ syncBtn.innerHTML = '<i class="fas fa-link text-white"></i>';
882
+ }
883
+ }
884
+
885
+ function toggleShapeOptions() {
886
+ shapeOptions.classList.toggle('hidden');
887
+ // Hide other options if visible
888
+ if (!prefectureOptions.classList.contains('hidden')) {
889
+ prefectureOptions.classList.add('hidden');
890
+ }
891
+ if (!aquapodBroadcastOptions.classList.contains('hidden')) {
892
+ aquapodBroadcastOptions.classList.add('hidden');
893
+ }
894
+ }
895
+
896
+ function togglePrefectureOptions() {
897
+ prefectureOptions.classList.toggle('hidden');
898
+ // Hide other options if visible
899
+ if (!shapeOptions.classList.contains('hidden')) {
900
+ shapeOptions.classList.add('hidden');
901
+ }
902
+ if (!aquapodBroadcastOptions.classList.contains('hidden')) {
903
+ aquapodBroadcastOptions.classList.add('hidden');
904
+ }
905
+ }
906
+
907
+ function toggleAquapodBroadcastOptions() {
908
+ if (currentPrefecture === 'aquapod') {
909
+ aquapodBroadcastOptions.classList.toggle('hidden');
910
+ // Hide other options if visible
911
+ if (!shapeOptions.classList.contains('hidden')) {
912
+ shapeOptions.classList.add('hidden');
913
+ }
914
+ if (!prefectureOptions.classList.contains('hidden')) {
915
+ prefectureOptions.classList.add('hidden');
916
+ }
917
+ }
918
+ }
919
+
920
+ function updateUserShape() {
921
+ // Clear all shape classes
922
+ userShape.className = 'w-10 h-10 flex items-center justify-center';
923
+
924
+ // Special case for icons
925
+ if (currentShape === 'bell' || currentShape === 'food' || currentShape === 'work') {
926
+ userShape.className += ` rounded-full bg-${getColorForShape(currentShape)}-500`;
927
+ const icon = userShape.querySelector('i') || document.createElement('i');
928
+ icon.className = `fas fa-${currentShape} text-white`;
929
+ if (!userShape.querySelector('i')) {
930
+ userShape.appendChild(icon);
931
+ }
932
+ }
933
+ // Apply shape and special styling for flags
934
+ else if (currentShape.startsWith('flag-')) {
935
+ userShape.className += ` ${currentShape}`;
936
+ const icon = userShape.querySelector('i') || document.createElement('i');
937
+ icon.className = `fas fa-flag ${getFlagIconColor(currentShape)}`;
938
+ if (!userShape.querySelector('i')) {
939
+ userShape.appendChild(icon);
940
+ }
941
+ } else {
942
+ userShape.classList.add('bg-' + getColorForShape(currentShape) + '-500');
943
+ if (currentShape !== 'circle') {
944
+ userShape.classList.add(currentShape);
945
+ } else {
946
+ userShape.classList.add('rounded-full');
947
+ }
948
+
949
+ // Update icon
950
+ const icon = userShape.querySelector('i') || document.createElement('i');
951
+ icon.className = `fas fa-${currentShape === 'circle' ? 'user' : 'shapes'} text-white`;
952
+ if (!userShape.querySelector('i')) {
953
+ userShape.appendChild(icon);
954
+ }
955
+ }
956
+ }
957
+
958
+ function displaySystemMessage(text) {
959
+ const div = document.createElement('div');
960
+ div.className = 'flex justify-center';
961
+ div.innerHTML = `
962
+ <div class="bg-gray-100 text-gray-600 px-4 py-2 rounded-lg max-w-xs text-center text-sm">
963
+ <p>${text}</p>
964
+ </div>
965
+ `;
966
+ messages.appendChild(div);
967
+ messages.scrollTop = messages.scrollHeight;
968
+ }
969
+
970
+ function getRandomShape() {
971
+ const shapes = [
972
+ 'circle', 'triangle', 'square', 'hexagon', 'pentagon',
973
+ 'octagon', 'diamond', 'pennant', 'swallowtail', 'burgee',
974
+ 'houseflag', 'flag-alpha', 'flag-bravo', 'flag-charlie',
975
+ 'flag-delta', 'flag-echo', 'flag-foxtrot', 'bell', 'food', 'work'
976
+ ];
977
+ return shapes[Math.floor(Math.random() * shapes.length)];
978
+ }
979
+
980
+ function getRandomPrefecture() {
981
+ const prefectures = ['diligence', 'industry', 'harmony', 'aquapod', 'archive'];
982
+ return prefectures[Math.floor(Math.random() * prefectures.length)];
983
+ }
984
+
985
+ function generateRandomMMSI() {
986
+ // Generate a random 9-digit MMSI for simulated responses
987
+ return Math.floor(100000000 + Math.random() * 900000000).toString();
988
+ }
989
+
990
+ function getColorForShape(shape) {
991
+ const colors = {
992
+ 'circle': 'blue',
993
+ 'triangle': 'green',
994
+ 'square': 'purple',
995
+ 'hexagon': 'yellow',
996
+ 'pentagon': 'red',
997
+ 'octagon': 'pink',
998
+ 'diamond': 'indigo',
999
+ 'pennant': 'orange',
1000
+ 'swallowtail': 'teal',
1001
+ 'burgee': 'rose',
1002
+ 'houseflag': 'lime',
1003
+ 'bell': 'amber',
1004
+ 'food': 'emerald',
1005
+ 'work': 'slate'
1006
+ };
1007
+ return colors[shape] || 'blue';
1008
+ }
1009
+
1010
+ function getColorForPrefecture(prefecture) {
1011
+ const colors = {
1012
+ 'diligence': 'orange',
1013
+ 'industry': 'emerald',
1014
+ 'harmony': 'blue',
1015
+ 'aquapod': 'cyan',
1016
+ 'archive': 'violet'
1017
+ };
1018
+ return colors[prefecture] || 'blue';
1019
+ }
1020
+
1021
+ function getFlagIconColor(flagShape) {
1022
+ // Determine appropriate icon color based on flag colors
1023
+ const flagColors = {
1024
+ 'flag-alpha': 'text-blue-600', // White/Blue - blue text for visibility
1025
+ 'flag-bravo': 'text-red-600', // Red/White - red text
1026
+ 'flag-charlie': 'text-white', // Blue/White/Red - white for contrast
1027
+ 'flag-delta': 'text-blue-600', // Yellow/Blue - blue text
1028
+ 'flag-echo': 'text-white', // Blue/Red/Blue - white for contrast
1029
+ 'flag-foxtrot': 'text-red-600' // White/Red - red text
1030
+ };
1031
+ return flagColors[flagShape] || 'text-white';
1032
+ }
1033
+
1034
+ function getPrefectureResponse(message, prefecture) {
1035
+ const responses = {
1036
+ 'diligence': `Regarding "${message}", our workers are already on it with maximum efficiency.`,
1037
+ 'industry': `"${message}" noted. Our factories will process this request immediately.`,
1038
+ 'harmony': `We appreciate your message about "${message}". Let's work together peacefully.`,
1039
+ 'aquapod': `"${message}" received. Our marine systems are analyzing this input.`,
1040
+ 'archive': `"${message}" has been recorded in our permanent knowledge banks.`
1041
+ };
1042
+ return responses[prefecture] || `Prefecture acknowledges: "${message}"`;
1043
+ }
1044
+
1045
+ // Bell system functions
1046
+ function showBellModal() {
1047
+ bellModal.classList.remove('hidden');
1048
+ bellCountInput.value = '1';
1049
+ bellMessageInput.value = '';
1050
+ }
1051
+
1052
+ function cancelBellTransaction() {
1053
+ bellModal.classList.add('hidden');
1054
+ toggleShapeOptions();
1055
+ }
1056
+
1057
+ function confirmBellTransaction() {
1058
+ const bellCount = parseInt(bellCountInput.value);
1059
+ const bellMessage = bellMessageInput.value.trim();
1060
+
1061
+ if (bellCount < 1 || bellCount > 8) {
1062
+ alert('Please enter a number between 1 and 8');
1063
+ return;
1064
+ }
1065
+
1066
+ // Get recipient MMSI (if specific recipient is selected)
1067
+ let recipientMmsi = '';
1068
+ if (recipientPrefecture === 'specific' && specificRecipients.length > 0) {
1069
+ recipientMmsi = specificRecipients[0].mmsi;
1070
+ }
1071
+
1072
+ // Record the transaction
1073
+ const transaction = {
1074
+ senderMmsi: mmsi,
1075
+ recipientMmsi: recipientMmsi,
1076
+ recipientPrefecture: recipientPrefecture,
1077
+ bellCount: bellCount,
1078
+ message: bellMessage,
1079
+ timestamp: new Date().toISOString()
1080
+ };
1081
+
1082
+ bellTransactions.push(transaction);
1083
+
1084
+ // Update bell balances
1085
+ if (recipientMmsi) {
1086
+ if (!bellBalances[recipientMmsi]) {
1087
+ bellBalances[recipientMmsi] = 0;
1088
+ }
1089
+ bellBalances[recipientMmsi] += bellCount;
1090
+ }
1091
+
1092
+ // Display the bell message
1093
+ let displayMessage = `Sent ${bellCount} bell${bellCount !== 1 ? 's' : ''}`;
1094
+ if (bellMessage) {
1095
+ displayMessage += ` for: ${bellMessage}`;
1096
+ }
1097
+
1098
+ if (recipientPrefecture === 'specific' && specificRecipients.length > 0) {
1099
+ displayMessage += ` to ${specificRecipients[0].name}`;
1100
+ if (recipientMmsi) {
1101
+ displayMessage += ` (MMSI: ${recipientMmsi})`;
1102
+ }
1103
+ } else if (recipientPrefecture !== 'all') {
1104
+ displayMessage += ` to Prefecture ${recipientPrefecture.charAt(0).toUpperCase() + recipientPrefecture.slice(1)}`;
1105
+ }
1106
+
1107
+ displayMessage(displayMessage, username, 'bell', currentPrefecture, true, mmsi);
1108
+
1109
+ // Simulate response if connected
1110
+ if (isConnected) {
1111
+ setTimeout(() => {
1112
+ const respondingPrefectures = getRespondingPrefectures();
1113
+
1114
+ respondingPrefectures.forEach((prefecture, index) => {
1115
+ setTimeout(() => {
1116
+ let responseMessage = '';
1117
+ if (recipientPrefecture === 'specific' && specificRecipients.length > 0) {
1118
+ responseMessage = `${specificRecipients[0].name} received ${bellCount} bell${bellCount !== 1 ? 's' : ''}`;
1119
+ if (recipientMmsi) {
1120
+ responseMessage += ` (Total: ${bellBalances[recipientMmsi] || bellCount} bells)`;
1121
+ }
1122
+ } else {
1123
+ responseMessage = `Prefecture ${prefecture.charAt(0).toUpperCase() + prefecture.slice(1)} received ${bellCount} bell${bellCount !== 1 ? 's' : ''}`;
1124
+ }
1125
+
1126
+ if (bellMessage) {
1127
+ responseMessage += ` for: ${bellMessage}`;
1128
+ }
1129
+
1130
+ displayMessage(
1131
+ responseMessage,
1132
+ recipientPrefecture === 'specific' && specificRecipients.length > 0 ?
1133
+ specificRecipients[0].name :
1134
+ `Prefecture ${prefecture.charAt(0).toUpperCase() + prefecture.slice(1)}`,
1135
+ 'bell',
1136
+ prefecture,
1137
+ false,
1138
+ recipientPrefecture === 'specific' && specificRecipients.length > 0 ?
1139
+ specificRecipients[0].mmsi || generateRandomMMSI() :
1140
+ generateRandomMMSI()
1141
+ );
1142
+ }, 1000 + (index * 800));
1143
+ });
1144
+ }, 1000);
1145
+ }
1146
+
1147
+ // Close modal and update UI
1148
+ bellModal.classList.add('hidden');
1149
+ updateUserShape();
1150
+ toggleShapeOptions();
1151
+ }
1152
+
1153
+ function updateBellTotalsDisplay() {
1154
+ bellTotalsList.innerHTML = '';
1155
+
1156
+ if (Object.keys(bellBalances).length === 0) {
1157
+ bellTotalsList.innerHTML = '<p class="text-sm text-gray-500">No bell transactions yet</p>';
1158
+ return;
1159
+ }
1160
+
1161
+ // Group transactions by recipient
1162
+ const recipientGroups = {};
1163
+ bellTransactions.forEach(tx => {
1164
+ if (tx.recipientMmsi) {
1165
+ if (!recipientGroups[tx.recipientMmsi]) {
1166
+ recipientGroups[tx.recipientMmsi] = {
1167
+ total: 0,
1168
+ transactions: []
1169
+ };
1170
+ }
1171
+ recipientGroups[tx.recipientMmsi].total += tx.bellCount;
1172
+ recipientGroups[tx.recipientMmsi].transactions.push(tx);
1173
+ }
1174
+ });
1175
+
1176
+ // Display totals for each recipient
1177
+ for (const [mmsi, data] of Object.entries(recipientGroups)) {
1178
+ const recipientDiv = document.createElement('div');
1179
+ recipientDiv.className = 'border-b pb-2 mb-2';
1180
+
1181
+ // Find recipient name if available
1182
+ let recipientName = 'Unknown';
1183
+ const recipient = specificRecipients.find(r => r.mmsi === mmsi);
1184
+ if (recipient) {
1185
+ recipientName = recipient.name;
1186
+ }
1187
+
1188
+ recipientDiv.innerHTML = `
1189
+ <div class="flex justify-between items-center">
1190
+ <div>
1191
+ <h4 class="text-sm font-medium">${recipientName}</h4>
1192
+ <p class="text-xs text-gray-500">MMSI: ${mmsi}</p>
1193
+ </div>
1194
+ <div class="flex items-center">
1195
+ <div class="w-6 h-6 rounded-full bg-amber-500 flex items-center justify-center mr-2">
1196
+ <i class="fas fa-bell text-white text-xs"></i>
1197
+ </div>
1198
+ <span class="font-medium">${data.total}</span>
1199
+ </div>
1200
+ </div>
1201
+ `;
1202
+
1203
+ // Add transaction details (collapsible)
1204
+ const detailsDiv = document.createElement('div');
1205
+ detailsDiv.className = 'mt-2 hidden';
1206
+
1207
+ data.transactions.forEach(tx => {
1208
+ const txDiv = document.createElement('div');
1209
+ txDiv.className = 'text-xs py-1 border-t border-gray-100';
1210
+ txDiv.innerHTML = `
1211
+ <div class="flex justify-between">
1212
+ <span>${new Date(tx.timestamp).toLocaleTimeString()}</span>
1213
+ <span class="font-medium">${tx.bellCount} bell${tx.bellCount !== 1 ? 's' : ''}</span>
1214
+ </div>
1215
+ ${tx.message ? `<div class="text-gray-500 mt-1">"${tx.message}"</div>` : ''}
1216
+ `;
1217
+ detailsDiv.appendChild(txDiv);
1218
+ });
1219
+
1220
+ recipientDiv.addEventListener('click', () => {
1221
+ detailsDiv.classList.toggle('hidden');
1222
+ });
1223
+
1224
+ recipientDiv.appendChild(detailsDiv);
1225
+ bellTotalsList.appendChild(recipientDiv);
1226
+ }
1227
+ }
1228
+
1229
+ // Make removeRecipient function available globally for the onclick handler
1230
+ window.removeRecipient = removeRecipient;
1231
+
1232
+ // Simulate metadata synchronization (in a real app, this would use WebRTC or similar)
1233
+ setInterval(() => {
1234
+ if (isConnected) {
1235
+ // Update metadata tags to simulate synchronization
1236
+ document.querySelector('meta[name="theme-color"]').content =
1237
+ `#${Math.floor(Math.random()*16777215).toString(16)}`;
1238
+ }
1239
+ }, 5000);
1240
+ });
1241
+ </script>
1242
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=privateuserh/honeycombxhat-beta1-04" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
1243
+ </html>
prompts.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ Modify the bells option when selected allow the sender to input how many bells to send to the recipient and display the total bells received by the recipient utilizing the recipient MMSI the recipient should only see the total bells received the sender sees the amount sent Aquapod: Live, Work, Thrive on the Water with a Bell-Based, DeFi-Powered Economy Summary: Aquapod redefines waterfront living with a unique, collaborative community. Our custom cryptocurrency, AQUAPOD, fuels resident-made products and services. But that's not all – Aquapod integrates with the exciting world of Decentralized Finance (DeFi) for wider economic opportunities. The Bell System: A Nautical Twist on Time Move over clocks, Aquapod uses a fun and thematic bell system to determine service costs. One bell translates to a specific time duration, keeping the economic pulse of our community in perfect rhythm with the water. Here's a breakdown of bells and their corresponding times: One Bell (1:30 Hours): 12:30 PM, 4:30 PM, 8:30 PM Two Bells (2 Hours): 1:00 PM, 5:00 PM, 9:00 PM Three Bells (2.5 Hours): 1:30 PM, 5:30 PM, 9:30 PM Four Bells (3 Hours): 2:00 PM, 6:00 PM, 10:00 PM Five Bells (3.5 Hours): 2:30 PM, 6:30 PM, 10:30 PM Six Bells (4 Hours): 3:00 PM, 7:00 PM, 11:00 PM Seven Bells (4.5 Hours): 3:30 PM, 7:30 PM, 11:30 PM Eight Bells (5 Hours): 4:00 PM, 8:00 PM, Midnight The exact service cost in AQUAPOD per bell will be determined by the community based on average completion times and desired compensation. Products and Services: Residents can offer a variety of skills and goods priced in AQUAPOD. Here are some examples: Custom Housepod/Floating Home Services: Minor repairs, consultations, and painting (e.g., 10 AQUAPOD/bell). Marine Services: Vessel cleaning and basic engine maintenance (e.g., small pod cleaning - 2 bells, Kwh charge - 3 bells). DIY Workshops & Classes: Learn valuable skills like pod maintenance (e.g., Intro to pod Maintenance - 2 bells/person). Local Crafts & Goods: Showcase your talents and sell handcrafted items (prices set individually in AQUAPOD). Subscription Services: Enjoy marina concierge or community meal kits for a monthly AQUAPOD fee. DeFi Integration: Your Gateway to a Wider World AQUAPOD, the heart of our internal economy, is also interoperable with the DeFi ecosystem, offering exciting possibilities: Pegged Stability: AQUAPOD is pegged to a basket of established cryptocurrencies like Stellar Lumens (XLM) and Bitcoin Cash (BCH) (soon). This peg provides stability and allows for easier exchange with other digital assets. Seamless Transactions: Residents can use DeFi platforms to exchange AQUAPOD for XLM or BCH, enabling them to: Purchase external goods and services: Need something unavailable within Aquapod? Convert your AQUAPOD to XLM or BCH for wider online purchases. Explore DeFi opportunities: Invest in lending, borrowing, and other DeFi protocols using your converted XLM or BCH. Attract New Residents & Businesses: The DeFi connection makes Aquapod more attractive. People with existing XLM or BCH holdings can easily convert them to AQUAPOD and participate in our unique economy. Benefits: Unique Bell System: A fun and thematic way to manage the community's economy. Flexibility & Collaboration: Barter skills and services using the bell system, promoting self-sufficiency and community spirit. DeFi Connection: Opens doors to wider financial opportunities and fosters a future-proof community. Join Aquapod and experience a vibrant community on the water with a one-of-a-kind, bell-based economy seamlessly connected to the DeFi world!