文字飞入搜索动画效果

代码语言:html

所属分类:搜索

代码描述:文字飞入搜索动画效果

代码标签: 动画 效果

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


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

<style>
* {
  box-sizing: border-box;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  margin: 0;
  padding: 0;
  background-color: white;
  font-family: 'Knewave', cursive;
}

label {
  width: 100%;
  max-width: 300px;
}

input {
  width: 100%;
  display: flex;
  padding: 15px;
  background-color: white;
  border: 2px solid black;
  color: #111;
  font-size: 15px;
  box-shadow: 3px 1px 0px 2px, 0px -1px 0px 2px rgba(0, 0, 0, 0.62);
  height: 58px;
  transform: skew(-3deg, 1deg);
  font-family: 'Knewave', cursive;
  letter-spacing: 2px;
  text-transform: uppercase;
}
input:focus, input:valid {
  outline: none;
}
input:focus ~ ul li:nth-child(1)::before, input:valid ~ ul li:nth-child(1)::before {
  filter: blur(20px);
  transform: translate(0, -35px) rotate(-210deg);
}
input:focus ~ ul li:nth-child(1)::after, input:valid ~ ul li:nth-child(1)::after {
  filter: blur(0);
  transform: scale(1) rotate(0);
}
input:focus ~ ul li:nth-child(2)::before, input:valid ~ ul li:nth-child(2)::before {
  filter: blur(20px);
  transform: translate(0, -35px) rotate(-210deg);
}
input:focus ~ ul li:nth-child(2)::after, input:valid ~ ul li:nth-child(2)::after {
  filter: blur(0);
  transform: scale(1) rotate(0);
}
input:focus ~ ul li:nth-child(3)::before, input:valid ~ ul li:nth-child(3)::before {
  filter: blur(20px);
  transform: translate(0, -35px) rotate(-210deg);
}
input:focus ~ ul li:nth-child(3)::after, input:valid ~ ul li:nth-child(3)::after {
  filter: blur(0);
  transform: scale(1) rotate(0);
}
input:focus ~ ul li:nth-child(4)::before, input:valid ~ ul li:nth-child(4)::before {
  filter: blur(20px);
  transform: translate(0, -35px) rotate(-210deg);
}
input:focus ~ ul li:nth-child(4)::after, input:valid ~ ul li:nth-child(4)::after {
  filter: blur(0);
  transform: scale(1) rotate(0);
}
input:focus ~ ul li:nth-child(5)::before, input:valid ~ ul li:nth-child(5)::before {
  filter: blur(20px);
  transform: translate(0, -35px) rotate(-210deg);
}
input:focus ~ ul li:nth-child(5)::after, input:valid ~ ul li:nth-child(5)::after {
  filter: blur(0);
  transform: scale(1) rotate(0);
}
input:focus ~ ul li:nth-child(6)::before, input:valid ~ ul li:nth-child(6)::before {
  filter: blur(20px);
  transform: translate(0, -35px) rotate(-210deg);
}
input:focus ~ ul li:nth-child(6)::after, input:valid ~ ul li:nth-child(6)::after {
  filter: blur(0);
  transform: scale(1) rotate(0);
}
input:focus ~ ul li:nth-child(1)::after, input:valid .........完整代码请登录后点击上方下载按钮下载查看

网友评论0