纯css实现多个表情变换效果
代码语言:html
所属分类:布局界面
代码描述:纯css实现多个表情变换效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
body {
-webkit-box-align: center;
align-items: center;
font: 400 16px/1.2em sans-serif;
display: -webkit-box;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
flex-direction: column;
-webkit-box-pack: center;
justify-content: center;
min-height: 100vh;
width: 100%;
}
body * {
box-sizing: border-box;
padding: 0;
margin: 0;
}
.container {
display: -webkit-box;
display: flex;
flex-wrap: wrap;
-webkit-box-pack: center;
justify-content: center;
min-width: 320px;
padding: 1em;
width: 100%;
}
.emoji {
-webkit-box-align: center;
align-items: center;
-webkit-animation-duration: 2s;
animation-duration: 2s;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-name: hover;
animation-name: hover;
-webkit-animation-timing-function: ease-in-out;
animation-timing-function: ease-in-out;
background: #ddd;
border-radius: 1em;
box-shadow: inset 0 0 0 0.25em rgba(34, 34, 34, 0.1);
display: -webkit-box;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
flex-direction: column;
height: 10em;
margin: 1em;
padding-top: 1.5em;
position: relative;
top: 0;
width: 10em;
}
.emoji:after {
-webkit-animation-duration: 2s;
animation-duration: 2s;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-name: shadow;
animation-name: shadow;
-webkit-animation-timing-function: ease-in-out;
animation-timing-function: ease-in-out;
background: rgba(34, 34, 34, 0.1);
border-radius: 0.5em;
bottom: -1em;
content: "";
height: 0.5em;
position: absolute;
width: 80%;
}
@-webkit-keyframes shadow {
from {
background: rgba(34, 34, 34, 0.1);
bottom: -1em;
height: 0.5em;
width: 80%;
}
50% {
background: rgba(34, 34, 34, 0.05);
bottom: -2em;
height: 0.35em;
width: 65%;
}
to {
background: rgba(34, 34, 34, 0.1);
bottom: -1em;
height: 0.5em;
width: 80%;
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0