Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.

Repository files navigation

Unchained UI

Detective

NPM VersionNPM Downloads

Collection of simple browser features detection functions

Usage

Just import features you need to check

import{requestAnimationFrame,isHDPI}from'uc-detective'

Features

  • requestAnimationFrame — function, prefixed or polyfill
  • isCSSOM — boolean, CSSOM is supported
  • transform — string, prefixed
  • transition — string, prefixed
  • transitionEnd — string, prefixed
  • browser
    • name
    • version
  • isHDPI — boolean, when devicePixelRatio > 1
  • is2x — boolean, when devicePixelRatio > 1.5 but less than 2.5
  • is3x — boolean, when devicePixelRatio > 2.5
  • isSmaller(size) – boolean, returns true when screen width of height less than size
  • isLarger(size) – boolean, returns true when screen width of height larfer than size
  • isTouch – boolean
  • isGeolocation – boolean

Helpers

hdpiImg(imgObj, name, defaultImg)

return coresponded data from the imgObj. If imgObj is false returns optional defaultImg. Example:

import{hdpiImg}from'uc-detective'constimage={'thumb': {url: '/some/image.jpg'},'thumb@2x': {url: '/some/image.jpg'}}console.log(hdpiImg(image,'thumb').url)

License MIT

© velocityzen

About

Collection of fast browser feature tests

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages