-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
75 additions
and
8 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions
52
packages/testnet/frontend/src/components/ui/RotatingLogo.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,52 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
import logoRound from '../../assets/logos/logo-round.png'; | ||
|
||
const RotatingLogo = () => { | ||
const [showLogo, setShowLogo] = useState(false); | ||
|
||
useEffect(() => { | ||
const timer = setTimeout(() => { | ||
setShowLogo(true); | ||
}, 1000); // 2 seconds timeout | ||
|
||
return () => clearTimeout(timer); // Clear the timer if the component unmounts | ||
}, []); | ||
|
||
if (showLogo) { | ||
return ( | ||
<> | ||
<style> | ||
{` | ||
@keyframes rotate { | ||
from { transform: rotate(0deg); } | ||
to { transform: rotate(360deg); } | ||
} | ||
.rotating-logo { | ||
animation: rotate 2s linear infinite; | ||
} | ||
`} | ||
</style> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
height: '100vh', | ||
width: '100vw', | ||
}} | ||
> | ||
<img | ||
src={logoRound} | ||
className="rotating-logo" | ||
alt="Logo" | ||
style={{ width: '7em' }} | ||
/> | ||
</div> | ||
</> | ||
); | ||
} else { | ||
return null; // or some loading indicator, or whatever should be shown before the logo appears | ||
} | ||
}; | ||
|
||
export default RotatingLogo; |
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