Compare commits

...

28 Commits
V1.3 ... main

Author SHA1 Message Date
Brendan
6ed7ec0d91 V2.3.0: Updated the design 2024-12-26 16:12:51 +00:00
Brendan
efe82a5d25 changed version number to V2.2.1 2024-08-23 09:57:00 +00:00
Brendan
52fcab7506 Fixed responsive web design for tablets 2024-08-23 09:54:26 +00:00
Brendan
d2e980e9f2
Update README.md 2024-07-10 22:58:36 +02:00
Brendan
62a3d0b7a7 New background, new "Ding" and fixed long messages breaking the design 2024-07-10 20:47:07 +00:00
abrendan
1ec626532c Added a "User left" message when someone leaves from a chatroom 2024-01-30 13:35:42 +00:00
Brendan
10da1b3392
Update README.md 2024-01-29 21:52:50 +01:00
abrendan
bd651effdc Small change 2024-01-29 20:51:04 +00:00
abrendan
fa1c78031c Added a error message when trying to connect without a username or room 2024-01-29 20:50:29 +00:00
abrendan
7f8151dfeb Made Leave Room button bigger on mobile 2024-01-29 18:09:40 +00:00
abrendan
7ce73ce036 Made the Access Part hide after connecting and also added a Leave Room button 2024-01-29 17:55:53 +00:00
abrendan
1970e36448 Increased the bottom margin of the connect button 2024-01-29 17:44:16 +00:00
abrendan
5bee7db3d1 Cleaned code 2024-01-29 17:33:55 +00:00
abrendan
db7b495194 Made the Chat part only visible after being connected with a room 2024-01-29 17:18:14 +00:00
abrendan
0d26f56c4b Added favi icon 2024-01-29 17:07:13 +00:00
abrendan
b28d9a16db V2.0.1! Added a version number on the bottom right and a future way to add a logo. Also changed version scheme 2024-01-22 19:44:22 +00:00
Brendan
91e2fa270a
Update README.md 2024-01-15 13:20:40 +01:00
abrendan
201546a7f3 Fixed the blur when viewed on webkit 2024-01-15 10:24:33 +00:00
abrendan
1733bb9a00 V2! New background, better mobile UI 2024-01-15 10:14:14 +00:00
abrendan
5ad7ad2ce6 V1.7! Bigger buttons for when viewed on a mobile screen or the android application 2024-01-12 14:28:32 +00:00
abrendan
226f1250da Added privacy statement 2024-01-12 14:11:21 +00:00
abrendan
8f6697b00b Made the buttons center when opened on a phone 2024-01-04 22:22:21 +00:00
abrendan
831834728d Made adjustments to the padding when viewed on a smaller screen 2024-01-04 21:00:40 +00:00
Brendan
7bd7e14910
Update README.md 2024-01-01 02:58:30 +01:00
abrendan
da41439428 Added a button for the GitHub Page and changed the font to Google's Roboto 2024-01-01 01:56:43 +00:00
Brendan
3ff4eedf62
Update README.md 2023-12-26 13:53:35 +01:00
abrendan
d4112b4a19 V1.4! Now with a centered design and the web application isn't broken on a mobile device anymore 2023-12-11 14:37:23 +00:00
Brendan
b23c6692ab
Update README.md 2023-12-02 01:25:49 +01:00
14 changed files with 373 additions and 143 deletions

View File

@ -86,3 +86,7 @@ support = true
[deployment]
deploymentTarget = "cloudrun"
run = ["sh", "-c", "node index.js"]
[[ports]]
localPort = 3000
externalPort = 80

View File

@ -1,6 +1,24 @@
# MicDropMessages
# MicDropMessagesV2
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
![grafik](https://github.com/abrendan/MicDropMessages/assets/94894839/13ba80a7-d4df-47ec-b86f-2a8e921c3d1a)
![grafik](https://github.com/abrendan/MicDropMessages/assets/94894839/d4e4a1c4-f194-460a-a31a-76798da58f26)
MicDropMessages is a basic chat platform using socket.io and JavaScript. Now with a simple dark mode option!
![grafik](https://github.com/abrendan/MicDropMessages/assets/94894839/1e91b762-3acd-4d1b-b89b-86957ef50064)

View 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"]
}
}]

View File

@ -4,15 +4,23 @@
<title> MicDropMessages </title>
<meta name="charset" charset="utf-8">
<meta name="viewport" content="width=device-width">
<link href='https://fonts.googleapis.com/css2?family=Segoe+UI:wght@400;500;600&display=swap' rel='stylesheet'>
<style>
html {
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>
<body onload="onload()">
<div id="Main">
<audio id = "Ding" src = "Ding.mp3"> </audio>
<h1 id = "Title"> MicDropMessages V1.3 </h1>
<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>
<audio id="Ding" src="new-notification.mp3"> </audio>
<h1 id="Title"> MicDropMessages</h1>
<img id="Logo" src="https://micdropmessages.app/pictures/mdm2logo1.png" alt="Logo">
<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">
<label id="NameLabel"> Username </label>
<input id="NameInput" class="input" type="text">
@ -32,15 +40,25 @@
<p id="Message6" class="Message"> - </p>
<p id="Message7" class="Message"> - </p>
<p id="Message8" class="Message"> - </p>
<p id = "Message9" class = "Message"> - </p>
<label id="MessageLabel"> Message </label>
<input id="ComposedMessage" class="input" type="text">
<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 class="other">
<p>Made by abrendan. Visit my website for more of my projects.</p>
<button id="darkModeToggle" onclick="toggleDarkMode()" class="button">Toggle Dark Mode</button>
<button onclick=" window.open('http://www.abrendan.dev','_blank')" class="button">abrendan.dev</button>
<br><br>
<div id="LinkButtons">
<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>
</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>
</body>
</html>

BIN
html/new-notification.mp3 Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1018 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 KiB

BIN
html/pictures/mdm2logo1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 KiB

56
html/privacy.html Normal file

File diff suppressed because one or more lines are too long

View File

@ -24,7 +24,9 @@ function onload(){
socket.on("join", function(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){
console.log(message);
@ -32,8 +34,7 @@ function onload(){
messages.push(message);
dingSound.currentTime = 0;
dingSound.play();
}
else{
} else {
messages.shift();
messages.push(message);
}
@ -41,11 +42,54 @@ function onload(){
document.getElementById("Message"+i).innerHTML = messages[i];
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(){
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(){
@ -61,10 +105,6 @@ function delayReset(){
delay = true;
}
function toggleDarkMode() {
document.body.classList.toggle('dark-mode');
}
document.addEventListener('keydown', function(event) {
// Check if Alt + Ctrl + R are pressed together
if (event.altKey && event.ctrlKey && event.key === 'r') {

View File

@ -1,104 +1,182 @@
body {
background-image: url('https://images.unsplash.com/37/IHLjdHdzSvi0rgUMMlSK_TE3_0286.jpg'); /* Path to your example image */
background-size: cover; /* Cover the entire viewport */
background-repeat: no-repeat; /* Do not repeat the image */
background-attachment: fixed; /* The background image does not scroll */
color: #000000;
font-family: 'Segoe UI';
}
label{
width: 5%;
display: inline-block;
text-align: right;
}
input{
background-color: rgba(255, 255, 255, 0.15);
color: #000000;
font-size: 120%;
border: none;
}
.Message{
color: #000000;
background-color: #202020;
color: #ffffff;
font-family: 'Segoe UI', 'Roboto', sans-serif;
display: flex;
justify-content: center;
align-items: center;
margin: 0;
min-height: 100vh;
background-image: linear-gradient(45deg, #1a1a1a 0%, #2d2d2d 100%);
}
#Main {
min-height: 94.5vh; /* Stretch to fill the viewport height */
padding: 20px; /* Padding added to the main content area */
border-radius: 10px;
backdrop-filter: blur(5px); /* Provide a translucent frosted-glass effect */
background-color: rgba(255, 255, 255, 0.2); /* Slightly white transparent background */
background: rgba(32, 32, 32, 0.8);
backdrop-filter: blur(20px);
-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;
}
#Title{
font-size: 300%;
#Main:hover {
transform: translateY(-5px);
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}
.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 */
}
.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 */
}
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 */
}
/* You might want to customize other elements for dark mode, for example: */
.dark-mode #Main {
background-color: #333; /* Dark background for main content area */
}
/* Additional elements can be customized as needed for dark mode... */
.input {
border-radius: 10px;
padding: 6px;
}
.button2 {
border-radius: 10px;
padding: 6px;
transition: background-color 0.3s ease; /* Transition for button hover effects */
}
.button2:hover {
background-color:#000000;
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 8px;
color: #ffffff;
padding: 12px;
font-size: 16px;
transition: all 0.3s ease;
width: 100%;
box-sizing: border-box;
}
.input:focus {
border-color: #0078d4;
outline: none;
background: rgba(255, 255, 255, 0.08);
}
.button, .button2 {
background: rgba(255, 255, 255, 0.08);
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 {
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) {
#Title {
font-size: 2rem;
}
}
#Chat {
display: none;
}

View File

@ -36,4 +36,11 @@ io.on('connection', function(socket){
socket.on("recieve", function(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.");
}
});
})