js+css实现模拟火柴拖拽擦火点燃燃烧交互动画代码

代码语言:html

所属分类:动画

代码描述:js+css实现模拟火柴拖拽擦火点燃燃烧交互动画代码

代码标签: js css 模拟 火柴 拖拽 擦火 点燃 燃烧 交互 动画 代码

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

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

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

body {
  background-color: #0d0d0f;
  color: rgba(255, 255, 255, 0.4);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  touch-action: none; /* prevent scrolling */
}

/* Background glow when lit using pseudo-element for smooth transition */
body::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 50% 40%, #4a2511 0%, #0d0d0f 60%);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: -1;
  pointer-events: none;
}

body.lit::before {
  opacity: 1;
}

body.lit {
  color: rgba(255, 255, 255, 0.8);
}

#instruction {
  position: absolute;
  top: 15%;
  font-size: 1.2rem;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
  user-select: none;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

body.lit #instruction {
  opacity: 0;
}

.scene {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* The Match container */
.match {
  position: relative.........完整代码请登录后点击上方下载按钮下载查看

网友评论0