Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7ceae69

Browse files
fix: lint
1 parent 69aa7f4 commit 7ceae69

File tree

13 files changed

+5293
-1889
lines changed

13 files changed

+5293
-1889
lines changed

‎documentation/docs/examples/custom-effects.mdx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function Example() {
1919
if (parallax.ref.current) {
2020
// set progress to CSS variable
2121
parallax.ref.current.style.setProperty(
22-
"--progress",
22+
'--progress',
2323
progress.toString()
2424
);
2525
}
@@ -47,5 +47,4 @@ Try it out for yourself in this CodeSandbox example: [Custom Effects Example](ht
4747

4848
Using this technique, we can animate any CSS property based on the scroll position of an element. Here's another example of animating the letter spacing and text shadow of a text element:
4949

50-
<CustomEffect/>
51-
50+
<CustomEffect />

‎documentation/docs/usage/next-13.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Usage with Next.js
32

43
This guide will show you how to set up `react-scroll-parallax` using the [Next 13](https://nextjs.org/blog/next-13) App router.

‎documentation/pnpm-lock.yaml‎

Lines changed: 5263 additions & 1858 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎documentation/sidebars.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
1515
const sidebars = {
1616
// By default, Docusaurus generates a sidebar from the docs folder structure
17-
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
17+
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
1818

1919
// But you can create a sidebar manually
2020
/*
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
.text-stroke {
2-
font-family: sans-serif;
3-
font-size: 15vmin;
4-
height: 100px;
2+
font-family: sans-serif;
3+
font-size: 15vmin;
4+
height: 100px;
55

6-
-webkit-text-stroke-color: white;
7-
-webkit-text-stroke-width: 1px;
6+
-webkit-text-stroke-color: white;
7+
-webkit-text-stroke-width: 1px;
88

9-
/* color:paleturquoise; */
10-
@apply text-blue-400;
11-
letter-spacing: calc(2vw * var(--progress) - 1vw);
12-
white-space: nowrap;
13-
text-shadow: 0 calc(4vw * var(--progress) - 2vw) 0 rgba(156, 163, 175, 0.2);
14-
}
9+
/* color:paleturquoise; */
10+
@apply text-blue-400;
11+
letter-spacing: calc(2vw * var(--progress) - 1vw);
12+
white-space: nowrap;
13+
text-shadow: 0 calc(4vw * var(--progress) - 2vw) 0 rgba(156, 163, 175, 0.2);
14+
}

‎src/components/Parallax/index.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ describe('given the <Parallax> component', () => {
9191
});
9292
});
9393

94-
describe.each(ALL_PARALLAX_PROPS)('when the prop %s is given', (props) => {
94+
describe.each(ALL_PARALLAX_PROPS)('when the prop %s is given', props => {
9595
it('then it renders without issue and calls create element with props', () => {
9696
const controller = ParallaxController.init({
9797
scrollAxis: ScrollAxis.vertical,

‎src/components/ParallaxBanner/ParallaxBanner.tsx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ const containerStyle: CSSProperties = {
1818
export const ParallaxBanner = (
1919
props: PropsWithChildren<ParallaxBannerProps>
2020
) => {
21-
const [targetElement, setTargetElement] =
22-
useState<HTMLDivElement | null>(null);
21+
const [targetElement, setTargetElement] = useState<HTMLDivElement | null>(
22+
null
23+
);
2324
const containerRef = useRef<HTMLDivElement>(null);
2425
useEffect(() => {
2526
setTargetElement(containerRef.current);
@@ -50,7 +51,7 @@ export const ParallaxBanner = (
5051

5152
function renderChildren() {
5253
if (targetElement) {
53-
return React.Children.map(props.children, (child) => {
54+
return React.Children.map(props.children, child => {
5455
const item = child as ReactElement<
5556
PropsWithChildren<{ targetElement: any }>
5657
>;

‎src/components/ParallaxBanner/index.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('given a <ParallaxBanner> component', () => {
2727
});
2828
});
2929

30-
describe.each(ALL_PARALLAX_PROPS)('when the prop %s is given', (props) => {
30+
describe.each(ALL_PARALLAX_PROPS)('when the prop %s is given', props => {
3131
it('then it renders without issue and calls create element with props', () => {
3232
const controller = ParallaxController.init({
3333
scrollAxis: ScrollAxis.vertical,

‎src/components/ParallaxProvider/ParallaxProvider.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function ParallaxProvider(
2323
if (props.scrollContainer && controller.current) {
2424
controller.current.updateScrollContainer(props.scrollContainer);
2525
}
26-
}, [props.scrollContainer,controller.current]);
26+
}, [props.scrollContainer]);
2727

2828
// disable/enable parallax
2929
useEffect(() => {
@@ -33,12 +33,12 @@ export function ParallaxProvider(
3333
if (!props.isDisabled && controller.current) {
3434
controller.current.enableParallaxController();
3535
}
36-
}, [props.isDisabled,controller.current]);
36+
}, [props.isDisabled]);
3737

3838
// remove the controller when unmounting
3939
useEffect(() => {
4040
return () => {
41-
controller?.current&&controller?.current.destroy();
41+
controller?.current?.destroy();
4242
};
4343
}, []);
4444

‎src/components/ParallaxProvider/index.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ describe('A <ParallaxProvider>', () => {
112112
screen.unmount();
113113

114114
expect(
115-
(parallaxController as unknown as ParallaxController)?.destroy
115+
((parallaxController as unknown) as ParallaxController)?.destroy
116116
).toBeCalled();
117117
});
118118

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /