js+css实现人机验证鼠标左键按住不放验证代码
代码语言:html
所属分类:验证
代码描述:js+css实现人机验证鼠标左键按住不放验证代码
代码标签: js css 人机 验证 鼠标 左键 按住 不放 验证 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!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>
:root {
--bg: #f0f4f8;
--card-bg: #ffffff;
--text: #2d3748;
--text-secondary: #718096;
--track-color: #e2e8f0;
--progress-start: #5b8def;
--progress-end: #48bb78;
--success: #48bb78;
--button-bg: #ffffff;
--button-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
--button-shadow-active: 0 2px 8px rgba(0, 0, 0, 0.12), 0 0 0 8px rgba(91, 141, 239, 0.15);
--button-shadow-success: 0 2px 8px rgba(0, 0, 0, 0.1), 0 0 0 16px rgba(72, 187, 120, 0.2);
--ring-glow: rgba(91, 141, 239, 0.5);
--ring-glow-success: rgba(72, 187, 120, 0.6);
--transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
--transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
background: var(--bg);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
-webkit-tap-highlight-color: transparent;
-webkit-user-select: none;
user-select: none;
-webkit-touch-callout: none;
padding: 20px;
}
/* 背景装饰 */
body::before {
content: '';
position: fixed;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: radial-gradient(ellipse at 50% 50%, rgba(91, 141, 239, 0.04) 0%, transparent 60%),
radial-gradient(ellipse at 30% 60%, rgba(72, 187, 120, 0.03) 0%, transparent 55%),
radial-gradient(ellipse at 70% 35%, rgba(139, 92, 246, 0.03) 0%, transparent 55%);
pointer-events: none;
z-index: 0;
}
/* 主卡片 */
.captcha-card {
position: relative;
z-index: 1;
background: var(--card-bg);
border-radius: 24px;
padding: 40px 36px 36px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04);
display: flex;
flex-direction: column;
align-items: center;
gap: 28px;
width: 100%;
max-width: 380px;
transition: box-shadow var(--transition-smooth);
}
.captcha-card.success-glow {
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04),
0 0 0 4px rgba(72, 187, 120, 0.25), 0 0 60px rgba(72, 187, 120, 0.2);
}
/* 标题 */
.captcha-header {
display: flex;
align-items: center;
gap: 10px;
opacity: 0.9;
}
.captcha-icon {
width: 28px;
height: 28px;
flex-shrink: 0;
}
.captcha-icon svg {
width: 100%;
height: 100%;
}
.captcha-title {
font-size: 17px;
font-weight: 600;
color: var(--text);
letter-spacing: -0.01em;
white-space.........完整代码请登录后点击上方下载按钮下载查看















网友评论0