Skip to content

Commit f9d694a

Browse files
Fix mobile AI homepage: title clipping, teaser overlap, code cleanup
Co-authored-by: interstellarmt <178904023+interstellarmt@users.noreply.github.com> Agent-Logs-Url: https://github.com/antvis/dumi-theme-antv/sessions/1c778a26-5645-4517-998e-638fd183068d
1 parent 30a0da8 commit f9d694a

2 files changed

Lines changed: 66 additions & 149 deletions

File tree

src/slots/Detail/index.module.less

Lines changed: 65 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
}
2929

3030
.title {
31-
font-size: 3.4em; //2.875em;
31+
font-size: 3.4em;
3232
color: rgba(0, 0, 0, 100%);
3333
position: relative;
3434
font-family: AlibabaPuHuiTiRHeavy;
@@ -38,80 +38,10 @@
3838
}
3939
}
4040

41-
.description {
42-
margin-top: 0.83%; //12px;
43-
margin-bottom: 0;
44-
font-weight: 200;
45-
position: relative;
46-
width: 40%;
47-
max-width: 700px;
48-
font-family: AlibabaPuHuiTiR;
49-
font-size: 18px;
50-
color: #424e66;
51-
max-height: 145px;
52-
overflow: hidden;
53-
text-overflow: ellipsis;
54-
-webkit-line-clamp: 4;
55-
display: box;
56-
-webkit-box-orient: vertical;
57-
}
58-
5941
.buttons {
6042
display: flex;
6143
margin-top: 10px;
6244

63-
.buttonLink {
64-
display: flex;
65-
align-items: center;
66-
justify-content: center;
67-
border-radius: 12px;
68-
z-index: 10;
69-
position: relative;
70-
transition: all 0.3s;
71-
text-align: center;
72-
height: 54px;
73-
min-width: 166px;
74-
padding: 0 10px;
75-
background-color: #691eff;
76-
font-size: 18px;
77-
cursor: pointer;
78-
box-shadow: 0 8px 28px 0 #f2f2f2;
79-
margin-right: 20px;
80-
color: #fff;
81-
overflow: hidden;
82-
83-
.icon {
84-
width: 20px;
85-
height: 20px;
86-
background-image: url(https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*lo_5RYdqKLsAAAAAAAAAAAAADmJ7AQ/original);
87-
margin-right: 6px;
88-
}
89-
90-
&:hover {
91-
opacity: 0.8;
92-
}
93-
94-
&.primary {
95-
background-color: #fff;
96-
color: #000;
97-
border: 1px solid #e8e8e8;
98-
99-
.icon {
100-
position: relative;
101-
background-image: url(https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*_xFsQbWE_AYAAAAAAAAAAAAADmJ7AQ/original);
102-
}
103-
104-
&:hover {
105-
color: #691eff;
106-
107-
.icon {
108-
left: -80px;
109-
filter: drop-shadow(#691eff 80px 0);
110-
}
111-
}
112-
}
113-
}
114-
11545
.githubWrapper {
11646
display: flex;
11747

@@ -206,6 +136,12 @@
206136
width: 100%;
207137
height: auto;
208138
position: relative;
139+
140+
.teaserImage {
141+
width: 100%;
142+
margin-left: 100px;
143+
margin-top: 40px;
144+
}
209145
}
210146
}
211147

@@ -216,18 +152,6 @@
216152
}
217153
}
218154

219-
@media (max-width: 1144px) {
220-
.wrapper {
221-
.teaser {
222-
transition: 0.3s all;
223-
margin: auto;
224-
margin-top: 0;
225-
top: 0;
226-
bottom: 0;
227-
}
228-
}
229-
}
230-
231155
@media (max-width: 900px) {
232156
.wrapper {
233157
.content {
@@ -247,28 +171,8 @@
247171
margin-left: 0;
248172
}
249173

250-
.description {
251-
width: 100%;
252-
max-width: 100%;
253-
margin-left: 0;
254-
font-size: 1em;
255-
}
256-
257174
.buttons {
258175
display: inline-flex;
259-
260-
.more {
261-
font-size: 1em;
262-
}
263-
264-
.githubIframe {
265-
height: 40px;
266-
}
267-
268-
.videoButtonWrapper {
269-
width: fit-content;
270-
height: fit-content;
271-
}
272176
}
273177
}
274178

@@ -300,18 +204,6 @@
300204
}
301205
}
302206

