sugakrit6 commited on
Commit
4e28ec5
·
verified ·
1 Parent(s): 5b1d2a2

Update online.html

Browse files
Files changed (1) hide show
  1. online.html +189 -130
online.html CHANGED
@@ -2,203 +2,262 @@
2
  <html lang="en">
3
  <head>
4
  <meta charset="UTF-8">
5
- <title>AeroCore OS</title>
 
6
  <link href="https://fonts.cdnfonts.com/css/gamestart" rel="stylesheet">
7
  <style>
8
  :root {
9
- --aero-blue: #00aaff;
10
- --aero-green: #33ff99;
11
- --mosaic-bg: rgba(255, 255, 255, 0.7);
 
12
  }
13
 
14
  body {
15
- background: url('https://e0.pxfuel.com/wallpapers/312/820/desktop-wallpaper-frutiger-aero-aesthetic.jpg');
16
- background-size: cover;
17
  font-family: 'GameStart', sans-serif;
18
  color: #003366;
19
- overflow: hidden;
20
- height: 100vh;
21
  margin: 0;
22
  display: flex;
23
  justify-content: center;
24
  align-items: center;
 
25
  }
26
 
27
- /* Mosaic Effect instead of Blur */
28
- .screen {
29
- width: 90%;
30
- max-width: 600px;
31
- height: 450px;
32
  background: var(--mosaic-bg);
33
- border: 4px solid white;
34
- border-radius: 0px; /* Mosaic style often uses sharper edges */
35
- box-shadow: 8px 8px 0px rgba(0,0,0,0.2);
36
- padding: 20px;
37
- display: none; /* Controlled by JS */
38
  flex-direction: column;
39
  position: relative;
40
  }
41
 
 
 
42
  .active { display: flex; }
43
 
44
- /* Glossy Buttons */
 
 
45
  button {
46
  font-family: 'GameStart', sans-serif;
47
- padding: 10px;
48
  margin: 5px;
49
- background: linear-gradient(to bottom, #fff 0%, #00aaff 50%, #004488 100%);
50
- border: 2px solid white;
51
- color: white;
52
- text-shadow: 2px 2px #000;
53
  cursor: pointer;
 
 
 
54
  }
55
 
56
- .navbar {
57
- position: absolute;
58
- bottom: 10px;
59
- width: 90%;
60
- display: flex;
61
- justify-content: space-around;
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  }
63
 
 
 
 
 
 
64
  input {
65
  font-family: 'GameStart', sans-serif;
66
- background: rgba(255,255,255,0.8);
67
  border: 2px solid var(--aero-blue);
68
- padding: 5px;
69
  }
70
 
71
- #chat-display {
72
- background: white;
73
- flex-grow: 1;
74
- overflow-y: auto;
75
- margin-bottom: 10px;
76
- border: 2px inset #ccc;
77
- padding: 10px;
78
- }
79
  </style>
80
  </head>
81
  <body>
82
 
83
- <div id="screen-home" class="screen active">
84
- <h1>AERO CORE v1.0</h1>
85
- <p>Welcome, User. Select a module:</p>
86
- <button onclick="nav('screen-music')">AUDIO PLAYER</button>
87
- <button onclick="nav('screen-chat')">COMMUNITY HUB</button>
88
- <button onclick="nav('screen-settings')">SYSTEM SETTINGS</button>
89
- </div>
90
-
91
- <div id="screen-music" class="screen">
92
- <h2>🎵 PLAYLIST</h2>
93
- <input type="text" id="musicUrl" placeholder="Enter .mp3 link">
94
- <button onclick="saveMusic()">Add to Data</button>
95
- <div id="playlist-box"></div>
96
- <div class="navbar">
97
- <button onclick="nav('screen-home')">BACK</button>
98
  </div>
99
- </div>
100
 
101
- <div id="screen-chat" class="screen">
102
- <h2 id="chat-title">COMMUNITY</h2>
103
- <div id="chat-display"></div>
104
- <input type="text" id="chatInput" placeholder="Message...">
105
- <button onclick="handleChat()">SEND</button>
106
- <div class="navbar">
107
- <button onclick="nav('screen-home')">HOME</button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  </div>
109
- </div>
110
 
111
- <div id="screen-settings" class="screen">
112
- <h2>⚙️ SETTINGS</h2>
113
- <label>Content Filter:</label>
114
- <select id="filterSetting" onchange="saveSettings()">
115
- <option value="strict">STRICT (Censor On)</option>
116
- <option value="none">OFF (Danger)</option>
117
- </select>
118
- <br><br>
119
- <button onclick="clearAllData()" style="background: red;">WIPE DATA</button>
120
- <div class="navbar">
121
- <button onclick="nav('screen-home')">BACK</button>
122
  </div>
