31 | Parallax is a displacement or difference in the apparent position of
32 | an object viewed along two different lines of sight and is measured by
33 | the angle or half-angle of inclination between those two lines. Due to
34 | foreshortening, nearby objects show a larger parallax than farther
35 | objects, so parallax can be used to determine distances.
36 |
37 |
38 | Parallax also affects optical instruments such as rifle scopes,
39 | binoculars, microscopes, and twin-lens reflex cameras that view
40 | objects from slightly different angles. Many animals, along with
41 | humans, have two eyes with overlapping visual fields that use parallax
42 | to gain depth perception; this process is known as stereopsis. In
43 | computer vision the effect is used for computer stereo vision, and
44 | there is a device called a parallax rangefinder that uses it to find
45 | the range, and in some variations also altitude to a target.
46 |
47 |
48 | Parallax is a displacement or difference in the apparent position of
49 | an object viewed along two different lines of sight and is measured by
50 | the angle or half-angle of inclination between those two lines. Due to
51 | foreshortening, nearby objects show a larger parallax than farther
52 | objects, so parallax can be used to determine distances.
53 |
54 |
55 | Parallax also affects optical instruments such as rifle scopes,
56 | binoculars, microscopes, and twin-lens reflex cameras that view
57 | objects from slightly different angles. Many animals, along with
58 | humans, have two eyes with overlapping visual fields that use parallax
59 | to gain depth perception; this process is known as stereopsis. In
60 | computer vision the effect is used for computer stereo vision, and
61 | there is a device called a parallax rangefinder that uses it to find
62 | the range, and in some variations also altitude to a target.
63 |
64 |
65 | >
66 | );
67 | };
68 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Getting Started with Create React App
2 |
3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4 |
5 | ## Available Scripts
6 |
7 | In the project directory, you can run:
8 |
9 | ### `npm start`
10 |
11 | Runs the app in the development mode.\
12 | Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
13 |
14 | The page will reload when you make changes.\
15 | You may also see any lint errors in the console.
16 |
17 | ### `npm test`
18 |
19 | Launches the test runner in the interactive watch mode.\
20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21 |
22 | ### `npm run build`
23 |
24 | Builds the app for production to the `build` folder.\
25 | It correctly bundles React in production mode and optimizes the build for the best performance.
26 |
27 | The build is minified and the filenames include the hashes.\
28 | Your app is ready to be deployed!
29 |
30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31 |
32 | ### `npm run eject`
33 |
34 | **Note: this is a one-way operation. Once you `eject`, you can't go back!**
35 |
36 | If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37 |
38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
39 |
40 | You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
41 |
42 | ## Learn More
43 |
44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45 |
46 | To learn React, check out the [React documentation](https://reactjs.org/).
47 |
48 | ### Code Splitting
49 |
50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
51 |
52 | ### Analyzing the Bundle Size
53 |
54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
55 |
56 | ### Making a Progressive Web App
57 |
58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
59 |
60 | ### Advanced Configuration
61 |
62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
63 |
64 | ### Deployment
65 |
66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67 |
68 | ### `npm run build` fails to minify
69 |
70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
71 |
--------------------------------------------------------------------------------
/src/parallax/parallax-2/Parallax.js:
--------------------------------------------------------------------------------
1 | import "./styles.css";
2 |
3 | import html from "./html.png";
4 | import css from "./css.png";
5 | import es6 from "./es6.png";
6 | import react from "./react.png";
7 |
8 | import gsap from "gsap";
9 | import { ScrollTrigger } from "gsap/all";
10 |
11 | import logo from "./logo.svg";
12 | import { useEffect, useRef } from "react";
13 |
14 | export const Parallax = () => {
15 | const containerRef = useRef();
16 |
17 | useEffect(() => {
18 | gsap.registerPlugin(ScrollTrigger);
19 | const sections = gsap.utils.toArray(".panel");
20 | gsap.to(sections, {
21 | xPercent: -100 * (sections.length - 1),
22 | ease: "none",
23 | scrollTrigger: {
24 | trigger: ".container",
25 | pin: true,
26 | scrub: 1,
27 | snap: 1 / (sections.length - 1),
28 | end: () => "+=" + containerRef.current.offsetWidth,
29 | },
30 | });
31 | }, []);
32 |
33 | return (
34 | <>
35 |
41 |
42 |
43 |
Hi, I'm Peter
44 |
Frontend Developer
45 |
46 |
47 |
48 |
49 |
50 |
HTML
51 |
52 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Animi
53 | labore eius cum perferendis consectetur culpa laboriosam quam, sed
54 | ea nihil, suscipit, quidem est expedita. Nihil enim obcaecati
55 | deleniti eaque sed.
56 |
57 |
58 |
59 |
60 |
CSS
61 |
62 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Animi
63 | labore eius cum perferendis consectetur culpa laboriosam quam, sed
64 | ea nihil, suscipit, quidem est expedita. Nihil enim obcaecati
65 | deleniti eaque sed.
66 |
67 |
68 |
69 |
70 |
ES6
71 |
72 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Animi
73 | labore eius cum perferendis consectetur culpa laboriosam quam, sed
74 | ea nihil, suscipit, quidem est expedita. Nihil enim obcaecati
75 | deleniti eaque sed.
76 |
77 |
78 |
79 |
80 |
React JS
81 |
82 | Lorem ipsum dolor sit, amet consectetur adipisicing elit. Animi
83 | labore eius cum perferendis consectetur culpa laboriosam quam, sed
84 | ea nihil, suscipit, quidem est expedita. Nihil enim obcaecati
85 | deleniti eaque sed.
86 |