Files
marqdo/examples/anlian-mq/public/css/index/home_news_timeline.css
T
cflmyandCursor d3b137c919 feat(anlian-mq): align site with Django anlian browse UX
Port original CSS/JS/assets, rebuild home as four sections with feed
fragments, expand schema (boards/notices/rooms/topics), and add
page.chrome HTML overrides plus invoke html returns so Marqdo can
render Django-class chrome without json glue.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-10 22:46:55 +08:00

462 lines
9.7 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 首页新闻时间轴
* - 台式(≥1025px):横向轨道,五条均分,卡片上下交错
* - 平板(768–1024px):横向轨道,卡片横向滑动
* - 手机(≤767px):竖向轨道,卡片左右交错
*/
.home-news {
--news-accent: #fdbbdb;
--news-accent-deep: #f0a8c4;
--news-accent-text: #a85878;
--news-accent-muted: #c97a96;
--timeline-axis-offset: 50%;
--bp-tablet: 1024px;
--bp-mobile: 767px;
height: auto;
min-height: 0;
padding: 20px 0;
}
section.home-news {
align-items: stretch;
}
.home-news .section-wrap.home-news-stage {
display: block;
position: relative;
height: auto;
min-height: 0;
max-height: none;
overflow: visible;
}
.home-news .news-timeline-panel,
.home-news .news-timeline-wrap,
.home-news .news-timeline {
overflow: visible;
}
.home-news .news-title {
font-size: 1.5rem;
font-weight: 600;
margin-bottom: 1rem;
color: #111;
border-bottom: 1px solid rgba(255, 255, 255, 0.5);
padding-bottom: 0.5rem;
text-align: center;
}
.home-news .home-news-board-bar {
margin-bottom: 1rem;
}
/* ---------- 时间轴容器 ---------- */
.home-news .news-timeline-wrap {
position: relative;
width: 100%;
max-width: none;
margin: 2rem 0 0;
padding: 0.5rem 0 1.5rem;
box-sizing: border-box;
}
.home-news .news-timeline-panel {
contain: layout style;
}
.home-news .news-timeline {
position: relative;
min-height: 13.5rem;
height: auto;
padding: 0.5rem 0 0;
}
/* ---------- 横向轨道(台式 + 平板) ---------- */
.home-news .news-timeline-rail {
position: absolute;
left: 1.25rem;
right: 1.25rem;
top: var(--timeline-axis-offset);
transform: translateY(-50%);
height: 3px;
width: auto;
pointer-events: none;
z-index: 0;
}
.home-news .news-timeline-line {
display: block;
width: 100%;
height: 100%;
border-radius: 999px;
background: linear-gradient(
90deg,
rgba(253, 189, 219, 0.35) 0%,
rgba(253, 189, 219, 0.75) 55%,
rgba(240, 168, 196, 0.9) 100%
);
box-shadow: 0 0 10px rgba(253, 189, 219, 0.25);
}
.home-news .news-timeline-arrow {
position: absolute;
right: -0.35rem;
top: 50%;
transform: translateY(-50%);
width: 1.5rem;
height: 1.5rem;
display: flex;
align-items: center;
justify-content: center;
color: var(--news-accent-deep);
font-size: 0.85rem;
filter: drop-shadow(0 1px 3px rgba(253, 189, 219, 0.45));
}
.home-news .news-timeline-arrow .news-timeline-arrow-icon--down {
display: none;
}
.home-news .news-timeline-items {
list-style: none;
margin: 0;
padding: 0 0.5rem;
display: flex;
align-items: stretch;
justify-content: space-between;
gap: 0.65rem;
position: relative;
z-index: 1;
min-height: 13.5rem;
}
.home-news .news-timeline-item {
flex: 1 1 0;
min-width: 0;
max-width: 11.5rem;
display: grid;
grid-template-rows: 1fr auto 1fr;
grid-template-columns: none;
align-items: center;
justify-items: center;
}
.home-news .news-timeline-node {
grid-row: 2;
grid-column: auto;
width: 12px;
height: 12px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.85);
border: 2px solid var(--news-accent-deep);
box-shadow:
0 0 0 3px rgba(253, 189, 219, 0.25),
0 2px 8px rgba(253, 189, 219, 0.35);
flex-shrink: 0;
z-index: 2;
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.home-news .news-timeline-item:nth-child(odd) .news-timeline-card {
grid-row: 1;
grid-column: auto;
align-self: end;
margin: 0 0 0.45rem;
}
.home-news .news-timeline-item:nth-child(even) .news-timeline-card {
grid-row: 3;
grid-column: auto;
align-self: start;
margin: 0.45rem 0 0;
}
.home-news .news-timeline-item:hover .news-timeline-node {
transform: scale(1.15);
box-shadow:
0 0 0 4px rgba(253, 189, 219, 0.35),
0 4px 12px rgba(253, 189, 219, 0.4);
}
.home-news .news-timeline-card {
width: 100%;
padding: 0.65rem 0.75rem;
border-radius: 14px;
background: rgba(255, 255, 255, 0.38);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
border: 1px solid rgba(255, 255, 255, 0.42);
box-shadow: 0 6px 20px rgba(253, 189, 219, 0.12);
transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.home-news .news-timeline-item:nth-child(odd):hover .news-timeline-card {
transform: translateY(-4px);
background: rgba(255, 255, 255, 0.52);
box-shadow: 0 10px 28px rgba(253, 189, 219, 0.22);
}
.home-news .news-timeline-item:nth-child(even):hover .news-timeline-card {
transform: translateY(4px);
background: rgba(255, 255, 255, 0.52);
box-shadow: 0 10px 28px rgba(253, 189, 219, 0.22);
}
.home-news .news-timeline-meta {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.35rem 0.5rem;
margin-bottom: 0.35rem;
}
.home-news .news-timeline-date {
font-size: 0.6875rem;
font-weight: 700;
color: var(--news-accent-muted);
white-space: nowrap;
}
.home-news .news-timeline-board {
font-size: 0.625rem;
font-weight: 600;
color: var(--news-accent-text);
background: rgba(253, 189, 219, 0.22);
padding: 0.1rem 0.35rem;
border-radius: 3px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
}
.home-news .news-timeline-title {
margin: 0;
min-width: 0;
}
.home-news .news-timeline-link {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
font-size: 0.8125rem;
font-weight: 600;
line-height: 1.35;
color: #222;
text-decoration: none;
}
.home-news .news-timeline-link:hover {
color: var(--news-accent-text);
}
.home-news .news-timeline-empty {
margin: 0;
text-align: center;
color: #666;
font-size: 0.9rem;
}
.home-news .news-timeline-item-empty {
flex: 1 1 100%;
max-width: none;
grid-template-rows: auto;
grid-template-columns: 1fr;
}
.home-news .news-timeline-item-empty .news-timeline-card {
grid-row: 1;
grid-column: 1;
margin: 0;
}
.home-news .news-timeline-wrap::before {
content: "";
position: absolute;
left: 5%;
right: 5%;
top: var(--timeline-axis-offset);
transform: translateY(-50%);
height: 70%;
background: radial-gradient(
ellipse 85% 100% at 50% 50%,
rgba(253, 189, 219, 0.18) 0%,
transparent 72%
);
pointer-events: none;
z-index: 0;
}
/* ========== 平板(768px–1024px):横向轨道 + 卡片横滑 ========== */
@media (max-width: 1024px) {
.home-news .news-timeline-wrap {
margin-top: 1.75rem;
}
.home-news .news-timeline {
min-height: 12rem;
}
.home-news .news-timeline-items {
justify-content: flex-start;
flex-wrap: nowrap;
gap: 0.75rem;
min-height: 12rem;
overflow-x: auto;
overflow-y: visible;
scroll-snap-type: x proximity;
-webkit-overflow-scrolling: touch;
padding: 0 0.5rem 0.5rem;
scrollbar-width: thin;
scrollbar-color: rgba(253, 189, 219, 0.5) transparent;
}
.home-news .news-timeline-items::-webkit-scrollbar {
height: 5px;
}
.home-news .news-timeline-items::-webkit-scrollbar-thumb {
background: rgba(253, 189, 219, 0.45);
border-radius: 999px;
}
.home-news .news-timeline-item {
flex: 0 0 auto;
width: min(10.5rem, 38vw);
max-width: 11rem;
scroll-snap-align: center;
}
.home-news .news-timeline-rail {
left: 0.75rem;
right: 0.75rem;
}
}
/* ========== 手机(≤767px):竖向时间轴 ========== */
@media (max-width: 767px) {
.home-news .news-timeline-wrap {
margin-top: 1.5rem;
}
.home-news .news-timeline-wrap::before {
left: 50%;
right: auto;
top: 4%;
bottom: 4%;
width: min(18rem, 72%);
height: auto;
transform: translateX(-50%);
background: radial-gradient(
ellipse 70% 90% at 50% 50%,
rgba(253, 189, 219, 0.2) 0%,
transparent 72%
);
}
.home-news .news-timeline {
min-height: 0;
padding: 0.25rem 0 0.5rem;
}
.home-news .news-timeline-rail {
left: 50%;
right: auto;
top: 0.35rem;
bottom: 0.65rem;
width: 3px;
height: auto;
transform: translateX(-50%);
}
.home-news .news-timeline-line {
width: 100%;
height: 100%;
background: linear-gradient(
180deg,
rgba(253, 189, 219, 0.35) 0%,
rgba(253, 189, 219, 0.75) 55%,
rgba(240, 168, 196, 0.9) 100%
);
}
.home-news .news-timeline-arrow {
left: 50%;
right: auto;
top: auto;
bottom: -0.6rem;
transform: translateX(-50%);
}
.home-news .news-timeline-arrow .news-timeline-arrow-icon--right {
display: none;
}
.home-news .news-timeline-arrow .news-timeline-arrow-icon--down {
display: block;
}
.home-news .news-timeline-items {
flex-direction: column;
align-items: stretch;
gap: 1.25rem;
min-height: 0;
padding: 0.35rem 0.5rem 1.25rem;
overflow: visible;
scroll-snap-type: none;
}
.home-news .news-timeline-item {
flex: none;
width: 100%;
max-width: none;
display: grid;
grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr);
grid-template-rows: auto;
column-gap: 0.55rem;
}
.home-news .news-timeline-node {
grid-row: 1;
grid-column: 2;
justify-self: center;
}
.home-news .news-timeline-item:nth-child(odd) .news-timeline-card {
grid-row: 1;
grid-column: 3;
align-self: center;
margin: 0;
}
.home-news .news-timeline-item:nth-child(even) .news-timeline-card {
grid-row: 1;
grid-column: 1;
align-self: center;
margin: 0;
}
.home-news .news-timeline-item:nth-child(odd):hover .news-timeline-card {
transform: translateX(4px);
}
.home-news .news-timeline-item:nth-child(even):hover .news-timeline-card {
transform: translateX(-4px);
}
.home-news .news-timeline-item-empty {
grid-template-columns: 1fr;
}
.home-news .news-timeline-card {
padding: 0.6rem 0.65rem;
}
.home-news .news-timeline-link {
font-size: 0.78rem;
}
}