Skip to content

Commit c9fb7a6

Browse files
committed
feat: animation gradient text
1 parent 11cb05d commit c9fb7a6

3 files changed

Lines changed: 35 additions & 1 deletion

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import React from 'react'
2+
import styles from './index.module.less'
3+
const GradientAnimationText = ({ text }) => {
4+
return <span className={styles['package-name']}>{text}</span>
5+
}
6+
7+
export default GradientAnimationText
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.package-name {
2+
color: transparent;
3+
background: linear-gradient(45deg, #ff6347, #ffd700, #32cd32, #1e90ff, #8a2be2);
4+
background-size: 400% 400%;
5+
background-clip: text;
6+
background-clip: text;
7+
font-size: 16px;
8+
font-weight: 700;
9+
line-height: 1.1;
10+
animation: gradient-animation 5s ease infinite;
11+
filter: drop-shadow(1px 2px 0 #fff);
12+
}
13+
14+
@keyframes gradient-animation {
15+
0% {
16+
background-position: 0% 0%;
17+
}
18+
19+
50% {
20+
background-position: 100% 100%;
21+
}
22+
23+
100% {
24+
background-position: 0% 0%;
25+
}
26+
}

src/pages/layout/proHeader/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { UserOutlined, LogoutOutlined, GithubOutlined, DownOutlined, SmileOutlin
66
import { useNavigate } from 'react-router-dom'
77
import { removeLocalStorage } from '@utils/publicFn'
88
import LanguageSwitcher from '@stateless/LanguageSwitcher'
9+
import GradientAnimationText from '@stateless/GradientAnimation'
910
// import { ReactComponent as LightSvg } from '@assets/svg/light.svg'
1011
// import { ReactComponent as DarkSvg } from '@assets/svg/dark.svg'
1112
// import LightSvg from '@assets/svg/light.svg'
@@ -81,7 +82,7 @@ const ProHeader = () => {
8182
>
8283
<div aria-hidden="true" className={styles.logo} onClick={() => redirectTo('/')}>
8384
{/* Pro React <Tag>{process.env.DEPLOYED_ENV}</Tag> */}
84-
Pro React Admin
85+
<GradientAnimationText text="Pro React Admin" />
8586
</div>
8687
<div className={styles.headerMeta}>
8788
<div className={styles.headerMenu}>

0 commit comments

Comments
 (0)