feat: 实现首页,采用玻璃拟态风格并展示仪表盘概览。

This commit is contained in:
2026-01-29 22:32:08 +08:00
parent 4208225a12
commit 1713778845
2 changed files with 97 additions and 5 deletions

View File

@@ -798,6 +798,89 @@
cursor: pointer; cursor: pointer;
padding: 4px 10px; padding: 4px 10px;
border-radius: var(--radius-full); border-radius: var(--radius-full);
}
/* Floating Action Button (FAB) */
.fab-voice-btn {
position: fixed;
bottom: 2rem;
right: 2rem;
width: 56px;
height: 56px;
background: linear-gradient(135deg, #f59e0b, #d97706);
color: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
cursor: pointer;
z-index: 100;
border: none;
transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s backwards;
}
.fab-voice-btn:hover {
transform: scale(1.1) translateY(-2px);
box-shadow: 0 8px 20px rgba(245, 158, 11, 0.5);
}
.fab-voice-btn:active {
transform: scale(0.95);
}
/* Pulse animation for microphone */
.fab-voice-btn::after {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border-radius: 50%;
border: 2px solid rgba(255, 255, 255, 0.5);
opacity: 0;
transform: scale(1);
}
.fab-voice-btn:hover::after {
animation: pulse-ring 1.5s infinite;
}
@keyframes pulse-ring {
0% {
transform: scale(1);
opacity: 0.8;
}
100% {
transform: scale(1.5);
opacity: 0;
}
}
@keyframes scaleIn {
from {
transform: scale(0);
opacity: 0;
}
to {
transform: scale(1);
opacity: 1;
}
}
/* 适配移动端 */
@media (max-width: 600px) {
.fab-voice-btn {
bottom: 5.5rem;
/* Avoid bottom nav if present, or just give space */
right: 1.5rem;
}
}
transition: background 0.2s; transition: background 0.2s;
background: rgba(var(--color-primary-rgb), 0.1); background: rgba(var(--color-primary-rgb), 0.1);
} }

View File

@@ -231,6 +231,10 @@ function Home() {
navigate('/chat'); navigate('/chat');
}; };
const handleVoiceBookkeeping = () => {
setVoiceModalOpen(true);
};
const handleAIConfirm = () => { const handleAIConfirm = () => {
// 确认后刷新数据 // 确认后刷新数据
loadData(); loadData();
@@ -600,11 +604,11 @@ function Home() {
<button className="action-card ai" onClick={handleAIBookkeeping}> <button className="action-card ai" onClick={handleAIBookkeeping}>
<div className="action-icon blur-bg"> <div className="action-icon blur-bg">
<Icon icon="solar:microphone-3-bold-duotone" width="24" /> <Icon icon="solar:chat-round-line-bold-duotone" width="24" />
</div> </div>
<div className="action-info"> <div className="action-info">
<span className="action-title">AI </span> <span className="action-title">AI </span>
<span className="action-desc"></span> <span className="action-desc"></span>
</div> </div>
</button> </button>
@@ -734,6 +738,11 @@ function Home() {
todaySpend={todaySpend} todaySpend={todaySpend}
yesterdaySpend={yesterdaySpend} yesterdaySpend={yesterdaySpend}
/> />
{/* Floating Action Button for Voice Input - Feature: voice-bookkeeping-module */}
<button className="fab-voice-btn" onClick={handleVoiceBookkeeping} title="语音记账">
<Icon icon="solar:microphone-bold-duotone" width="28" />
</button>
</div> </div>
); );
} }