js+css实现沙漠中的虫子交互攻击目标代码

代码语言:html

所属分类:布局界面

代码描述:js+css实现沙漠中的虫子交互攻击目标代码,鼠标移动,虫子会有反应,点击设定攻击位置,蠕虫就会攻击。

代码标签: js css 沙漠 虫子 交互 攻击 目标 代码

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

<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
 <style>
     :root {
  --sand-gold: #d4b36a;
  --sand-glow: rgba(212, 179, 106, 0.35);
  --sign-red: #c04632;
  --sign-cream: #e8dcc0;
  --dusk-haze: rgba(236, 196, 146, 0.22);
}

body {
  margin: 0;
  background: #000;
  overflow: hidden;
  height: 100vh;
  font-family: 'Courier New', monospace;
}

.vhs-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  cursor: pointer;
  overflow: hidden;
  filter: contrast(1.08) brightness(1.02) saturate(1.06);
  background: #000;
}

.sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      #6f8aa2 0%,
      #96a2a6 18%,
      #bcb5a2 32%,
      #d8bf98 44%,
      #eac48e 54%,
      #f0c082 62%,
      #e8aa6e 72%,
      #d6925e 100%);
  z-index: 0;
}

.clouds {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(2deg, transparent 19%, rgba(255, 238, 214, 0.2) 19.6%, rgba(255, 238, 214, 0.2) 20.6%, transparent 21.2%) no-repeat,
    linear-gradient(-1.5deg, transparent 27%, rgba(255, 228, 198, 0.16) 27.5%, rgba(255, 228, 198, 0.16) 28.4%, transparent 29%) no-repeat,
    linear-gradient(1deg, transparent 14%, rgba(255, 242, 222, 0.12) 14.4%, rgba(255, 242, 222, 0.12) 15%, transparent 15.6%) no-repeat,
    linear-gradient(-2deg, transparent 34%, rgba(240, 222, 202, 0.12) 34.4%, rgba(240, 222, 202, 0.12) 35.2%, transparent 35.8%) no-repeat;
  filter: blur(2px);
}

.sun {
  position: absolute;
  top: 34%;
  left: 12%;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle,
      rgba(255, 250, 232, 0.95) 0%,
      rgba(255, 244, 212, 0.7) 18%,
      rgba(255, 230, 178, 0.38) 38%,
      rgba(255, 220, 165, 0.16) 58%,
      transparent 72%);
  box-shadow:
    0 0 60px 25px rgba(255, 222, 168, 0.22),
    0 0 140px 70px rgba(255, 210, 150, 0.1);
  filter: blur(2px);
  z-index: 1;
  pointer-events: none;
}

.sun::after {
  content: "";
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 238, 205, 0.1);
}

.mesa-row {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  pointer-events:.........完整代码请登录后点击上方下载按钮下载查看

网友评论0