All Projects → vivaxy → impression

vivaxy / impression

Licence: MIT license
👀Element view notifier

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to impression

traceml
Engine for ML/Data tracking, visualization, dashboards, and model UI for Polyaxon.
Stars: ✭ 445 (+477.92%)
Mutual labels:  tracking
js-id-number
JavaScript ID Number Toolkit | A collection of identification number validators with uniform interfaces for JavaScript.
Stars: ✭ 22 (-71.43%)
Mutual labels:  npm-package
Visual-Tracking-Development
Recent Trackers
Stars: ✭ 93 (+20.78%)
Mutual labels:  tracking
create-xo
Add XO to your project
Stars: ✭ 41 (-46.75%)
Mutual labels:  npm-package
linear-discord-serverless
Get linear's events forwarded to Discord webhooks through Vercel serverless functions.
Stars: ✭ 47 (-38.96%)
Mutual labels:  tracking
tracking-location-provider-android
Tracking the android mobile and animating marker smoothly in Google Maps. Tracking has been done both in foreground and background. Tested in Android Oreo 8.1, Android 6.0 and Android 5.0
Stars: ✭ 37 (-51.95%)
Mutual labels:  tracking
alternative-frontends
🔐🌐 Privacy-respecting web frontends for popular services
Stars: ✭ 821 (+966.23%)
Mutual labels:  tracking
react-use-observer
Performant react hooks for WebApi Observers, useResizeObserver, useInteractionObserver, useMutationObserver
Stars: ✭ 19 (-75.32%)
Mutual labels:  intersection-observer
pcan
Prototypical Cross-Attention Networks for Multiple Object Tracking and Segmentation, NeurIPS 2021 Spotlight
Stars: ✭ 294 (+281.82%)
Mutual labels:  tracking
odoc
Next.js based Static 📓 Documentation Site Generator
Stars: ✭ 17 (-77.92%)
Mutual labels:  npm-package
react-windows-ui
Build Windows fluent UI apps using ReactJS. Provides a set of accessible, reusable, and composable React components that make it super easy to create websites and apps.
Stars: ✭ 383 (+397.4%)
Mutual labels:  npm-package
ngx-deploy-npm
Publish your libraries to NPM with just one command
Stars: ✭ 70 (-9.09%)
Mutual labels:  npm-package
img2gcode
convert jpg, png,gif to gcode with nodejs and jimp
Stars: ✭ 31 (-59.74%)
Mutual labels:  npm-package
awesome-3d-multi-object-tracking-autonomous-driving
A summary and list of open source 3D multi object tracking and datasets at this stage.
Stars: ✭ 16 (-79.22%)
Mutual labels:  tracking
react-spring-pop
Animate React elements when they enter the viewport with physics based animations
Stars: ✭ 17 (-77.92%)
Mutual labels:  intersection-observer
Kalman.jl
Flexible filtering and smoothing in Julia
Stars: ✭ 62 (-19.48%)
Mutual labels:  tracking
ggtrack
restlessdata.com.au/ggtrack
Stars: ✭ 39 (-49.35%)
Mutual labels:  tracking
deep sort realtime
A really more real-time adaptation of deep sort
Stars: ✭ 31 (-59.74%)
Mutual labels:  tracking
pageviews
A simple and lightweight pageviews counter for your WordPress posts and pages.
Stars: ✭ 23 (-70.13%)
Mutual labels:  tracking
kakao-ad-android
No description or website provided.
Stars: ✭ 18 (-76.62%)
Mutual labels:  advertising

impression

See appear event instead. For React hook, see useAppear. For React components, see react-lifecycle-appear.

impression

Build Status NPM Version NPM Downloads MIT License Codecov Codacy Badge

Element impression, for ads or user behaviour statistics.

Written in es6 javascript, published as npm package as es5 along with a browser standalone.

Browser support

IE9+, chrome, safari, firefox, opera...

Installation

npm

npm install @vivaxy/impression

browser

<script src="./bundle/impression.rollup.js"></script>

<script src="./bundle/impression.webpack.js"></script>

Usage

import Impression from '@vivaxy/impression';
const impression = new Impression();
const element = document.querySelector('#test');
impression.isViewable(element); // => true
impression.on('begin', '#test', (element) => {
    console.log(`element shown into view`, element);
});
impression.on('end', '#test', (element) => {
    console.log(`element shown out of view`, element);
});
impression.scan(); // flush current viewable element

API

constructor Impression => {Impression}

Initialize the instance.

const impression = new Impression(options)

isViewable => {Boolean}

Test if an element is viewable.

impression.isViewable(element)

Only accepts a single element.

on => {Impression}

Listen when elements match selector enter or leave the view.

impression.on(event, selector, callback)

callback(element, { type, direction })

off => {Impression}

Remove listeners.

impression.off(event, selector, callback)

impression.off(event, selector)

impression.off(event)

impression.off()

scan => {Impression}

Scan page to update element status.

impression.scan()

once => {Impression}

impression.once(event, selector, callback)

attach => {Impression}

impression.attach()

detach => {Impression}

impression.detach()

onObservers => {Impression}

impression.onObservers(type, callback)

onceObservers => {Impression}

impression.onceObservers(type, callback)

offObservers => {Impression}

impression.offObservers(type, callback)

impression.offObservers(type)

impression.offObservers()

Options

tolerance

The number of pixels an element is allowed to enter its container boundaries before calling its callback.

default 0

debounce

The number of milliseconds to wait before calling an element's callback after the changes.

default 100

container

The container of the elements you want to track.

default window

Events

begin

impression.on('begin', '[data-impression-uniqueid="1"]', (element, { type }) => {
    // => which element begins to impression
    // => the cause of the change
});

end

impression.on('end', '[data-impression-uniqueid="1"]', (element, { type }) => {
    // => which element's impression ends
    // => the cause of the change
});

Types

  • mutation
  • resize
  • scroll
  • unload
  • scan

Reference

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].