css文字漂浮景深动画效果

代码语言:html

所属分类:视觉差异

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

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

<style>
  body {
  margin: 0;
  font-size: 20px;
}

* {
  box-sizing: border-box;
}

.container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: white;
  color: black;
  font-family: arial, sans-serif;
  overflow: hidden;
}

.content {
  position: relative;
  width: 600px;
  max-width: 100%;
  margin: 20px;
  background: white;
  padding: 60px 40px;
  text-align: center;
  box-shadow: -10px 10px 67px -12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  animation: apparition 0.8s 1.2s cubic-bezier(0.39, 0.575, 0.28, 0.995) forwards;
}
.content p {
  font-size: 1.3rem;
  margin-top: 0;
  margin-bottom: 0.6rem;
  letter-spacing: 0.1rem;
  color: #595959;
}
.content p:last-child {
  margin-bottom: 0;
}
.content button {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.5rem 1rem;
  border: 3px solid #595959;
  background: transparent;
  font-size: 1rem;
  color: #595959;
  text-decoration: none;
  cursor: pointer;
  font-weight: bold;
}

.particle {
  position: absolute;
  display: block;
  pointer-events: none;
}
.particle:nth-child(1) {
  top: 34.9939246659%;
  left: 47.8983382209%;
  font-size: 23px;
  filter: blur(0.02px);
  animation: 22s float2 infinite;
}
.particle:nth-child(2) {
  top: 59.0799031477%;
  left: 24.3664717349%;
  font-size: 26px;
  filter: blur(0.04px);
  animation: 40s floatReverse2 infinite;
}
.particle:nth-child(3) {
  top: 9.7442143727%;
  left: 9.7943192948%;
  font-size: 21px;
  filter: blur(0.06px);
  animation: 35s float2 infinite;
}
.particle:nth-child(4) {
  top: 92.4574209246%;
  left: 96.8688845401%;
  font-size: 22px;
  filter: blur(0.08px);
  animation: 40s float infinite;
}
.particle:nth-child(5) {
  top.........完整代码请登录后点击上方下载按钮下载查看

网友评论0