first commit
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
import React from "react";
|
||||
import Card from "@mui/material/Card";
|
||||
import { Typography } from "@mui/material";
|
||||
import Box from '@mui/material/Box';
|
||||
import Switch from '@mui/material/Switch';
|
||||
import Paper from '@mui/material/Paper';
|
||||
import Collapse from '@mui/material/Collapse';
|
||||
import FormControlLabel from '@mui/material/FormControlLabel';
|
||||
|
||||
const icon = (
|
||||
<Paper sx={{ m: 1 }} elevation={4}>
|
||||
<Box component="svg" sx={{ width: 100, height: 100 }}>
|
||||
<Box
|
||||
component="polygon"
|
||||
sx={{
|
||||
fill: (theme) => theme.palette.common.white,
|
||||
stroke: (theme) => theme.palette.divider,
|
||||
strokeWidth: 1,
|
||||
}}
|
||||
points="0,100 50,00, 100,100"
|
||||
/>
|
||||
</Box>
|
||||
</Paper>
|
||||
);
|
||||
|
||||
export default function CollapseTransitions() {
|
||||
|
||||
const [checked, setChecked] = React.useState(false);
|
||||
|
||||
const handleChange = () => {
|
||||
setChecked((prev) => !prev);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
borderRadius: "10px",
|
||||
p: "25px",
|
||||
mb: "15px",
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
as="h3"
|
||||
sx={{
|
||||
fontSize: 18,
|
||||
fontWeight: 500,
|
||||
mb: '10px'
|
||||
}}
|
||||
>
|
||||
Collapse
|
||||
</Typography>
|
||||
|
||||
<Box sx={{ height: 300 }}>
|
||||
<FormControlLabel
|
||||
control={<Switch checked={checked} onChange={handleChange} />}
|
||||
label="Show"
|
||||
/>
|
||||
<Box
|
||||
sx={{
|
||||
'& > :not(style)': {
|
||||
display: 'flex',
|
||||
justifyContent: 'space-around',
|
||||
height: 120,
|
||||
width: 250,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<div>
|
||||
<Collapse in={checked}>{icon}</Collapse>
|
||||
<Collapse in={checked} collapsedSize={40}>
|
||||
{icon}
|
||||
</Collapse>
|
||||
</div>
|
||||
<div>
|
||||
<Box sx={{ width: '50%' }}>
|
||||
<Collapse orientation="horizontal" in={checked}>
|
||||
{icon}
|
||||
</Collapse>
|
||||
</Box>
|
||||
<Box sx={{ width: '50%' }}>
|
||||
<Collapse orientation="horizontal" in={checked} collapsedSize={40}>
|
||||
{icon}
|
||||
</Collapse>
|
||||
</Box>
|
||||
</div>
|
||||
</Box>
|
||||
</Box>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
import React from "react";
|
||||
import Card from "@mui/material/Card";
|
||||
import { Typography } from "@mui/material";
|
||||
import Box from '@mui/material/Box';
|
||||
import Switch from '@mui/material/Switch';
|
||||
import Paper from '@mui/material/Paper';
|
||||
import Fade from '@mui/material/Fade';
|
||||
import FormControlLabel from '@mui/material/FormControlLabel';
|
||||
|
||||
const icon = (
|
||||
<Paper sx={{ m: 1 }} elevation={4}>
|
||||
<Box component="svg" sx={{ width: 100, height: 100 }}>
|
||||
<Box
|
||||
component="polygon"
|
||||
sx={{
|
||||
fill: (theme) => theme.palette.common.white,
|
||||
stroke: (theme) => theme.palette.divider,
|
||||
strokeWidth: 1,
|
||||
}}
|
||||
points="0,100 50,00, 100,100"
|
||||
/>
|
||||
</Box>
|
||||
</Paper>
|
||||
);
|
||||
|
||||
export default function FadeTransitions() {
|
||||
|
||||
const [checked, setChecked] = React.useState(false);
|
||||
|
||||
const handleChange = () => {
|
||||
setChecked((prev) => !prev);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
borderRadius: "10px",
|
||||
p: "25px",
|
||||
mb: "15px",
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
as="h3"
|
||||
sx={{
|
||||
fontSize: 18,
|
||||
fontWeight: 500,
|
||||
mb: '10px'
|
||||
}}
|
||||
>
|
||||
Fade
|
||||
</Typography>
|
||||
|
||||
<Box sx={{ height: 180 }}>
|
||||
<FormControlLabel
|
||||
control={<Switch checked={checked} onChange={handleChange} />}
|
||||
label="Show"
|
||||
/>
|
||||
<Box sx={{ display: 'flex' }}>
|
||||
<Fade in={checked}>{icon}</Fade>
|
||||
</Box>
|
||||
</Box>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
import React from "react";
|
||||
import Card from "@mui/material/Card";
|
||||
import { Typography } from "@mui/material";
|
||||
import Box from '@mui/material/Box';
|
||||
import Switch from '@mui/material/Switch';
|
||||
import Paper from '@mui/material/Paper';
|
||||
import Grow from '@mui/material/Grow';
|
||||
import FormControlLabel from '@mui/material/FormControlLabel';
|
||||
|
||||
const icon = (
|
||||
<Paper sx={{ m: 1 }} elevation={4}>
|
||||
<Box component="svg" sx={{ width: 100, height: 100 }}>
|
||||
<Box
|
||||
component="polygon"
|
||||
sx={{
|
||||
fill: (theme) => theme.palette.common.white,
|
||||
stroke: (theme) => theme.palette.divider,
|
||||
strokeWidth: 1,
|
||||
}}
|
||||
points="0,100 50,00, 100,100"
|
||||
/>
|
||||
</Box>
|
||||
</Paper>
|
||||
);
|
||||
|
||||
export default function GrowTransitions() {
|
||||
|
||||
const [checked, setChecked] = React.useState(false);
|
||||
|
||||
const handleChange = () => {
|
||||
setChecked((prev) => !prev);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
borderRadius: "10px",
|
||||
p: "25px",
|
||||
mb: "15px",
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
as="h3"
|
||||
sx={{
|
||||
fontSize: 18,
|
||||
fontWeight: 500,
|
||||
mb: '10px'
|
||||
}}
|
||||
>
|
||||
Grow Transitions
|
||||
</Typography>
|
||||
|
||||
<Box sx={{ height: 180 }}>
|
||||
<FormControlLabel
|
||||
control={<Switch checked={checked} onChange={handleChange} />}
|
||||
label="Show"
|
||||
/>
|
||||
<Box sx={{ display: 'flex' }}>
|
||||
<Grow in={checked}>{icon}</Grow>
|
||||
{/* Conditionally applies the timeout prop to change the entry speed. */}
|
||||
<Grow
|
||||
in={checked}
|
||||
style={{ transformOrigin: '0 0 0' }}
|
||||
{...(checked ? { timeout: 1000 } : {})}
|
||||
>
|
||||
{icon}
|
||||
</Grow>
|
||||
</Box>
|
||||
</Box>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
import React from "react";
|
||||
import Card from "@mui/material/Card";
|
||||
import { Typography } from "@mui/material";
|
||||
import Box from '@mui/material/Box';
|
||||
import Switch from '@mui/material/Switch';
|
||||
import Paper from '@mui/material/Paper';
|
||||
import Slide from '@mui/material/Slide';
|
||||
import FormControlLabel from '@mui/material/FormControlLabel';
|
||||
|
||||
const icon = (
|
||||
<Paper sx={{ m: 1, width: 100, height: 100 }} elevation={4}>
|
||||
<Box component="svg" sx={{ width: 100, height: 100 }}>
|
||||
<Box
|
||||
component="polygon"
|
||||
sx={{
|
||||
fill: (theme) => theme.palette.common.white,
|
||||
stroke: (theme) => theme.palette.divider,
|
||||
strokeWidth: 1,
|
||||
}}
|
||||
points="0,100 50,00, 100,100"
|
||||
/>
|
||||
</Box>
|
||||
</Paper>
|
||||
);
|
||||
export default function SlideRelativeToAContainer() {
|
||||
|
||||
const [checked, setChecked] = React.useState(false);
|
||||
const containerRef = React.useRef(null);
|
||||
|
||||
const handleChange = () => {
|
||||
setChecked((prev) => !prev);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
borderRadius: "10px",
|
||||
p: "25px",
|
||||
mb: "15px",
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
as="h3"
|
||||
sx={{
|
||||
fontSize: 18,
|
||||
fontWeight: 500,
|
||||
mb: '10px'
|
||||
}}
|
||||
>
|
||||
Slide Relative To A Container
|
||||
</Typography>
|
||||
|
||||
<Box
|
||||
sx={{
|
||||
height: 180,
|
||||
width: 240,
|
||||
display: 'flex',
|
||||
padding: 2,
|
||||
borderRadius: 1,
|
||||
bgcolor: (theme) =>
|
||||
theme.palette.mode === 'light' ? 'grey.100' : 'grey.900',
|
||||
overflow: 'hidden',
|
||||
}}
|
||||
ref={containerRef}
|
||||
className="bg-black"
|
||||
>
|
||||
<Box sx={{ width: 200 }}>
|
||||
<FormControlLabel
|
||||
control={<Switch checked={checked} onChange={handleChange} />}
|
||||
label="Show from target"
|
||||
/>
|
||||
<Slide direction="up" in={checked} container={containerRef.current}>
|
||||
{icon}
|
||||
</Slide>
|
||||
</Box>
|
||||
</Box>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
import React from "react";
|
||||
import Card from "@mui/material/Card";
|
||||
import { Typography } from "@mui/material";
|
||||
import Box from '@mui/material/Box';
|
||||
import Switch from '@mui/material/Switch';
|
||||
import Paper from '@mui/material/Paper';
|
||||
import Slide from '@mui/material/Slide';
|
||||
import FormControlLabel from '@mui/material/FormControlLabel';
|
||||
|
||||
const icon = (
|
||||
<Paper sx={{ m: 1 }} elevation={4}>
|
||||
<Box component="svg" sx={{ width: 100, height: 100 }}>
|
||||
<Box
|
||||
component="polygon"
|
||||
sx={{
|
||||
fill: (theme) => theme.palette.common.white,
|
||||
stroke: (theme) => theme.palette.divider,
|
||||
strokeWidth: 1,
|
||||
}}
|
||||
points="0,100 50,00, 100,100"
|
||||
/>
|
||||
</Box>
|
||||
</Paper>
|
||||
);
|
||||
|
||||
export default function SlideTransitions() {
|
||||
|
||||
const [checked, setChecked] = React.useState(false);
|
||||
|
||||
const handleChange = () => {
|
||||
setChecked((prev) => !prev);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
borderRadius: "10px",
|
||||
p: "25px",
|
||||
mb: "15px",
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
as="h3"
|
||||
sx={{
|
||||
fontSize: 18,
|
||||
fontWeight: 500,
|
||||
mb: '10px'
|
||||
}}
|
||||
>
|
||||
Slide Transitions
|
||||
</Typography>
|
||||
|
||||
<Box sx={{ height: 180 }}>
|
||||
<Box sx={{ width: `calc(100px + 16px)` }}>
|
||||
<FormControlLabel
|
||||
control={<Switch checked={checked} onChange={handleChange} />}
|
||||
label="Show"
|
||||
/>
|
||||
<Slide direction="up" in={checked} mountOnEnter unmountOnExit>
|
||||
{icon}
|
||||
</Slide>
|
||||
</Box>
|
||||
</Box>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
import React from "react";
|
||||
import Card from "@mui/material/Card";
|
||||
import { Typography } from "@mui/material";
|
||||
import Box from '@mui/material/Box';
|
||||
import Switch from '@mui/material/Switch';
|
||||
import Paper from '@mui/material/Paper';
|
||||
import Zoom from '@mui/material/Zoom';
|
||||
import FormControlLabel from '@mui/material/FormControlLabel';
|
||||
|
||||
const icon = (
|
||||
<Paper sx={{ m: 1 }} elevation={4}>
|
||||
<Box component="svg" sx={{ width: 100, height: 100 }}>
|
||||
<Box
|
||||
component="polygon"
|
||||
sx={{
|
||||
fill: (theme) => theme.palette.common.white,
|
||||
stroke: (theme) => theme.palette.divider,
|
||||
strokeWidth: 1,
|
||||
}}
|
||||
points="0,100 50,00, 100,100"
|
||||
/>
|
||||
</Box>
|
||||
</Paper>
|
||||
);
|
||||
|
||||
export default function ZoomTransitions() {
|
||||
|
||||
const [checked, setChecked] = React.useState(false);
|
||||
|
||||
const handleChange = () => {
|
||||
setChecked((prev) => !prev);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
borderRadius: "10px",
|
||||
p: "25px",
|
||||
mb: "15px",
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
as="h3"
|
||||
sx={{
|
||||
fontSize: 18,
|
||||
fontWeight: 500,
|
||||
mb: '10px'
|
||||
}}
|
||||
>
|
||||
ZoomTransitions
|
||||
</Typography>
|
||||
|
||||
<Box sx={{ height: 180 }}>
|
||||
<FormControlLabel
|
||||
control={<Switch checked={checked} onChange={handleChange} />}
|
||||
label="Show"
|
||||
/>
|
||||
<Box sx={{ display: 'flex' }}>
|
||||
<Zoom in={checked}>{icon}</Zoom>
|
||||
<Zoom in={checked} style={{ transitionDelay: checked ? '500ms' : '0ms' }}>
|
||||
{icon}
|
||||
</Zoom>
|
||||
</Box>
|
||||
</Box>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user