mirror of
https://github.com/abrendan/MicDropMessages.git
synced 2025-06-16 20:55:00 +02:00
Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6ed7ec0d91 | ||
![]() |
efe82a5d25 | ||
![]() |
52fcab7506 | ||
![]() |
d2e980e9f2 | ||
![]() |
62a3d0b7a7 | ||
![]() |
1ec626532c | ||
![]() |
10da1b3392 | ||
![]() |
bd651effdc | ||
![]() |
fa1c78031c | ||
![]() |
7f8151dfeb | ||
![]() |
7ce73ce036 | ||
![]() |
1970e36448 | ||
![]() |
5bee7db3d1 | ||
![]() |
db7b495194 | ||
![]() |
0d26f56c4b |
4
.replit
4
.replit
@ -86,3 +86,7 @@ support = true
|
|||||||
[deployment]
|
[deployment]
|
||||||
deploymentTarget = "cloudrun"
|
deploymentTarget = "cloudrun"
|
||||||
run = ["sh", "-c", "node index.js"]
|
run = ["sh", "-c", "node index.js"]
|
||||||
|
|
||||||
|
[[ports]]
|
||||||
|
localPort = 3000
|
||||||
|
externalPort = 80
|
||||||
|
20
README.md
20
README.md
@ -1,8 +1,22 @@
|
|||||||
# MicDropMessages
|
# MicDropMessagesV2
|
||||||
|
|
||||||
MicDropMessages is a basic chat platform using socket.io and JavaScript. Now with a simple dark mode option!
|
MicDropMessages is a basic chat platform using socket.io and JavaScript. It doesn't save any messages on any server.
|
||||||
|
|
||||||
|
## Android App
|
||||||
|
|
||||||
|
MicDropMessages is available as an webapp at https://micdropmessages.app but also as an app in the Google Play Store:
|
||||||
|
|
||||||
|
https://play.google.com/store/apps/details?id=com.abrendan.micdropmessages
|
||||||
|
|
||||||
|
## Screenshots
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
9
html/.well-known/assetlinks.json
Normal file
9
html/.well-known/assetlinks.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[{
|
||||||
|
"relation": ["delegate_permission/common.handle_all_urls"],
|
||||||
|
"target": {
|
||||||
|
"namespace": "android_app",
|
||||||
|
"package_name": "com.abrendan.micdropmessages",
|
||||||
|
"sha256_cert_fingerprints":
|
||||||
|
["F4:68:84:2F:72:FC:E3:DC:82:A8:AC:73:FA:EA:0D:E9:9D:20:CD:07:D5:91:55:C7:E6:ED:49:9F:61:80:54:84"]
|
||||||
|
}
|
||||||
|
}]
|
@ -1,52 +1,64 @@
|
|||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title> MicDropMessages </title>
|
<title> MicDropMessages </title>
|
||||||
<meta name = "charset" charset = "utf-8">
|
<meta name="charset" charset="utf-8">
|
||||||
<meta name = "viewport" content = "width=device-width">
|
<meta name="viewport" content="width=device-width">
|
||||||
<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet'>
|
<link href='https://fonts.googleapis.com/css2?family=Segoe+UI:wght@400;500;600&display=swap' rel='stylesheet'>
|
||||||
<link rel = "stylesheet" type = "text/css" href = "style.css">
|
<style>
|
||||||
<script src = "script.js"></script>
|
html {
|
||||||
<script src= "socket.io/socket.io.js"></script>
|
scroll-behavior: smooth;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<link rel="stylesheet" type="text/css" href="style.css">
|
||||||
|
<link rel="icon" href="https://i.ibb.co/jvVTdPM/nobackground-withoutname2.png">
|
||||||
|
<script src="script.js"></script>
|
||||||
|
<script src="socket.io/socket.io.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload = "onload()">
|
<body onload="onload()">
|
||||||
<div id = "Main">
|
<div id="Main">
|
||||||
<audio id = "Ding" src = "Ding.mp3"> </audio>
|
<audio id="Ding" src="new-notification.mp3"> </audio>
|
||||||
<!-- <img id = "Logo" src="https://micdropmessages.app/pictures/micdropmessages_logo-circle.png" alt="Logo"> -->
|
<h1 id="Title"> MicDropMessages</h1>
|
||||||
<h1 id = "Title"> MicDropMessages V2 </h1>
|
<img id="Logo" src="https://micdropmessages.app/pictures/mdm2logo1.png" alt="Logo">
|
||||||
<p>Welcome to MicDropMessages! This small webbased application allows you to chat with your friends anonymously! To start, enter your username and enter a chatroom.</p>
|
<p>Welcome to MicDropMessages! This small web-based application allows you to chat with your friends anonymously! To start, enter your username and enter a chatroom.</p>
|
||||||
<div id = "AccessPort">
|
<div id="AccessPort">
|
||||||
<label id = "NameLabel"> Username </label>
|
<label id="NameLabel"> Username </label>
|
||||||
<input id = "NameInput" class="input" type = "text">
|
<input id="NameInput" class="input" type="text">
|
||||||
<br><br>
|
<br><br>
|
||||||
<label id = "IDLabel"> Chatroom </label>
|
<label id="IDLabel"> Chatroom </label>
|
||||||
<input id = "IDInput" class="input" value = "Room1" type = "text">
|
<input id="IDInput" class="input" value="Room1" type="text">
|
||||||
<input id = "ConnectButton" class="button2" type = "submit" value = "Connect" onclick = "Connect()">
|
<input id="ConnectButton" class="button2" type="submit" value="Connect" onclick="Connect()">
|
||||||
</div>
|
</div>
|
||||||
<h2 id = "RoomID"> Chatroom : None </h2>
|
<h2 id="RoomID"> Chatroom: None </h2>
|
||||||
<div id = "Chat">
|
<div id="Chat">
|
||||||
<p id = "Message0" class = "Message"> - </p>
|
<p id="Message0" class="Message"> - </p>
|
||||||
<p id = "Message1" class = "Message"> - </p>
|
<p id="Message1" class="Message"> - </p>
|
||||||
<p id = "Message2" class = "Message"> - </p>
|
<p id="Message2" class="Message"> - </p>
|
||||||
<p id = "Message3" class = "Message"> - </p>
|
<p id="Message3" class="Message"> - </p>
|
||||||
<p id = "Message4" class = "Message"> - </p>
|
<p id="Message4" class="Message"> - </p>
|
||||||
<p id = "Message5" class = "Message"> - </p>
|
<p id="Message5" class="Message"> - </p>
|
||||||
<p id = "Message6" class = "Message"> - </p>
|
<p id="Message6" class="Message"> - </p>
|
||||||
<p id = "Message7" class = "Message"> - </p>
|
<p id="Message7" class="Message"> - </p>
|
||||||
<p id = "Message8" class = "Message"> - </p>
|
<p id="Message8" class="Message"> - </p>
|
||||||
<p id = "Message9" class = "Message"> - </p>
|
<label id="MessageLabel"> Message </label>
|
||||||
<label id = "MessageLabel"> Message </label>
|
<input id="ComposedMessage" class="input" type="text">
|
||||||
<input id = "ComposedMessage" class="input" type = "text">
|
<input id="SendMessage" onclick="Send()" value="Send your message" class="button2" type="submit">
|
||||||
<input id = "SendMessage" onclick="Send()" value = "Send your message" class="button2" type = "submit">
|
<input id="LeaveRoomButton" class="button2" type="submit" value="Leave Room" onclick="LeaveRoom()">
|
||||||
</div>
|
</div>
|
||||||
<button id="darkModeToggle" onclick="toggleDarkMode()" class="button">Toggle Dark Mode</button>
|
<div class="other">
|
||||||
<p>Made by abrendan. Visit my website for more of my projects.</p>
|
<p>Made by abrendan. Visit my website for more of my projects.</p>
|
||||||
<div id="LinkButtons">
|
<div id="LinkButtons">
|
||||||
<button id="GitHubButton" onclick=" window.open('https://github.com/abrendan/MicDropMessages','_blank')" class="button">GitHub Page for MicDropMessages</button>
|
<button id="GitHubButton" onclick="window.open('https://github.com/abrendan/MicDropMessages','_blank')" class="button">GitHub Page for MicDropMessages</button>
|
||||||
<button id="WebsiteButton" onclick=" window.open('http://www.abrendan.dev','_blank')" class="button">abrendan.dev</button>
|
<button id="WebsiteButton" onclick="window.open('http://www.abrendan.dev','_blank')" class="button">abrendan.dev</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p class="version-number">V2.3.0</p>
|
||||||
|
</div>
|
||||||
|
<div id="errorPopup" class="error-popup">
|
||||||
|
<div class="error-popup-content">
|
||||||
|
<p id="errorText">Please enter a username and a chatroom.</p>
|
||||||
|
<button id="errorButton" class="button2" onclick="closeErrorPopup()">Continue</button>
|
||||||
</div>
|
</div>
|
||||||
<br><br>
|
|
||||||
<p class="version-number">V2.0.1</p>
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
BIN
html/new-notification.mp3
Normal file
BIN
html/new-notification.mp3
Normal file
Binary file not shown.
BIN
html/pictures/andy-holmes-background2_small.jpg
Normal file
BIN
html/pictures/andy-holmes-background2_small.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 1018 KiB |
BIN
html/pictures/andy-holmes-rCbdp8VCYhQ-unsplash.jpg
Normal file
BIN
html/pictures/andy-holmes-rCbdp8VCYhQ-unsplash.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.0 MiB |
BIN
html/pictures/mdm2logo1.png
Normal file
BIN
html/pictures/mdm2logo1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 547 KiB |
@ -23,8 +23,10 @@ function onload(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
socket.on("join", function(room){
|
socket.on("join", function(room){
|
||||||
chatRoom.innerHTML = "Current Chatroom : " + room;
|
chatRoom.innerHTML = "Current Chatroom: " + room;
|
||||||
})
|
// Show the chat div when successfully joined a room.
|
||||||
|
document.getElementById("Chat").style.display = "block";
|
||||||
|
});
|
||||||
|
|
||||||
socket.on("recieve", function(message){
|
socket.on("recieve", function(message){
|
||||||
console.log(message);
|
console.log(message);
|
||||||
@ -32,8 +34,7 @@ function onload(){
|
|||||||
messages.push(message);
|
messages.push(message);
|
||||||
dingSound.currentTime = 0;
|
dingSound.currentTime = 0;
|
||||||
dingSound.play();
|
dingSound.play();
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
messages.shift();
|
messages.shift();
|
||||||
messages.push(message);
|
messages.push(message);
|
||||||
}
|
}
|
||||||
@ -41,11 +42,54 @@ function onload(){
|
|||||||
document.getElementById("Message"+i).innerHTML = messages[i];
|
document.getElementById("Message"+i).innerHTML = messages[i];
|
||||||
document.getElementById("Message"+i).style.color = getComputedStyle(document.body).color;
|
document.getElementById("Message"+i).style.color = getComputedStyle(document.body).color;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
|
// Ensure that the error popup is not displayed when the page is loaded
|
||||||
|
document.getElementById('errorPopup').style.display = 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
function Connect(){
|
function Connect(){
|
||||||
socket.emit("join", chatIDInput.value, usernameInput.value);
|
var username = usernameInput.value.trim();
|
||||||
|
var room = chatIDInput.value.trim();
|
||||||
|
if(username && room){
|
||||||
|
socket.emit("join", room, username);
|
||||||
|
chatRoom.innerHTML = "Chatroom: " + room;
|
||||||
|
document.getElementById('AccessPort').style.display = 'none';
|
||||||
|
} else {
|
||||||
|
showErrorPopup("Please enter a username and a chatroom.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function showErrorPopup(message) {
|
||||||
|
document.getElementById('errorText').textContent = message;
|
||||||
|
document.getElementById('errorPopup').style.display = 'flex';
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeErrorPopup() {
|
||||||
|
document.getElementById('errorPopup').style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
function LeaveRoom(){
|
||||||
|
if (chatRoom.innerHTML.includes("Chatroom")) {
|
||||||
|
var roomName = chatRoom.innerHTML.split(": ")[1];
|
||||||
|
var username = usernameInput.value;
|
||||||
|
socket.emit('leave', roomName, username);
|
||||||
|
}
|
||||||
|
// Show access port to join another chat room.
|
||||||
|
document.getElementById('AccessPort').style.display = 'block';
|
||||||
|
|
||||||
|
// Hide the chat div as the user is leaving the room.
|
||||||
|
document.getElementById('Chat').style.display = 'none';
|
||||||
|
|
||||||
|
// Reset chatRoom text to indicate no room connection.
|
||||||
|
chatRoom.innerHTML = "Chatroom: None";
|
||||||
|
|
||||||
|
// If the user is in a room, emit a leave event.
|
||||||
|
if (rooms[socket.id]) {
|
||||||
|
socket.emit('leave', rooms[socket.id], usernames[socket.id]);
|
||||||
|
rooms[socket.id] = null;
|
||||||
|
usernames[socket.id] = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Send(){
|
function Send(){
|
||||||
@ -61,10 +105,6 @@ function delayReset(){
|
|||||||
delay = true;
|
delay = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleDarkMode() {
|
|
||||||
document.body.classList.toggle('dark-mode');
|
|
||||||
}
|
|
||||||
|
|
||||||
document.addEventListener('keydown', function(event) {
|
document.addEventListener('keydown', function(event) {
|
||||||
// Check if Alt + Ctrl + R are pressed together
|
// Check if Alt + Ctrl + R are pressed together
|
||||||
if (event.altKey && event.ctrlKey && event.key === 'r') {
|
if (event.altKey && event.ctrlKey && event.key === 'r') {
|
||||||
|
306
html/style.css
306
html/style.css
@ -1,156 +1,182 @@
|
|||||||
body{
|
body {
|
||||||
background-image: url('https://micdropmessages.app/pictures/jezael-melgoza-2FiXtdnVhjQ-unsplash.jpg'); /* Path to your example image */
|
background-color: #202020;
|
||||||
background-size: cover; /* Cover the entire viewport */
|
color: #ffffff;
|
||||||
background-repeat: no-repeat; /* Do not repeat the image */
|
font-family: 'Segoe UI', 'Roboto', sans-serif;
|
||||||
background-attachment: fixed; /* The background image does not scroll */
|
display: flex;
|
||||||
color: #000000;
|
justify-content: center;
|
||||||
font-family: 'Roboto';
|
align-items: center;
|
||||||
display: flex; /* Use flexbox to center content */
|
margin: 0;
|
||||||
justify-content: center; /* Center horizontally */
|
min-height: 100vh;
|
||||||
align-items: center; /* Center vertically */
|
background-image: linear-gradient(45deg, #1a1a1a 0%, #2d2d2d 100%);
|
||||||
}
|
}
|
||||||
label{
|
|
||||||
min-width: 70px; /* Ensure label has enough width */
|
#Main {
|
||||||
display: block; /* Make labels stack above inputs and buttons */
|
background: rgba(32, 32, 32, 0.8);
|
||||||
margin-bottom: 0.5em; /* Provide some space between label and input/button */
|
backdrop-filter: blur(20px);
|
||||||
text-align: left; /* Align text to the left */
|
-webkit-backdrop-filter: blur(20px);
|
||||||
|
border-radius: 12px;
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
|
padding: 2rem;
|
||||||
|
width: 90%;
|
||||||
|
max-width: 800px;
|
||||||
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
|
||||||
|
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
||||||
}
|
}
|
||||||
input{
|
|
||||||
background-color: rgba(255, 255, 255, 0.15);
|
#Main:hover {
|
||||||
color: #000000;
|
transform: translateY(-5px);
|
||||||
font-size: 120%;
|
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
|
||||||
border: none;
|
|
||||||
width: 100%; /* Full width input fields */
|
|
||||||
box-sizing: border-box; /* Border box sizing for padding and borders */
|
|
||||||
margin-bottom: 1em; /* Provide space below inputs */
|
|
||||||
}
|
|
||||||
.Message{
|
|
||||||
color: #000000;
|
|
||||||
}
|
|
||||||
#Logo{
|
|
||||||
height: 80px;
|
|
||||||
}
|
|
||||||
#Main{
|
|
||||||
min-height: 94.5vh; /* Stretch to fill the viewport height */
|
|
||||||
width: 50%;
|
|
||||||
padding: 20px; /* Padding added to the main content area */
|
|
||||||
border-radius: 10px;
|
|
||||||
backdrop-filter: blur(5px); /* Provide a translucent frosted-glass effect */
|
|
||||||
-webkit-backdrop-filter: blur(5px);
|
|
||||||
background-color: rgba(255, 255, 255, 0.2); /* Slightly white transparent background */
|
|
||||||
display: flex; /* Adding flex properties to layout contents */
|
|
||||||
flex-direction: column; /* Stack children elements vertically */
|
|
||||||
align-items: center; /* Centering child elements horizontally */
|
|
||||||
position: relative; /* To position the version number correctly */
|
|
||||||
}
|
|
||||||
#Title{
|
|
||||||
font-size: 300%;
|
|
||||||
}
|
|
||||||
#LinkButtons{
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
.button {
|
|
||||||
background-color:transparent;
|
|
||||||
border-radius:28px;
|
|
||||||
border:0px solid #000000;
|
|
||||||
display:inline-block;
|
|
||||||
cursor:pointer;
|
|
||||||
color:#000000;
|
|
||||||
font-size:17px;
|
|
||||||
padding:16px 31px;
|
|
||||||
text-decoration:none;
|
|
||||||
text-shadow:0px 1px 0px #000000;
|
|
||||||
background-color: rgba(255, 255, 255, 0.2); /* Slightly white transparent background */
|
|
||||||
transition: background-color 0.3s ease; /* Transition for button hover effects */
|
|
||||||
width: auto; /* Width is determined by content within */
|
|
||||||
margin: 0.5em 0; /* Margin around buttons */
|
|
||||||
}
|
|
||||||
.button:hover {
|
|
||||||
background-color:#000000;
|
|
||||||
color:#ffffff;
|
|
||||||
}
|
|
||||||
.button:active {
|
|
||||||
position:relative;
|
|
||||||
top:1px;
|
|
||||||
}
|
|
||||||
/* Add this to your CSS to support dark mode */
|
|
||||||
body.dark-mode {
|
|
||||||
color: #ffffff; /* Light text color for contrast */
|
|
||||||
|
|
||||||
background-color: rgba(0, 0, 0, 1); /* Slightly transparent dark background */
|
|
||||||
}
|
|
||||||
body.dark-mode .button {
|
|
||||||
color: #ffffff; /* Dark button background color */
|
|
||||||
}
|
|
||||||
body.dark-mode .button2 {
|
|
||||||
color: #ffffff; /* Dark button background color */
|
|
||||||
}
|
|
||||||
body.dark-mode .input {
|
|
||||||
color: #ffffff; /* Dark button background color */
|
|
||||||
}
|
|
||||||
.dark-mode #Main {
|
|
||||||
background-color: rgba(0, 0, 0, 0.5); /* Slightly transparent dark background */
|
|
||||||
}
|
|
||||||
body.dark-mode .version-number {
|
|
||||||
color: #ffffff; /* Dark button background color */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.input {
|
.input {
|
||||||
border-radius: 10px;
|
background: rgba(255, 255, 255, 0.05);
|
||||||
padding: 6px;
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
width: 100%; /* Full width input fields */
|
border-radius: 8px;
|
||||||
box-sizing: border-box; /* Border box sizing for padding and borders */
|
color: #ffffff;
|
||||||
}
|
padding: 12px;
|
||||||
.button2 {
|
font-size: 16px;
|
||||||
border-radius: 10px;
|
transition: all 0.3s ease;
|
||||||
padding: 6px;
|
width: 100%;
|
||||||
transition: background-color 0.3s ease; /* Transition for button hover effects */
|
box-sizing: border-box;
|
||||||
width: auto; /* Width is determined by content within */
|
|
||||||
margin: 0.5em 0; /* Margin around buttons */
|
|
||||||
}
|
|
||||||
.button2:hover {
|
|
||||||
background-color:#000000;
|
|
||||||
color:#ffffff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.version-number {
|
.input:focus {
|
||||||
position: absolute;
|
border-color: #0078d4;
|
||||||
bottom: 1px;
|
outline: none;
|
||||||
right: 10px;
|
background: rgba(255, 255, 255, 0.08);
|
||||||
font-size: 0.75em;
|
|
||||||
color: #000000; /* Assuming light text for visibility against a potentially dark background */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 800px) {
|
.button, .button2 {
|
||||||
label {
|
background: rgba(255, 255, 255, 0.08);
|
||||||
width: auto; /* Full width on narrow screens */
|
border: none;
|
||||||
|
border-radius: 8px;
|
||||||
|
color: #ffffff;
|
||||||
|
padding: 12px 24px;
|
||||||
|
font-size: 16px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
margin: 8px 0;
|
||||||
|
backdrop-filter: blur(4px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.button:hover, .button2:hover {
|
||||||
|
background: #0078d4;
|
||||||
|
transform: translateY(-2px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.button:active, .button2:active {
|
||||||
|
transform: translateY(0);
|
||||||
|
background: #006cbd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Message {
|
||||||
|
padding: 12px;
|
||||||
|
margin: 8px 0;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: rgba(255, 255, 255, 0.05);
|
||||||
|
animation: fadeIn 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeIn {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(10px);
|
||||||
}
|
}
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Title {
|
||||||
|
font-size: 2.5rem;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
text-align: center;
|
||||||
|
background: linear-gradient(45deg, #0078d4, #00b4ff);
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
-webkit-text-fill-color: transparent;
|
||||||
|
animation: titleGlow 2s ease-in-out infinite alternate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes titleGlow {
|
||||||
|
from {
|
||||||
|
filter: drop-shadow(0 0 2px rgba(0, 120, 212, 0.3));
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
filter: drop-shadow(0 0 10px rgba(0, 120, 212, 0.6));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Logo {
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto;
|
||||||
|
height: 80px;
|
||||||
|
animation: float 3s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes float {
|
||||||
|
0% { transform: translateY(0px); }
|
||||||
|
50% { transform: translateY(-10px); }
|
||||||
|
100% { transform: translateY(0px); }
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-popup {
|
||||||
|
display: none;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: rgba(32, 32, 32, 0.95);
|
||||||
|
backdrop-filter: blur(20px);
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error-popup-content {
|
||||||
|
background: #202020;
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
|
color: #ffffff;
|
||||||
|
border-radius: 12px;
|
||||||
|
padding: 20px;
|
||||||
|
text-align: center;
|
||||||
|
max-width: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 900px) {
|
||||||
|
body {
|
||||||
|
background: #202020;
|
||||||
|
}
|
||||||
|
|
||||||
#Main {
|
#Main {
|
||||||
width: 100%; /* Full width on narrow screens */
|
width: 100%;
|
||||||
|
padding: 1rem;
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
backdrop-filter: none;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#Main:hover {
|
||||||
|
transform: none;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#SendMessage, #LeaveRoomButton, #ConnectButton {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 300px;
|
||||||
|
margin: 8px auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 650px) {
|
@media (max-width: 650px) {
|
||||||
#Title {
|
#Title {
|
||||||
font-size: 150%;
|
font-size: 2rem;
|
||||||
}
|
|
||||||
#ConnectButton {
|
|
||||||
display: block;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 20px 40px; /* Increase the padding to make the button bigger */
|
|
||||||
font-size: 20px; /* Increase the font-size for better readability on small screens */
|
|
||||||
}
|
|
||||||
#WebsiteButton {
|
|
||||||
display: block;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
#LinkButtons {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
#SendMessage {
|
|
||||||
display: block;
|
|
||||||
margin: 0 auto;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
margin-top: 10px;
|
|
||||||
padding: 20px 40px; /* Increase the padding to make the button bigger */
|
|
||||||
font-size: 20px; /* Increase the font-size for better readability on small screens */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#Chat {
|
||||||
|
display: none;
|
||||||
|
}
|
11
index.js
11
index.js
@ -24,16 +24,23 @@ io.on('connection', function(socket){
|
|||||||
usernames[socket.id] = username;
|
usernames[socket.id] = username;
|
||||||
socket.leaveAll();
|
socket.leaveAll();
|
||||||
socket.join(room);
|
socket.join(room);
|
||||||
io.in(room).emit("recieve", "Server : " + username + " has entered the chat.");
|
io.in(room).emit("recieve", "Server: " + username + " has entered the chat.");
|
||||||
socket.emit("join", room);
|
socket.emit("join", room);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
socket.on("send", function(message){
|
socket.on("send", function(message){
|
||||||
io.in(rooms[socket.id]).emit("recieve", usernames[socket.id] +" : " + message);
|
io.in(rooms[socket.id]).emit("recieve", usernames[socket.id] +": " + message);
|
||||||
})
|
})
|
||||||
|
|
||||||
socket.on("recieve", function(message){
|
socket.on("recieve", function(message){
|
||||||
socket.emit("recieve", message);
|
socket.emit("recieve", message);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
socket.on("leave", function(room, username){
|
||||||
|
if (room && username) {
|
||||||
|
socket.leave(room);
|
||||||
|
io.in(room).emit("recieve", "Server: " + username + " has left the chat.");
|
||||||
|
}
|
||||||
|
});
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user