🎨 styles: cart drawer animation

:%s
This commit is contained in:
lytrankieio123 2021-09-15 14:25:03 +07:00
parent d44567e9f2
commit 8412ca6ecd
3 changed files with 10 additions and 4 deletions

View File

@ -8,6 +8,7 @@ interface Props {
const option = { const option = {
slidesPerView: 1, slidesPerView: 1,
mode: 'free',
} }
const Banner = memo(({ data }: Props) => { const Banner = memo(({ data }: Props) => {
if (data.length === 1) { if (data.length === 1) {

View File

@ -8,19 +8,23 @@
height: 100vh; height: 100vh;
width: 100%; width: 100%;
z-index: 20000; z-index: 20000;
transform: translateX(110%); transform: none;
&.hide {
.innerWrap {
background: none;
}
transform: translateX(110%);
}
&.show { &.show {
.innerWrap { .innerWrap {
background: rgba(0, 0, 0, 0.2); background: rgba(0, 0, 0, 0.2);
animation: animateBackground 0.8s; animation: animateBackground 0.8s;
} }
transform: none;
} }
.innerWrap { .innerWrap {
@apply w-full; @apply w-full;
background: none;
} }
.inner { .inner {
@apply flex flex-col bg-white; @apply flex flex-col bg-white;

View File

@ -22,7 +22,8 @@ const handleClickOut = (e: any) => {
return ( return (
<div className={classNames({ <div className={classNames({
[s.drawerCommon]: true, [s.drawerCommon]: true,
[s.show]: visible [s.hide]: !visible,
[s.show]: visible,
})}> })}>
<div className={s.innerWrap} onClick={handleClickOut}> <div className={s.innerWrap} onClick={handleClickOut}>
<div className={s.inner} ref={refInner}> <div className={s.inner} ref={refInner}>