You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1351 lines
50 KiB
1351 lines
50 KiB
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
<title>青核 Youthome - 热榜首页</title>
|
|
<link rel="stylesheet" href="../colors_and_type.css">
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<style>
|
|
* {
|
|
-webkit-tap-highlight-color: transparent;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
:root {
|
|
/* Traework 设计令牌 - 圆角/间距/阴影/高度 */
|
|
--radius-xs: 4px;
|
|
--radius-sm: 8px;
|
|
--radius-md: 12px;
|
|
--radius-lg: 16px;
|
|
--radius-xl: 20px;
|
|
--radius-full: 9999px;
|
|
--height-btn: 44px;
|
|
--height-input: 44px;
|
|
--height-nav: 64px;
|
|
--space-1: 4px;
|
|
--space-2: 8px;
|
|
--space-3: 12px;
|
|
--space-4: 16px;
|
|
--space-5: 20px;
|
|
--space-6: 24px;
|
|
--shadow-card: 0 2px 12px rgba(0, 0, 0, 0.04);
|
|
--shadow-card-hover: 0 6px 20px rgba(0, 0, 0, 0.06);
|
|
--shadow-btn: 0 2px 8px rgba(38, 194, 187, 0.25);
|
|
--shadow-btn-hover: 0 4px 16px rgba(38, 194, 187, 0.35);
|
|
--shadow-modal: 0 16px 48px rgba(0, 0, 0, 0.12);
|
|
--shadow-float: 0 4px 24px rgba(0, 0, 0, 0.08);
|
|
--shadow-inset: inset 0 1px 3px rgba(0, 0, 0, 0.03);
|
|
--glass-bg: rgba(255, 255, 255, 0.72);
|
|
--glass-blur: blur(20px);
|
|
--glass-border: rgba(255, 255, 255, 0.3);
|
|
|
|
}
|
|
|
|
|
|
body {
|
|
font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
background: var(--youth-bg-page);
|
|
color: var(--youth-text-primary);
|
|
margin: 0;
|
|
padding: 0;
|
|
overflow: hidden;
|
|
overflow-x: hidden;}
|
|
|
|
/* 页面容器 - 固定812px高度 */
|
|
.app-container {
|
|
width: 375px;
|
|
height: 812px;
|
|
margin: 0 auto;
|
|
position: relative;
|
|
overflow: hidden;
|
|
background: var(--youth-bg-page);
|
|
}
|
|
|
|
/* 状态栏 */
|
|
.status-bar {
|
|
height: 24px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 0 16px;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
color: var(--youth-text-primary);
|
|
flex-shrink: 0;
|
|
z-index: 50;
|
|
position: relative;
|
|
}
|
|
|
|
.status-bar .right-icons {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 5px;
|
|
}
|
|
|
|
/* 顶部导航栏 */
|
|
.top-nav {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
padding: 4px 10px 6px;
|
|
background: var(--youth-bg-page);
|
|
position: relative;
|
|
z-index: 40;
|
|
}
|
|
|
|
.logo-icon {
|
|
width: 24px;
|
|
height: 24px;
|
|
border-radius: 7px;
|
|
background: var(--youth-gradient-primary);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
flex-shrink: 0;
|
|
box-shadow: 0 2px 6px rgba(38, 194, 187, 0.3);
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.logo-icon::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
height: 50%;
|
|
background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
|
|
pointer-events: none;
|
|
}
|
|
|
|
.logo-icon span {
|
|
font-size: 12px;
|
|
font-weight: 700;
|
|
color: white;
|
|
position: relative;
|
|
z-index: 1;
|
|
}
|
|
|
|
.app-title {
|
|
font-size: 15px;
|
|
font-weight: 700;
|
|
background: var(--youth-gradient-primary);
|
|
-webkit-background-clip: text;
|
|
-webkit-text-fill-color: transparent;
|
|
background-clip: text;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
/* 搜索框 */
|
|
.search-box {
|
|
flex: 1;
|
|
height: 28px;
|
|
background: var(--youth-input);
|
|
border-radius: 8px;
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 0 10px;
|
|
gap: 5px;
|
|
box-shadow: var(--youth-inset-input);
|
|
border: 1px solid var(--youth-border-light);
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.search-box:active {
|
|
transform: scale(0.98);
|
|
}
|
|
|
|
.search-box svg {
|
|
color: var(--youth-gray-400);
|
|
flex-shrink: 0;
|
|
width: 14px;
|
|
height: 14px;
|
|
}
|
|
|
|
.search-box span {
|
|
font-size: 12px;
|
|
color: var(--youth-gray-400);
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
/* 发布按钮 */
|
|
.btn-post {
|
|
width: 28px;
|
|
height: 28px;
|
|
border-radius: 50%;
|
|
background: var(--youth-gradient-primary);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
flex-shrink: 0;
|
|
box-shadow: 0 2px 8px rgba(38, 194, 187, 0.35);
|
|
position: relative;
|
|
overflow: hidden;
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
border: none;
|
|
padding: 0;
|
|
}
|
|
|
|
.btn-post::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
height: 50%;
|
|
background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
|
|
pointer-events: none;
|
|
}
|
|
|
|
.btn-post:active {
|
|
transform: scale(0.92);
|
|
}
|
|
|
|
.btn-post svg {
|
|
color: white;
|
|
position: relative;
|
|
z-index: 1;
|
|
width: 14px;
|
|
height: 14px;
|
|
}
|
|
|
|
/* Tab分类栏 */
|
|
.tab-bar {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 2px;
|
|
padding: 0 8px;
|
|
overflow-x: auto;
|
|
white-space: nowrap;
|
|
background: var(--youth-bg-page);
|
|
position: relative;
|
|
z-index: 30;
|
|
border-bottom: 1px solid var(--youth-border-light);
|
|
scrollbar-width: none;
|
|
-ms-overflow-style: none;
|
|
flex-shrink: 0;
|
|
height: 64px;
|
|
}
|
|
|
|
.tab-bar::-webkit-scrollbar {
|
|
display: none;
|
|
}
|
|
|
|
.tab-item {
|
|
position: relative;
|
|
padding: 6px 8px 4px;
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
color: var(--youth-muted-foreground);
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.tab-item.active {
|
|
color: var(--youth-primary);
|
|
font-weight: 600;
|
|
}
|
|
|
|
.tab-item.active::after {
|
|
content: '';
|
|
position: absolute;
|
|
bottom: 0;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
width: 18px;
|
|
height: 2.5px;
|
|
border-radius: 16px;
|
|
background: var(--youth-gradient-primary);
|
|
}
|
|
|
|
/* 信息流内容区 */
|
|
.feed-content {
|
|
flex: 1;
|
|
overflow: hidden;
|
|
padding: 8px 10px;
|
|
padding-bottom: 6px;
|
|
}
|
|
|
|
/* 动态卡片 */
|
|
.post-card {
|
|
background: var(--youth-bg-card);
|
|
border-radius: 12px;
|
|
padding: 8px 10px;
|
|
margin-bottom: 8px;
|
|
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
|
|
border: 1px solid var(--youth-border-light);
|
|
position: relative;
|
|
overflow: hidden;
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.post-card:active {
|
|
transform: scale(0.99);
|
|
}
|
|
|
|
/* 卡片顶部微高光 */
|
|
.post-card::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
height: 1px;
|
|
background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
|
|
pointer-events: none;
|
|
}
|
|
|
|
/* 卡片头部 */
|
|
.post-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
margin-bottom: 4px;
|
|
}
|
|
|
|
.avatar {
|
|
width: 28px;
|
|
height: 28px;
|
|
border-radius: 50%;
|
|
background: var(--youth-gradient-primary);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
flex-shrink: 0;
|
|
position: relative;
|
|
overflow: hidden;
|
|
box-shadow: 0 2px 4px rgba(38, 194, 187, 0.2);
|
|
}
|
|
|
|
.avatar.anonymous {
|
|
background: var(--youth-gray-200);
|
|
box-shadow: none;
|
|
}
|
|
|
|
.avatar span {
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
color: white;
|
|
}
|
|
|
|
.avatar.anonymous span {
|
|
color: var(--youth-gray-500);
|
|
}
|
|
|
|
.post-user-info {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.post-user-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
margin-bottom: 1px;
|
|
}
|
|
|
|
.post-nickname {
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
color: var(--youth-text-primary);
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.post-nickname.anonymous {
|
|
color: var(--youth-gray-500);
|
|
}
|
|
|
|
.verify-badge {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 2px;
|
|
padding: 1px 4px;
|
|
background: var(--youth-accent);
|
|
border-radius: 4px;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.verify-badge span {
|
|
font-size: 8px;
|
|
color: var(--youth-accent-foreground);
|
|
font-weight: 500;
|
|
}
|
|
|
|
.post-time {
|
|
font-size: 10px;
|
|
color: var(--youth-muted-foreground);
|
|
}
|
|
|
|
.btn-more {
|
|
width: 20px;
|
|
height: 20px;
|
|
border-radius: 50%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: var(--youth-gray-400);
|
|
cursor: pointer;
|
|
flex-shrink: 0;
|
|
transition: background 0.2s ease;
|
|
}
|
|
|
|
.btn-more:active {
|
|
background: var(--youth-secondary);
|
|
}
|
|
|
|
.btn-more svg {
|
|
width: 14px;
|
|
height: 14px;
|
|
}
|
|
|
|
/* 热榜徽章 - 降饱和度 */
|
|
.hot-badge {
|
|
position: absolute;
|
|
top: 8px;
|
|
right: 10px;
|
|
padding: 3px 6px;
|
|
background: linear-gradient(135deg, #FFB980 0%, #FF9F6B 100%);
|
|
border-radius: 6px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 3px;
|
|
box-shadow: 0 2px 6px rgba(255, 159, 107, 0.3);
|
|
z-index: 2;
|
|
}
|
|
|
|
.hot-badge svg {
|
|
width: 10px;
|
|
height: 10px;
|
|
}
|
|
|
|
.hot-badge span {
|
|
font-size: 10px;
|
|
font-weight: 600;
|
|
color: white;
|
|
}
|
|
|
|
/* 正文 */
|
|
.post-text {
|
|
font-size: 12px;
|
|
line-height: 1.4;
|
|
color: var(--youth-text-primary);
|
|
margin-bottom: 6px;
|
|
display: -webkit-box;
|
|
-webkit-line-clamp: 2;
|
|
-webkit-box-orient: vertical;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* 图片区域 */
|
|
.post-images {
|
|
margin-bottom: 6px;
|
|
border-radius: 8px;
|
|
overflow: hidden;
|
|
position: relative;
|
|
border: 1px solid var(--youth-border-light);
|
|
box-shadow: var(--youth-inset-soft);
|
|
}
|
|
|
|
.post-images.single {
|
|
height: 70px;
|
|
}
|
|
|
|
.post-images.grid-4 {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
grid-template-rows: 1fr 1fr;
|
|
gap: 2px;
|
|
height: 70px;
|
|
}
|
|
|
|
.post-image-item {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.post-image-item .emoji {
|
|
font-size: 28px;
|
|
position: relative;
|
|
z-index: 1;
|
|
}
|
|
|
|
.post-images.grid-4 .post-image-item .emoji {
|
|
font-size: 22px;
|
|
}
|
|
|
|
.img-grad-1 { background: linear-gradient(135deg, #A5E3E0 0%, #26C2BB 100%); }
|
|
.img-grad-2 { background: linear-gradient(135deg, #FFD4A5 0%, #FFB980 100%); }
|
|
.img-grad-3 { background: linear-gradient(135deg, #FFD4D4 0%, #E8A0A0 100%); }
|
|
.img-grad-4 { background: linear-gradient(135deg, #D4C8F0 0%, #A89BD6 100%); }
|
|
.img-grad-5 { background: linear-gradient(135deg, #C8E8C8 0%, #8CC89A 100%); }
|
|
.img-grad-6 { background: linear-gradient(135deg, #C8D8F0 0%, #8FAED8 100%); }
|
|
|
|
/* 话题标签 */
|
|
.post-tags {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 5px;
|
|
margin-bottom: 6px;
|
|
}
|
|
|
|
.post-tag {
|
|
font-size: 10px;
|
|
color: var(--youth-primary);
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
transition: opacity 0.2s ease;
|
|
}
|
|
|
|
.post-tag:active {
|
|
opacity: 0.7;
|
|
}
|
|
|
|
/* 互动栏 */
|
|
.post-actions {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-around;
|
|
padding-top: 6px;
|
|
border-top: 1px solid var(--youth-border-light);
|
|
}
|
|
|
|
.action-btn {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 2px;
|
|
padding: 3px 6px;
|
|
border-radius: 8px;
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
position: relative;
|
|
background: var(--youth-bg-card);
|
|
border: 1px solid var(--youth-border-light);
|
|
box-shadow: 0 1px 2px rgba(26, 32, 32, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.8);
|
|
}
|
|
|
|
.action-btn:active {
|
|
transform: scale(0.95);
|
|
box-shadow: var(--youth-inset-soft);
|
|
}
|
|
|
|
.action-btn svg {
|
|
width: 13px;
|
|
height: 13px;
|
|
stroke-width: 2;
|
|
fill: none;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.action-btn span {
|
|
font-size: 10px;
|
|
color: var(--youth-muted-foreground);
|
|
font-weight: 500;
|
|
min-width: 14px;
|
|
text-align: center;
|
|
}
|
|
|
|
.action-btn.like-btn svg {
|
|
color: var(--youth-gray-400);
|
|
stroke: currentColor;
|
|
}
|
|
|
|
.action-btn.like-btn.liked svg {
|
|
fill: #E8A0A0;
|
|
stroke: #E8A0A0;
|
|
color: #E8A0A0;
|
|
}
|
|
|
|
.action-btn.like-btn.liked span {
|
|
color: #E8A0A0;
|
|
}
|
|
|
|
.action-btn.comment-btn svg {
|
|
color: var(--youth-gray-400);
|
|
stroke: currentColor;
|
|
}
|
|
|
|
.action-btn.collect-btn svg {
|
|
color: var(--youth-gray-400);
|
|
stroke: currentColor;
|
|
}
|
|
|
|
.action-btn.collect-btn.collected svg {
|
|
fill: #FFB980;
|
|
stroke: #FFB980;
|
|
color: #FFB980;
|
|
}
|
|
|
|
.action-btn.collect-btn.collected span {
|
|
color: #FFB980;
|
|
}
|
|
|
|
.action-btn.gift-btn svg {
|
|
color: var(--youth-gray-400);
|
|
stroke: currentColor;
|
|
}
|
|
|
|
/* 点赞动画 */
|
|
@keyframes likePop {
|
|
0% { transform: scale(1); }
|
|
50% { transform: scale(1.3); }
|
|
100% { transform: scale(1); }
|
|
}
|
|
|
|
.like-btn.liked svg {
|
|
animation: likePop 0.3s ease;
|
|
}
|
|
|
|
@keyframes countUp {
|
|
0% { transform: translateY(0); }
|
|
50% { transform: translateY(-3px); opacity: 0; }
|
|
51% { transform: translateY(3px); opacity: 0; }
|
|
100% { transform: translateY(0); opacity: 1; }
|
|
}
|
|
|
|
.like-btn.liked .count-num {
|
|
animation: countUp 0.3s ease;
|
|
}
|
|
|
|
/* 浮动FAB - 缩小 */
|
|
.fab-btn {
|
|
position: absolute;
|
|
right: 12px;
|
|
bottom: 56px;
|
|
width: 40px;
|
|
height: 40px;
|
|
border-radius: 50%;
|
|
background: var(--youth-gradient-primary);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
box-shadow: 0 3px 12px rgba(38, 194, 187, 0.4);
|
|
cursor: pointer;
|
|
z-index: 35;
|
|
transition: all 0.2s ease;
|
|
border: none;
|
|
padding: 0;
|
|
}
|
|
|
|
.fab-btn::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
height: 50%;
|
|
background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%);
|
|
border-radius: 22px 22px 0 0;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.fab-btn:active {
|
|
transform: scale(0.92);
|
|
}
|
|
|
|
.fab-btn svg {
|
|
color: white;
|
|
position: relative;
|
|
z-index: 1;
|
|
width: 18px;
|
|
height: 18px;
|
|
}
|
|
|
|
/* 底部Tab导航 */
|
|
.bottom-nav {
|
|
position: absolute;
|
|
bottom: 0;
|
|
left: 0;
|
|
right: 0;
|
|
height: 64px;
|
|
background: var(--youth-glass-bg);
|
|
backdrop-filter: blur(20px);
|
|
-webkit-backdrop-filter: blur(20px);
|
|
border-top: 1px solid var(--youth-glass-border);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-around;
|
|
padding-top: 3px;
|
|
padding-bottom: 0;
|
|
z-index: 40;
|
|
}
|
|
|
|
.bottom-tab {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 1px;
|
|
padding: 3px 8px;
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
position: relative;
|
|
}
|
|
|
|
.bottom-tab:active {
|
|
transform: scale(0.95);
|
|
}
|
|
|
|
.bottom-tab svg {
|
|
width: 18px;
|
|
height: 18px;
|
|
stroke-width: 1.8;
|
|
fill: none;
|
|
stroke: var(--youth-gray-400);
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.bottom-tab.active svg {
|
|
stroke: var(--youth-primary);
|
|
fill: rgba(38, 194, 187, 0.1);
|
|
}
|
|
|
|
.bottom-tab span {
|
|
font-size: 9px;
|
|
color: var(--youth-gray-400);
|
|
font-weight: 500;
|
|
transition: color 0.2s ease;
|
|
}
|
|
|
|
.bottom-tab.active span {
|
|
color: var(--youth-primary);
|
|
font-weight: 600;
|
|
}
|
|
|
|
/* 礼物弹窗 */
|
|
.gift-modal-overlay {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: rgba(0, 0, 0, 0.45);
|
|
display: none;
|
|
align-items: flex-end;
|
|
justify-content: center;
|
|
z-index: 998;
|
|
opacity: 0;
|
|
transition: opacity 0.3s ease;
|
|
}
|
|
|
|
.gift-modal-overlay.show {
|
|
display: flex;
|
|
opacity: 1;
|
|
}
|
|
|
|
.gift-modal {
|
|
width: 375px;
|
|
background: var(--youth-bg-card);
|
|
border-radius: 20px 20px 0 0;
|
|
padding: 10px;
|
|
padding-bottom: 18px;
|
|
transform: translateY(100%);
|
|
transition: transform 0.3s ease;
|
|
z-index: 999;
|
|
box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
|
|
position: relative;
|
|
}
|
|
|
|
.gift-modal-overlay.show .gift-modal {
|
|
transform: translateY(0);
|
|
}
|
|
|
|
.gift-modal-title {
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
color: var(--youth-text-primary);
|
|
text-align: center;
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.gift-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(4, 1fr);
|
|
gap: 6px;
|
|
}
|
|
|
|
.gift-item {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 3px;
|
|
padding: 6px 3px;
|
|
border-radius: 8px;
|
|
background: var(--youth-secondary);
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
border: 1px solid transparent;
|
|
}
|
|
|
|
.gift-item:active {
|
|
transform: scale(0.95);
|
|
border-color: var(--youth-primary);
|
|
}
|
|
|
|
.gift-item .gift-emoji {
|
|
font-size: 20px;
|
|
}
|
|
|
|
.gift-item .gift-name {
|
|
font-size: 9px;
|
|
color: var(--youth-muted-foreground);
|
|
}
|
|
|
|
.gift-item .gift-price {
|
|
font-size: 8px;
|
|
color: var(--youth-primary);
|
|
font-weight: 600;
|
|
}
|
|
|
|
.gift-modal-close {
|
|
margin-top: 10px;
|
|
width: 100%;
|
|
height: 32px;
|
|
border-radius: 16px;
|
|
background: var(--youth-secondary);
|
|
color: var(--youth-text-primary);
|
|
border: 1px solid var(--youth-border-light);
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.gift-modal-close:active {
|
|
transform: scale(0.98);
|
|
}
|
|
|
|
/* 主内容滚动容器 */
|
|
.main-scroll {
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: calc(812px - 24px);
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* SVG 图标统一尺寸 */
|
|
.icon-svg {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 1em;
|
|
height: 1em;
|
|
vertical-align: middle;
|
|
line-height: 1;
|
|
}
|
|
.icon-svg svg {
|
|
width: 100%;
|
|
height: 100%;
|
|
stroke: currentColor;
|
|
}
|
|
/* 侧栏图标 */
|
|
.sidebar-icon .icon-svg { width: 22px; height: 22px; font-size: 22px; }
|
|
/* 社团logo图标 */
|
|
.club-logo .icon-svg { width: 28px; height: 28px; font-size: 28px; color: #fff; }
|
|
/* 头图大图标 */
|
|
.hero-icon .icon-svg { width: 56px; height: 56px; font-size: 56px; opacity: 0.3; }
|
|
/* meta 小图标 */
|
|
.club-meta .icon-svg { width: 12px; height: 12px; font-size: 12px; }
|
|
/* 分类选择网格图标 */
|
|
.cat-option .icon-svg { width: 26px; height: 26px; font-size: 26px; }
|
|
/* logo预览图标 */
|
|
.logo-preview .icon-svg { width: 40px; height: 40px; font-size: 40px; color: #fff; }
|
|
/* 提示图标 */
|
|
.notice-icon .icon-svg { width: 18px; height: 18px; font-size: 18px; }
|
|
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="app-container">
|
|
<!-- 状态栏 -->
|
|
<div class="status-bar">
|
|
<span>9:41</span>
|
|
<div class="right-icons">
|
|
<!-- 信号图标 -->
|
|
<svg width="15" height="10" viewBox="0 0 17 11" fill="currentColor">
|
|
<rect x="0" y="7" width="3" height="4" rx="0.5"></rect>
|
|
<rect x="4.5" y="5" width="3" height="6" rx="0.5"></rect>
|
|
<rect x="9" y="2.5" width="3" height="8.5" rx="0.5"></rect>
|
|
<rect x="13.5" y="0" width="3" height="11" rx="0.5"></rect>
|
|
</svg>
|
|
<!-- WiFi图标 -->
|
|
<svg width="13" height="10" viewBox="0 0 15 11" fill="currentColor">
|
|
<path d="M7.5 11C6.9 11 6.4 10.8 6 10.4C5.2 9.6 5 8.6 5.4 7.6C5.8 6.6 6.8 6 7.8 6C9 6 10 6.8 10.2 8C10.4 8.8 10 9.6 9.4 10.2C8.9 10.7 8.2 11 7.5 11ZM7.5 4.5C6 4.5 4.5 5 3.4 6.2C2.3 7.4 2 9 2.4 10.4C2.5 10.8 2.8 11 3.2 11C3.5 11 3.8 10.8 3.9 10.5C4.2 9.5 4.8 8.6 5.7 8C6.6 7.4 7.6 7.1 8.6 7.2C9.8 7.3 10.9 7.8 11.6 8.7C12.3 9.6 12.6 10.7 12.4 11.8L12.4 12C12.3 12.4 12.6 12.7 13 12.8C13.4 12.9 13.7 12.6 13.8 12.2C14.1 10.5 13.5 8.8 12.4 7.5C11.3 6.2 9.6 5.3 7.8 4.9L7.5 4.5Z"></path>
|
|
<path d="M7.5 1C5.3 1 3.2 1.7 1.5 3C-0.5 4.7 -0.5 7.5 1.5 9.2C1.9 9.6 2.5 9.6 2.9 9.2C3.3 8.8 3.3 8.2 2.9 7.8C1.6 6.5 1.6 4.4 2.9 3.1C4.2 1.8 6.3 1.4 8 2C10.1 2.7 11.7 4.4 12.2 6.5C12.5 7.3 12.4 8.1 11.8 8.7C11.4 9.1 11.4 9.7 11.8 10.1C12.2 10.5 12.8 10.5 13.2 10.1C14.2 9.1 14.5 7.7 14.2 6.3C13.6 4 12.1 2.3 10.2 1.3C9.3 1 8.4 0.9 7.5 1Z"></path>
|
|
</svg>
|
|
<!-- 电池图标 -->
|
|
<svg width="22" height="10" viewBox="0 0 25 12" fill="none">
|
|
<rect x="0.5" y="0.5" width="21" height="11" rx="2.5" stroke="currentColor" opacity="0.5"></rect>
|
|
<rect x="2" y="2" width="18" height="8" rx="1.5" fill="currentColor"></rect>
|
|
<rect x="22.5" y="4" width="1.5" height="4" rx="0.5" fill="currentColor" opacity="0.5"></rect>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="main-scroll">
|
|
<!-- 顶部导航栏 -->
|
|
<div class="top-nav">
|
|
<div class="logo-icon">
|
|
<span>青</span>
|
|
</div>
|
|
<div class="app-title">青核热榜</div>
|
|
<div class="search-box" data-dom-id="btn-search">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<circle cx="11" cy="11" r="8"></circle>
|
|
<path d="m21 21-4.3-4.3"></path>
|
|
</svg>
|
|
<span>搜索校园趣事</span>
|
|
</div>
|
|
<button class="btn-post" data-dom-id="btn-post-create" aria-label="发布">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M12 5v14"></path>
|
|
<path d="M5 12h14"></path>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Tab分类栏 -->
|
|
<div class="tab-bar">
|
|
<div class="tab-item active" data-dom-id="tab-recommend" data-tab="recommend">推荐</div>
|
|
<div class="tab-item" data-dom-id="tab-hot" data-tab="hot">热榜</div>
|
|
<div class="tab-item" data-dom-id="tab-campus" data-tab="campus">校园</div>
|
|
<div class="tab-item" data-dom-id="tab-topic" data-tab="topic">话题</div>
|
|
<div class="tab-item" data-dom-id="tab-follow" data-tab="follow">关注</div>
|
|
<div class="tab-item" data-dom-id="tab-city" data-tab="city">同城</div>
|
|
</div>
|
|
|
|
<!-- 信息流内容区 -->
|
|
<div class="feed-content">
|
|
<!-- 动态卡片1 - 热榜 -->
|
|
<div class="post-card" data-dom-id="card-post-1">
|
|
<div class="hot-badge">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z"></path>
|
|
</svg>
|
|
<span>热</span>
|
|
</div>
|
|
<div class="post-header">
|
|
<div class="avatar">
|
|
<span>林</span>
|
|
</div>
|
|
<div class="post-user-info">
|
|
<div class="post-user-row">
|
|
<span class="post-nickname">林小语</span>
|
|
<div class="verify-badge">
|
|
<svg width="9" height="9" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="color: var(--youth-primary);">
|
|
<path d="M20 6 9 17l-5-5"></path>
|
|
</svg>
|
|
<span>清大认证</span>
|
|
</div>
|
|
</div>
|
|
<div class="post-time">5分钟前 · 来自推荐</div>
|
|
</div>
|
|
<button class="btn-more" 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="1"></circle>
|
|
<circle cx="19" cy="12" r="1"></circle>
|
|
<circle cx="5" cy="12" r="1"></circle>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
<div class="post-text">
|
|
期末周图书馆抢座真的太卷了!早上六点半起床去图书馆门口排队,结果发现已经排了几十个人了...大家都这么拼的吗<span class="icon-svg icon-frown"><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><path d="M16 16s-1.5-2-4-2-4 2-4 2"></path><line x1="9" x2="9.01" y1="9" y2="9"></line><line x1="15" x2="15.01" y1="9" y2="9"></line></svg></span>
|
|
</div>
|
|
<div class="post-images single">
|
|
<div class="post-image-item img-grad-6" style="width: 100%; height: 100%;">
|
|
<span class="emoji"></span>
|
|
</div>
|
|
</div>
|
|
<div class="post-tags">
|
|
<span class="post-tag">#期末加油</span>
|
|
<span class="post-tag">#图书馆日常</span>
|
|
<span class="post-tag">#校园生活</span>
|
|
</div>
|
|
<div class="post-actions">
|
|
<button class="action-btn like-btn" data-dom-id="btn-like-1">
|
|
<svg viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"></path>
|
|
</svg>
|
|
<span class="count-num">328</span>
|
|
</button>
|
|
<button class="action-btn comment-btn" data-dom-id="btn-comment-1">
|
|
<svg viewBox="0 0 24 24" 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>56</span>
|
|
</button>
|
|
<button class="action-btn collect-btn" data-dom-id="btn-collect-1">
|
|
<svg viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"></path>
|
|
</svg>
|
|
<span>89</span>
|
|
</button>
|
|
<button class="action-btn gift-btn" data-dom-id="btn-gift-1">
|
|
<svg viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M20 12v10H4V12"></path>
|
|
<path d="M2 7h20v5H2z"></path>
|
|
<path d="M12 22V7"></path>
|
|
<path d="M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z"></path>
|
|
<path d="M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z"></path>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 动态卡片2 - 匿名+4图 -->
|
|
<div class="post-card" data-dom-id="card-post-2">
|
|
<div class="post-header">
|
|
<div class="avatar anonymous">
|
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="color: var(--youth-gray-500);">
|
|
<circle cx="12" cy="8" r="4"></circle>
|
|
<path d="M20 21a8 8 0 0 0-16 0"></path>
|
|
</svg>
|
|
</div>
|
|
<div class="post-user-info">
|
|
<div class="post-user-row">
|
|
<span class="post-nickname anonymous">匿名同学</span>
|
|
</div>
|
|
<div class="post-time">15分钟前 · 匿名发布</div>
|
|
</div>
|
|
<button class="btn-more" 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="1"></circle>
|
|
<circle cx="19" cy="12" r="1"></circle>
|
|
<circle cx="5" cy="12" r="1"></circle>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
<div class="post-text">
|
|
今天在食堂遇到一个超级温柔的学长!打饭的时候我不小心把汤洒了一点到他身上,他不但没生气还笑着说没关系 🥺
|
|
</div>
|
|
<div class="post-images grid-4">
|
|
<div class="post-image-item img-grad-1">
|
|
|
|
</div>
|
|
<div class="post-image-item img-grad-2">
|
|
|
|
</div>
|
|
<div class="post-image-item img-grad-3">
|
|
|
|
</div>
|
|
<div class="post-image-item img-grad-4">
|
|
<span class="emoji"></span>
|
|
</div>
|
|
</div>
|
|
<div class="post-tags">
|
|
<span class="post-tag">#校园日常</span>
|
|
<span class="post-tag">#心动瞬间</span>
|
|
<span class="post-tag">#寻人启事</span>
|
|
</div>
|
|
<div class="post-actions">
|
|
<button class="action-btn like-btn" data-dom-id="btn-like-2">
|
|
<svg viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"></path>
|
|
</svg>
|
|
<span class="count-num">512</span>
|
|
</button>
|
|
<button class="action-btn comment-btn" data-dom-id="btn-comment-2">
|
|
<svg viewBox="0 0 24 24" 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>128</span>
|
|
</button>
|
|
<button class="action-btn collect-btn" data-dom-id="btn-collect-2">
|
|
<svg viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"></path>
|
|
</svg>
|
|
<span>45</span>
|
|
</button>
|
|
<button class="action-btn gift-btn" data-dom-id="btn-gift-2">
|
|
<svg viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M20 12v10H4V12"></path>
|
|
<path d="M2 7h20v5H2z"></path>
|
|
<path d="M12 22V7"></path>
|
|
<path d="M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z"></path>
|
|
<path d="M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z"></path>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- 浮动FAB发布按钮 -->
|
|
<button class="fab-btn" data-dom-id="btn-post-fab" aria-label="发布">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M12 5v14"></path>
|
|
<path d="M5 12h14"></path>
|
|
</svg>
|
|
</button>
|
|
|
|
<!-- 底部Tab导航 -->
|
|
<div class="bottom-nav">
|
|
<div class="bottom-tab" data-dom-id="tab-home" data-bottom-tab="home">
|
|
<svg viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
|
|
<polyline points="9 22 9 12 15 12 15 22"></polyline>
|
|
</svg>
|
|
<span>首页</span>
|
|
</div>
|
|
<div class="bottom-tab" data-dom-id="tab-friends" data-bottom-tab="friends">
|
|
<svg viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
|
|
<circle cx="9" cy="7" r="4"></circle>
|
|
<path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
|
|
<path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
|
|
</svg>
|
|
<span>交友</span>
|
|
</div>
|
|
<div class="bottom-tab active" data-dom-id="tab-dynamic" data-bottom-tab="dynamic">
|
|
<svg viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"></path>
|
|
</svg>
|
|
<span>动态</span>
|
|
</div>
|
|
<div class="bottom-tab" data-dom-id="tab-message" data-bottom-tab="message">
|
|
<svg viewBox="0 0 24 24" 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>消息</span>
|
|
</div>
|
|
<div class="bottom-tab" data-dom-id="tab-profile" data-bottom-tab="profile">
|
|
<svg viewBox="0 0 24 24" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"></path>
|
|
<circle cx="12" cy="7" r="4"></circle>
|
|
</svg>
|
|
<span>我的</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 礼物弹窗 -->
|
|
<div class="gift-modal-overlay" id="giftModal">
|
|
<div class="gift-modal">
|
|
<div class="gift-modal-title">送个礼物吧 <span class="icon-svg icon-gift"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="8" width="18" height="4" rx="1"></rect><path d="M12 8v13"></path><path d="M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7"></path><path d="M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5"></path></svg></span></div>
|
|
<div class="gift-grid">
|
|
<div class="gift-item">
|
|
<span class="gift-emoji">🌹</span>
|
|
<span class="gift-name">玫瑰</span>
|
|
<span class="gift-price">9青豆</span>
|
|
</div>
|
|
<div class="gift-item">
|
|
<span class="gift-emoji">🍺</span>
|
|
<span class="gift-name">啤酒</span>
|
|
<span class="gift-price">19青豆</span>
|
|
</div>
|
|
<div class="gift-item">
|
|
<span class="gift-emoji">🍰</span>
|
|
<span class="gift-name">蛋糕</span>
|
|
<span class="gift-price">29青豆</span>
|
|
</div>
|
|
<div class="gift-item">
|
|
<span class="gift-emoji">💎</span>
|
|
<span class="gift-name">钻石</span>
|
|
<span class="gift-price">99青豆</span>
|
|
</div>
|
|
<div class="gift-item">
|
|
<span class="gift-emoji">🚀</span>
|
|
<span class="gift-name">火箭</span>
|
|
<span class="gift-price">199青豆</span>
|
|
</div>
|
|
<div class="gift-item">
|
|
<span class="gift-emoji"><span class="icon-svg icon-crown"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z"></path><path d="M5 21h14"></path></svg></span></span>
|
|
<span class="gift-name">皇冠</span>
|
|
<span class="gift-price">299青豆</span>
|
|
</div>
|
|
<div class="gift-item">
|
|
<span class="gift-emoji"><span class="icon-svg icon-party-popper"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5.8 11.3 2 22l10.7-3.8"></path><path d="M4 3h.01"></path><path d="M22 8h.01"></path><path d="M15 2h.01"></path><path d="M22 20h.01"></path><path d="m22 2-2.2.8-.8 2.2"></path><path d="m22 2-2.2.8-.8 2.2"></path><path d="M9 10.5 8 10l-3 1 1 3 .5-1 1.5 1 .5-1 1.5 1 .5-1 1-2Z"></path></svg></span></span>
|
|
<span class="gift-name">礼花</span>
|
|
<span class="gift-price">59青豆</span>
|
|
</div>
|
|
<div class="gift-item">
|
|
<span class="gift-emoji">💝</span>
|
|
<span class="gift-name">爱心</span>
|
|
<span class="gift-price">39青豆</span>
|
|
</div>
|
|
</div>
|
|
<button class="gift-modal-close" id="giftModalClose">关闭</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>// ===== 主题切换 =====
|
|
(function() {
|
|
const html = document.documentElement;
|
|
|
|
// 读取localStorage的主题设置
|
|
|
|
sunIcon.style.display = 'block';
|
|
moonIcon.style.display = 'none';
|
|
}
|
|
});
|
|
})();
|
|
|
|
// ===== Tab分类切换 =====
|
|
(function() {
|
|
const tabItems = document.querySelectorAll('.tab-item');
|
|
|
|
tabItems.forEach(function(tab) {
|
|
tab.addEventListener('click', function(e) {
|
|
e.stopPropagation();
|
|
tabItems.forEach(function(t) {
|
|
t.classList.remove('active');
|
|
});
|
|
this.classList.add('active');
|
|
|
|
// 滚动到可见区域
|
|
this.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'center' });
|
|
});
|
|
});
|
|
})();
|
|
|
|
// ===== 点赞功能 =====
|
|
(function() {
|
|
const likeBtns = document.querySelectorAll('.like-btn');
|
|
|
|
likeBtns.forEach(function(btn) {
|
|
btn.addEventListener('click', function(e) {
|
|
e.stopPropagation();
|
|
const isLiked = this.classList.toggle('liked');
|
|
const countEl = this.querySelector('.count-num');
|
|
let count = parseInt(countEl.textContent);
|
|
|
|
if (isLiked) {
|
|
countEl.textContent = count + 1;
|
|
// 重新触发动画
|
|
countEl.style.animation = 'none';
|
|
countEl.offsetHeight; // 触发重排
|
|
countEl.style.animation = '';
|
|
} else {
|
|
countEl.textContent = count - 1;
|
|
}
|
|
});
|
|
});
|
|
})();
|
|
|
|
// ===== 收藏功能 =====
|
|
(function() {
|
|
const collectBtns = document.querySelectorAll('.collect-btn');
|
|
|
|
collectBtns.forEach(function(btn) {
|
|
btn.addEventListener('click', function(e) {
|
|
e.stopPropagation();
|
|
this.classList.toggle('collected');
|
|
});
|
|
});
|
|
})();
|
|
|
|
// ===== 评论按钮 =====
|
|
(function() {
|
|
const commentBtns = document.querySelectorAll('.comment-btn');
|
|
|
|
commentBtns.forEach(function(btn) {
|
|
btn.addEventListener('click', function(e) {
|
|
e.stopPropagation();
|
|
console.log('进入评论详情页');
|
|
// 实际项目中跳转详情页
|
|
});
|
|
});
|
|
})();
|
|
|
|
// ===== 礼物按钮 - 弹窗 =====
|
|
(function() {
|
|
const giftBtns = document.querySelectorAll('.gift-btn');
|
|
const giftModal = document.getElementById('giftModal');
|
|
const giftModalClose = document.getElementById('giftModalClose');
|
|
|
|
giftBtns.forEach(function(btn) {
|
|
btn.addEventListener('click', function(e) {
|
|
e.stopPropagation();
|
|
giftModal.classList.add('show');
|
|
});
|
|
});
|
|
|
|
giftModalClose.addEventListener('click', function() {
|
|
giftModal.classList.remove('show');
|
|
});
|
|
|
|
giftModal.addEventListener('click', function(e) {
|
|
if (e.target === giftModal) {
|
|
giftModal.classList.remove('show');
|
|
}
|
|
});
|
|
|
|
// 礼物项点击
|
|
const giftItems = giftModal.querySelectorAll('.gift-item');
|
|
giftItems.forEach(function(item) {
|
|
item.addEventListener('click', function() {
|
|
const giftName = this.querySelector('.gift-name').textContent;
|
|
console.log('送出礼物:' + giftName);
|
|
giftModal.classList.remove('show');
|
|
});
|
|
});
|
|
})();
|
|
|
|
// ===== 动态卡片点击 =====
|
|
(function() {
|
|
const postCards = document.querySelectorAll('.post-card');
|
|
|
|
postCards.forEach(function(card) {
|
|
card.addEventListener('click', function() {
|
|
const postId = this.getAttribute('data-dom-id');
|
|
console.log('进入动态详情:' + postId);
|
|
// 实际项目中跳转详情页
|
|
});
|
|
});
|
|
})();
|
|
|
|
// ===== 发布按钮 =====
|
|
(function() {
|
|
const postBtns = document.querySelectorAll('[data-dom-id="btn-post-create"], [data-dom-id="btn-post-fab"]');
|
|
|
|
postBtns.forEach(function(btn) {
|
|
btn.addEventListener('click', function() {
|
|
console.log('跳转到发布页');
|
|
// 实际项目中跳转发布页
|
|
});
|
|
});
|
|
})();
|
|
|
|
// ===== 搜索框 =====
|
|
(function() {
|
|
const searchBox = document.querySelector('[data-dom-id="btn-search"]');
|
|
|
|
searchBox.addEventListener('click', function() {
|
|
console.log('进入搜索页');
|
|
// 实际项目中跳转搜索页
|
|
});
|
|
})();
|
|
|
|
// ===== 底部Tab切换 =====
|
|
(function() {
|
|
const bottomTabs = document.querySelectorAll('.bottom-tab');
|
|
|
|
bottomTabs.forEach(function(tab) {
|
|
tab.addEventListener('click', function(e) {
|
|
e.stopPropagation();
|
|
bottomTabs.forEach(function(t) {
|
|
t.classList.remove('active');
|
|
});
|
|
this.classList.add('active');
|
|
|
|
const tabName = this.getAttribute('data-bottom-tab');
|
|
console.log('切换到底部Tab:' + tabName);
|
|
// 实际项目中切换页面
|
|
});
|
|
});
|
|
})();</script>
|
|
</body>
|
|
</html>
|
|
|