Update online.html
Browse files- online.html +189 -130
online.html
CHANGED
|
@@ -2,203 +2,262 @@
|
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
-
<
|
|
|
|
| 6 |
<link href="https://fonts.cdnfonts.com/css/gamestart" rel="stylesheet">
|
| 7 |
<style>
|
| 8 |
:root {
|
| 9 |
-
--aero-blue: #
|
| 10 |
-
--aero-green: #
|
| 11 |
-
--mosaic-bg: rgba(255, 255, 255, 0.
|
|
|
|
| 12 |
}
|
| 13 |
|
| 14 |
body {
|
| 15 |
-
background:
|
| 16 |
-
|
| 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 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
max-width: 600px;
|
| 31 |
-
height: 450px;
|
| 32 |
background: var(--mosaic-bg);
|
| 33 |
-
border:
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
padding: 20px;
|
| 37 |
-
display: none; /* Controlled by JS */
|
| 38 |
flex-direction: column;
|
| 39 |
position: relative;
|
| 40 |
}
|
| 41 |
|
|
|
|
|
|
|
| 42 |
.active { display: flex; }
|
| 43 |
|
| 44 |
-
|
|
|
|
|
|
|
| 45 |
button {
|
| 46 |
font-family: 'GameStart', sans-serif;
|
| 47 |
-
padding:
|
| 48 |
margin: 5px;
|
| 49 |
-
background: linear-gradient(to bottom, #
|
| 50 |
-
border: 2px solid
|
| 51 |
-
|
| 52 |
-
text-shadow: 2px 2px #000;
|
| 53 |
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
| 54 |
}
|
| 55 |
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
}
|
| 63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
input {
|
| 65 |
font-family: 'GameStart', sans-serif;
|
| 66 |
-
|
| 67 |
border: 2px solid var(--aero-blue);
|
| 68 |
-
padding: 5px;
|
| 69 |
}
|
| 70 |
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
margin-bottom: 10px;
|
| 76 |
-
border: 2px inset #ccc;
|
| 77 |
-
padding: 10px;
|
| 78 |
-
}
|
| 79 |
</style>
|
| 80 |
</head>
|
| 81 |
<body>
|
| 82 |
|
| 83 |
-
<div
|
| 84 |
-
<
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 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 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
</div>
|
| 109 |
-
</div>
|
| 110 |
|
| 111 |
-
<div id="screen-settings" class="screen">
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
<button onclick="nav('screen-home')">BACK</button>
|
| 122 |
</div>
|
| 123 |
</div>
|
| 124 |
|
| 125 |
<script>
|
| 126 |
-
// ---
|
| 127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
document.querySelectorAll('.screen').forEach(s => s.classList.remove('active'));
|
| 129 |
-
document.getElementById(
|
| 130 |
}
|
| 131 |
|
| 132 |
-
// ---
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
};
|
| 138 |
|
| 139 |
-
function
|
| 140 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
}
|
| 142 |
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 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 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
if(url) {
|
| 160 |
-
appData.playlist.push(url);
|
| 161 |
-
updateStorage();
|
| 162 |
-
renderPlaylist();
|
| 163 |
-
}
|
| 164 |
}
|
| 165 |
|
| 166 |
-
function
|
| 167 |
-
const
|
| 168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
}
|
| 170 |
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
renderChat();
|
| 178 |
-
input.value = "";
|
| 179 |
}
|
| 180 |
|
| 181 |
-
function
|
| 182 |
-
const
|
| 183 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
}
|
| 185 |
|
| 186 |
-
function
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
}
|
| 191 |
|
| 192 |
-
function
|
| 193 |
-
|
| 194 |
-
|
|
|
|
|
|
|
| 195 |
}
|
| 196 |
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
|
|
|
| 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>
|