Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-skrollr

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-skrollr - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

35

lib/Parallax.js

@@ -1,2 +0,2 @@

"use strict";
'use strict';

@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", {

var _react = require("react");
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require("prop-types");
var _propTypes = require('prop-types');

@@ -26,13 +26,13 @@ var _propTypes2 = _interopRequireDefault(_propTypes);

var Parellax = function (_React$Component) {
_inherits(Parellax, _React$Component);
var Parallax = function (_React$Component) {
_inherits(Parallax, _React$Component);
function Parellax() {
_classCallCheck(this, Parellax);
function Parallax() {
_classCallCheck(this, Parallax);
return _possibleConstructorReturn(this, (Parellax.__proto__ || Object.getPrototypeOf(Parellax)).apply(this, arguments));
return _possibleConstructorReturn(this, (Parallax.__proto__ || Object.getPrototypeOf(Parallax)).apply(this, arguments));
}
_createClass(Parellax, [{
key: "componentDidMount",
_createClass(Parallax, [{
key: 'componentDidMount',
value: function componentDidMount() {

@@ -42,3 +42,8 @@ this.context.refresh();

}, {
key: "render",
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps() {
this.context.refresh();
}
}, {
key: 'render',
value: function render() {

@@ -50,3 +55,3 @@ var _props = this.props,

return _react2.default.createElement(
"div",
'div',
data,

@@ -58,6 +63,6 @@ children

return Parellax;
return Parallax;
}(_react2.default.Component);
Parellax.contextTypes = { refresh: _propTypes2.default.func };
exports.default = Parellax;
Parallax.contextTypes = { refresh: _propTypes2.default.func };
exports.default = Parallax;

@@ -1,2 +0,2 @@

"use strict";
'use strict';

@@ -9,11 +9,11 @@ Object.defineProperty(exports, "__esModule", {

var _react = require("react");
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require("prop-types");
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _skrollr = require("skrollr");
var _skrollr = require('skrollr');

@@ -30,6 +30,6 @@ var _skrollr2 = _interopRequireDefault(_skrollr);

var Parellax = function (_React$Component) {
_inherits(Parellax, _React$Component);
var ParallaxProvider = function (_React$Component) {
_inherits(ParallaxProvider, _React$Component);
function Parellax() {
function ParallaxProvider() {
var _ref;

@@ -39,3 +39,3 @@

_classCallCheck(this, Parellax);
_classCallCheck(this, ParallaxProvider);

@@ -46,3 +46,3 @@ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {

return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Parellax.__proto__ || Object.getPrototypeOf(Parellax)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ParallaxProvider.__proto__ || Object.getPrototypeOf(ParallaxProvider)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
refresh: function refresh() {

@@ -56,4 +56,4 @@ return null;

_createClass(Parellax, [{
key: "initSkrollr",
_createClass(ParallaxProvider, [{
key: 'initSkrollr',
value: function initSkrollr() {

@@ -66,15 +66,15 @@ this.skrollr = _skrollr2.default.init(this.props.init);

}, {
key: "componentDidMount",
key: 'componentDidMount',
value: function componentDidMount() {
this.initSkrollr();
window.addEventListener("scroll", this.getScrollTop);
window.addEventListener('scroll', this.getScrollTop);
}
}, {
key: "componentWillUnMount",
key: 'componentWillUnMount',
value: function componentWillUnMount() {
window.removeEventListener("scroll", this.getScrollTop);
window.removeEventListener('scroll', this.getScrollTop);
this.skrollr.destroy();
}
}, {
key: "getChildContext",
key: 'getChildContext',
value: function getChildContext() {

@@ -84,3 +84,3 @@ return { refresh: this.state.refresh };

}, {
key: "render",
key: 'render',
value: function render() {

@@ -90,3 +90,3 @@ var children = this.props.children;

return _react2.default.createElement(
"div",
'div',
null,

@@ -98,10 +98,10 @@ children

return Parellax;
return ParallaxProvider;
}(_react2.default.Component);
Parellax.propTypes = {
ParallaxProvider.propTypes = {
init: _propTypes2.default.object,
getScrollTop: _propTypes2.default.func
};
Parellax.defaultProps = {
ParallaxProvider.defaultProps = {
init: {},

@@ -112,5 +112,5 @@ getScrollTop: function getScrollTop() {

};
Parellax.childContextTypes = {
ParallaxProvider.childContextTypes = {
refresh: _propTypes2.default.func
};
exports.default = Parellax;
exports.default = ParallaxProvider;
{
"name": "react-skrollr",
"version": "1.0.0",
"version": "1.0.1",
"description": "React Component parallax scrolling JavaScript library base on Skrollr",

@@ -43,3 +43,3 @@ "main": "lib/index.js",

"serve": "serve -s build",
"build-lib": "babel ./src/react-skrollr --out-dir ../lib",
"build-lib": "babel ./src/react-skrollr --out-dir lib",
"test": "react-scripts test --env=jsdom",

@@ -46,0 +46,0 @@ "eject": "react-scripts eject"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc