three+mediapipe摄像头手势控制宇宙星尘行星光环粒子动画效果代码

代码语言:html

所属分类:粒子

代码描述:three+mediapipe摄像头手势控制宇宙星尘行星光环粒子动画效果代码,手势:五指张开 放大+爆发 ✊ 握拳 恢复原状 ☝️ 伸食指 视角旋转 ✌️ 双指 平面翻转

代码标签: three mediapipe 摄像头 手势 控制 宇宙 星尘 行星 粒子 光环 动画

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

<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>粒子宇宙 - 手势控制行星系统</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            overflow: hidden;
            background: #000;
            font-family: 'Segoe UI', Arial, sans-serif;
        }
        
        #canvas-container {
            width: 100vw;
            height: 100vh;
            position: fixed;
            top: 0;
            left: 0;
        }
        
        #video-container {
            position: fixed;
            top: 20px;
            right: 20px;
            width: 280px;
            height: 210px;
            border: 2px solid rgba(0, 255, 255, 0.4);
            border-radius: 16px;
            overflow: hidden;
            z-index: 100;
            background: rgba(0, 0, 0, 0.6);
            box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
        }
        
        #video {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transform: scaleX(-1);
        }
        
        #hand-canvas {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            transform: scaleX(-1);
            pointer-events: none;
        }
        
        #status-panel {
            position: fixed;
            top: 20px;
            left: 20px;
            padding: 25px;
            background: linear-gradient(135deg, rgba(0,0,0,0.85), rgba(20,20,40,0.85));
            border: 1px solid rgba(0, 255, 255, 0.3);
            border-radius: 16px;
            color: white;
            z-index: 100;
            min-width: 260px;
            backdrop-filter: blur(10px);
            box-shadow: 0 0 40px rgba(0, 255, 255, 0.15);
        }
        
        .status-title {
            font-size: 22px;
            font-weight: bold;
            margin-bottom: 20px;
            background: linear-gradient(90deg, #00ffff, #ff00ff);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        .status-item {
            margin: 12px 0;
            font-size: 14px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .status-label {
            color: #888;
        }
        
        .status-value {
            color: #fff;
            font-weight: bold;
            font-family: 'Courier New', monospace;
        }
        
        #gesture-mode {
            padding: 6px 14px;
            border-radius: 20px;
            background: #333;
            display: inline-block;
            font-size: 13px;
            transition: all 0.3s ease;
        }
        
        #gesture-mode.scale-open { 
            background: linear-gradient(45deg, #ff6b6b, #feca57);
            box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
        }
        #gesture-mode.scale-fist { 
            background: linear-gradient(45deg, #a8e6cf, #88d8b0);
            box-shadow: 0 0 20px rgba(136, 216, 176, 0.5);
        }
        #gesture-mode.rotate { 
            background: linear-gradient(45deg, #48dbfb, #1dd1a1);
            box-shadow: 0 0 20px rgba(72, 219, 251, 0.5);
        }
        #gesture-mode.flip { 
            background: linear-gradient(45deg, #a55eea, #5f27cd);
            box-shadow: 0 0 20px rgba(165, 94, 234, 0.5);
        }
        #gesture-mode.idle { 
            background: linear-gradient(45deg, #333, #555);
        }
        
        #gesture-debug {
            margin-top: 15px;
            padding-top: 15px;
            border-top: 1px solid rgba(255,255,255,0.1);
            font-size: 12px;
            color: #666;
        }
        
        #instructions {
            position: fixed;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%);
            padding: 20px 40px;
            background: linear-gradient(135deg, rgba(0,0,0,0.85), rgba(20,20,40,0.85));
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 20px;
            color: white;
            z-index: 100;
            display: flex;
            gap: 30px;
            backdrop-filter: blur(10px);
        }
        
        .instruction-item {
            text-align: center;
            font-size: 13px;
            transition: transform 0.3s ease;
        }
        
        .instruction-item:hover {
            transform: scale(1.1);
        }
        
        .instruction-icon {
            font-size: 32px;
            display: block;
            margin-bottom: 8px;
            filter: drop-shadow(0 0 10px currentColor);
        }
        
        .instruction-item:nth-child(1) .instruction-icon { color: #ff6b6b; }
        .instruction-item:nth-child(2) .instruction-icon { color: #88d8b0; }
        .instruction-item:nth-child(3) .instruction-icon { color: #48dbfb; }
        .instruction-item:nth-child(4) .instruction-icon { color: #a55eea; }
        
        #loading {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: radial-gradient(ellipse at center, #0a0a20 0%, #000 100%);
            display: flex;
            flex-direction: column;
            justify-content: center;
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0