three实现三维太阳系行星运行轨迹动画演示代码

代码语言:html

所属分类:三维

代码描述:three实现三维太阳系行星运行轨迹动画演示代码

代码标签: three 三维 太阳系 行星 运行 轨迹 动画 演示 代码

下面为部分代码预览,完整代码请点击下载或在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>三维太阳系行星运行轨迹教学演示</title>
  <style>
    :root {
      --panel: rgba(7, 11, 22, 0.78);
      --line: rgba(120, 170, 255, 0.28);
      --accent: #69a8ff;
    }

    * {
      box-sizing: border-box;
    }

    html,
    body {
      width: 100%;
      height: 100%;
      margin: 0;
      overflow: hidden;
      background: #000;
      color: #eaf2ff;
      font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    }

    #app {
      position: fixed;
      inset: 0;
    }

    #labels {
      position: absolute;
      inset: 0;
      pointer-events: none;
      z-index: 2;
    }

    .label {
      color: #fff;
      font-size: 12px;
      text-shadow: 0 0 6px rgba(0, 0, 0, 0.95);
      pointer-events: none;
      user-select: none;
      white-space: nowrap;
      padding: 2px 6px;
      border-radius: 999px;
      background: rgba(0, 0, 0, 0.22);
      border: 1px solid rgba(255, 255, 255, 0.12);
    }

    .label-sun {
      color: #ffe08a;
      border-color: rgba(255, 220, 120, 0.35);
    }

    #ui {
      position: fixed;
      top: 14px;
      left: 14px;
      width: 310px;
      max-height: calc(100vh - 28px);
      overflow: auto;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 16px;
      padding: 14px;
      z-index: 10;
      backdrop-filter: blur(10px);
      box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    }

    #ui h1 {
      font-size: 18px;
      margin: 0 0 4px;
    }

    .sub {
      font-size: 12px;
      color: #9fb6dd;
      margin-bottom: 10px;
      line-height: 1.5;
    }

    .panel-section {
      border-top: 1px solid rgba(255, 255, 255, 0.08);
      padding-top: 10px;
      margin-top: 10px;
    }

    .row {
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 8px 0;
      flex-wrap: wrap;
    }

    button {
      border: 1px solid rgba(140, 180, 255, 0.35);
      background: rgba(70, 110, 190, 0.16);
      color: #eaf2ff;
      border-radius: 9px;
      padding: 6px 10px;
      cursor: pointer;
      font-size: 13px;
      transition: 0.18s;
    }

    button:hover {
      background: rgba(90, 140, 230, 0.3);
    }

    button.active {
      background: rgba(80, 150, 255, 0.42);
      border-color: rgba(140, 190, 255, 0.85);
    }

    .checkbox {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 13.........完整代码请登录后点击上方下载按钮下载查看

网友评论0