-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #291 from liam-hq/loading-animation-3
feat: add loading spinner animation
- Loading branch information
Showing
7 changed files
with
80 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@liam-hq/erd-core": patch | ||
"@liam-hq/cli": patch | ||
--- | ||
|
||
💄 add loading spinner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/Spinner/Spinner.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
@keyframes spin { | ||
from { | ||
transform: rotate(0); | ||
} | ||
to { | ||
transform: rotate(359deg); | ||
} | ||
} | ||
|
||
.spinnerBox { | ||
width: 300px; | ||
height: 300px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background-color: transparent; | ||
pointer-events: none; | ||
} | ||
|
||
.circleBorder { | ||
width: 100px; | ||
height: 100px; | ||
padding: 1px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
border-radius: 50%; | ||
background: #141616; | ||
background: linear-gradient( | ||
0deg, | ||
rgba(29, 237, 131, 0.05) 33%, | ||
rgba(29, 237, 131, 1) 100% | ||
); | ||
animation: spin 1.2s linear 0s infinite; | ||
} | ||
|
||
.circleCore { | ||
width: 100%; | ||
height: 100%; | ||
background-color: #141616; | ||
border-radius: 50%; | ||
} |
17 changes: 17 additions & 0 deletions
17
frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/Spinner/Spinner.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import clsx from 'clsx' | ||
import type { FC } from 'react' | ||
import styles from './Spinner.module.css' | ||
|
||
type Props = { | ||
className?: string | ||
} | ||
|
||
export const Spinner: FC<Props> = ({ className }) => { | ||
return ( | ||
<span className={clsx(styles.spinnerBox, className)}> | ||
<span className={styles.circleBorder}> | ||
<span className={styles.circleCore} /> | ||
</span> | ||
</span> | ||
) | ||
} |
1 change: 1 addition & 0 deletions
1
frontend/packages/erd-core/src/components/ERDRenderer/ERDContent/Spinner/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './Spinner' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters