This commit is contained in:
oneao committed 2026-03-03 17:28:56 +08:00
1 parent 2efeb7cee2
commit c0531c1d0a
35 files changed
+1817 -984

No files matched your search

+105 -96
View File
@@ -1,121 +1,130 @@
<!DOCTYPE html>
<html lang="zh-CN">
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Space Card</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>加入其它空间 Demo</title>
<style>
* {
box-sizing: border-box;
body {
font-family: sans-serif;
background: #f5f6f8;
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body {
background: #f4f6f8;
padding: 40px;
}
.space-card {
width: 380px;
/* 页面列表项 */
.space-option {
padding: 16px;
background: #fff;
border-radius: 16px;
padding: 18px;
border: 1px solid #eee;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
transition: all 0.25s ease;
cursor: pointer;
}
.space-card:hover {
transform: translateY(-3px);
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08);
border-color: #ddd;
}
.space-card.selected {
border: 1px solid #111;
box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}
.space-header {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 12px;
}
.space-avatar {
width: 40px;
height: 40px;
margin: 16px;
border-radius: 12px;
background: linear-gradient(135deg, #667eea, #764ba2);
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-weight: 600;
font-size: 16px;
}
.space-name {
font-size: 16px;
font-weight: 600;
color: #111;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 200px;
}
.badge {
font-size: 11px;
padding: 3px 8px;
border-radius: 999px;
background: #f0f2f5;
color: #555;
}
.badge.primary {
background: #e8f0ff;
color: #3b6cff;
}
.space-info {
display: flex;
justify-content: space-between;
font-size: 13px;
color: #666;
align-items: center;
cursor: pointer;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.space-option:hover {
background: #f0f0f0;
}
/* modal 背景 */
.modal-backdrop {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.4);
display: none;
justify-content: center;
align-items: center;
}
/* modal 内容 */
.modal {
background: #fff;
border-radius: 16px;
padding: 24px;
width: 90%;
max-width: 400px;
}
.modal h2 {
margin: 0 0 16px 0;
font-size: 20px;
color: #333;
}
.modal input {
width: 100%;
padding: 12px;
margin-bottom: 16px;
border-radius: 8px;
border: 1px solid #ccc;
font-size: 16px;
}
.modal button {
width: 100%;
padding: 12px;
border-radius: 8px;
border: none;
background: #333;
color: #fff;
font-size: 16px;
cursor: pointer;
margin-bottom: 8px;
}
.modal .scan-button {
background: #f0f0f0;
color: #333;
}
</style>
</head>
<body>
<div class="space-card selected">
<div class="space-header">
<div class="space-avatar">工</div>
<!-- 加入其它空间选项 -->
<div class="space-option" id="joinSpaceBtn">
<span>加入其它空间</span>
<span>→</span>
</div>
<div>
<div style="display:flex; align-items:center; gap:6px;">
<div class="space-name">
我的超级长长长长长长工作空间
</div>
<span class="badge">创建者</span>
<span class="badge primary">默认</span>
</div>
</div>
</div>
<div class="space-info">
<div>昵称:张三</div>
<div>成员:8人</div>
<!-- Modal -->
<div class="modal-backdrop" id="modalBackdrop">
<div class="modal">
<h2>加入空间</h2>
<input type="text" placeholder="请输入邀请码" id="inviteInput" />
<button id="joinBtn">加入</button>
<button class="scan-button" id="scanBtn">扫码加入</button>
</div>
</div>
<script>
const joinBtnEl = document.getElementById('joinSpaceBtn');
const modalEl = document.getElementById('modalBackdrop');
joinBtnEl.addEventListener('click', () => {
modalEl.style.display = 'flex';
});
modalEl.addEventListener('click', (e) => {
if (e.target === modalEl) {
modalEl.style.display = 'none';
}
});
document.getElementById('joinBtn').addEventListener('click', () => {
const code = document.getElementById('inviteInput').value;
alert(`尝试加入空间:${code}`);
});
document.getElementById('scanBtn').addEventListener('click', () => {
alert('扫码功能触发(可接入扫码库)');
});
</script>
</body>
</html>