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>3D 逼真地球 - 距离计算器</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            background: #000;
            overflow: hidden;
            font-family: 'Segoe UI', Arial, sans-serif;
            color: #fff;
        }

        #canvas-container {
            width: 100vw;
            height: 100vh;
        }

        #info-panel {
            position: absolute;
            top: 20px;
            left: 20px;
            background: rgba(0, 10, 30, 0.85);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(100, 180, 255, 0.3);
            border-radius: 12px;
            padding: 20px;
            min-width: 320px;
            box-shadow: 0 0 30px rgba(0, 100, 255, 0.15);
        }

        #info-panel h2 {
            font-size: 18px;
            margin-bottom: 15px;
            color: #6ec6ff;
            text-shadow: 0 0 10px rgba(100, 180, 255, 0.5);
        }

        .point-info {
            margin-bottom: 10px;
            padding: 10px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            border-left: 3px solid #4a9eff;
        }

        .point-info.point-b {
            border-left-color: #ff6b6b;
        }

        .point-info label {
            font-size: 12px;
            color: #8ab4f8;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .point-info .coords {
            font-size: 14px;
            margin-top: 4px;
            color: #e0e0e0;
        }

        .point-info .location-name {
            font-size: 13px;
            color: #aaa;
            margin-top: 2px;
        }

        #distance-display {
            margin-top: 15px;
            padding: 15px;
            background: linear-gradient(135deg, rgba(74, 158, 255, 0.15), rgba(255, 107, 107, 0.15));
            border-radius: 10px;
            text-align: center;
            border: 1px solid rgba(100, 180, 255, 0.2);
        }

        #distance-display .label {
            font-size: 12px;
            color: #8ab4f8;
            text-transform: uppercase;
            letter-spacing: 2px;
        }

        #distance-display .value {
            font-size: 28px;
            font-weight: bold;
            color: #fff;
            margin-top: 5px;
            text-shadow: 0 0 20px rgba(100, 180, 255, 0.5);
        }

        #distance-display .sub-value {
            font-size: 13px;
            color: #aaa;
            margin-top: 3px;
        }

        #instructions {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 10, 30, 0.8);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(100, 180, 255, 0.2);
            border-radius: 10px;
            padding: 12px 24px;
            font-size: 13px;
            color: #8ab4f8;
            text-align: center;
        }

        #instructions span {
            color: #6ec6ff;
            font-weight: bold;
        }

        #clear-btn {
            margin-top: 12px;
            width: 100%;
            padding: 8px;
            background: rgba(255, 107, 107, 0.2);
            border: 1px solid rgba(255, 107, 107, 0.4);
            border-radius: 8px;
            color: #ff6b6b;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.3s;
        }

        #clear-btn:hover {
            background: rgba(255, 107, 107, 0.35);
        }

        .arc-line {
            position: absolute;
        }

        #loading {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 18px;
            color: #6ec6ff;
        }

        .spinner {
            width: 40px;
            height: 40px;
            border: 3px solid rgba(100, 180, 255, 0.2);
            border-top-color: #6ec6ff;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 15px;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }
    </style>
</head>.........完整代码请登录后点击上方下载按钮下载查看

网友评论0