mediapipe实现摄像头手势识别擦玻璃雾气水雾效果代码
代码语言:html
所属分类:其他
代码描述:mediapipe实现摄像头手势识别擦玻璃雾气水雾效果代码
代码标签: mediapipe 摄像头 手势 识别 擦玻璃 雾气 水雾
下面为部分代码预览,完整代码请点击下载或在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>✋ 手势擦玻璃 - MediaPipe</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
min-height: 100vh;
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-family: 'Microsoft YaHei', sans-serif;
overflow: hidden;
padding: 20px;
}
.title {
color: #fff;
font-size: clamp(20px, 5vw, 32px);
margin-bottom: 20px;
text-shadow: 0 0 30px rgba(0, 200, 255, 0.5);
text-align: center;
}
.container {
position: relative;
border-radius: 20px;
overflow: hidden;
box-shadow:
0 25px 80px rgba(0, 0, 0, 0.5),
0 0 40px rgba(0, 200, 255, 0.2),
inset 0 0 100px rgba(255, 255, 255, 0.05);
border: 2px solid rgba(255, 255, 255, 0.1);
}
video {
display: none;
}
canvas {
display: block;
max-width: 100%;
height: auto;
}
#fogCanvas {
position: absolute;
top: 0;
left: 0;
pointer-events: none;
}
#effectCanvas {
position: absolute;
top: 0;
left: 0;
pointer-events: none;
}
.controls {
position: absolute;
top: 15px;
right: 15px;
display: flex;
gap: 10px;
z-index: 100;
}
.btn {
padding: 10px 20px;
background: rgba(255, 255, 255, 0.15);
border: 1px solid rgba(255, 255, 255, 0.3);
border-radius: 25px;
color: #fff;
font-size: 14px;
cursor: pointer;
backdrop-filter: blur(10px);
transition: all 0.3s ease;
}
.btn:hover {
background: rgba(0, 200, 255, 0.4);
border-color: #00c8ff;
box-shadow: 0 0 25px rgba(0, 200, 255, 0.5);
transform: scale(1.05);
}
.progress-container {
position: absolute;
bottom: 15px;
left: 50%;
transform: translateX(-50%);
background: rgba(0, 0, 0, 0.6);
padding: 12px 25px;
border-radius: 30px;
display: flex;
align-items: center;
gap: 12px;
backdrop-filter: blur(10px);
border: 1p.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0