Updated tools, proper linting, build README

This commit is contained in:
Angelos Chalaris
2017-12-14 19:38:11 +02:00
parent 3e79c9071d
commit 94c1923ee7
13 changed files with 74 additions and 61 deletions

View File

@ -12,7 +12,7 @@ const elementIsVisibleInViewport = (el, partiallyVisible = false) => {
? ((top > 0 && top < innerHeight) || (bottom > 0 && bottom < innerHeight)) &&
((left > 0 && left < innerWidth) || (right > 0 && right < innerWidth))
: top >= 0 && left >= 0 && bottom <= innerHeight && right <= innerWidth;
}
};
// e.g. 100x100 viewport and a 10x10px element at position {top: -1, left: 0, bottom: 9, right: 10}
// elementIsVisibleInViewport(el) -> false (not fully visible)
// elementIsVisibleInViewport(el, true) -> true (partially visible)