Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: get rid of framer-motion

Abdullah Atta9281f9a390a2
diff --git a/apps/web/package.json b/apps/web/package.json
index 48883b5d4..a2d0c40da 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -55,7 +55,6 @@
"event-source-polyfill": "^1.0.25",
"fflate": "^0.8.0",
"file-saver": "^2.0.5",
- "framer-motion": "^11.5.6",
"hash-wasm": "^4.9.0",
"hotkeys-js": "^3.8.3",
"katex": "0.16.2",
diff --git a/apps/web/src/components/animated/index.js b/apps/web/src/components/animated/index.js
deleted file mode 100644
index 4a5df788d..000000000
--- a/apps/web/src/components/animated/index.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-This file is part of the Notesnook project (https://notesnook.com/)
-
-Copyright (C) 2023 Streetwriters (Private) Limited
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-import { motion } from "framer-motion";
-import { Flex, Box, Image, Text } from "@theme-ui/components";
-import { Input } from "@theme-ui/components";
-
-export const AnimatedFlex = motion(Flex);
-export const AnimatedBox = motion(Box);
-export const AnimatedImage = motion(Image);
-export const AnimatedText = motion(Text);
-export const AnimatedInput = motion(Input);
diff --git a/apps/web/src/components/navigation-menu/index.tsx b/apps/web/src/components/navigation-menu/index.tsx
index 5a3d228c5..8265eff0a 100644
--- a/apps/web/src/components/navigation-menu/index.tsx
+++ b/apps/web/src/components/navigation-menu/index.tsx
@@ -38,7 +38,6 @@ import {
Reminders,
User
} from "../icons";
-import { AnimatedFlex } from "../animated";
import NavigationItem, { SortableNavigationItem } from "./navigation-item";
import { hardNavigate, hashNavigate, navigate } from "../../navigation";
import { db } from "../../common/db";
@@ -227,18 +226,11 @@ function NavigationMenu(props: NavigationMenuProps) {
borderRight: "1px solid var(--separator)"
}}
>
- <AnimatedFlex
+ <Flex
id="navigation-menu"
data-test-id="navigation-menu"
- initial={{
- opacity: 0
- }}
- animate={{
- opacity: isFocusMode ? 0 : 1,
- visibility: isFocusMode ? "collapse" : "visible"
- }}
- transition={{ duration: 0.2, ease: "easeInOut" }}
sx={{
+ display: isFocusMode ? "none" : "flex",
flex: 1,
overflow: "hidden",
flexDirection: "column",
@@ -522,7 +514,7 @@ function NavigationMenu(props: NavigationMenuProps) {
)}
</NavigationItem>
</Flex>
- </AnimatedFlex>
+ </Flex>
</ScopedThemeProvider>
);
}
diff --git a/apps/web/src/components/properties/index.tsx b/apps/web/src/components/properties/index.tsx
index 5b870173c..5b2805b0a 100644
--- a/apps/web/src/components/properties/index.tsx
+++ b/apps/web/src/components/properties/index.tsx
@@ -39,7 +39,6 @@ import {
import { db } from "../../common/db";
import { useStore as useAppStore } from "../../stores/app-store";
import { store as noteStore } from "../../stores/note-store";
-import { AnimatedFlex } from "../animated";
import Toggle from "./toggle";
import ScrollContainer from "../scroll-container";
import {
@@ -117,18 +116,17 @@ function EditorProperties(props: EditorPropertiesProps) {
);
if (isFocusMode || !session) return null;
return (
- <AnimatedFlex
- animate={{
- x: 0
- }}
- transition={{
- duration: 0.1,
- bounceDamping: 1,
- bounceStiffness: 1,
- ease: "easeOut"
- }}
- initial={{ x: 600 }}
+ <Flex
+ css={`@keyframes slideIn {
+ from {
+ transform: translateX(600px);
+ }
+ to {
+ transform: translateX(0);
+ }`}
sx={{
+ transform: "translateX(600)",
+ animation: "0.1s ease-out 0s 1 slideIn",
display: "flex",
position: "absolute",
top: TITLE_BAR_HEIGHT,
@@ -227,7 +225,7 @@ function EditorProperties(props: EditorPropertiesProps) {
)}
</ScrollContainer>
</ScopedThemeProvider>
- </AnimatedFlex>
+ </Flex>
);
}
export default React.memo(EditorProperties);