forked from ZcashFoundation/zebra
-
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.
Adds hover state to carousels (ZcashFoundation#318)
This adds a nice hover state to carousels so they darken when you hover over them. <img width="982" alt="Screen Shot 2024-07-20 at 10 47 18 AM" src="https://github.com/user-attachments/assets/50f9039a-b81c-4949-828b-0651566b0a70"> --------- Co-authored-by: Skylar Saveland <skylar.saveland@gmail.com>
- Loading branch information
Showing
3 changed files
with
33 additions
and
25 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,27 @@ | ||
import { styled } from '@mui/material/styles'; | ||
import { Card, CardProps } from '@mui/material'; | ||
|
||
const StyledCard = styled(Card)(({ theme }) => ({ | ||
transition: 'background-color 0.3s', | ||
'&:hover': { | ||
backgroundColor: theme.palette.action.hover, | ||
}, | ||
})); | ||
|
||
const HoverCard: React.FC<CardProps> = (props) => { | ||
return <StyledCard {...props} | ||
style={{ | ||
width: '90%', | ||
maxWidth: '400px', | ||
minHeight: 220, | ||
position: 'relative', | ||
marginLeft: 'auto', | ||
marginRight: 'auto', | ||
cursor: 'pointer', | ||
marginBottom: '0.5em', | ||
}} | ||
|
||
/>; | ||
}; | ||
|
||
export default HoverCard; |
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