js+css布局实现立体质感设备带音效按钮键盘代码

代码语言:html

所属分类:布局界面

代码描述:js+css布局实现立体质感设备带音效按钮键盘代码

代码标签: js css 布局实 立体 质感 设备 音效 按钮 键盘 代码

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

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  
  
  
  
<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background: radial-gradient(ellipse at center, #0f0f0f 0%, #000000 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
  perspective: 800px;
}

.scene-container {
  position: relative;
  transform-style: preserve-3d;
  animation: subtle-float 8s ease-in-out infinite;
}

@keyframes subtle-float {
  0%, 100% { transform: translateY(0) rotateX(-30deg) rotateY(35deg) rotateZ(0deg); }
  50% { transform: translateY(-15px) rotateX(-30deg) rotateY(35deg) rotateZ(0deg); }
}

.keyboard-base {
  width: 400px;
  height: 180px;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-30deg) rotateY(35deg) rotateZ(0deg);
}

/* Device edges for 3D depth */
.device-edge {
  position: absolute;
  background: linear-gradient(to bottom, #1a1a1a, #0a0a0a);
}

.edge-front {
  width: 100%;
  height: 30px;
  bottom: -30px;
  transform: rotateX(-90deg);
  transform-origin: top;
  background: linear-gradient(to bottom, #2a2a2a, #0a0a0a);
}

.edge-back {
  width: 100%;
  height: 30px;
  top: -30px;
  transform: rotateX(90deg);
  transform-origin: bottom;
}

.edge-left {
  width: 30px;
  height: 180px;
  left: -30px;
  transform: rotateY(-90deg);
  transform-origin: right;
}

.edge-right {
  width: 30px;
  height: 180px;
  right: -30px;
  transform: rotateY(90deg);
  transform-origin: left;
}

.keyboard-body {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
    #3a3a3a 0%, 
    #4a4a4a 25%, 
    #3a3a3a 50%, 
    #5a5a5a 75%, 
    #3a3a3a 100%);
  border-radius: 15px;
  position: relative;
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.9),
    0 15px 30px rgba(0, 0, 0, 0.7),
    inset 0 2px 0 rgba(255, 255, 255, 0.15),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4),
    0 0 100px rgba(0, 200, 255, 0.1);
  transform-style: preserve-3d;
  transform: translateZ(15px);
}

/* Surface texture for brushed aluminum effect */
.surface-texture {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 1px,
      rgba(255, 255, 255, 0.03) 1px,
      rgba(255, 255, 255, 0.03) 2px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 1px,
      rgba(255, 255, 255, 0.02) 1px,
      rgba(255, 255, 255, 0.02) 2px
    );
  border-radius: 15px;
  pointer-events: none;
  opacity: 0.8;
}

/* Volume knob assembly */
.knob-assembly {
  position: absolute;
  top: 25px;
  left: 30px;
  transform-style: preserve-3d;
  transform: translateZ(20px);
}

.knob-base {
  width: 45px;
  height: 45px;
  background: radial-gradient(circle, #2a2a2a, #1a1a1a);
  border-radius: 50%;
  position: absolute;
  box-shadow: 
    inset 0 2px 5px rgba(0, 0, 0, 0.8),
    0 1px 0 rgba(255, 255, 255, 0.1);
}

.volume-knob {
  width: 40px;
  height: 40px;
  position: relative;
  transform-style: preserve-3d;
  cursor: pointer;
  transform: translateZ(15px.........完整代码请登录后点击上方下载按钮下载查看

网友评论0