css实现表情效果

代码语言:html

所属分类:布局界面

代码描述:css实现表情效果

代码标签: 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
body,
html {
  height: 100%;
  width: 100%;
  margin: 0;
}

* {
  box-sizing: border-box;
}

.emoji-box:hover ~ .emoji-box {
  filter: blur(3px);
}

.container {
  background-image: linear-gradient(to top, #e6e9f0 0%, #eef1f5 100%);
  height: 100%;
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  align-items: center;
}
.container .emoji-box {
  width: 110px;
  height: 110px;
  border-radius: 12px;
  margin-right: 2rem;
  padding: 16px;
  position: relative;
  transform: scale(1);
  transition: all 0.2s cubic-bezier(0.17, 0.67, 0.83, 0.67);
}
.container .emoji-box:hover {
  transform: scale(1.3);
}
.container .eyes {
  margin-top: 6px;
  display: flex;
  overflow: hidden;
  justify-content: space-between;
  align-items: center;
}
.container .eyes .eye {
  width: 32px;
  height: 32px;
  background-color: #fff;
  border-radius: 50%;
  position: relative;
}
.container .eyes .eye:before {
  content: "";
  min-width: 50%;
  position: absolute;
  min-height: 50%;
  left: 50%;
  top: 50%;
  background-color: #000;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.no-deal {
  background-color: #2c99cd;
}
.no-deal .smile {
  width: 65%;
  margin: auto;
  height: 4px;
  background-color: #1d6c90;
  margin-top: 22px;
  transform: rotate(-4deg);
  border-radius: 16px;
}

.embarrasing {
  background-color: #fdc535;
}
.embarrasing .eye:before {
  width: 70%;
  height: 70%;
}
.embarrasing .chins {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}
.embarrasing .chins .chin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #e08b93;
  filter: blur(3px);
}
.embarrasing .smile {
  width: 30%;
  height: 10px;
  border-radius: 12px;
  margin: 2px auto;
  background-color: #cb9128;
}

.fight {
  background-color: #ec9380;
  position: relative;
  overflow: hidden;
}
.fight .eyebrow {
  position: absolute;
  height: 200px;
  bottom: 68%;
  left: -28px;
  width: 150%;
  border-radius: 50%;
  background-color: #ec9380;
  z-index: 2;
}
.fight .eye:before {
  width: 70%;
  height: 70%;
}
.fight .chins {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}
.fight .chins .chin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #e82b3c;
  filter: blur(3px);
}
.fight .smile {
  width: 100%;
  margin: 2px auto;
  height: 40px;
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  background-color: transparent;
}
.fight .smile .curve {
  position: absolute;
  top: 0;
  left: 50%;
  transform: t.........完整代码请登录后点击上方下载按钮下载查看

网友评论0