123
  </div>
124
 
125
  <script>
126
- // --- NAVIGATION LOGIC ---
127
- function nav(screenId) {
 
 
 
 
128
  document.querySelectorAll('.screen').forEach(s => s.classList.remove('active'));
129
- document.getElementById(screenId).classList.add('active');
130
  }
131
 
132
- // --- DATA SAVE LOGIC (LocalStorage) ---
133
- let appData = JSON.parse(localStorage.getItem('aeroData')) || {
134
- playlist: [],
135
- settings: { filter: 'strict' },
136
- chatHistory: []
137
- };
138
 
139
- function updateStorage() {
140
- localStorage.setItem('aeroData', JSON.stringify(appData));
 
 
 
 
 
141
  }
142
 
143
- // --- CONTENT FILTER LOGIC ---
144
- const bannedWords = ["bad", "mean", "toxic"];
145
-
146
- function filterText(text) {
147
- if (appData.settings.filter === 'none') return text;
148
- let censored = text;
149
- bannedWords.forEach(word => {
150
- const rel = new RegExp(word, "gi");
151
- censored = censored.replace(rel, "###");
152
- });
153
- return censored;
154
  }
155
 
156
- // --- MUSIC FUNCTIONS ---
157
- function saveMusic() {
158
- const url = document.getElementById('musicUrl').value;
159
- if(url) {
160
- appData.playlist.push(url);
161
- updateStorage();
162
- renderPlaylist();
163
- }
164
  }
165
 
166
- function renderPlaylist() {
167
- const box = document.getElementById('playlist-box');
168
- box.innerHTML = appData.playlist.map(i => `<div>- ${i.substring(0,20)}...</div>`).join('');
 
 
 
 
169
  }
170
 
171
- // --- CHAT FUNCTIONS ---
172
- function handleChat() {
173
- const input = document.getElementById('chatInput');
174
- const cleanMsg = filterText(input.value);
175
- appData.chatHistory.push(cleanMsg);
176
- updateStorage();
177
- renderChat();
178
- input.value = "";
179
  }
180
 
181
- function renderChat() {
182
- const display = document.getElementById('chat-display');
183
- display.innerHTML = appData.chatHistory.map(m => `<div>> ${m}</div>`).join('');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  }
185
 
186
- function saveSettings() {
187
- appData.settings.filter = document.getElementById('filterSetting').value;
188
- updateStorage();
189
- alert("Settings Saved!");
 
 
 
 
 
 
 
 
 
 
 
 
190
  }
191
 
192
- function clearAllData() {
193
- localStorage.removeItem('aeroData');
194
- location.reload();
 
 
195
  }
196
 
197
- // Initial Load
198
- renderPlaylist();
199
- renderChat();
200
- document.getElementById('filterSetting').value = appData.settings.filter;
 
201
 
 
 
202
  </script>
 
203
  </body>
204
  </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
+ <title>AeroCore OS - Community Hub</title>
7
  <link href="https://fonts.cdnfonts.com/css/gamestart" rel="stylesheet">
8
  <style>
9
  :root {
10
+ --aero-blue: #0080ff;
11
+ --aero-green: #40ffaa;
12
+ --mosaic-bg: rgba(255, 255, 255, 0.85);
13
+ --gloss-top: rgba(255, 255, 255, 0.5);
14
  }
15
 
16
  body {
17
+ background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%),
18
+ url('https://www.transparenttextures.com/patterns/cubes.png');
19
  font-family: 'GameStart', sans-serif;
20
  color: #003366;
 
 
21
  margin: 0;
22
  display: flex;
23
  justify-content: center;
24
  align-items: center;
25
+ height: 100vh;
26
  }
27
 
28
+ .window {
29
+ width: 700px;
30
+ height: 550px;
 
 
31
  background: var(--mosaic-bg);
32
+ border: 5px solid #fff;
33
+ box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.15);
34
+ display: flex;
 
 
35
  flex-direction: column;
36
  position: relative;
37
  }
38
 
39
+ /* Screen Management */
40
+ .screen { display: none; padding: 20px; flex-direction: column; height: 100%; box-sizing: border-box; }
41
  .active { display: flex; }
42
 
