Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ const Footer = ({ data, theme }) => {
alignItems: "center",
justifyContent: "center",
position: "fixed",
bottom: "0px",
bottom: "0",
left: "0",
right: "0",
display: "flex",
flexDirection: "column",
mb: [10, 20],
Expand Down
60 changes: 33 additions & 27 deletions src/components/liquidswipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ const StyledButton = styled(animated.button)`
background: transparent;
color: ${(props) => props.color};
border: 1px solid ${(props) => props.color};
cursor: pointer;
touch-action: pan-y;
&::focus {
outline: 0;
}
outline: none;
`;

const height = window.innerHeight;
Expand Down Expand Up @@ -119,39 +122,42 @@ const Page = ({ children, theme, index, setActive, gone = false }) => {
}
}, [gone]);

const bind = useDrag(({ down, movement: [mx], xy: [, my], vxvy: [vx] }) => {
if (!isGone) {
if (down && isMove) {
setDvalue({
d: getPath(my, mx + 60, 10),
});
setPos({
posX: mx + 20,
posY: my - 20,
});
if (mx > width / 2 || vx > 3) {
const bind = useDrag(
({ down, movement: [mx], xy: [, my], vxvy: [vx] }) => {
if (!isGone) {
if (down && isMove) {
setDvalue({
d: getPath(my, -50, w),
d: getPath(my, mx + 60, 10),
});
setPos({
posX: mx + 20,
posY: my - 20,
});
setGone(true);
setTimeout(() => {
if (mx > width / 2 || vx > 3) {
setDvalue({
d: getPath(my, 0, w),
d: getPath(my, -50, w),
});
setActive(index);
}, 240);
setGone(true);
setTimeout(() => {
setDvalue({
d: getPath(my, 0, w),
});
setActive(index);
}, 240);
}
} else {
setDvalue({
d: getPath(height * 0.72, 48, 5),
});
setPos({
posX: 7,
posY: height * 0.72 - 20,
});
}
} else {
setDvalue({
d: getPath(height * 0.72, 48, 5),
});
setPos({
posX: 7,
posY: height * 0.72 - 20,
});
}
}
});
},
{ useTouch: width <= 813 }
);
return (
<PageContainer id={`pageContainer${index}`} {...bind()}>
<StyledSVG version="1.1" id="blob" xmlns="http://www.w3.org/2000/svg">
Expand Down