Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 1 addition & 36 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,7 @@
<title>Chat App</title>
<script defer src="http://localhost:3000/socket.io/socket.io.js"></script>
<script defer src="script.js"></script>
<style>
body {
padding: 0;
margin: 0;
display: flex;
justify-content: center;
}

#message-container {
width: 80%;
max-width: 1200px;
}

#message-container div {
background-color: #CCC;
padding: 5px;
}

#message-container div:nth-child(2n) {
background-color: #FFF;
}

#send-container {
position: fixed;
padding-bottom: 30px;
bottom: 0;
background-color: white;
max-width: 1200px;
width: 80%;
display: flex;
}

#message-input {
flex-grow: 1;
}
</style>
<link rel="stylesheet" href="main.css">
</head>
<body>
<div id="message-container"></div>
Expand Down
130 changes: 130 additions & 0 deletions main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
body {
padding: 0;
margin: 0;
display: flex;
justify-content: center;
}

#message-container {
width: 80%;
max-width: 1200px;
}

body {
padding: 0;
margin: 0;
display: flex;
justify-content: center;
}

#message-container {
width: 80%;
max-width: 1200px;
}

#message-container div {
background-color: #CCC;
padding: 5px;
}

#message-container div:nth-child(2n) {
background-color: #FFF;
}

#send-container {
position: fixed;
padding: 10px;
bottom: 0;
background-color: white;
max-width: 1200px;
width: 80%;
display: flex;
gap: 10px; /* Add spacing between input and button */
box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1); /* Subtle shadow for the container */
}

#message-input {
flex-grow: 1;
padding: 10px;
border: 1px solid #ccc;
border-radius: 20px; /* Rounded corners for input */
font-size: 16px;
background: linear-gradient(135deg, #e0eafc, #cfdef3); /* Gradient background */
color: #333;
outline: none;
transition: box-shadow 0.3s ease;
}

#message-input:focus {
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); /* Focus effect */
}

#send-button {
padding: 10px 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 20px; /* Rounded corners for button */
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease;
}

#send-button:hover {
background-color: #0056b3;
transform: scale(1.05); /* Slightly enlarge on hover */
}
#send-container {
position: fixed;
padding: 10px;
bottom: 0;
background-color: white;
max-width: 1200px;
width: 80%;
display: flex;
gap: 10px; /* Add spacing between input and button */
box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1); /* Subtle shadow for the container */
}

#message-input {
flex-grow: 1;
padding: 10px;
border: 1px solid #ccc;
border-radius: 20px; /* Rounded corners for input */
font-size: 16px;
background: linear-gradient(135deg, #e0eafc, #cfdef3); /* Gradient background */
color: #333;
outline: none;
transition: box-shadow 0.3s ease;
}

#message-input:focus {
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); /* Focus effect */
}

#send-button {
padding: 10px 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 20px; /* Rounded corners for button */
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease;
}

#send-button:hover {
background-color: #0056b3;
transform: scale(1.05); /* Slightly enlarge on hover */
}#message-container div {
background-color: #d4edda; /* Light green for messages */
padding: 10px;
margin-bottom: 5px;
border-radius: 10px; /* Rounded corners for messages */
color: #155724; /* Dark green text for better contrast */
}

#message-container div:nth-child(2n) {
background-color: #cce5ff; /* Light blue for alternating messages */
color: #004085; /* Dark blue text for better contrast */
}
Loading