Files
Pawer/refrence_html/nearby.html
2026-06-18 14:33:50 +08:00

653 lines
34 KiB
HTML

<!doctype html>
<html lang="zh-CN"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>附近 · 汪圈</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;450;510;600;700&amp;family=Space+Grotesk:wght@500;600;700&amp;display=swap" rel="stylesheet">
<style>
:root {
--bg: #14102b;
--surface: #1f1742;
--fg: #f0e9ff;
--fg-2: #c7b9e0;
--muted: #8a7aab;
--border: #2e234a;
--accent: #d8b4ff;
--accent-2: #ffb3c8;
--primary: #ffd9a8;
--primary-on: #2a1d10;
--success: #8fe5b5;
--map-bg: #0e0a22;
--map-road: rgba(240, 233, 255, 0.10);
--map-road-2: rgba(240, 233, 255, 0.05);
--map-block: rgba(240, 233, 255, 0.04);
--font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
--font-body: 'Inter', system-ui, -apple-system, 'PingFang SC', sans-serif;
--sheet-h: 220px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
background: radial-gradient(ellipse 70% 50% at 25% 0%, rgba(216, 180, 255, 0.10), transparent 60%), radial-gradient(ellipse 60% 50% at 75% 100%, rgba(255, 179, 200, 0.08), transparent 60%), #0a0719;
color: var(--fg);
font-family: var(--font-body);
-webkit-font-smoothing: antialiased;
display: grid; place-items: center;
overflow: auto;
}
.stage-wrap { padding: 24px; }
.phone {
width: 390px; height: 844px;
background: var(--map-bg);
border-radius: 50px;
position: relative; overflow: hidden;
box-shadow: 0 60px 120px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 0 0 2px rgba(255, 255, 255, 0.04);
}
.phone::before {
content: ''; position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
width: 110px; height: 32px; background: #000; border-radius: 9999px; z-index: 200;
}
.status-bar {
position: absolute; top: 0; left: 0; right: 0; z-index: 60;
height: 54px; display: flex; align-items: flex-end; justify-content: space-between;
padding: 0 32px 8px; font: 600 15px/1 var(--font-body);
}
.status-bar .right { display: flex; align-items: center; gap: 6px; }
.status-bar .ic-sig { display: flex; align-items: flex-end; gap: 2px; }
.status-bar .ic-sig span { width: 3px; background: var(--fg); border-radius: 1px; }
.status-bar .ic-sig span:nth-child(1) { height: 4px; } .status-bar .ic-sig span:nth-child(2) { height: 6px; } .status-bar .ic-sig span:nth-child(3) { height: 8px; } .status-bar .ic-sig span:nth-child(4) { height: 10px; }
.status-bar .ic-batt { width: 26px; height: 12px; border: 1.2px solid rgba(240, 233, 255, 0.6); border-radius: 3px; padding: 1.5px; }
.status-bar .ic-batt .fill { display: block; height: 100%; background: var(--fg); border-radius: 1px; width: 78%; }
/* WeChat mini program capsule - top-right of status bar */
.mp-capsule {
display: flex; align-items: center;
height: 28px; border-radius: 14px;
background: rgba(255, 255, 255, 0.06);
border: 1px solid rgba(255, 255, 255, 0.14);
overflow: hidden;
backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.mp-capsule .capsule-btn {
display: grid; place-items: center;
width: 32px; height: 28px;
background: transparent; border: 0; padding: 0; cursor: pointer; color: var(--fg);
}
.mp-capsule .capsule-btn + .capsule-btn { border-left: 1px solid rgba(255, 255, 255, 0.12); }
.mp-capsule svg { width: 14px; height: 14px; }
.map-area {
position: absolute; inset: 0;
background:
radial-gradient(circle at 20% 30%, rgba(45, 26, 90, 0.6), transparent 50%),
radial-gradient(circle at 80% 70%, rgba(40, 30, 80, 0.5), transparent 50%),
var(--map-bg);
overflow: hidden;
}
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pin {
position: absolute; transform: translate(-50%, -100%);
display: flex; flex-direction: column; align-items: center; gap: 2px;
cursor: pointer; transition: transform 240ms cubic-bezier(0.2, 0, 0, 1);
z-index: 5;
}
.pin .avatar {
width: 44px; height: 44px; border-radius: 50%;
border: 3px solid var(--bg);
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
position: relative;
}
.pin .avatar::after {
content: ''; position: absolute; inset: -6px; border-radius: 50%;
border: 1.5px solid var(--accent); opacity: 0.4;
}
.pin .label {
margin-top: 2px; padding: 2px 8px; border-radius: 999px;
background: rgba(20, 16, 43, 0.85); backdrop-filter: blur(6px);
color: var(--fg); font: 600 10px/1.4 var(--font-body);
border: 1px solid rgba(216, 180, 255, 0.15); white-space: nowrap;
}
.pin.active { z-index: 6; }
.pin.active .avatar { transform: scale(1.18); }
.pin.active .avatar::after { border-color: var(--accent); opacity: 0.9; box-shadow: 0 0 0 4px rgba(216, 180, 255, 0.18); }
.pin .distance {
position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%);
font: 500 9px/1 var(--font-body); color: var(--muted);
background: rgba(20, 16, 43, 0.7); padding: 2px 6px; border-radius: 6px; white-space: nowrap;
}
.pin.me { z-index: 7; }
.pin.me .avatar { width: 22px; height: 22px; background: var(--accent); border: 3px solid var(--bg); box-shadow: 0 0 0 4px rgba(216, 180, 255, 0.3); }
.pin.me .avatar::after { content: none; }
.pin.me .pulse {
position: absolute; inset: -10px; border-radius: 50%;
border: 1.5px solid var(--accent); opacity: 0.6;
animation: pulse 2400ms ease-out infinite;
}
@keyframes pulse {
0% { transform: scale(0.6); opacity: 0.7; }
100% { transform: scale(2.2); opacity: 0; }
}
.top-nav {
position: absolute; top: 54px; left: 0; right: 0; z-index: 50;
padding: 10px 16px 0;
display: flex; align-items: center; gap: 8px;
}
.loc-pill {
flex: 1; display: flex; align-items: center; gap: 6px;
padding: 10px 12px; border-radius: 14px;
background: rgba(20, 16, 43, 0.78);
backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
border: 1px solid rgba(216, 180, 255, 0.10);
font: 600 13px/1 var(--font-body); color: var(--fg);
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
cursor: pointer;
}
.loc-pill svg { width: 14px; height: 14px; color: var(--accent); }
.loc-pill .caret { margin-left: auto; color: var(--muted); }
.icon-btn {
width: 40px; height: 40px; border-radius: 14px;
background: rgba(20, 16, 43, 0.78);
backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
display: grid; place-items: center; cursor: pointer;
border: 1px solid rgba(216, 180, 255, 0.10);
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
.icon-btn svg { width: 18px; height: 18px; color: var(--fg); }
.map-controls {
position: absolute; right: 12px; bottom: calc(var(--sheet-h) + 20px);
z-index: 30;
display: flex; flex-direction: column; gap: 8px;
transition: bottom 280ms cubic-bezier(0.2, 0, 0, 1);
}
.ctrl {
width: 44px; height: 44px; border-radius: 14px;
background: rgba(20, 16, 43, 0.85);
backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
display: grid; place-items: center; cursor: pointer;
border: 1px solid rgba(216, 180, 255, 0.10);
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.ctrl svg { width: 18px; height: 18px; color: var(--fg); }
.search-area {
position: absolute; left: 50%; top: calc(100% - var(--sheet-h) - 70px);
transform: translate(-50%, 0);
z-index: 30;
display: flex; align-items: center; gap: 6px;
padding: 8px 14px; border-radius: 999px;
background: var(--fg); color: var(--primary-on);
font: 600 12px/1 var(--font-body);
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
border: 0; cursor: pointer;
transition: top 280ms cubic-bezier(0.2, 0, 0, 1), transform 180ms;
}
.search-area svg { width: 12px; height: 12px; }
.sheet {
position: absolute; left: 0; right: 0; bottom: 88px;
height: var(--sheet-h);
background: rgba(31, 23, 66, 0.92);
backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
border-top: 1px solid rgba(216, 180, 255, 0.12);
border-radius: 24px 24px 0 0;
box-shadow: 0 -20px 40px rgba(0, 0, 0, 0.3);
display: flex; flex-direction: column;
z-index: 40;
transition: height 280ms cubic-bezier(0.2, 0, 0, 1);
will-change: height;
touch-action: none;
overflow: hidden;
}
.sheet.min .sheet-header,
.sheet.min .sheet-chips,
.sheet.min .sheet-list { display: none; }
.sheet.min .sheet-handle { padding: 16px 0 14px; }
.sheet.min .sheet-handle .bar { width: 48px; height: 5px; background: rgba(216, 180, 255, 0.5); }
.sheet-handle {
padding: 10px 0 6px;
display: flex; justify-content: center; align-items: center;
cursor: grab; flex-shrink: 0;
}
.sheet-handle:active { cursor: grabbing; }
.sheet-handle .bar { width: 40px; height: 4px; border-radius: 2px; background: rgba(216, 180, 255, 0.3); transition: background 200ms, width 200ms; }
.sheet-handle:hover .bar { background: rgba(216, 180, 255, 0.55); width: 46px; }
.sheet-header { padding: 0 20px 8px; flex-shrink: 0; }
.sheet-header h2 { font: 700 20px/1.2 var(--font-display); letter-spacing: -0.01em; }
.sheet-header .count { font: 500 12px/1.4 var(--font-body); color: var(--muted); margin-top: 2px; }
.chip {
flex-shrink: 0; padding: 6px 10px; border-radius: 999px;
background: rgba(45, 34, 85, 0.4); border: 1px solid rgba(216, 180, 255, 0.08);
color: var(--fg-2); font: 500 11px/1 var(--font-body);
cursor: pointer; transition: all 200ms;
}
.chip.act { background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%); color: var(--primary-on); border-color: transparent; }
.sheet-chips { display: flex; gap: 6px; padding: 0 20px 10px; overflow-x: auto; flex-shrink: 0; }
.sheet-chips::-webkit-scrollbar { display: none; }
.sheet-list { flex: 1; overflow-y: auto; padding: 0 16px 16px; }
.sheet-list::-webkit-scrollbar { display: none; }
.card {
display: flex; gap: 12px; padding: 10px;
background: rgba(45, 34, 85, 0.4);
border-radius: 16px; border: 1px solid rgba(216, 180, 255, 0.06);
margin-bottom: 8px; cursor: pointer;
transition: background 200ms, border-color 200ms;
}
.card:hover { background: rgba(45, 34, 85, 0.6); }
.card.active { background: rgba(216, 180, 255, 0.12); border-color: var(--accent); }
.card .photo {
flex-shrink: 0; width: 72px; height: 72px; border-radius: 12px;
position: relative; overflow: hidden;
}
.card:nth-child(1) .photo { background: radial-gradient(circle at 50% 30%, rgba(255, 217, 168, 0.5) 0%, transparent 50%), linear-gradient(160deg, #6b4f9a 0%, #2a1f4a 100%); }
.card:nth-child(2) .photo { background: radial-gradient(circle at 50% 30%, rgba(143, 229, 181, 0.5) 0%, transparent 50%), linear-gradient(160deg, #4a7a6a 0%, #1a3a2a 100%); }
.card:nth-child(3) .photo { background: radial-gradient(circle at 50% 30%, rgba(255, 179, 200, 0.5) 0%, transparent 50%), linear-gradient(160deg, #7a4a6a 0%, #3a1a2a 100%); }
.card:nth-child(4) .photo { background: radial-gradient(circle at 50% 30%, rgba(216, 180, 255, 0.5) 0%, transparent 50%), linear-gradient(160deg, #4a4a8a 0%, #1a1a3a 100%); }
.card:nth-child(5) .photo { background: radial-gradient(circle at 50% 30%, rgba(255, 209, 102, 0.5) 0%, transparent 50%), linear-gradient(160deg, #7a6a4a 0%, #3a2a1a 100%); }
.card .photo::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 35%, rgba(255, 255, 255, 0.18) 0%, transparent 60%); }
.card .photo .pin-distance {
position: absolute; left: 6px; bottom: 6px; padding: 2px 6px; border-radius: 6px;
background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px);
color: var(--fg); font: 600 9px/1.2 var(--font-body);
}
.card .col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.card .row1 { display: flex; align-items: center; gap: 6px; }
.card .nm { font: 700 14px/1.2 var(--font-body); }
.card .age { font: 500 12px/1 var(--font-body); color: var(--muted); }
.card .online-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 4px var(--success); }
.card .meta { font: 400 11px/1.3 var(--font-body); color: var(--fg-2); }
.card .meta .dot { display: inline-block; margin: 0 6px; color: var(--muted); }
.card .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.card .tag { padding: 2px 8px; border-radius: 999px; background: rgba(255, 217, 168, 0.14); color: var(--primary); font: 500 9px/1.4 var(--font-body); border: 1px solid rgba(255, 217, 168, 0.18); }
.card .tag.green { background: rgba(143, 229, 181, 0.12); color: var(--success); border-color: rgba(143, 229, 181, 0.2); }
.card .tag.pink { background: rgba(255, 179, 200, 0.14); color: var(--accent-2); border-color: rgba(255, 179, 200, 0.2); }
.card .actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.card .act-btn {
width: 36px; height: 36px; border-radius: 50%;
background: rgba(45, 34, 85, 0.5); border: 1px solid rgba(216, 180, 255, 0.1);
display: grid; place-items: center; cursor: pointer;
}
.card .act-btn svg { width: 16px; height: 16px; color: var(--fg-2); }
.card .act-btn.like { background: linear-gradient(135deg, var(--accent-2) 0%, #ff8aab 100%); border: 0; box-shadow: 0 6px 16px rgba(255, 138, 171, 0.35); }
.card .act-btn.like svg { color: white; }
.tabbar {
position: absolute; left: 0; right: 0; bottom: 0;
height: 88px; padding-bottom: 22px;
background: rgba(20, 16, 43, 0.85);
backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
border-top: 1px solid rgba(216, 180, 255, 0.06);
display: flex; align-items: center; justify-content: space-around;
z-index: 60;
}
.tab-item {
display: flex; flex-direction: column; align-items: center; gap: 4px;
padding: 6px 8px; cursor: pointer; flex: 1;
color: var(--muted); transition: color 200ms;
text-decoration: none;
}
.tab-item.act { color: var(--accent); }
.tab-item svg { width: 24px; height: 24px; }
.tab-item .label { font: 500 10px/1 var(--font-body); letter-spacing: 0.02em; }
.tab-fab { position: relative; flex: 0 0 auto; margin: 0 4px; }
.tab-fab .b {
width: 52px; height: 52px; border-radius: 16px;
background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
display: grid; place-items: center;
box-shadow: 0 10px 24px rgba(216, 180, 255, 0.3);
margin-top: -16px;
transition: transform 200ms;
}
.tab-fab:hover .b { transform: scale(1.05); }
.tab-fab svg { width: 24px; height: 24px; color: var(--primary-on); }
.home-indicator {
position: absolute; left: 50%; bottom: 8px;
transform: translateX(-50%);
width: 134px; height: 5px; background: var(--fg); border-radius: 3px;
opacity: 0.7; z-index: 70;
}
.match-toast {
position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0);
width: 90px; height: 90px; pointer-events: none; z-index: 100;
display: grid; place-items: center;
transition: transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.match-toast.show { transform: translate(-50%, -50%) scale(1); }
.match-toast svg { width: 90px; height: 90px; color: var(--accent-2); filter: drop-shadow(0 4px 20px rgba(255, 138, 171, 0.6)); }
</style>
</head>
<body>
<div class="stage-wrap">
<div class="phone">
<div class="status-bar">
<span>9:41</span>
<div class="mp-capsule" aria-label="小程序菜单">
<button class="capsule-btn" aria-label="更多">
<svg viewBox="0 0 24 24" fill="currentColor">
<circle cx="6" cy="12" r="1.6"></circle>
<circle cx="12" cy="12" r="1.6"></circle>
<circle cx="18" cy="12" r="1.6"></circle>
</svg>
</button>
<button class="capsule-btn" aria-label="关闭">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
</div>
</div>
<div class="map-area" id="mapArea">
<svg class="map-svg" viewBox="0 0 390 716" preserveAspectRatio="xMidYMid slice" aria-hidden="true">
<defs>
<linearGradient id="parkGrad" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="rgba(143, 229, 181, 0.10)"></stop>
<stop offset="100%" stop-color="rgba(143, 229, 181, 0.04)"></stop>
</linearGradient>
<linearGradient id="waterGrad" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="rgba(189, 244, 255, 0.10)"></stop>
<stop offset="100%" stop-color="rgba(189, 244, 255, 0.04)"></stop>
</linearGradient>
</defs>
<path d="M0,80 Q60,40 130,60 Q170,90 160,150 Q120,180 60,170 Q0,150 0,80Z" fill="url(#parkGrad)"></path>
<circle cx="80" cy="110" r="22" fill="rgba(143, 229, 181, 0.06)"></circle>
<circle cx="110" cy="135" r="14" fill="rgba(143, 229, 181, 0.05)"></circle>
<path d="M260,500 Q340,490 390,520 L390,600 Q330,610 270,580 Z" fill="url(#waterGrad)"></path>
<line x1="0" y1="220" x2="390" y2="220" stroke="var(--map-road)" stroke-width="2"></line>
<line x1="0" y1="380" x2="390" y2="380" stroke="var(--map-road)" stroke-width="1.5"></line>
<line x1="0" y1="500" x2="390" y2="500" stroke="var(--map-road-2)" stroke-width="1.5"></line>
<line x1="0" y1="280" x2="390" y2="280" stroke="var(--map-road-2)" stroke-width="1"></line>
<line x1="80" y1="0" x2="80" y2="716" stroke="var(--map-road)" stroke-width="1.5"></line>
<line x1="200" y1="0" x2="200" y2="716" stroke="var(--map-road)" stroke-width="2"></line>
<line x1="320" y1="0" x2="320" y2="716" stroke="var(--map-road-2)" stroke-width="1.5"></line>
<line x1="140" y1="0" x2="140" y2="716" stroke="var(--map-road-2)" stroke-width="1"></line>
<line x1="0" y1="0" x2="220" y2="180" stroke="var(--map-road-2)" stroke-width="1"></line>
<line x1="200" y1="280" x2="390" y2="500" stroke="var(--map-road-2)" stroke-width="1"></line>
<g fill="var(--map-block)" stroke="rgba(240, 233, 255, 0.05)" stroke-width="0.5">
<rect x="10" y="200" width="60" height="14" rx="2"></rect>
<rect x="10" y="232" width="50" height="14" rx="2"></rect>
<rect x="90" y="232" width="80" height="14" rx="2"></rect>
<rect x="210" y="232" width="60" height="14" rx="2"></rect>
<rect x="10" y="290" width="60" height="20" rx="2"></rect>
<rect x="90" y="290" width="100" height="20" rx="2"></rect>
<rect x="210" y="290" width="40" height="20" rx="2"></rect>
<rect x="10" y="340" width="40" height="32" rx="2"></rect>
<rect x="60" y="340" width="110" height="32" rx="2"></rect>
<rect x="210" y="340" width="80" height="32" rx="2"></rect>
<rect x="10" y="390" width="100" height="20" rx="2"></rect>
<rect x="120" y="390" width="70" height="20" rx="2"></rect>
<rect x="210" y="390" width="60" height="20" rx="2"></rect>
<rect x="280" y="390" width="100" height="20" rx="2"></rect>
<rect x="10" y="420" width="60" height="40" rx="2"></rect>
<rect x="80" y="420" width="100" height="40" rx="2"></rect>
<rect x="210" y="420" width="50" height="40" rx="2"></rect>
<rect x="280" y="420" width="100" height="40" rx="2"></rect>
<rect x="10" y="510" width="60" height="40" rx="2"></rect>
<rect x="80" y="510" width="50" height="40" rx="2"></rect>
<rect x="210" y="510" width="60" height="40" rx="2"></rect>
</g>
</svg>
<div class="pin me" style="left: 48%; top: 44%;">
<div class="avatar"><div class="pulse"></div></div>
</div>
<div class="pin active" data-id="p1" style="left: 22%; top: 32%;">
<div class="avatar" style="background: linear-gradient(135deg, #ffd9a8, #ffb3c8);"></div>
<div class="label">麻薯</div>
<div class="distance">1.2 km</div>
</div>
<div class="pin" data-id="p2" style="left: 68%; top: 22%;">
<div class="avatar" style="background: linear-gradient(135deg, #8fe5b5, #d8b4ff);"></div>
<div class="label">乐乐</div>
<div class="distance">1.8 km</div>
</div>
<div class="pin" data-id="p3" style="left: 75%; top: 48%;">
<div class="avatar" style="background: linear-gradient(135deg, #bdf4ff, #d8b4ff);"></div>
<div class="label">Lucky</div>
<div class="distance">2.4 km</div>
</div>
<div class="pin" data-id="p4" style="left: 30%; top: 60%;">
<div class="avatar" style="background: linear-gradient(135deg, #ffb3c8, #c084fc);"></div>
<div class="label">年糕</div>
<div class="distance">2.1 km</div>
</div>
<div class="pin" data-id="p5" style="left: 60%; top: 68%;">
<div class="avatar" style="background: linear-gradient(135deg, #ffd166, #ffb3c8);"></div>
<div class="label">豆豆</div>
<div class="distance">2.7 km</div>
</div>
<div class="top-nav">
<button class="icon-btn" aria-label="筛选">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"></polygon></svg>
</button>
<div class="loc-pill">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3"></circle></svg>
<span>3 km 内 · 浦东</span>
<svg class="caret" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>
</div>
</div>
<button class="search-area" aria-label="搜索此区域">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"></polyline><polyline points="1 20 1 14 7 14"></polyline><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path></svg>
搜索此区域
</button>
<div class="map-controls">
<button class="ctrl" aria-label="放大">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>
</button>
<button class="ctrl" aria-label="缩小">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="5" y1="12" x2="19" y2="12"></line></svg>
</button>
<button class="ctrl" aria-label="定位到我的位置">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"></circle><path d="M12 2v3M12 19v3M2 12h3M19 12h3"></path></svg>
</button>
</div>
</div>
<div class="sheet" id="sheet">
<div class="sheet-handle" id="handle">
<div class="bar"></div>
</div>
<div class="sheet-header">
<h2>附近的毛孩子</h2>
<div class="count">3 km 内 · 5 个 · 在线 3</div>
</div>
<div class="sheet-chips" id="sheetChips">
<div class="chip act">全部</div>
<div class="chip">🐕 狗狗</div>
<div class="chip">🐈 猫咪</div>
<div class="chip">仅在线</div>
</div>
<div class="sheet-list" id="sheetList">
<div class="card active" data-id="p1">
<div class="photo"><span class="pin-distance">1.2 km</span></div>
<div class="col">
<div class="row1">
<div class="nm">麻薯</div>
<div class="age">2 岁</div>
<div class="online-dot" style="margin-left: auto;"></div>
</div>
<div class="meta">金毛 · ♀<span class="dot">·</span>喜欢在江边慢跑</div>
<div class="tags">
<div class="tag">🌿 慢跑</div>
<div class="tag green">已认证</div>
</div>
</div>
<div class="actions">
<button class="act-btn like" aria-label="喜欢"><svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg></button>
</div>
</div>
<div class="card" data-id="p2">
<div class="photo"><span class="pin-distance">1.8 km</span></div>
<div class="col">
<div class="row1">
<div class="nm">乐乐</div>
<div class="age">1 岁</div>
<div class="online-dot" style="margin-left: auto;"></div>
</div>
<div class="meta">布偶 · ♂<span class="dot">·</span>安静、怕生</div>
<div class="tags">
<div class="tag pink">🐈 室内</div>
<div class="tag green">已认证</div>
</div>
</div>
<div class="actions">
<button class="act-btn like" aria-label="喜欢"><svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg></button>
</div>
</div>
<div class="card" data-id="p3">
<div class="photo"><span class="pin-distance">2.4 km</span></div>
<div class="col">
<div class="row1">
<div class="nm">Lucky</div>
<div class="age">3 岁</div>
</div>
<div class="meta">柯基 · ♂<span class="dot">·</span>喜欢追球</div>
<div class="tags">
<div class="tag">🎾 飞盘</div>
<div class="tag green">已认证</div>
</div>
</div>
<div class="actions">
<button class="act-btn like" aria-label="喜欢"><svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg></button>
</div>
</div>
<div class="card" data-id="p4">
<div class="photo"><span class="pin-distance">2.1 km</span></div>
<div class="col">
<div class="row1">
<div class="nm">年糕</div>
<div class="age">1 岁</div>
<div class="online-dot" style="margin-left: auto;"></div>
</div>
<div class="meta">布偶 · ♀<span class="dot">·</span>安静、亲人</div>
<div class="tags">
<div class="tag pink">🐈 室内</div>
<div class="tag green">已认证</div>
</div>
</div>
<div class="actions">
<button class="act-btn like" aria-label="喜欢"><svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg></button>
</div>
</div>
<div class="card" data-id="p5">
<div class="photo"><span class="pin-distance">2.7 km</span></div>
<div class="col">
<div class="row1">
<div class="nm">豆豆</div>
<div class="age">4 岁</div>
</div>
<div class="meta">柴犬 · ♂<span class="dot">·</span>爱社交</div>
<div class="tags">
<div class="tag">☕ 咖啡馆友好</div>
<div class="tag green">已认证</div>
</div>
</div>
<div class="actions">
<button class="act-btn like" aria-label="喜欢"><svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg></button>
</div>
</div>
</div>
</div>
<div class="match-toast" id="matchToast"><svg viewBox="0 0 24 24" fill="currentColor"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg></div>
<nav class="tabbar" aria-label="底部导航">
<a class="tab-item" href="plaza.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><polygon points="16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"></polygon></svg><span class="label">广场</span></a>
<a class="tab-item act" href="nearby.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3"></circle></svg><span class="label">附近</span></a>
<a class="tab-fab" href="publish.html" aria-label="发布"><div class="b"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg></div></a>
<a class="tab-item" href="messages.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg><span class="label">消息</span></a>
<a class="tab-item" href="profile.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg><span class="label">我的</span></a>
</nav>
<div class="home-indicator"></div>
</div>
</div>
<script>
var sheet = document.getElementById('sheet');
var handle = document.getElementById('handle');
var MIN = 60, PEEK = 220, HALF = 420, FULL = 620;
var SNAPS = [MIN, PEEK, HALF, FULL];
var MIN_H = MIN, MAX_H = FULL;
var currentH = PEEK;
var dragging = false, startY = 0, startH = 0;
function setSheetHeight(h, animate) {
animate = animate !== false;
currentH = Math.max(MIN_H, Math.min(MAX_H, h));
sheet.style.transition = animate ? 'height 280ms cubic-bezier(0.2, 0, 0, 1)' : 'none';
sheet.style.setProperty('--sheet-h', currentH + 'px');
sheet.classList.toggle('min', currentH <= MIN + 8);
}
setSheetHeight(PEEK, false);
handle.addEventListener('pointerdown', function (e) {
dragging = true; startY = e.clientY; startH = currentH;
try { handle.setPointerCapture(e.pointerId); } catch (_) {}
sheet.style.transition = 'none';
});
handle.addEventListener('pointermove', function (e) {
if (!dragging) return;
setSheetHeight(startH + (startY - e.clientY), false);
});
handle.addEventListener('pointerup', function () {
if (!dragging) return;
dragging = false;
var nearest = SNAPS[0], dist = Infinity;
for (var i = 0; i < SNAPS.length; i++) {
var d = Math.abs(currentH - SNAPS[i]);
if (d < dist) { dist = d; nearest = SNAPS[i]; }
}
setSheetHeight(nearest, true);
});
handle.addEventListener('pointercancel', function () { dragging = false; setSheetHeight(PEEK, true); });
var sheetChips = document.getElementById('sheetChips');
sheetChips.addEventListener('click', function (e) {
var c = e.target.closest('.chip');
if (!c) return;
sheetChips.querySelectorAll('.chip').forEach(function (x) { x.classList.remove('act'); });
c.classList.add('act');
});
var cards = document.querySelectorAll('.card');
var pins = document.querySelectorAll('.pin[data-id]');
var toast = document.getElementById('matchToast');
function selectPet(id) {
cards.forEach(function (c) { c.classList.toggle('active', c.dataset.id === id); });
pins.forEach(function (p) { p.classList.toggle('active', p.dataset.id === id); });
if (currentH < HALF) setSheetHeight(HALF, true);
var card = document.querySelector('.card[data-id="' + id + '"]');
if (card && sheet.clientHeight > 200) {
card.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
}
}
cards.forEach(function (card) {
card.addEventListener('click', function (e) {
if (e.target.closest('.act-btn')) return;
selectPet(card.dataset.id);
});
});
pins.forEach(function (pin) {
pin.addEventListener('click', function () { selectPet(pin.dataset.id); });
});
document.querySelectorAll('.act-btn.like').forEach(function (btn) {
btn.addEventListener('click', function (e) {
e.stopPropagation();
toast.classList.add('show');
setTimeout(function () { toast.classList.remove('show'); }, 480);
});
});
var sa = document.querySelector('.search-area');
sa.addEventListener('click', function () {
sa.style.transform = 'translate(-50%, -2px) scale(0.97)';
setTimeout(function () { sa.style.transform = 'translate(-50%, 0)'; }, 180);
});
</script>
</body></html>