Skip to content

krvns/hamo-smooth-scroll

 
 

Repository files navigation

HAMO

Introduction

Hamo means hook, you do the math

🚧 This package is not stable, API might change at any time 🚧


Setup

$ npm i @studio-freight/hamo

or use whatever package manager you like the most


Features

This toolkit is composed of:

useOutsideClickEvent – trigger a callback when user clicks outside of a reference node.

useDebug – returns true if #debug, ?debug or /_debug is present in the url.

useDocumentReadyState – returns document.readyState.

useFrame – use @studio-freight/tempus animation frame.

useInterval – run a callback every x milliseconds.

useIsClient – returns true if window is defined.

useIsTouchDevice – returns true if client is using a touch-capable device.

useIntersectionObserver – returns a setRef and the intersection object, which will have the method .intersecting as true or false depending on the configurations passed to the hook.

useMediaQuery – css-like media query support in Javascript.

useRect – return getBoundingClientRect

useSlots – brings vue slots to react

useResizeObserver – observe elements dimensions using ResizeObserver

useWindowSize – listens to window size and returns width and height.


Authors

This set of hooks is curated and maintained by the Studio Freight Darkroom team:


License

The MIT License.

About

Hamo means hook, do the math.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%