-
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.
Update animation and styling when hovering and clicking buttons
- Loading branch information
Showing
4 changed files
with
132 additions
and
5 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
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,63 @@ | ||
import Button from '@mui/material/Button'; | ||
import Typography from '@mui/material/Typography'; | ||
import { keyframes } from '@mui/system'; | ||
|
||
const colorAnimation = keyframes` | ||
0% { | ||
color: #FFFFFF; | ||
} | ||
30% { | ||
color: #FFFFFF; | ||
} | ||
100% { | ||
color: #000000; | ||
} | ||
`; | ||
|
||
const DepositEthButton = () => { | ||
const handleMouseDown = (event) => { | ||
event.currentTarget.blur(); | ||
}; | ||
|
||
return ( | ||
<Button | ||
variant="contained" | ||
onMouseDown={handleMouseDown} | ||
disableRipple={true} | ||
sx={{ | ||
width: 200, | ||
height: 55, | ||
borderRadius: '15px', | ||
border: '4px solid #000000', | ||
backgroundColor: '#A388EE', | ||
boxShadow: '2px 4px 0px rgba(0, 0, 0)', | ||
textTransform: 'none', | ||
'&:focus .MuiTypography-root': { | ||
animation: `${colorAnimation} 0.5s forwards`, | ||
}, | ||
'&:hover': { | ||
backgroundColor: '#A388EE', | ||
boxShadow: '2px 4px 0px rgba(0, 0, 0)', | ||
'& .MuiTypography-root': { | ||
fontSize: '20px', | ||
}, | ||
}, | ||
}} | ||
> | ||
<Typography | ||
variant="button" | ||
sx={{ | ||
fontFamily: 'Lexend Mega, sans-serif', | ||
fontWeight: 'bold', | ||
fontSize: '16px', | ||
whiteSpace: 'nowrap', | ||
color: '#000000', | ||
}} | ||
> | ||
Deposit | ||
</Typography> | ||
</Button> | ||
); | ||
}; | ||
|
||
export default DepositEthButton; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import Button from '@mui/material/Button'; | ||
import Typography from '@mui/material/Typography'; | ||
import { keyframes } from '@mui/system'; | ||
|
||
const colorAnimation = keyframes` | ||
0% { | ||
color: #FFFFFF; | ||
} | ||
30% { | ||
color: #FFFFFF; | ||
} | ||
100% { | ||
color: #000000; | ||
} | ||
`; | ||
|
||
const WithdrawEthButton = () => { | ||
const handleMouseDown = (event) => { | ||
event.currentTarget.blur(); | ||
}; | ||
|
||
return ( | ||
<Button | ||
variant="contained" | ||
onMouseDown={handleMouseDown} | ||
disableRipple={true} | ||
sx={{ | ||
width: 200, | ||
height: 55, | ||
borderRadius: '15px', | ||
border: '4px solid #000000', | ||
backgroundColor: '#FFA07A', | ||
boxShadow: '2px 4px 0px rgba(0, 0, 0)', | ||
textTransform: 'none', | ||
'&:focus .MuiTypography-root': { | ||
animation: `${colorAnimation} 0.5s forwards`, | ||
}, | ||
'&:hover': { | ||
backgroundColor: '#FFA07A', | ||
boxShadow: '2px 4px 0px rgba(0, 0, 0)', | ||
'& .MuiTypography-root': { | ||
fontSize: '20px', | ||
}, | ||
}, | ||
}} | ||
> | ||
<Typography | ||
variant="button" | ||
sx={{ | ||
fontFamily: 'Lexend Mega, sans-serif', | ||
fontWeight: 'bold', | ||
fontSize: '16px', | ||
whiteSpace: 'nowrap', | ||
color: '#000000', | ||
}} | ||
> | ||
Withdraw | ||
</Typography> | ||
</Button> | ||
); | ||
}; | ||
|
||
export default WithdrawEthButton; |