Skip to content

Commit c5d82d5

Browse files
author
qianxun
committed
feat: add style transition
1 parent ac8632c commit c5d82d5

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

src/pages/index.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import title from "@/static/images/home_title.png";
55
import styles from '@/styles/home.module.scss';
66
import {AboutDoc, DesignSystem, LeftOrigin, RightOrigin} from '@/data/doc';
77
import {useEffect, useState} from "react";
8+
import {Button} from "antd";
89

910
function Home() {
1011
const [bgHeight, setBgHeight] = useState('0px');
@@ -51,7 +52,7 @@ function Home() {
5152
<img src={item?.imgUrl} alt=""/>
5253
<div className={styles.title}>{item.title}</div>
5354
<div className={styles.subTitle}>{item.subTitle}</div>
54-
<div className={styles.jump} onClick={() => router.push(item.jumpUrl)}>{'查看详情>'}</div>
55+
<Button onClick={() => router.push(item.jumpUrl)} type={'link'}>{'查看详情>'}</Button>
5556
</div>
5657
))
5758
}
@@ -64,7 +65,7 @@ function Home() {
6465
<div style={{ margin: '35px 0px' }}>
6566
<div className={styles.title}>{item.title}</div>
6667
<div className={styles.subTitle}>{item.subTitle}</div>
67-
<div className={styles.jump} onClick={() => router.push(item.jumpUrl)}>{'查看详情>'}</div>
68+
<Button onClick={() => router.push(item.jumpUrl)} type={'link'}>{'查看详情>'}</Button>
6869
</div>
6970
</div>
7071
))

src/styles/home.module.scss

+10-8
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
background: #F1F9FE;
3333
border-radius: 16px;
3434
margin-right: 40px;
35+
cursor: pointer;
36+
transition: box-shadow .3s;
3537

3638
img {
3739
width: 160px;
@@ -45,6 +47,9 @@
4547
padding: 0 40px;
4648
}
4749
}
50+
.box:hover {
51+
box-shadow: 0 3px 6px -4px #0000001f, 0 6px 16px #00000014, 0 9px 28px 8px #0000000d;
52+
}
4853
}
4954
}
5055

@@ -69,6 +74,7 @@
6974
height: 381px;
7075
margin-right: 40px;
7176
text-align: center;
77+
transition: box-shadow .3s;
7278

7379
img {
7480
width: 150px;
@@ -86,16 +92,13 @@
8692
color: #64698B;
8793
margin: 18px 0 40px 0;
8894
}
89-
90-
.jump {
91-
color: #1D78FF;
92-
}
9395
}
9496

9597
.rightBox {
9698
width: 580px;
9799
height: 170px;
98100
display: flex;
101+
transition: box-shadow .3s;
99102

100103
img {
101104
width: 100px;
@@ -116,12 +119,11 @@
116119
width: 236px;
117120
margin: 12px 0px;
118121
}
119-
120-
.jump {
121-
color: #1D78FF;
122-
}
123122
}
124123

124+
.leftBox:hover,.rightBox:hover {
125+
box-shadow: 0 3px 6px -4px #0000001f, 0 6px 16px #00000014, 0 9px 28px 8px #0000000d;
126+
}
125127
.rightBox:first-child {
126128
margin-bottom: 40px;
127129
}

src/styles/navHeader.module.scss

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
font-family: PingFangSC-Medium, PingFang SC;
2626
font-weight: 500;
2727
color: #3D446E;
28+
cursor: pointer;
2829
}
2930
}
3031
.menu {

0 commit comments

Comments
 (0)