Refactored and cleaned up

This commit is contained in:
2021-05-26 19:34:31 +02:00
parent 05b85f2d4e
commit b911164db2
8 changed files with 159 additions and 125 deletions

100
public/css/chat.css Normal file
View File

@@ -0,0 +1,100 @@
#chat {
display: flex;
flex-flow: column;
overflow: hidden;
border-left: #7d7d7d solid 2px;
height: 100%;
}
#messages_received {
flex: 1 1 90%;
display: flex;
flex-direction: column;
overflow: auto;
padding: 5px;
}
#message_add {
flex: 0 0 10%;
}
#message_add form {
height: 100%;
width: 100%;
}
#message_input {
height: calc(100% - 10px - 2em - 6px);
width: calc(100% - 10px);
}
#message_send {
height: 2em;
width: 100%;
}
.log_message {
list-style-type: none;
padding: 5px;
font-weight: bold;
color: #424242;
text-align: center;
}
.chat_message {
list-style-type: none;
margin: 5px;
padding: 5px 10px 5px 10px;
border-radius: 5px;
background: #0672e6;
color: #fff;
position: relative;
}
.me {
margin-left: 2em;
}
.me:before {
content: "";
width: 0;
height: 0;
position: absolute;
border-left: 10px solid #0672e6;
border-right: 10px solid transparent;
border-top: 10px solid #0672e6;
border-bottom: 10px solid transparent;
right: -10px;
top: 0;
}
.others {
margin-right: 2em;
}
.others:before {
content: "";
width: 0;
height: 0;
position: absolute;
border-left: 10px solid transparent;
border-right: 10px solid #0672e6;
border-top: 10px solid #0672e6;
border-bottom: 10px solid transparent;
left: -10px;
top: 0;
}
.username {
font-weight: bold;
}
.messageBody {
}
.messageBody::before {
content: '\A';
white-space: pre;
}

View File

@@ -12,92 +12,10 @@ body {
overflow: hidden;
}
header {
height: 3em;
}
main {
display: grid;
grid-template-columns: 80% 20%;
height: calc(100% - 3em);
}
#game {
height: 100%;
grid-column-start: 1;
}
#chat {
border-left: #7d7d7d solid 2px;
height: 100%;
grid-column-start: 2;
}
#messages {
height: calc(100% - 5em - 3em);
overflow-y: scroll;
padding: 5px;
}
.log {
list-style-type: none;
padding: 5px;
font-weight: bold;
color: #424242;
text-align: center;
}
.message {
list-style-type: none;
margin: 5px;
border-radius: 5px;
background: #0079a5;
color: #fff;
padding: 5px 5px 5px 15px;
position: relative;
}
.me:before {
content: "";
width: 0;
height: 0;
position: absolute;
border-left: 15px solid #0079a5;
border-right: 15px solid transparent;
border-top: 15px solid #0079a5;
border-bottom: 15px solid transparent;
right: -10px;
top: 0;
}
.others:before {
content: "";
width: 0;
height: 0;
position: absolute;
border-left: 15px solid transparent;
border-right: 15px solid #0079a5;
border-top: 15px solid #0079a5;
border-bottom: 15px solid transparent;
left: -10px;
top: 0;
}
.username {
font-weight: bold;
}
.messageBody {
}
.messageBody::before {
content: '\A';
white-space: pre;
}
#message_form {
height: 5em;
height: calc(100% - 3em - 10px);
}
.material-icon {

4
public/css/game.css Normal file
View File

@@ -0,0 +1,4 @@
#game {
height: 100%;
grid-column-start: 1;
}