mirror of
https://github.com/System-End/site.git
synced 2026-04-20 00:25:19 +00:00
Fix bank scroll animation
This commit is contained in:
parent
e86787b94c
commit
61d466da0f
4 changed files with 74 additions and 1175 deletions
|
|
@ -1,16 +1,18 @@
|
|||
import { Box } from 'theme-ui'
|
||||
import AnimatedValue from 'animated-value'
|
||||
import anime from 'animejs/lib/anime.es.js'
|
||||
|
||||
const handleClick = () => {
|
||||
const scrollValue = new AnimatedValue({
|
||||
start: document.scrollingElement.scrollTop,
|
||||
end: window.innerHeight,
|
||||
ease: AnimatedValue.CURVES.EXPO_OUT,
|
||||
})
|
||||
scrollValue.play(800, () => {
|
||||
document.scrollingElement.scrollTop = scrollValue.value()
|
||||
})
|
||||
const scroll = { x: document.scrollingElement.scrollTop }
|
||||
|
||||
anime({
|
||||
targets: scroll,
|
||||
x: window.innerHeight,
|
||||
easing: 'easeOutExpo',
|
||||
duration: 800,
|
||||
update: () => {
|
||||
document.scrollingElement.scrollTop = scroll.x
|
||||
}
|
||||
})
|
||||
}
|
||||
const ScrollHint = () => (
|
||||
<Box
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
const withMDX = require('@next/mdx')({ extension: /\.mdx?$/ })
|
||||
module.exports = withMDX({
|
||||
const nextConfig = {
|
||||
trailingSlash: true,
|
||||
pageExtensions: ['js', 'jsx', 'mdx'],
|
||||
images: {
|
||||
|
|
@ -187,4 +186,11 @@ module.exports = withMDX({
|
|||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const withPlugins = require('next-compose-plugins')
|
||||
|
||||
const withMDX = require('@next/mdx')({ extension: /\.mdx?$/ })
|
||||
const withTM = require('next-transpile-modules')(['animejs'])
|
||||
|
||||
module.exports = withPlugins([withTM, withMDX], nextConfig)
|
||||
|
|
|
|||
|
|
@ -18,9 +18,12 @@
|
|||
"@next/mdx": "^11.1.0",
|
||||
"airtable-plus": "^1.0.4",
|
||||
"animated-value": "^0.2.4",
|
||||
"animejs": "^3.2.1",
|
||||
"globby": "^11.0.4",
|
||||
"lodash": "^4.17.21",
|
||||
"next": "^11.1.0",
|
||||
"next-compose-plugins": "^2.2.1",
|
||||
"next-transpile-modules": "^8.0.0",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-masonry-css": "^1.0.16",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue