757 lines
23 KiB
HTML
757 lines
23 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>方案4:轮播大卡片式</title>
|
||
<style>
|
||
* {
|
||
margin: 0;
|
||
padding: 0;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
body {
|
||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||
min-height: 100vh;
|
||
max-width: 375px;
|
||
margin: 0 auto;
|
||
overflow-x: hidden;
|
||
}
|
||
|
||
.header {
|
||
background: rgba(255,255,255,0.1);
|
||
backdrop-filter: blur(20px);
|
||
padding: 20px;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
color: white;
|
||
}
|
||
|
||
.header-info h1 {
|
||
font-size: 20px;
|
||
margin-bottom: 4px;
|
||
}
|
||
|
||
.header-info p {
|
||
font-size: 14px;
|
||
opacity: 0.8;
|
||
}
|
||
|
||
.header-actions {
|
||
display: flex;
|
||
gap: 10px;
|
||
}
|
||
|
||
.header-btn {
|
||
width: 36px;
|
||
height: 36px;
|
||
border-radius: 18px;
|
||
border: none;
|
||
cursor: pointer;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
font-size: 16px;
|
||
background: rgba(255,255,255,0.2);
|
||
color: white;
|
||
}
|
||
|
||
.carousel-container {
|
||
position: relative;
|
||
height: 400px;
|
||
margin: 20px 0;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.carousel-track {
|
||
display: flex;
|
||
transition: transform 0.5s ease;
|
||
height: 100%;
|
||
}
|
||
|
||
.pet-slide {
|
||
min-width: 100%;
|
||
padding: 0 20px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.pet-large-card {
|
||
width: 100%;
|
||
max-width: 320px;
|
||
background: rgba(255,255,255,0.95);
|
||
border-radius: 30px;
|
||
padding: 30px;
|
||
text-align: center;
|
||
backdrop-filter: blur(20px);
|
||
box-shadow: 0 20px 60px rgba(0,0,0,0.2);
|
||
position: relative;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.pet-large-card::before {
|
||
content: '';
|
||
position: absolute;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
height: 6px;
|
||
background: linear-gradient(90deg, #FF6B6B, #4ECDC4, #45B7D1);
|
||
}
|
||
|
||
.pet-large-avatar {
|
||
width: 100px;
|
||
height: 100px;
|
||
border-radius: 50px;
|
||
background: linear-gradient(135deg, #FFE0B2, #FFCC80);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
font-size: 50px;
|
||
margin: 0 auto 20px;
|
||
position: relative;
|
||
box-shadow: 0 10px 30px rgba(0,0,0,0.2);
|
||
}
|
||
|
||
.pet-status-indicator {
|
||
position: absolute;
|
||
bottom: -5px;
|
||
right: -5px;
|
||
width: 30px;
|
||
height: 30px;
|
||
border-radius: 15px;
|
||
background: #4CAF50;
|
||
border: 4px solid white;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
font-size: 14px;
|
||
}
|
||
|
||
.pet-large-name {
|
||
font-size: 24px;
|
||
font-weight: bold;
|
||
color: #333;
|
||
margin-bottom: 8px;
|
||
}
|
||
|
||
.pet-large-details {
|
||
font-size: 16px;
|
||
color: #666;
|
||
margin-bottom: 15px;
|
||
}
|
||
|
||
.pet-large-tags {
|
||
display: flex;
|
||
justify-content: center;
|
||
gap: 8px;
|
||
margin-bottom: 25px;
|
||
}
|
||
|
||
.large-tag {
|
||
background: #E8F5E8;
|
||
color: #4CAF50;
|
||
padding: 6px 12px;
|
||
border-radius: 15px;
|
||
font-size: 12px;
|
||
font-weight: bold;
|
||
}
|
||
|
||
.pet-large-stats {
|
||
display: grid;
|
||
grid-template-columns: repeat(3, 1fr);
|
||
gap: 15px;
|
||
margin-bottom: 25px;
|
||
}
|
||
|
||
.large-stat {
|
||
background: #F8F9FA;
|
||
padding: 15px 10px;
|
||
border-radius: 15px;
|
||
text-align: center;
|
||
}
|
||
|
||
.large-stat-number {
|
||
font-size: 20px;
|
||
font-weight: bold;
|
||
color: #333;
|
||
display: block;
|
||
margin-bottom: 4px;
|
||
}
|
||
|
||
.large-stat-label {
|
||
font-size: 12px;
|
||
color: #999;
|
||
}
|
||
|
||
.pet-large-actions {
|
||
display: flex;
|
||
gap: 10px;
|
||
}
|
||
|
||
.large-action-btn {
|
||
flex: 1;
|
||
background: linear-gradient(135deg, #667eea, #764ba2);
|
||
color: white;
|
||
border: none;
|
||
padding: 12px 16px;
|
||
border-radius: 15px;
|
||
font-size: 14px;
|
||
font-weight: bold;
|
||
cursor: pointer;
|
||
transition: transform 0.2s;
|
||
}
|
||
|
||
.large-action-btn:hover {
|
||
transform: translateY(-2px);
|
||
}
|
||
|
||
.carousel-indicators {
|
||
display: flex;
|
||
justify-content: center;
|
||
gap: 8px;
|
||
margin: 20px 0;
|
||
}
|
||
|
||
.indicator {
|
||
width: 12px;
|
||
height: 12px;
|
||
border-radius: 6px;
|
||
background: rgba(255,255,255,0.3);
|
||
cursor: pointer;
|
||
transition: all 0.3s ease;
|
||
}
|
||
|
||
.indicator.active {
|
||
background: rgba(255,255,255,0.8);
|
||
transform: scale(1.2);
|
||
}
|
||
|
||
.carousel-nav {
|
||
position: absolute;
|
||
top: 50%;
|
||
transform: translateY(-50%);
|
||
width: 40px;
|
||
height: 40px;
|
||
border-radius: 20px;
|
||
background: rgba(255,255,255,0.2);
|
||
border: none;
|
||
color: white;
|
||
font-size: 18px;
|
||
cursor: pointer;
|
||
transition: all 0.3s ease;
|
||
backdrop-filter: blur(10px);
|
||
}
|
||
|
||
.carousel-nav:hover {
|
||
background: rgba(255,255,255,0.3);
|
||
transform: translateY(-50%) scale(1.1);
|
||
}
|
||
|
||
.nav-prev {
|
||
left: 10px;
|
||
}
|
||
|
||
.nav-next {
|
||
right: 10px;
|
||
}
|
||
|
||
.summary-panel {
|
||
background: rgba(255,255,255,0.95);
|
||
margin: 0 20px 20px;
|
||
border-radius: 20px;
|
||
padding: 20px;
|
||
backdrop-filter: blur(20px);
|
||
}
|
||
|
||
.summary-title {
|
||
font-size: 18px;
|
||
font-weight: bold;
|
||
color: #333;
|
||
margin-bottom: 15px;
|
||
text-align: center;
|
||
}
|
||
|
||
.summary-overview {
|
||
display: grid;
|
||
grid-template-columns: repeat(2, 1fr);
|
||
gap: 15px;
|
||
margin-bottom: 20px;
|
||
}
|
||
|
||
.overview-card {
|
||
background: linear-gradient(135deg, #667eea, #764ba2);
|
||
color: white;
|
||
padding: 15px;
|
||
border-radius: 15px;
|
||
text-align: center;
|
||
}
|
||
|
||
.overview-number {
|
||
font-size: 20px;
|
||
font-weight: bold;
|
||
margin-bottom: 4px;
|
||
}
|
||
|
||
.overview-label {
|
||
font-size: 12px;
|
||
opacity: 0.9;
|
||
}
|
||
|
||
.quick-functions {
|
||
display: grid;
|
||
grid-template-columns: repeat(4, 1fr);
|
||
gap: 10px;
|
||
}
|
||
|
||
.quick-function {
|
||
background: #F8F9FA;
|
||
border: none;
|
||
border-radius: 12px;
|
||
padding: 12px 8px;
|
||
text-align: center;
|
||
cursor: pointer;
|
||
transition: transform 0.2s;
|
||
}
|
||
|
||
.quick-function:hover {
|
||
transform: translateY(-2px);
|
||
}
|
||
|
||
.function-icon {
|
||
font-size: 18px;
|
||
margin-bottom: 4px;
|
||
display: block;
|
||
}
|
||
|
||
.function-text {
|
||
font-size: 10px;
|
||
color: #666;
|
||
font-weight: bold;
|
||
}
|
||
|
||
.recent-activities {
|
||
background: rgba(255,255,255,0.95);
|
||
margin: 0 20px 20px;
|
||
border-radius: 20px;
|
||
padding: 20px;
|
||
backdrop-filter: blur(20px);
|
||
}
|
||
|
||
.activities-header {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
margin-bottom: 15px;
|
||
}
|
||
|
||
.activities-title {
|
||
font-size: 16px;
|
||
font-weight: bold;
|
||
color: #333;
|
||
}
|
||
|
||
.view-more {
|
||
background: none;
|
||
border: none;
|
||
color: #667eea;
|
||
font-size: 12px;
|
||
cursor: pointer;
|
||
}
|
||
|
||
.activity-list {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 12px;
|
||
}
|
||
|
||
.activity-row {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 12px;
|
||
padding: 8px 0;
|
||
}
|
||
|
||
.activity-pet {
|
||
width: 32px;
|
||
height: 32px;
|
||
border-radius: 16px;
|
||
background: #FFE0B2;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
font-size: 16px;
|
||
}
|
||
|
||
.activity-details {
|
||
flex: 1;
|
||
}
|
||
|
||
.activity-text {
|
||
font-size: 14px;
|
||
color: #333;
|
||
margin-bottom: 2px;
|
||
}
|
||
|
||
.activity-meta {
|
||
font-size: 12px;
|
||
color: #999;
|
||
}
|
||
|
||
.activity-badge {
|
||
background: #E3F2FD;
|
||
color: #2196F3;
|
||
padding: 2px 8px;
|
||
border-radius: 10px;
|
||
font-size: 10px;
|
||
}
|
||
|
||
.ai-assistant {
|
||
background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
|
||
margin: 0 20px 80px;
|
||
border-radius: 20px;
|
||
padding: 20px;
|
||
color: white;
|
||
}
|
||
|
||
.ai-header {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
margin-bottom: 12px;
|
||
}
|
||
|
||
.ai-title {
|
||
font-size: 16px;
|
||
font-weight: bold;
|
||
}
|
||
|
||
.ai-content {
|
||
background: rgba(255,255,255,0.2);
|
||
border-radius: 12px;
|
||
padding: 12px;
|
||
margin-bottom: 12px;
|
||
font-size: 14px;
|
||
line-height: 1.4;
|
||
}
|
||
|
||
.ai-actions {
|
||
display: flex;
|
||
gap: 8px;
|
||
}
|
||
|
||
.ai-btn {
|
||
background: rgba(255,255,255,0.2);
|
||
color: white;
|
||
border: none;
|
||
padding: 8px 12px;
|
||
border-radius: 12px;
|
||
font-size: 12px;
|
||
cursor: pointer;
|
||
}
|
||
|
||
.floating-add {
|
||
position: fixed;
|
||
bottom: 30px;
|
||
right: 20px;
|
||
width: 56px;
|
||
height: 56px;
|
||
border-radius: 28px;
|
||
background: linear-gradient(135deg, #667eea, #764ba2);
|
||
color: white;
|
||
border: none;
|
||
font-size: 24px;
|
||
cursor: pointer;
|
||
box-shadow: 0 4px 20px rgba(102,126,234,0.4);
|
||
transition: transform 0.3s;
|
||
}
|
||
|
||
.floating-add:hover {
|
||
transform: scale(1.1);
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div class="header">
|
||
<div class="header-info">
|
||
<h1>🎡 宠物轮播</h1>
|
||
<p>沉浸式宠物展示体验</p>
|
||
</div>
|
||
<div class="header-actions">
|
||
<button class="header-btn">👨👩👧👦</button>
|
||
<button class="header-btn">➕</button>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="carousel-container">
|
||
<div class="carousel-track" id="carouselTrack">
|
||
<div class="pet-slide">
|
||
<div class="pet-large-card">
|
||
<div class="pet-large-avatar">
|
||
🐱
|
||
<div class="pet-status-indicator">💚</div>
|
||
</div>
|
||
<div class="pet-large-name">小橘</div>
|
||
<div class="pet-large-details">橘猫 · 2岁 · 陪伴365天</div>
|
||
<div class="pet-large-tags">
|
||
<span class="large-tag">活泼</span>
|
||
<span class="large-tag">粘人</span>
|
||
<span class="large-tag">健康</span>
|
||
</div>
|
||
<div class="pet-large-stats">
|
||
<div class="large-stat">
|
||
<span class="large-stat-number">4.5kg</span>
|
||
<span class="large-stat-label">体重</span>
|
||
</div>
|
||
<div class="large-stat">
|
||
<span class="large-stat-number">89</span>
|
||
<span class="large-stat-label">记录数</span>
|
||
</div>
|
||
<div class="large-stat">
|
||
<span class="large-stat-number">¥580</span>
|
||
<span class="large-stat-label">本月消费</span>
|
||
</div>
|
||
</div>
|
||
<div class="pet-large-actions">
|
||
<button class="large-action-btn">📝 记录</button>
|
||
<button class="large-action-btn">💬 聊天</button>
|
||
<button class="large-action-btn">📊 详情</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="pet-slide">
|
||
<div class="pet-large-card">
|
||
<div class="pet-large-avatar">
|
||
🐶
|
||
<div class="pet-status-indicator">💚</div>
|
||
</div>
|
||
<div class="pet-large-name">小白</div>
|
||
<div class="pet-large-details">金毛 · 3岁 · 陪伴1095天</div>
|
||
<div class="pet-large-tags">
|
||
<span class="large-tag">温顺</span>
|
||
<span class="large-tag">忠诚</span>
|
||
<span class="large-tag">健康</span>
|
||
</div>
|
||
<div class="pet-large-stats">
|
||
<div class="large-stat">
|
||
<span class="large-stat-number">25kg</span>
|
||
<span class="large-stat-label">体重</span>
|
||
</div>
|
||
<div class="large-stat">
|
||
<span class="large-stat-number">67</span>
|
||
<span class="large-stat-label">记录数</span>
|
||
</div>
|
||
<div class="large-stat">
|
||
<span class="large-stat-number">¥890</span>
|
||
<span class="large-stat-label">本月消费</span>
|
||
</div>
|
||
</div>
|
||
<div class="pet-large-actions">
|
||
<button class="large-action-btn">📝 记录</button>
|
||
<button class="large-action-btn">💬 聊天</button>
|
||
<button class="large-action-btn">📊 详情</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="pet-slide">
|
||
<div class="pet-large-card">
|
||
<div class="pet-large-avatar">
|
||
🐰
|
||
<div class="pet-status-indicator">💚</div>
|
||
</div>
|
||
<div class="pet-large-name">小灰</div>
|
||
<div class="pet-large-details">垂耳兔 · 1岁 · 陪伴180天</div>
|
||
<div class="pet-large-tags">
|
||
<span class="large-tag">安静</span>
|
||
<span class="large-tag">可爱</span>
|
||
<span class="large-tag">健康</span>
|
||
</div>
|
||
<div class="pet-large-stats">
|
||
<div class="large-stat">
|
||
<span class="large-stat-number">1.2kg</span>
|
||
<span class="large-stat-label">体重</span>
|
||
</div>
|
||
<div class="large-stat">
|
||
<span class="large-stat-number">34</span>
|
||
<span class="large-stat-label">记录数</span>
|
||
</div>
|
||
<div class="large-stat">
|
||
<span class="large-stat-number">¥120</span>
|
||
<span class="large-stat-label">本月消费</span>
|
||
</div>
|
||
</div>
|
||
<div class="pet-large-actions">
|
||
<button class="large-action-btn">📝 记录</button>
|
||
<button class="large-action-btn">💬 聊天</button>
|
||
<button class="large-action-btn">📊 详情</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<button class="carousel-nav nav-prev" onclick="prevSlide()">‹</button>
|
||
<button class="carousel-nav nav-next" onclick="nextSlide()">›</button>
|
||
</div>
|
||
|
||
<div class="carousel-indicators">
|
||
<div class="indicator active" onclick="goToSlide(0)"></div>
|
||
<div class="indicator" onclick="goToSlide(1)"></div>
|
||
<div class="indicator" onclick="goToSlide(2)"></div>
|
||
</div>
|
||
|
||
<div class="summary-panel">
|
||
<div class="summary-title">📊 家庭概览</div>
|
||
<div class="summary-overview">
|
||
<div class="overview-card">
|
||
<div class="overview-number">190</div>
|
||
<div class="overview-label">总记录数</div>
|
||
</div>
|
||
<div class="overview-card">
|
||
<div class="overview-number">¥1,590</div>
|
||
<div class="overview-label">本月消费</div>
|
||
</div>
|
||
<div class="overview-card">
|
||
<div class="overview-number">3</div>
|
||
<div class="overview-label">家庭成员</div>
|
||
</div>
|
||
<div class="overview-card">
|
||
<div class="overview-number">5</div>
|
||
<div class="overview-label">待办提醒</div>
|
||
</div>
|
||
</div>
|
||
<div class="quick-functions">
|
||
<button class="quick-function">
|
||
<span class="function-icon">📝</span>
|
||
<span class="function-text">快速记录</span>
|
||
</button>
|
||
<button class="quick-function">
|
||
<span class="function-icon">💰</span>
|
||
<span class="function-text">记账</span>
|
||
</button>
|
||
<button class="quick-function">
|
||
<span class="function-icon">📸</span>
|
||
<span class="function-text">拍照</span>
|
||
</button>
|
||
<button class="quick-function">
|
||
<span class="function-icon">🏥</span>
|
||
<span class="function-text">领养</span>
|
||
</button>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="recent-activities">
|
||
<div class="activities-header">
|
||
<div class="activities-title">⏰ 最近活动</div>
|
||
<button class="view-more">查看更多</button>
|
||
</div>
|
||
<div class="activity-list">
|
||
<div class="activity-row">
|
||
<div class="activity-pet">🐱</div>
|
||
<div class="activity-details">
|
||
<div class="activity-text">小橘完成了今天的早餐</div>
|
||
<div class="activity-meta">2小时前 · 日常记录</div>
|
||
</div>
|
||
<div class="activity-badge">饮食</div>
|
||
</div>
|
||
<div class="activity-row">
|
||
<div class="activity-pet">🐶</div>
|
||
<div class="activity-details">
|
||
<div class="activity-text">小白外出散步30分钟</div>
|
||
<div class="activity-meta">3小时前 · 日常记录</div>
|
||
</div>
|
||
<div class="activity-badge">运动</div>
|
||
</div>
|
||
<div class="activity-row">
|
||
<div class="activity-pet">🐰</div>
|
||
<div class="activity-details">
|
||
<div class="activity-text">小灰吃了新鲜胡萝卜</div>
|
||
<div class="activity-meta">5小时前 · 随手记</div>
|
||
</div>
|
||
<div class="activity-badge">饮食</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="ai-assistant">
|
||
<div class="ai-header">
|
||
<span>🤖</span>
|
||
<div class="ai-title">AI助手建议</div>
|
||
</div>
|
||
<div class="ai-content">
|
||
根据分析,小橘今天的活动量比平时少15%,建议增加互动游戏时间。小白的散步规律很好,继续保持!
|
||
</div>
|
||
<div class="ai-actions">
|
||
<button class="ai-btn">详细分析</button>
|
||
<button class="ai-btn">开始聊天</button>
|
||
</div>
|
||
</div>
|
||
|
||
<button class="floating-add">📝</button>
|
||
|
||
<script>
|
||
let currentSlide = 0;
|
||
const totalSlides = 3;
|
||
|
||
function updateCarousel() {
|
||
const track = document.getElementById('carouselTrack');
|
||
track.style.transform = `translateX(-${currentSlide * 100}%)`;
|
||
|
||
// 更新指示器
|
||
document.querySelectorAll('.indicator').forEach((indicator, index) => {
|
||
indicator.classList.toggle('active', index === currentSlide);
|
||
});
|
||
}
|
||
|
||
function nextSlide() {
|
||
currentSlide = (currentSlide + 1) % totalSlides;
|
||
updateCarousel();
|
||
}
|
||
|
||
function prevSlide() {
|
||
currentSlide = (currentSlide - 1 + totalSlides) % totalSlides;
|
||
updateCarousel();
|
||
}
|
||
|
||
function goToSlide(index) {
|
||
currentSlide = index;
|
||
updateCarousel();
|
||
}
|
||
|
||
// 自动轮播
|
||
setInterval(nextSlide, 5000);
|
||
|
||
// 触摸滑动支持
|
||
let startX = 0;
|
||
let endX = 0;
|
||
|
||
document.addEventListener('touchstart', (e) => {
|
||
startX = e.touches[0].clientX;
|
||
});
|
||
|
||
document.addEventListener('touchend', (e) => {
|
||
endX = e.changedTouches[0].clientX;
|
||
handleSwipe();
|
||
});
|
||
|
||
function handleSwipe() {
|
||
const threshold = 50;
|
||
const diff = startX - endX;
|
||
|
||
if (Math.abs(diff) > threshold) {
|
||
if (diff > 0) {
|
||
nextSlide();
|
||
} else {
|
||
prevSlide();
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
</body>
|
||
</html>
|