Skip to content

Commit ac5f372

Browse files
committed
Merge branch 'master' into beta-docs
2 parents bf5193c + 79d444e commit ac5f372

File tree

171 files changed

+5275
-7163
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+5275
-7163
lines changed

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"access": "public",
77
"baseBranch": "master",
88
"updateInternalDependencies": "patch",
9-
"ignore": []
9+
"ignore": ["@react-spring/demo", "@react-spring/docs"]
1010
}

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# These are supported funding model platforms
22

33
open_collective: react-spring
4+
github: joshuaellis

.meta

Lines changed: 0 additions & 5 deletions
This file was deleted.

demo/package.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
"serve": "vite preview"
1212
},
1313
"dependencies": {
14-
"@react-three/fiber": "^8.0.27",
14+
"@react-three/drei": "^9.40.0",
15+
"@react-three/fiber": "^8.9.1",
16+
"@stitches/react": "^1.2.8",
17+
"@use-gesture/react": "^10.2.22",
1518
"lodash-move": "1.1.1",
1619
"lodash.clamp": "^4.0.3",
1720
"lodash.shuffle": "^4.2.0",
@@ -21,9 +24,14 @@
2124
"react-feather": "^2.0.10",
2225
"react-use-gesture": "^9.1.3",
2326
"react-use-measure": "^2.1.1",
24-
"styled-components": "^5.3.5",
25-
"three": "^0.144.0",
27+
"styled-components": "^5.3.6",
28+
"three": "^0.146.0",
29+
"three-stdlib": "^2.17.3",
2630
"vec-la": "^1.5.0",
27-
"wouter": "^2.8.0-alpha.2"
31+
"wouter": "^2.8.1"
32+
},
33+
"devDependencies": {
34+
"@types/lodash.clamp": "^4.0.7",
35+
"@types/lodash.shuffle": "^4.2.6"
2836
}
2937
}

demo/public/bright-rain.png

4.73 MB
Loading

demo/public/cross.jpg

12.4 KB
Loading

demo/public/headless.glb

72.7 KB
Binary file not shown.

demo/public/switch.glb

172 KB
Binary file not shown.

demo/src/App.jsx

Lines changed: 15 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import React, { useEffect } from 'react'
1+
import * as React from 'react'
22
import { Link, Route } from 'wouter'
3+
import { Globals } from '@react-spring/web'
4+
35
import styles from './styles.module.css'
46

57
import AnimatingAuto from './sandboxes/animating-auto/src/App'
@@ -16,6 +18,7 @@ import DraggableList from './sandboxes/draggable-list/src/App'
1618
import ExitBeforeEnter from './sandboxes/exit-before-enter/src/App'
1719

1820
import FlipCard from './sandboxes/flip-card/src/App'
21+
import FloatingButton from './sandboxes/floating-button/src/App'
1922

2023
import GooBlobs from './sandboxes/goo-blobs/src/App'
2124

@@ -35,12 +38,19 @@ import ParallaxSticky from './sandboxes/parallax-sticky/src/App'
3538
import SimpleTransition from './sandboxes/simple-transition/src/App'
3639
import Slide from './sandboxes/slide/src/App'
3740
import SvgFilter from './sandboxes/svg-filter/src/App'
41+
import SpringBoxes from './sandboxes/springy-boxes/src/App'
3842

3943
import Trail from './sandboxes/trail/src/App'
4044
import Tree from './sandboxes/tree/src/App'
4145

4246
import Viewpager from './sandboxes/viewpager/src/App'
4347

48+
import WebGlSwitch from './sandboxes/webgl-switch/src/App'
49+
50+
Globals.assign({
51+
frameLoop: 'always',
52+
})
53+
4454
const links = {
4555
'animating-auto': AnimatingAuto,
4656
card: Card,
@@ -52,6 +62,7 @@ const links = {
5262
'draggable-list': DraggableList,
5363
'exit-before-enter': ExitBeforeEnter,
5464
'flip-card': FlipCard,
65+
'floating-button': FloatingButton,
5566
'goo-blobs': GooBlobs,
5667
'image-fade': ImageFade,
5768
'list-reordering': ListReordering,
@@ -63,10 +74,12 @@ const links = {
6374
'parallax-sticky': ParallaxSticky,
6475
'simple-transition': SimpleTransition,
6576
slide: Slide,
77+
'spring-boxes': SpringBoxes,
6678
'svg-filter': SvgFilter,
6779
trail: Trail,
6880
viewpager: Viewpager,
6981
tree: Tree,
82+
'webgl-switch': WebGlSwitch,
7083
}
7184

7285
const Example = ({ link }) => {
@@ -102,51 +115,4 @@ export default function App() {
102115
<Route path="/:link">{params => <Example link={params.link} />}</Route>
103116
</>
104117
)
105-
}
106-
107-
import * as Dialog from '@radix-ui/react-dialog'
108-
import { styled } from '@stitches/react'
109-
import { animated, useSpring } from '@react-spring/web'
110-
111-
export const AnimatedDialog = ({ isOpen, onOpenCallback }) => {
112-
const { x, backgroundColor, opacity } = useSpring({
113-
x: isOpen ? '0%' : '-100%',
114-
backgroundColor: isOpen
115-
? 'var(--color-whiteblur)'
116-
: 'var(--colors-white00)',
117-
opacity: isOpen ? 1 : 0,
118-
onRest: () => {
119-
if (isOpen && onOpenCallback) {
120-
onOpenCallback()
121-
}
122-
},
123-
})
124-
125-
return (
126-
<Dialog.Root>
127-
<Overlay style={{ backgroundColor }} />
128-
<Modal
129-
style={{
130-
x,
131-
backgroundColor: opacity.to(o => `rgba(255,255,255, ${o})`),
132-
}}
133-
/>
134-
</Dialog.Root>
135-
)
136-
}
137-
138-
const Modal = styled(animated(Dialog.Content), {
139-
position: 'fixed',
140-
inset: 0,
141-
height: '100vh',
142-
width: '30rem',
143-
zIndex: '$3',
144-
})
145-
146-
const Overlay = styled(animated(Dialog.Overlay), {
147-
position: 'fixed',
148-
inset: 0,
149-
width: '100vw',
150-
height: '100vh',
151-
zIndex: '$2',
152-
})
118+
}

demo/src/sandboxes/animating-auto/package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
{
2-
"name": "spring-animating-auto",
2+
"name": "Animating Auto",
33
"version": "1.0.0",
44
"main": "src/index.tsx",
5+
"description": "Animating widths with react-spring, use-measure and interpolation",
6+
"keywords": [
7+
"useSpring",
8+
"useMeasure",
9+
"auto",
10+
"width",
11+
"interpolation"
12+
],
513
"dependencies": {
614
"@react-spring/web": "*",
715
"react": "^18.0.0",

0 commit comments

Comments
 (0)