给html表情添加属性,HTML5 给文本添加表情动画

CSS

语言:

CSSSCSS

确定

body {

font-family: 'Roboto', sans-serif;

}

.emojify-input {

border: #DDD 1px solid;

box-shadow: inset 0px -1px 2px rgba(0, 0, 0, 0.1), inset 0px 1px 2px rgba(0, 0, 0, 0.1);

border-radius: 5px;

height: 150px;

width: 300px;

padding: 15px;

font-size: 12pt;

line-height: 18pt;

margin: 15% auto 0 auto;

outline: none;

}

.emojify-input .emojiChar {

padding: 0 0 0 3px;

}

.emojify-input span.detectedEmoji {

color: #ff9933;

font-weight: 500;

cursor: pointer;

display: inline-block;

position: relative;

background: -webkit-linear-gradient(0deg, #ff9933, #EF3D35, #ff9933);

background: linear-gradient(90deg, #ff9933, #EF3D35, #ff9933);

background-position: 0 0;

-webkit-background-clip: text;

-webkit-text-fill-color: transparent;

-webkit-animation: shinny 5s infinite, bounce 500ms 1;

animation: shinny 5s infinite, bounce 500ms 1;

-webkit-transition: all 250ms ease-in-out;

transition: all 250ms ease-in-out;

-webkit-transform: translateY(0);

transform: translateY(0);

}

.emojify-input span.detectedEmoji .selector {

position: absolute;

background-color: #FFF;

box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);

width: auto;

border-radius: 5px;

padding: 5px 15px 5px 15px;

text-align: center;

top: -42px;

letter-spacing: 4px;

border-top: #EEE 1px solid;

z-index: 3;

-webkit-background-clip: none;

-webkit-text-fill-color: #333;

}

.emojify-input span.detectedEmoji .selector:before {

content: '';

position: absolute;

bottom: -7px;

left: 50%;

width: 0;

height: 0;

margin-left: -8px;

border-left: 8px solid transparent;

border-right: 8px solid transparent;

border-top: 8px solid #FFF;

z-index: 2;

}

.emojify-input span.detectedEmoji .selector:after {

content: '';

position: absolute;

bottom: -8px;

left: 50%;

width: 0;

height: 0;

margin-left: -8px;

border-left: 8px solid transparent;

border-right: 8px solid transparent;

border-top: 8px solid #CCC;

z-index: 1;

}

#emojifyIt {

height: 50px;

width: 300px;

padding: 15px;

font-size: 12pt;

margin: 10px auto;

display: block;

border: 0;

background-color: #FFF;

color: #2D72D9;

font-weight: 500;

text-transform: uppercase;

}

#emojifyIt:hover {

background-color: #2D72D9;

color: #FFF;

border-radius: 5px;

cursor: pointer;

}

@-webkit-keyframes shinny {

0% {

background-position: 0 0;

}

100% {

background-position: 150px 0;

}

}

@keyframes shinny {

0% {

background-position: 0 0;

}

100% {

background-position: 150px 0;

}

}

@-webkit-keyframes bounce {

0% {

-webkit-transform: scale(1) rotate(0);

transform: scale(1) rotate(0);

}

50% {

-webkit-transform: scale(1.1) rotate(-2deg);

transform: scale(1.1) rotate(-2deg);

}

100% {

-webkit-transform: scale(1) rotate(0);

transform: scale(1) rotate(0);

}

}

@keyframes bounce {

0% {

-webkit-transform: scale(1) rotate(0);

transform: scale(1) rotate(0);

}

50% {

-webkit-transform: scale(1.1) rotate(-2deg);

transform: scale(1.1) rotate(-2deg);

}

100% {

-webkit-transform: scale(1) rotate(0);

transform: scale(1) rotate(0);

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值