• INTRODUÇÃO

Você já viu em alguns canais aqueles chats na live bem bonitos e com cores personalizadas e você não faz ideia de como fazer algo parecido pro seu canal? Nesse vídeo eu vou disponibilizar um modelo de chat com código CSS pra você usar e ensinar como deixar o seu chat com as suas cores personalizadas!

HTML:

<!-- 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>

CSS:

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;800&display=swap');

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    text-shadow: 0 0 1px #000, 0 0 2px #000;
    background: {background_color};
    font-family: 'Montserrat', 'Roboto', Arial, sans-serif!important;
    font-weight: 700;
    font-size: {font_size};
    line-height: 1.5em;
    color: {text_color};
  	-webkit-mask-image: -webkit-gradient(linear, left 16%, left top, from(rgba(0,0,0,1)), to(rgba(0,0,0,0)));
}

#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 {
    display: table;
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 0 10px 10px;
    width: 900px;
    table-layout: fixed;
}

#log>div {
    display: block;
  	margin-bottom: 20px;
}

#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 {
    vertical-align: top;
    display: block;
    padding-bottom: 0.1em;
}
#log .meta {
    max-width: 500px;
  	vertical-align: top;
    display: inline-block;
    padding-bottom: 0.1em;
  	text-align: left;
    padding-right: 0.5em;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    background: #D835AA;
    font-weight: bolder;
    padding: 8px 10px;
    color: #fff;
    border-top-right-radius: 20px;
  	border-top-left-radius: 5px;
  	border-bottom-right-radius: 20px;
    border-bottom-left-radius: 20px;
}

#log .message {
    word-wrap: break-word;
    width: 65%;
  	font-weight: 500;
    background: rgba(9, 19, 20, 0.75);
    color: #fff;
    padding: 20px 20px;
    border-top-right-radius: 25px;
  	border-top-left-radius: 10px;
    border-bottom-right-radius: 25px;
    border-bottom-left-radius: 25px;
    border: 3px solid #2FC9C5;
}

.badge {
    display: inline-block;
    margin-right: 0px;
    position: relative;
    height: 1em;
    vertical-align: middle;
    top: -0.1em;
}

.name {
    margin-left: 0;
  	color: #fff!important;
}