b站视频演示效果:
效果图:
完整代码:
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>在无效输入时摇一摇动画</title>
<style>
* {
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: "Poppins", sans-serif;
}
body {
background-color: #3498db; /* 蓝色背景 */
}
h1{
color: white;
text-align: center;
}
form {
width: min(90%, 25em);
background-color: #151729;
position: absolute;
transform: translat