From 4c3a17cdcc3f06a2abfc06f58a6eff8c6d515f9b Mon Sep 17 00:00:00 2001 From: Dhruwang Date: Sun, 8 Oct 2023 16:24:39 +0530 Subject: [PATCH] made expansion animation smoother --- .../[environmentId]/surveys/PreviewSurvey.tsx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/PreviewSurvey.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/PreviewSurvey.tsx index 8938160f65..a0041a9d04 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/PreviewSurvey.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/PreviewSurvey.tsx @@ -60,26 +60,29 @@ const previewParentContainerVariant: Variants = { const previewScreenVariants: Variants = { expanded: { right: "5%", - bottom: "2%", - width: "90%", - height: "90%", + bottom: "10%", + top: "10%", + width: "40%", + position: "fixed", + height: "80%", zIndex: 1050, boxShadow: "0px 4px 5px 4px rgba(169, 169, 169, 0.25)", transition: { ease: "easeInOut", - duration: 0.3, + duration: 0, }, }, expanded_with_fixed_positioning: { zIndex: 1050, position: "fixed", + top: "5%", right: "5%", - bottom: "5%", + bottom: "10%", width: "90%", height: "90%", transition: { ease: "easeOut", - duration: 0.2, + duration: 0.4, }, }, shrink: { @@ -240,7 +243,7 @@ export default function PreviewSurvey({ { - setIsFullScreenPreview(false); + setIsFullScreenPreview(true); setPreviewPosition("relative"); }} /> @@ -249,7 +252,7 @@ export default function PreviewSurvey({ className="mr-2 h-4 w-4 cursor-pointer" onClick={() => { setIsFullScreenPreview(true); - setTimeout(() => setPreviewPosition("fixed"), 300); + setTimeout(() => setPreviewPosition("fixed"), 200); }} /> )}