This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const lerp = (a, b, n) => (1 - n) * a + n * b; | |
class SmoothScroll { | |
constructor() { | |
this.DOM = { | |
main: document.querySelector('main'), | |
wrapper: document.querySelector('.site-container') | |
}; | |
if (!this.DOM.main) throw new Error('Please provide a main element.'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
forwardRef, | |
useCallback, | |
type ComponentPropsWithoutRef, | |
type ElementRef, | |
type MouseEventHandler, | |
} from 'react'; | |
const PropagationStopper = forwardRef<ElementRef<'div'>, ComponentPropsWithoutRef<'div'>>( | |
({ children, ...props }, forwardedRef) => { |
OlderNewer