![]() |
VOOZH | about |
The following approach covers how to create an animated sliding page gallery using framer-motion and ReactJS.
Prerequisites:
Creating React Application And Installing Module:
Step 1: Create a React application using the following command:
$ npx create-react-app page-galleryStep 2: After creating your project folder i.e. page-gallery, move to it using the following command.
$ cd page-galleryStep 3: Add the npm packages you will need during the project.
$ npm install framer-motion @popmotion/popcornOpen the src folder and delete the following files:
Create a file named PageSlider.js.
Project structure: The project structure tree should look like this:
Filename: App.js
Filename: PageSlider.js
Filename: App.css
Step to Run Application: Run the application using the following command from the root directory of the project:
$ npm startOutput: Now open your browser and go to http://localhost:3000/, you will see the following output: