Skip to content

Commit a64b03f

Browse files
committed
refactor: update article list style
1 parent 74ce042 commit a64b03f

File tree

4 files changed

+40
-7
lines changed

4 files changed

+40
-7
lines changed

client/src/components/ArticleCarousel/index.module.scss

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
position: relative;
1212
display: flex;
1313
width: 100%;
14-
height: 460px;
14+
height: 260px;
1515
background-position: center;
1616
background-size: cover;
1717
background-repeat: no-repeat;
@@ -54,7 +54,31 @@
5454

5555
@media (max-width: 768px) {
5656
.articleItem {
57-
height: 180px;
57+
height: 300px;
58+
}
59+
}
60+
61+
@media (min-width: 768px) {
62+
.container {
63+
width: 768px;
64+
}
65+
}
66+
67+
@media (min-width: 992px) {
68+
.articleItem {
69+
height: 340px;
70+
}
71+
}
72+
73+
@media (min-width: 1200px) {
74+
.articleItem {
75+
height: 380px;
76+
}
77+
}
78+
79+
@media (min-width: 1360px) {
80+
.articleItem {
81+
height: 460px;
5882
}
5983
}
6084
}

client/src/components/ArticleList/index.module.scss

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
&:hover {
2323
img {
2424
transform: scale(1.1);
25-
transition: all .2s ease-in;
25+
transition: all 0.2s ease-in;
2626
}
2727
}
2828

@@ -194,7 +194,6 @@
194194
}
195195

196196
@media (max-width: 658px) {
197-
198197
.articleItem {
199198
.coverWrapper {
200199
width: 140px;
@@ -213,6 +212,16 @@
213212
flex-direction: column;
214213
align-items: flex-start;
215214

215+
.title {
216+
display: -webkit-box;
217+
-webkit-box-orient: vertical;
218+
-webkit-line-clamp: 2;
219+
overflow: hidden;
220+
text-overflow: ellipsis;
221+
line-height: 1.2em;
222+
max-height: 2.4em;
223+
}
224+
216225
.info {
217226
font-size: 0.8em;
218227

client/src/components/ArticleList/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const ArticleList: React.FC<IProps> = ({ articles = [] }) => {
4646
<Link href={`/article/[id]`} as={`/article/${article.id}`} scroll={false}>
4747
<a aria-label={article.title} className={style.link}>
4848
<header>
49-
<div className={style.title}>{article.title}</div>
49+
<div className={style.title} title={article.title}>{article.title}</div>
5050
<div className={style.info}>
5151
{article.category && categoryIndex >= 0 && (
5252
<Tag className={style.antBadge} color={getColorFromNumber(categoryIndex)}>
@@ -58,7 +58,7 @@ export const ArticleList: React.FC<IProps> = ({ articles = [] }) => {
5858
</header>
5959
<main className={style.desc} title={article.title}>
6060
<div className={style.contentWrapper}>
61-
<div className={style.desc}>
61+
<div className={style.desc} title={article.summary}>
6262
<span dangerouslySetInnerHTML={{ __html: article.summary }} />
6363
</div>
6464
<div className={style.meta}>

client/src/theme/reset.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ iframe {
7575

7676
@media (min-width: 768px) {
7777
.container {
78-
width: 768px;
78+
width: calc(768px - 32px);
7979
}
8080
}
8181

0 commit comments

Comments
 (0)