Skip to content

Commit

Permalink
fix snap example
Browse files Browse the repository at this point in the history
  • Loading branch information
clementroche committed Oct 10, 2024
1 parent 3c8ddba commit 8938bb5
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 30 deletions.
49 changes: 23 additions & 26 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vercel
3 changes: 3 additions & 0 deletions website/.npmrc.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
always-auth=true
//npm.greensock.com/:_authToken=GSAP_AUTH_TOKEN
@gsap:registry=https://npm.greensock.com
3 changes: 2 additions & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"postbuild": "next-sitemap",
"analyze": "cross-env ANALYZE=true next build",
"analyze:server": "cross-env BUNDLE_ANALYZE=server next build",
"analyze:browser": "cross-env BUNDLE_ANALYZE=browser next build"
"analyze:browser": "cross-env BUNDLE_ANALYZE=browser next build",
"npmrc": "pnpx npmrc-replace-env -w"
},
"keywords": [],
"author": "",
Expand Down
4 changes: 2 additions & 2 deletions website/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Tempus from '@darkroom.engineering/tempus'
import { useDebug } from '@studio-freight/hamo'
import { raf } from '@studio-freight/tempus'
import { RealViewport } from 'components/real-viewport'
import { gsap } from 'gsap'
import { ScrollTrigger } from 'gsap/dist/ScrollTrigger'
Expand All @@ -18,7 +18,7 @@ if (typeof window !== 'undefined') {
// merge rafs
gsap.ticker.lagSmoothing(0)
gsap.ticker.remove(gsap.updateRoot)
raf.add((time) => {
Tempus.add((time) => {
gsap.updateRoot(time / 1000)
}, 0)
}
Expand Down
2 changes: 1 addition & 1 deletion website/pages/snap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function Page() {
const snap = new Snap(lenis, {
type: 'mandatory', // 'mandatory', 'proximity'
velocityThreshold: 1,
debounce: 1000,
// debounce: 1000,
// duration: 2,
// easing: (t) => t,
onSnapStart: (snap) => {
Expand Down

1 comment on commit 8938bb5

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"⚡️ Lighthouse report for the changes in this commit:

🟠 Performance: 54
🟢 Accessibility: 96
🟠 Best practices: 79
🟢 SEO: 92

Lighthouse ran on https://vercel.com/login?next=%2Fsso-api%3Furl%3Dhttps%253A%252F%252Flenis-orwj7wa8c-darkroom-engineering.vercel.app%252F%26nonce%3Dc73afbfe12ff712dc085f0e8e3041c451e83f315d135956f8133408eac1f6e06"

Please sign in to comment.