├── .husky
├── pre-commit
├── pre-push
└── commit-msg
├── .prettierignore
├── scripts
├── setup-tests.ts
├── tsconfig.build.json
├── rollup.config.ts
├── tsconfig.dev.json
├── tsconfig.base.json
└── rollupConfigs.ts
├── .czrc
├── tsconfig.json
├── misc
├── demo.gif
└── device_orientation.jpg
├── stories
├── TiltImg
│ ├── TiltImg.demozap.css
│ ├── img
│ │ └── nyc.jpg
│ ├── TiltImg.demozap.tsx
│ └── _TiltImg.tsx
├── MultipleTiltScroll
│ ├── MultipleTiltScroll.demozap.css
│ ├── MultipleTiltScroll.demozap.tsx
│ └── _MultipleTiltScroll.tsx
├── FlipPage
│ ├── Page
│ │ ├── lorem-picsum.png
│ │ ├── Page.css
│ │ └── Page.tsx
│ ├── FlipPage.demozap.css
│ ├── FlipPage.demozap.tsx
│ └── _FlipPage.tsx
├── ParallaxEffectImg
│ ├── img
│ │ ├── tree.png
│ │ └── background.jpg
│ ├── ParallaxEffectImg.demozap.css
│ ├── ParallaxEffectImg.demozap.tsx
│ └── _ParallaxEffectImg.tsx
├── types
│ └── images.d.ts
├── MultipleTilt
│ ├── MultipleTilt.demozap.css
│ ├── MultipleTilt.demozap.tsx
│ └── _MultipleTilt.tsx
├── Default
│ ├── Default.demozap.tsx
│ └── _Default.tsx
├── _DefaultComponent
│ ├── DefaultComponent.tsx
│ └── DefaultComponent.css
├── KeepFloating
│ ├── KeepFloating.demozap.tsx
│ └── _KeepFloating.tsx
├── ReverseTilt
│ ├── ReverseTilt.demozap.tsx
│ └── _ReverseTilt.tsx
├── InitialTilt
│ ├── InitialTilt.demozap.tsx
│ └── _InitialTilt.tsx
├── GlareEffect
│ ├── GlareEffect.demozap.tsx
│ └── _GlareEffect.tsx
├── GlareEffect360
│ ├── GlareEffect360.demozap.tsx
│ └── _GlareEffect360.tsx
├── ParallaxEffect
│ ├── ParallaxEffect.demozap.tsx
│ ├── ParallaxEffect.demozap.css
│ └── _ParallaxEffect.tsx
├── GlareEffectNoTilt
│ ├── GlareEffectNoTilt.demozap.tsx
│ └── _GlareEffectNoTilt.tsx
├── EventTiltAngle
│ ├── EventTiltAngle.demozap.css
│ ├── EventTiltAngle.demozap.tsx
│ └── _EventTiltAngle.tsx
├── ParallaxEffectGlareScale
│ ├── ParallaxEffectGlareScale.demozap.tsx
│ ├── ParallaxEffectGlareScale.demozap.css
│ └── _ParallaxEffectGlareScale.tsx
├── TrackOnWindow
│ ├── TrackOnWindow.demozap.tsx
│ ├── TrackOnWindow.demozap.css
│ └── _TrackOnWindow.tsx
├── ReactParallaxTilt.css
├── FlipVH
│ ├── FlipVH.demozap.css
│ ├── FlipVH.demozap.tsx
│ └── _FlipVH.tsx
├── ScaleNoTilt
│ ├── ScaleNoTilt.demozap.css
│ ├── ScaleNoTilt.demozap.tsx
│ └── _ScaleNoTilt.tsx
├── TiltDisableAxis
│ ├── TiltDisableAxis.demozap.css
│ ├── TiltDisableAxis.demozap.tsx
│ └── _TiltDisableAxis.tsx
├── TiltScale
│ ├── TiltScale.demozap.css
│ ├── TiltScale.demozap.tsx
│ └── _TiltScale.tsx
├── TiltManualInput
│ ├── TiltManualInput.demozap.css
│ ├── TiltManualInput.demozap.tsx
│ └── _TiltManualInput.tsx
├── EventParams
│ ├── EventParams.demozap.css
│ ├── EventParams.demozap.tsx
│ └── _EventParams.tsx
└── ReactParallaxTilt.stories.tsx
├── .prettierrc
├── .lintstagedrc
├── .storybook
├── theme.ts
├── manager.ts
├── preview.tsx
└── main.ts
├── .github
├── ISSUE_TEMPLATE
│ ├── config.yml
│ └── bug_report.yml
├── workflows
│ ├── tsc.yml
│ ├── lint.yml
│ ├── build.yml
│ ├── actions
│ │ └── setup_node_npm
│ │ │ └── action.yml
│ ├── npm-release.yml
│ ├── deploy-storybook.yml
│ ├── test.yml
│ └── test-e2e.yml
└── pull_request_template.md
├── .commitlintrc.ts
├── e2e
├── consts.ts
├── global.setup.ts
├── events.spec.ts
└── on-move-params.spec.ts
├── src
├── utils
│ ├── types.ts
│ ├── TiltTest.tsx
│ └── helperFns.ts
├── index.ts
├── features
│ ├── tilt
│ │ ├── test
│ │ │ ├── tiltOnEnter.test.tsx
│ │ │ ├── tiltOnLeave.test.tsx
│ │ │ ├── tiltDisable.test.tsx
│ │ │ ├── tiltOnTouchMove.test.tsx
│ │ │ ├── tiltTrackOnWindow.test.tsx
│ │ │ ├── tiltMaxAngle.test.tsx
│ │ │ ├── tiltReverse.test.tsx
│ │ │ ├── tiltStyle.test.tsx
│ │ │ ├── tiltReset.test.tsx
│ │ │ ├── tiltOnPropChange.test.tsx
│ │ │ ├── tiltAxis.test.tsx
│ │ │ └── tiltManualAngle.test.tsx
│ │ ├── types.public.ts
│ │ └── Tilt.ts
│ └── glare
│ │ ├── types.public.ts
│ │ ├── test
│ │ ├── glareStyle.test.tsx
│ │ └── glare.test.tsx
│ │ └── Glare.ts
└── react-parallax-tilt
│ ├── types.ts
│ ├── defaultProps.ts
│ ├── types.public.ts
│ └── ReactParallaxTilt.tsx
├── .gitignore
├── knip.ts
├── vitest.config.ts
├── LICENSE
├── playwright.config.ts
├── package.json
├── eslint.config.mjs
└── README.md
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | npm run lint:staged
--------------------------------------------------------------------------------
/.husky/pre-push:
--------------------------------------------------------------------------------
1 | npm run test:report
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | test-unit-report
2 | dist
--------------------------------------------------------------------------------
/.husky/commit-msg:
--------------------------------------------------------------------------------
1 | npx --no-install commitlint --edit "$1"
--------------------------------------------------------------------------------
/scripts/setup-tests.ts:
--------------------------------------------------------------------------------
1 | import '@testing-library/jest-dom';
2 |
--------------------------------------------------------------------------------
/.czrc:
--------------------------------------------------------------------------------
1 | {
2 | "path": "node_modules/cz-conventional-changelog"
3 | }
4 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./scripts/tsconfig.dev.json"
3 | }
4 |
--------------------------------------------------------------------------------
/misc/demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mkosir/react-parallax-tilt/HEAD/misc/demo.gif
--------------------------------------------------------------------------------
/stories/TiltImg/TiltImg.demozap.css:
--------------------------------------------------------------------------------
1 | .tilt-img {
2 | .inner-element {
3 | width: 70vw;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/misc/device_orientation.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mkosir/react-parallax-tilt/HEAD/misc/device_orientation.jpg
--------------------------------------------------------------------------------
/stories/TiltImg/img/nyc.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mkosir/react-parallax-tilt/HEAD/stories/TiltImg/img/nyc.jpg
--------------------------------------------------------------------------------
/stories/MultipleTiltScroll/MultipleTiltScroll.demozap.css:
--------------------------------------------------------------------------------
1 | .multiple-tilt-scroll > * {
2 | margin-bottom: 200px;
3 | }
4 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "printWidth": 120,
3 | "semi": true,
4 | "singleQuote": true,
5 | "trailingComma": "all"
6 | }
7 |
--------------------------------------------------------------------------------
/.lintstagedrc:
--------------------------------------------------------------------------------
1 | {
2 | "*": ["prettier --write --ignore-unknown"],
3 | "*.{js,jsx,ts,tsx}": ["eslint --max-warnings 0"]
4 | }
5 |
--------------------------------------------------------------------------------
/stories/FlipPage/Page/lorem-picsum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mkosir/react-parallax-tilt/HEAD/stories/FlipPage/Page/lorem-picsum.png
--------------------------------------------------------------------------------
/stories/ParallaxEffectImg/img/tree.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mkosir/react-parallax-tilt/HEAD/stories/ParallaxEffectImg/img/tree.png
--------------------------------------------------------------------------------
/stories/ParallaxEffectImg/img/background.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mkosir/react-parallax-tilt/HEAD/stories/ParallaxEffectImg/img/background.jpg
--------------------------------------------------------------------------------
/stories/types/images.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.png' {
2 | const value: string;
3 | export = value;
4 | }
5 | declare module '*.jpg' {
6 | const value: string;
7 | export = value;
8 | }
9 |
--------------------------------------------------------------------------------
/.storybook/theme.ts:
--------------------------------------------------------------------------------
1 | import { create } from 'storybook/theming';
2 |
3 | export const theme = create({
4 | base: 'light',
5 | brandTitle: 'React Parallax Tilt 👀',
6 | brandUrl: 'https://github.com/mkosir/react-parallax-tilt',
7 | });
8 |
--------------------------------------------------------------------------------
/stories/FlipPage/FlipPage.demozap.css:
--------------------------------------------------------------------------------
1 | body {
2 | overflow-x: hidden;
3 | }
4 |
5 | .flip-page {
6 | display: flex;
7 | flex-direction: column;
8 | justify-content: center;
9 | align-items: center;
10 |
11 | width: 80vw;
12 | }
13 |
--------------------------------------------------------------------------------
/stories/MultipleTilt/MultipleTilt.demozap.css:
--------------------------------------------------------------------------------
1 | .multiple-tilt {
2 | display: flex;
3 | flex-direction: row;
4 |
5 | .col {
6 | margin-right: 20px;
7 |
8 | :first-child {
9 | margin-bottom: 20px;
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 | contact_links:
3 | - name: Ask a question
4 | url: https://github.com/mkosir/react-parallax-tilt/discussions
5 | about: Ask questions and discuss topics with other community members
6 |
--------------------------------------------------------------------------------
/.commitlintrc.ts:
--------------------------------------------------------------------------------
1 | import type { UserConfig } from '@commitlint/types';
2 |
3 | const commitlintConfig: UserConfig = {
4 | extends: ['@commitlint/config-conventional'],
5 | };
6 |
7 | // eslint-disable-next-line import-x/no-default-export
8 | export default commitlintConfig;
9 |
--------------------------------------------------------------------------------
/stories/Default/Default.demozap.tsx:
--------------------------------------------------------------------------------
1 | import Tilt from '@/index';
2 |
3 | import { DefaultComponent } from '../_DefaultComponent/DefaultComponent';
4 |
5 | const Default = () => (
6 |
84 | {JSON.stringify(eventParams)}
85 |
86 |
88 | {JSON.stringify(eventParams)}
89 |
90 |