refactor: restructure css files into common and page-specific styles

This commit is contained in:
shenghuo2
2025-06-20 17:48:51 +08:00
parent 51962faa87
commit baedcc608b
13 changed files with 1832 additions and 7 deletions

229
styles/home.css Normal file
View File

@ -0,0 +1,229 @@
/* 首页专用样式 */
/* 房间导航 */
.room-nav {
display: flex;
gap: 20px;
padding: 20px;
overflow-x: auto;
scrollbar-width: none;
-ms-overflow-style: none;
}
.room-nav::-webkit-scrollbar {
display: none;
}
.room-tabs {
display: flex;
gap: 20px;
min-width: max-content;
}
.room-tab {
padding: 8px 16px;
border-radius: 20px;
background-color: #fff;
color: #666;
font-size: 14px;
cursor: pointer;
transition: all 0.3s ease;
white-space: nowrap;
border: 1px solid transparent;
}
.room-tab.active {
background-color: #ff6900;
color: #fff;
}
.home-name {
font-size: 18px;
font-weight: 600;
color: #333;
}
/* 首页菜单图标 */
.home-menu-icon {
font-size: 18px;
color: #666;
cursor: pointer;
}
/* 空气质量 */
.air-quality {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 20px;
background-color: #fff;
margin-bottom: 15px;
font-size: 14px;
color: #666;
}
/* 设备网格 */
.device-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 15px;
padding: 0 20px;
margin-bottom: 20px;
}
.device-card {
background-color: #fff;
border-radius: 12px;
padding: 20px;
position: relative;
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
cursor: pointer;
transition: transform 0.2s;
animation: fadeIn 0.3s ease-out;
}
.device-card:hover {
transform: translateY(-2px);
}
.device-card.active {
background-color: #fff5e6;
border: 1px solid #ff6900;
}
.device-icon {
width: 40px;
height: 40px;
margin-bottom: 15px;
display: flex;
align-items: center;
justify-content: center;
background-color: #f8f8f8;
border-radius: 8px;
}
.device-icon i {
font-size: 20px;
color: #666;
}
.ac-icon {
width: 30px;
height: 20px;
background-color: #666;
border-radius: 4px;
position: relative;
}
.ac-icon::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 20px;
height: 2px;
background-color: #fff;
}
.device-name {
font-size: 16px;
font-weight: 600;
color: #333;
margin-bottom: 5px;
}
.device-status {
font-size: 12px;
color: #999;
}
.power-button {
position: absolute;
top: 15px;
right: 15px;
width: 30px;
height: 30px;
background-color: #ff6900;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.power-button i {
color: #fff;
font-size: 14px;
}
/* 传感器网格 */
.sensor-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 15px;
padding: 0 20px;
margin-bottom: 20px;
}
.sensor-card {
background-color: #fff;
border-radius: 12px;
padding: 20px;
position: relative;
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
cursor: pointer;
animation: fadeIn 0.3s ease-out;
}
.sensor-icon {
margin-bottom: 15px;
}
.temp-display {
font-size: 24px;
font-weight: 600;
color: #333;
}
.humidity-display {
font-size: 14px;
color: #666;
margin-left: 5px;
}
.sensor-name {
font-size: 14px;
font-weight: 600;
color: #333;
margin-bottom: 5px;
}
.sensor-status {
font-size: 12px;
color: #999;
}
.bluetooth-icon {
position: absolute;
top: 15px;
right: 15px;
color: #007AFF;
font-size: 16px;
}
/* 响应式设计 */
@media (max-width: 414px) {
.device-grid,
.sensor-grid {
padding: 0 15px;
}
.room-tabs {
gap: 15px;
}
.room-tab {
font-size: 14px;
}
}