43
+ h1, h2 { text-shadow: 2px 2px #fff; margin-top: 0; }
44
+
45
+ /* Frutiger Buttons */
46
  button {
47
  font-family: 'GameStart', sans-serif;
48
+ padding: 8px 12px;
49
  margin: 5px;
50
+ background: linear-gradient(to bottom, #ffffff 0%, #aadaff 50%, #4facfe 100%);
51
+ border: 2px solid #fff;
52
+ border-radius: 4px;
 
53
  cursor: pointer;
54
+ color: #003366;
55
+ font-size: 0.8rem;
56
+ box-shadow: 2px 2px 0px #0055aa;
57
  }
58
 
59
+ button:active { transform: translate(2px, 2px); box-shadow: 0px 0px; }
60
+
61
+ /* Chat Display */
62
+ #chat-display {
63
+ background: rgba(255,255,255,0.5);
64
+ border: 3px inset #fff;
65
+ flex-grow: 1;
66
+ overflow-y: auto;
67
+ padding: 10px;
68
+ margin-bottom: 10px;
69
+ }
70
+
71
+ .message {
72
+ background: rgba(255,255,255,0.8);
73
+ border-left: 4px solid var(--aero-blue);
74
+ padding: 8px;
75
+ margin-bottom: 8px;
76
+ font-size: 0.7rem;
77
+ position: relative;
78
  }
79
 
80
+ .msg-meta { font-size: 0.5rem; color: #666; margin-bottom: 4px; }
81
+ .msg-tools { margin-top: 5px; display: flex; gap: 5px; }
82
+
83
+ .btn-del { background: linear-gradient(#ff8888, #aa0000); color: white; font-size: 0.5rem; }
84
+
85
  input {
86
  font-family: 'GameStart', sans-serif;
87
+ padding: 8px;
88
  border: 2px solid var(--aero-blue);
 
89
  }
90
 
91
+ .media-btn-row { display: flex; gap: 5px; margin-bottom: 5px; }
92
+
93
+ /* Hidden Inputs */
94
+ input[type="file"] { display: none; }
 
 
 
 
95
  </style>
96
  </head>
97
  <body>
98
 
99
+ <div class="window">
100
+ <div id="screen-home" class="screen active">
101
+ <h1>AEROCORE v2.0</h1>
102
+ <p>SYSTEM STATUS: ONLINE</p>
103
+ <button onclick="nav('screen-chat')">ENTER COMMUNITY HUB</button>
104
+ <button onclick="nav('screen-settings')">FILTERS & DATA</button>
 
 
 
 
 
 
 
 
 
105
  </div>
 
106
 
107
+ <div id="screen-chat" class="screen">
108
+ <h2>COMMUNITY HUB</h2>
109
+ <div id="lobby-ui">
110
+ <button onclick="initChat('Public')">JOIN PUBLIC SERVER</button>
111
+ <hr>
112
+ <button onclick="createPrivate()">HOST PRIVATE ROOM</button>
113
+ <div id="private-code-box" style="margin: 10px 0; color: var(--aero-blue);"></div>
114
+ <input type="text" id="join-code" placeholder="ENTER ROOM CODE">
115
+ <button onclick="initChat('Private')">JOIN PRIVATE</button>
116
+ </div>
117
+
118
+ <div id="chat-ui" style="display:none; flex-direction:column; flex-grow:1; height:80%;">
119
+ <div id="chat-display"></div>
120
+
121
+ <div class="media-btn-row">
122
+ <button onclick="triggerFile('img')">IMG</button>
123
+ <button onclick="triggerFile('aud')">AUD</button>
124
+ <button onclick="triggerFile('vid')">VID</button>
125
+ </div>
126
+
127
+ <input type="file" id="fileInput" onchange="handleFileUpload()">
128
+ <input type="text" id="chatInput" placeholder="TYPE MESSAGE...">
129
+
130
+ <div style="display:flex; margin-top:10px;">
131
+ <button onclick="sendMessage()" style="flex:2">SEND</button>
132
+ <button onclick="exitChat()" style="flex:1; background: linear-gradient(#40ffaa, #008844);">DONE</button>
133
+ </div>
134
+ </div>
135
+ <button onclick="nav('screen-home')" id="back-home">BACK</button>
136
  </div>
 
137
 
138
+ <div id="screen-settings" class="screen">
139
+ <h2>SYSTEM CONFIG</h2>
140
+ <label>CENSORSHIP:</label>
141
+ <select id="censor-toggle">
142
+ <option value="on">ENABLED (STRICT)</option>
143
+ <option value="off">DISABLED</option>
144
+ </select>
145
+ <br><br>
146
+ <button onclick="clearData()" style="background: red; color: white;">WIPE DATA</button>
147
+ <button onclick="nav('screen-home')">SAVE & EXIT</button>
 
148
  </div>
149
  </div>
150
 
151
  <script>
152
+ // --- DATABASE & STATE ---
153
+ let db = JSON.parse(localStorage.getItem('aero_db')) || { messages: [], filter: 'on' };
154
+ let currentRoom = "Public";
155
+ let pendingFileType = '';
156
+
157
+ function nav(id) {
158
  document.querySelectorAll('.screen').forEach(s => s.classList.remove('active'));
159
+ document.getElementById(id).classList.add('active');
160
  }
161
 
162
+ // --- CHAT LOGIC ---
163
+ function createPrivate() {
164
+ const code = Math.floor(1000 + Math.random() * 9000);
165
+ document.getElementById('private-code-box').innerText = "GENERATED CODE: " + code;
166
+ }
 
167
 
168
+ function initChat(mode) {
169
+ if(mode === 'Private' && !document.getElementById('join-code').value) return alert("Code Required");
170
+ currentRoom = mode;
171
+ document.getElementById('lobby-ui').style.display = 'none';
172
+ document.getElementById('back-home').style.display = 'none';
173
+ document.getElementById('chat-ui').style.display = 'flex';
174
+ renderMessages();
175
  }
176
 
177
+ function exitChat() {
178
+ document.getElementById('lobby-ui').style.display = 'block';
179
+ document.getElementById('back-home').style.display = 'block';
180
+ document.getElementById('chat-ui').style.display = 'none';
 
 
 
 
 
 
 
181
  }
182
 
183
+ function triggerFile(type) {
184
+ pendingFileType = type;
185
+ document.getElementById('fileInput').click();
 
 
 
 
 
186
  }
187
 
188
+ function handleFileUpload() {
189
+ const file = document.getElementById('fileInput').files[0];
190
+ if (file) {
191
+ const reader = new FileReader();
192
+ reader.onload = (e) => addMessage(e.target.result, pendingFileType);
193
+ reader.readAsDataURL(file);
194
+ }
195
  }
196
 
197
+ function sendMessage() {
198
+ const txt = document.getElementById('chatInput').value;
199
+ if(txt) {
200
+ addMessage(txt, 'text');
201
+ document.getElementById('chatInput').value = '';
202
+ }
 
 
203
  }
204
 
205
+ function addMessage(content, type) {
206
+ const isCensor = document.getElementById('censor-toggle').value === 'on';
207
+ let safeContent = content;
208
+
209
+ if(type === 'text' && isCensor) {
210
+ const badWords = ["bad", "rude"];
211
+ badWords.forEach(w => safeContent = safeContent.replace(new RegExp(w, 'gi'), '***'));
212
+ }
213
+
214
+ const msgObj = {
215
+ id: Date.now(),
216
+ room: currentRoom,
217
+ body: safeContent,
218
+ type: type,
219
+ date: new Date().toLocaleString()
220
+ };
221
+
222
+ db.messages.push(msgObj);
223
+ save();
224
+ renderMessages();
225
  }
226
 
227
+ function renderMessages() {
228
+ const container = document.getElementById('chat-display');
229
+ const roomMsgs = db.messages.filter(m => m.room === currentRoom);
230
+
231
+ container.innerHTML = roomMsgs.map(m => `
232
+ <div class="message" id="msg-${m.id}">
233
+ <div class="msg-meta">${m.date} | Room: ${m.room}</div>
234
+ <div class="msg-body">
235
+ ${renderBody(m)}
236
+ </div>
237
+ <div class="msg-tools">
238
+ <button class="btn-del" onclick="deleteMsg(${m.id})">DELETE FOR ME</button>
239
+ </div>
240
+ </div>
241
+ `).join('');
242
+ container.scrollTop = container.scrollHeight;
243
  }
244
 
245
+ function renderBody(m) {
246
+ if(m.type === 'img') return `<img src="${m.body}" style="max-width:100px;">`;
247
+ if(m.type === 'aud') return `<audio src="${m.body}" controls style="width:150px;"></audio>`;
248
+ if(m.type === 'vid') return `<video src="${m.body}" controls style="width:150px;"></video>`;
249
+ return m.body;
250
  }
251
 
252
+ function deleteMsg(id) {
253
+ db.messages = db.messages.filter(m => m.id !== id);
254
+ save();
255
+ renderMessages();
256
+ }
257
 
258
+ function save() { localStorage.setItem('aero_db', JSON.stringify(db)); }
259
+ function clearData() { localStorage.removeItem('aero_db'); location.reload(); }
260
  </script>
261
+
262
  </body>
263
  </html>