viewport_checker 0.0.2

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 32

viewport_checker

A library for Dart who check if elements from page are in viewport.

Simple Usage

new viewportChecker('.my-element-to-check', {
    'classToAdd': 'visible', // Class to add to the elements when they are visible,
    'classToAddForFullView': 'full-visible', // Class to add when an item is completely visible in the viewport
    'classToRemove': 'invisible', // Class to remove before adding 'classToAdd' to the elements
    'removeClassAfterAnimation': false, // Remove added classes after animation has finished
    'offset': [100 OR 10%], // The offset of the elements (let them appear earlier or later). This can also be percentage based by adding a '%' at the end
    'invertBottomOffset': true, // Add the offset as a negative number to the element's bottom
    'repeat': false, // Add the possibility to remove the class if the elements are not visible
    'callbackFunction': function(elem, action){}, // Callback to do after a class was added to an element. Action will return "add" or "remove", depending if the class was added or removed
    'scrollHorizontal': false // Set to true if your website scrolls horizontal instead of vertical.
});

Features and bugs

Please file feature requests and bugs at the issue tracker.

Changelog

0.0.2

  • Fix documentation

0.0.1

  • Initial version, created by Stagehand

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  viewport_checker: "^0.0.2"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:viewport_checker/viewport_checker.dart';
        
Version Uploaded Documentation Archive
0.0.2 Jun 17, 2016 Go to the documentation of viewport_checker 0.0.2 Download viewport_checker 0.0.2 archive
0.0.1 Jun 17, 2016 Go to the documentation of viewport_checker 0.0.1 Download viewport_checker 0.0.1 archive

Analysis

We analyzed this package on Apr 23, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
97 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
15 / 100
Overall score:
Weighted score of the above. [more]
32
Learn more about scoring.

Platforms

Detected platforms: web

Primary library: package:viewport_checker/viewport_checker.dart with components: html.

Suggestions

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use viewport_checker.dart.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 3 hints.

    Run dartfmt to format lib/viewport_checker.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.0.0 <2.0.0