Skip to content

Instantly share code, notes, and snippets.

@devgiordane
Last active July 11, 2021 15:32
Show Gist options
  • Save devgiordane/5dfb4092256d4ef3f7954d9b6daf8454 to your computer and use it in GitHub Desktop.
Save devgiordane/5dfb4092256d4ef3f7954d9b6daf8454 to your computer and use it in GitHub Desktop.
<!-- item will be appened to this layout -->
<div id="log" class="sl__chat__layout">
</div>
<!-- chat item -->
<script type="text/template" id="chatlist_item">
<div data-from="{from}" data-id="{messageId}">
<span class="meta" style="color: {color}">
<span class="badges">
</span>
<span class="name">{from}</span>
</span>
<span class="message">
{message}
</span>
</div>
</script>
@import url("https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300;400&display=swap");
* {
box-sizing: border-box;
}
html,
body {
height: 100%;
overflow: hidden;
background: rgb(34, 34, 34);
}
body {
background: none;
font-family: "Roboto Condensed", sans-serif;
font-weight: 300;
font-size: 20px;
line-height: 1.5em;
color: #ffffff;
}
#log > div {
margin-bottom: 10px;
display: flex;
}
.colon {
display: none;
}
#log {
display: table;
position: absolute;
bottom: 0;
left: 0;
padding: 0 10px 10px;
width: 100%;
table-layout: fixed;
}
#log > div.deleted {
transition: all 1s;
transform: scale(0);
}
#log .emote {
background-repeat: no-repeat;
background-position: center;
background-size: contain;
padding: 0.4em 0.2em;
position: relative;
}
#log .emote img {
display: inline-block;
height: 1em;
opacity: 0;
}
#log .message,
#log .meta {
vertical-align: top;
display: table-cell;
padding-bottom: 0.1em;
}
#log .meta {
width: 35%;
text-align: right;
padding-right: 0.5em;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
#log .message {
word-wrap: break-word;
width: 65%;
background: rgb(42, 42, 42);
padding: 5px 10px;
border-radius: 5px;
animation: opacidade 1s ease-in;
}
@keyframes opacidade {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.badge {
display: inline-block;
margin-right: 0.2em;
position: relative;
height: 1em;
vertical-align: middle;
top: -0.1em;
}
.name {
margin-left: 0.2em;
color: #ececec;
font-weight: 400;
text-transform: uppercase;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment