(创建页面,内容为“→首页网格布局 - 三列卡片: .home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 20px; } →活动卡片样式: .home-card { display: flex; flex-direction: column; border-radius: 8px; box-shadow: 0 3px 6px rgba(0,0,0,0.04), 0 3px 6px rgba(0,0,0,0.0575); overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; } .home-card:hover { transform: translateY(-5px); box-shadow: 0…”) |
无编辑摘要 |
||
第7行: | 第7行: | ||
} | } | ||
/* | /* 活动卡片主体样式 */ | ||
.home-card { | .home-card { | ||
overflow: visible; | |||
max-width: 400px; | |||
margin-bottom: 1.6rem; | |||
background: var(--color-surface-2); | |||
border: 1px solid var(--border-color-base); /* 基础边框 */ | |||
border-radius: 15px; /* 15px边框圆角 */ | |||
box-shadow: var(--box-shadow-card); | |||
font-size: 0.875rem; | |||
display: flex; | display: flex; | ||
flex-direction: column; | flex-direction: column; | ||
transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); | |||
} | } | ||
.home-card:hover { | .home-card:hover { | ||
transform: translateY(-5px); | transform: translateY(-5px); | ||
border-color: var(--color-primary); /* 悬停时边框变色 */ | |||
box-shadow: 0 10px 20px rgba(0,0,0,0.1); | box-shadow: 0 10px 20px rgba(0,0,0,0.1); | ||
} | } | ||
/* | /* 卡片标题区域 */ | ||
.home-card__header { | .home-card__header { | ||
width: 100%; | |||
margin-top: 20px; | |||
margin-bottom: 5px; | |||
color: var(--color-base--emphasized); | |||
font-size: 1. | font-size: 1.4rem; | ||
line-height: 1.4; | |||
padding: 0 20px; /* 与15px边框匹配的内边距 */ | |||
} | } | ||
第35行: | 第42行: | ||
.home-card .transport-card { | .home-card .transport-card { | ||
position: relative; | position: relative; | ||
height: 180px; | height: 180px; | ||
margin: 0; | margin: 0; | ||
border: none !important; | border: none !important; | ||
第42行: | 第49行: | ||
.home-card .transport-image { | .home-card .transport-image { | ||
position: absolute; | position: absolute; | ||
inset: 0; | inset: 0; | ||
margin: 0; | margin: 0; | ||
border-radius: 0; | border-radius: 14px 14px 0 0; /* 图片区域圆角比卡片小1px,避免边框重叠 */ | ||
overflow: hidden; | |||
} | |||
.home-card .transport-image img { | |||
display: block; | |||
max-width: 100%; | |||
height: 100%; | |||
object-fit: cover; | |||
transition: transform 0.5s cubic-bezier(0, 0.8, 0.2, 1); | |||
} | |||
.home-card .transport-image img:hover { | |||
transform: scale(1.1); | |||
} | } | ||
/* | /* 卡片文本内容 */ | ||
.home-card__text { | .home-card__text { | ||
margin: 0; | margin: 0; | ||
padding: 15px; | padding: 0 20px 15px; | ||
line-height: 1.6; | line-height: 1.6; | ||
} | } | ||
/* | /* 卡片数据行样式(模仿infobox-data) */ | ||
.home-card .data-row { | |||
display: flex; | |||
flex-direction: row; | |||
padding: 5px 20px; | |||
border-bottom: 1px solid var(--border-color-base); /* 数据行分隔线 */ | |||
} | |||
.home-card .data-label { | |||
color: var(--color-base--subtle); | |||
font-size: 0.8125rem; | |||
font-weight: normal; | |||
letter-spacing: 0.75px; | |||
width: 30%; | |||
} | |||
.home-card .data-value { | |||
font-weight: 600; | |||
width: 70%; | |||
} | |||
/* 卡片按钮区域 */ | |||
.home-link { | .home-link { | ||
margin: 10px 15px | margin: 10px 20px 15px; | ||
text-align: center; | |||
} | } | ||
第63行: | 第104行: | ||
display: inline-block; | display: inline-block; | ||
padding: 8px 16px; | padding: 8px 16px; | ||
background-color | background: var(--color-primary); | ||
color: white; | color: white; | ||
border-radius: | border-radius: 8px; | ||
text-decoration: none; | text-decoration: none; | ||
transition: background- | transition: background 0.3s cubic-bezier(0.16, 1, 0.3, 1); | ||
font-weight: 600; | |||
} | } | ||
.home-link__button:hover { | .home-link__button:hover { | ||
background-color | background: var(--color-primary--hover); | ||
} | } | ||
第78行: | 第120行: | ||
.home-grid { | .home-grid { | ||
grid-template-columns: 1fr; | grid-template-columns: 1fr; | ||
} | |||
.home-card { | |||
max-width: 100%; | |||
} | } | ||
} | } |
2025年6月18日 (三) 20:29的版本
/* 首页网格布局 - 三列卡片 */
.home-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20px;
padding: 20px;
}
/* 活动卡片主体样式 */
.home-card {
overflow: visible;
max-width: 400px;
margin-bottom: 1.6rem;
background: var(--color-surface-2);
border: 1px solid var(--border-color-base); /* 基础边框 */
border-radius: 15px; /* 15px边框圆角 */
box-shadow: var(--box-shadow-card);
font-size: 0.875rem;
display: flex;
flex-direction: column;
transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.home-card:hover {
transform: translateY(-5px);
border-color: var(--color-primary); /* 悬停时边框变色 */
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
/* 卡片标题区域 */
.home-card__header {
width: 100%;
margin-top: 20px;
margin-bottom: 5px;
color: var(--color-base--emphasized);
font-size: 1.4rem;
line-height: 1.4;
padding: 0 20px; /* 与15px边框匹配的内边距 */
}
/* 卡片图片容器 */
.home-card .transport-card {
position: relative;
height: 180px;
margin: 0;
border: none !important;
}
.home-card .transport-image {
position: absolute;
inset: 0;
margin: 0;
border-radius: 14px 14px 0 0; /* 图片区域圆角比卡片小1px,避免边框重叠 */
overflow: hidden;
}
.home-card .transport-image img {
display: block;
max-width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.5s cubic-bezier(0, 0.8, 0.2, 1);
}
.home-card .transport-image img:hover {
transform: scale(1.1);
}
/* 卡片文本内容 */
.home-card__text {
margin: 0;
padding: 0 20px 15px;
line-height: 1.6;
}
/* 卡片数据行样式(模仿infobox-data) */
.home-card .data-row {
display: flex;
flex-direction: row;
padding: 5px 20px;
border-bottom: 1px solid var(--border-color-base); /* 数据行分隔线 */
}
.home-card .data-label {
color: var(--color-base--subtle);
font-size: 0.8125rem;
font-weight: normal;
letter-spacing: 0.75px;
width: 30%;
}
.home-card .data-value {
font-weight: 600;
width: 70%;
}
/* 卡片按钮区域 */
.home-link {
margin: 10px 20px 15px;
text-align: center;
}
.home-link__button {
display: inline-block;
padding: 8px 16px;
background: var(--color-primary);
color: white;
border-radius: 8px;
text-decoration: none;
transition: background 0.3s cubic-bezier(0.16, 1, 0.3, 1);
font-weight: 600;
}
.home-link__button:hover {
background: var(--color-primary--hover);
}
/* 响应式布局 - 小屏幕下自动调整为单列 */
@media (max-width: 768px) {
.home-grid {
grid-template-columns: 1fr;
}
.home-card {
max-width: 100%;
}
}