Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
34 lines
810 B
JavaScript
34 lines
810 B
JavaScript
import { styled, createTheme, ThemeProvider } from '@mui/material/styles';
|
|
import { deepPurple } from '@mui/material/colors';
|
|
import Avatar from '@mui/material/Avatar';
|
|
|
|
const customTheme = createTheme({
|
|
palette: {
|
|
primary: {
|
|
main: deepPurple[500],
|
|
},
|
|
},
|
|
});
|
|
|
|
const StyledAvatar = styled(Avatar)`
|
|
${({ theme }) => `
|
|
cursor: pointer;
|
|
background-color: ${theme.palette.primary.main};
|
|
transition: ${theme.transitions.create(['background-color', 'transform'], {
|
|
duration: theme.transitions.duration.standard,
|
|
})};
|
|
&:hover {
|
|
background-color: ${theme.palette.secondary.main};
|
|
transform: scale(1.3);
|
|
}
|
|
`}
|
|
`;
|
|
|
|
export default function TransitionHover() {
|
|
return (
|
|
<ThemeProvider theme={customTheme}>
|
|
<StyledAvatar>OP</StyledAvatar>
|
|
</ThemeProvider>
|
|
);
|
|
}
|