mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 12:24:18 +00:00
🎨 styles: cart drawer animation
:%s
This commit is contained in:
parent
d44567e9f2
commit
8412ca6ecd
@ -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) {
|
||||||
|
@ -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;
|
||||||
|
@ -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}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user