<commit_before># jQuery Viewport Detector

This simple jQuery utility allows you to detect when an element scrolls into the viewport. It provides some basic callbacks.

This is still in its infency but it works very well. It's tested with most major and rect browsers.

Checkout the index.html Example.

Use at your own risk.

License: MIT.<commit_msg>Cleaned up the README and added a usage example<commit_after># jQuery Viewport Detector

A simple jQuery utility plugin that detects DOM objects as they scroll into the viewport.

This is still in its infency but it works very well. It's tested with most major and recent browsers.

Checkout the examples directory.

## How to Use

```javascript
$('body > ul').viewportDetector({
    selector: 'li',                 // The element that wraps the cards
    sensitivity: 0.2,               // A threshold set to tolerate fault (0.2 = 2%)
    activeClass: 'active-card',     // The class applied to cards within the viewport
    callback: {                     // A callback function that gets called on card change

        /**
         * @var int cardIndex   The index of the current active card
         * @var object card     The DOM object of the active card
         * @var object prev     The DOM object of the previously active card
        */
        cardChange: function (cardIndex, card, prev) {
            console.log('Card Activated:', cardIndex, card, prev);
        }
    }
});
```

Use at your own risk.

License: MIT.
{'fraction_non_alphanumeric': 0.06873315363881402, 'fraction_numerical': 0.0033692722371967657, 'mean_word_length': 2.6219512195121952, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '274166', 'n_tokens_mistral': 386, 'n_tokens_neox': 373, 'n_words': 195}