以下是一个简单的HTML+JavaScript实现,满足你的需求。代码包含输入框、按钮、动态跑步动画、POST请求处理以及结果弹窗显示。 ```html <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Zeep步数修改工具</title> <style> body { font-family: Arial, sans-serif; background-color: #f0f8ff; margin: 0; padding: 0; } .container { width: 400px; margin: 50px auto; padding: 20px; background: #ffffff; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); } input[type="text"], input[type="password"], input[type="number"] { width: 100%; padding: 10px; margin: 10px 0; border: 1px solid #ccc; border-radius: 4px; } button { width: 100%; padding: 10px; background-color: #1e90ff; color: white; border: none; border-radius: 4px; cursor: pointer; } button:hover { background-color: #1c86ee; } .animation { text-align: center; margin-top: 20px; } .animation img { width: 100px; animation: run 1s infinite alternate; } @keyframes run { from { transform: translateX(-10px); } to { transform: translateX(10px); } } .result { margin-top: 20px; text-align: center; font-size: 16px; color: green; } </style> </head> <body> <div class="container"> <h2 style="text-align:center;">Zeep步数修改工具</h2> <input type="text" id="username" placeholder="请输入Zeep账号"> <input type="password" id="password" placeholder="请输入Zeep密码"> <input type="number" id="stepCount" placeholder="步数(默认随机20000-28000)"> <button onclick="submitForm()">提交</button> <div class="animation"> <img src="https://via.placeholder.com/100x100?text=Robot" alt="跑步机器人"> </div> <div class="result" id="result"></div> </div> <script> function getRandomStep() { return Math.floor(Math.random() * (28000 - 20000 + 1)) + 20000; } function submitForm() { const user = document.getElementById('username').value; const password = document.getElementById('password').value; const stepInput = document.getElementById('stepCount').value; const step = stepInput ? parseInt(stepInput) : getRandomStep(); if (!user || !password) { alert("账号和密码不能为空!"); return; } const xhr = new XMLHttpRequest(); xhr.open("POST", "https://ydapi.datu520.com", true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function () { if (xhr.readyState === 4 && xhr.status === 200) { const response = JSON.parse(xhr.responseText); document.getElementById('result').innerText = response.msg; } }; const params = `user=${encodeURIComponent(user)}&password=${encodeURIComponent(password)}&step=${step}`; xhr.send(params); } </script> <div style="margin-top:20px; text-align:center;"> <h3>使用教程</h3> <p>1. 输入您的Zeep账号和密码。</p> <p>2. 填写步数或留空以使用默认随机值。</p> <p>3. 点击提交按钮,等待返回结果。</p> <p>联系Q群:*</p> </div> </body> </html> ``` 额外需要注意的逻辑点 1. POST请求中需要对用户输入进行编码,避免特殊字符导致请求失败。 2. 步数输入框应增加验证,确保只接受正整数。 3. 动态跑步动画可以进一步优化为更复杂的运动效果。 [2025-06-04 00:48:17 | AI写代码神器 | 1050点数解答]