我想从Streamlabs自定义我的抽搐聊天叠加层,以便该用户的用户名从左侧开始动画,而他们发送的实际邮件则从右侧开始设置动画。下面我粘贴了CSS,这是我所需要的,因为Stream-labs完成剩下的工作。控制文本动画的主要位置从第19行开始#log>div{
此外,抱歉长代码,但你需要它。
h@import url(https://fonts.googleapis.com/css?family=Roboto:700);
* {
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: 'Roboto';
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 {
display: table;
position: absolute;
bottom: 0;
left: 0;
padding: 0 10px 10px;
width: 100%;
table-layout: fixed;
}
#log>div {
display: table-row;
}
#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;
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%;
}
.badge {
display: inline-block;
margin-right: 0.2em;
position: relative;
height: 1em;
vertical-align: middle;
top: -0.1em;
}
.name {
margin-left: 0.2em;
}
答案 0 :(得分:0)
我是CSS的新手,同样也想自定义我的StreamLabs聊天,因此名称/徽章的动画将与消息不同。我花了一段时间才弄清楚,主要是因为我开始使用的模板需要display
的{{1}}属性和分配给#log .meta
的{{1}}才能使动画生效。在您的情况下,#log .message
也支持动画,因此无需更改。
在第一个inline-block
元素中,从两个动画属性中删除table-cell
。
在要从左侧滑入的#log>div
(徽章+名称)中,添加fadeInRight .3s ease forwards,
和#log .meta
属性,其值为animation
。
对webkit-animation
执行相同操作,但将slideInLeft .3s ease forwards;
替换为#log .message
。