303-
@media (max-width: 786px) {
304-
.wrapper {
305-
.text {
306-
.buttons {
307-
.videoButtonWrapper {
308-
display: none;
309-
}
310-
}
311-
}
312-
}
313-
}
314-
315207
@media only screen and (max-width: 767.99px) {
316208
.wrapper {
317209
height: auto;
@@ -322,72 +214,97 @@
322214

323215
.content {
324216
height: auto;
325-
}
326-
327-
.news {
328-
position: relative;
329-
bottom: auto;
330-
left: auto;
217+
display: flex;
218+
flex-direction: column;
331219
width: 100%;
332-
padding: 0 4.5%;
220+
max-width: 100%;
221+
margin-left: 0;
222+
margin-right: 0;
223+
margin-bottom: 0;
333224
box-sizing: border-box;
334225
}
335-
}
336-
337-
.homeDialog {
338-
margin: 16px auto;
339-
}
340-
}
341226

342-
@media (max-width: 510px) {
343-
.wrapper {
344227
.text {
345-
.buttons {
346-
margin-top: 70%;
347-
position: relative;
348-
top: -170px;
228+
top: 0;
229+
padding: 20px 4.5% 0;
230+
margin-left: 0;
231+
order: 1;
349232

350-
.githubWrapper {
351-
display: none;
352-
}
233+
.titleButtons {
234+
flex-direction: column;
235+
align-items: center;
236+
gap: 12px;
237+
}
353238

354-
.buttonLink:nth-child(2) {
355-
margin-right: 0;
356-
}
239+
.title {
240+
font-size: 2em;
357241
}
358242
}
359243

360244
.teaser {
361-
width: 100%;
362-
top: 5%;
245+
order: 2;
246+
position: relative;
247+
width: 70%;
248+
height: auto;
249+
max-width: none;
250+
right: auto;
251+
top: auto;
252+
bottom: auto;
253+
margin: 16px auto 0;
254+
justify-content: center;
363255

364256
.teaserimg {
365257
width: 100%;
258+
259+
.teaserImage {
260+
margin-left: 0;
261+
margin-top: 0;
262+
}
366263
}
367264
}
368265

266+
.homeDialog {
267+
order: 3;
268+
margin: 16px auto;
269+
}
270+
271+
.news {
272+
order: 4;
273+
position: relative;
274+
bottom: auto;
275+
left: auto;
276+
width: 100%;
277+
padding: 0 4.5%;
278+
box-sizing: border-box;
279+
}
280+
369281
.backLeftBottom {
370282
display: none;
371283
}
372284
}
373285
}
374286

375-
@media (max-width: 480px) {
287+
@media only screen and (max-width: 480px) {
376288
.wrapper {
289+
.teaser {
290+
width: 90%;
291+
}
292+
377293
.text {
378-
height: 70%;
294+
.buttons {
295+
.githubWrapper {
296+
display: none;
297+
}
298+
}
379299
}
380300

381301
.news {
382302
height: 160px;
383303
}
384-
385-
.teaser {
386-
top: 10%;
387-
}
388304
}
389305
}
390306

391307
.homeDialog {
392308
margin: 140px auto;
393309
}
310+

src/slots/Detail/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const Detail: React.FC<DetailProps> = ({
102102
{/** image */}
103103
<div className={cx(styles.teaser, 'teaser')}>
104104
<div className={cx(styles.teaserimg, 'teaser-img')}>
105-
<img width="100%" style={{ marginLeft: '100px', marginTop: '40px', ...imageStyle }} src={image} />
105+
<img className={styles.teaserImage} width="100%" style={imageStyle} src={image} />
106106
</div>
107107
</div>
108108
<img

0 commit comments

Comments
 (0)