viewport_checker 0.0.2

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 0

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

Use this package as a library

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
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
0
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Dependencies

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