Skip to content

Instantly share code, notes, and snippets.

@Hamcha
Created March 12, 2021 15:43
Show Gist options
  • Save Hamcha/6f5bf6aa71d45fe0107387ccc4613dfa to your computer and use it in GitHub Desktop.
Save Hamcha/6f5bf6aa71d45fe0107387ccc4613dfa to your computer and use it in GitHub Desktop.
For use in Streamlabs Chat Box
* {
box-sizing: border-box;
}
html, body {
height: 100%;
overflow: hidden;
white-space: nowrap;
}
body {
background: {background_color};
font-family: 'Comic Neue Angular';
font-weight: 700;
font-size: {font_size};
line-height: 1.5em;
color: {text_color};
}
#log>div {
animation: fadeInRight .3s ease forwards, fadeOut 0.5s ease {message_hide_delay} forwards;
-webkit-animation: fadeInRight .3s ease forwards, fadeOut 0.5s ease {message_hide_delay} forwards;
}
.colon {
display: none;
}
#log {
padding: 0 10px 10px;
right: 0;
position: absolute;
text-align: right;
overflow: hidden;
}
#log>div.deleted {
visibility: hidden;
}
#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;
padding-bottom: 0.1em;
}
#log .meta {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
display: inline-block;
}
#log .message {
display: inline-block;
word-wrap: break-word;
font-weight: 400;
max-width: 500px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.messagebox {
margin: 0 5px;
padding: 2px 10px 0 10px;
border-radius: 10px;
background: rgba(0,0,0,0.8);
display: inline-block;
}
.badge {
display: inline-block;
position: relative;
height: 1em;
vertical-align: middle;
top: -0.1em;
padding-right: 0.2em;
}
.name {
font-weight: bold;
filter: brightness(1.75) saturate(60%);
}
<!-- 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 class="messagebox" data-from="{from}" data-id="{messageId}">
<div class="meta" style="color: {color}"><span class="badges"></span><span class="name">{from}</span></div>
<div class="message">{message}</div>
</div>
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment