diff --git a/client/package-lock.json b/client/package-lock.json index 399da29..55e363e 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@reduxjs/toolkit": "^2.5.0", "@zegocloud/zego-uikit-prebuilt": "^2.14.0", + "aos": "^2.3.4", "axios": "^1.7.9", "client": "^0.0.1", "date-fns": "^4.1.0", @@ -1667,6 +1668,17 @@ "node": ">= 8" } }, + "node_modules/aos": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/aos/-/aos-2.3.4.tgz", + "integrity": "sha512-zh/ahtR2yME4I51z8IttIt4lC1Nw0ktsFtmeDzID1m9naJnWXhCoARaCgNOGXb5CLy3zm+wqmRAEgMYB5E2HUw==", + "license": "MIT", + "dependencies": { + "classlist-polyfill": "^1.0.3", + "lodash.debounce": "^4.0.6", + "lodash.throttle": "^4.0.1" + } + }, "node_modules/arg": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", @@ -2237,6 +2249,12 @@ "node": ">= 6" } }, + "node_modules/classlist-polyfill": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/classlist-polyfill/-/classlist-polyfill-1.2.0.tgz", + "integrity": "sha512-GzIjNdcEtH4ieA2S8NmrSxv7DfEV5fmixQeyTmqmRmRJPGpRBaSnA2a0VrCjyT8iW8JjEdMbKzDotAJf+ajgaQ==", + "license": "Unlicense" + }, "node_modules/client": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/client/-/client-0.0.1.tgz", @@ -4443,6 +4461,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", + "license": "MIT" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -4450,6 +4474,12 @@ "dev": true, "license": "MIT" }, + "node_modules/lodash.throttle": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", + "integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==", + "license": "MIT" + }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", diff --git a/client/package.json b/client/package.json index 4778340..abff2a0 100644 --- a/client/package.json +++ b/client/package.json @@ -12,6 +12,7 @@ "dependencies": { "@reduxjs/toolkit": "^2.5.0", "@zegocloud/zego-uikit-prebuilt": "^2.14.0", + "aos": "^2.3.4", "axios": "^1.7.9", "client": "^0.0.1", "date-fns": "^4.1.0", diff --git a/client/src/App.jsx b/client/src/App.jsx index 1178ad0..681f8b6 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -8,6 +8,9 @@ import { setUser } from "./store/slices/userSlice.jsx"; import ScrollToTop from "./components/ScrollToTop"; import ScrollRestoration from "./components/ScrollRestoration"; import { Toaster, toast } from 'react-hot-toast'; +import AOS from "aos"; +import "aos/dist/aos.css"; + function App() { const matches = useMatches(); const hideLayout = matches.some((match) => match.handle?.noLayout); @@ -17,7 +20,7 @@ function App() { // Restore user session on app load const token = localStorage.getItem('token'); const userData = localStorage.getItem('userData'); - + if (token && userData) { try { const parsedUserData = JSON.parse(userData); @@ -29,6 +32,13 @@ function App() { localStorage.removeItem('userData'); } } + + // ✅ Initialize AOS + AOS.init({ + duration: 1000, // animation duration in ms + once: true, // whether animation happens only once + easing: "ease-in-out", // default easing + }); }, [dispatch]); return ( @@ -44,7 +54,7 @@ function App() { {!hideLayout &&