react-skrollr
Advanced tools
Comparing version 0.0.1 to 1.0.0
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,13 +6,10 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = undefined; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _class, _temp; | ||
var _react = require("react"); | ||
var _react = require('react'); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _propTypes = require('prop-types'); | ||
var _propTypes = require("prop-types"); | ||
@@ -29,3 +26,3 @@ var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var Parellax = (_temp = _class = function (_React$Component) { | ||
var Parellax = function (_React$Component) { | ||
_inherits(Parellax, _React$Component); | ||
@@ -40,3 +37,3 @@ | ||
_createClass(Parellax, [{ | ||
key: 'componentDidMount', | ||
key: "componentDidMount", | ||
value: function componentDidMount() { | ||
@@ -46,3 +43,3 @@ this.context.refresh(); | ||
}, { | ||
key: 'render', | ||
key: "render", | ||
value: function render() { | ||
@@ -54,3 +51,3 @@ var _props = this.props, | ||
return _react2.default.createElement( | ||
'div', | ||
"div", | ||
data, | ||
@@ -63,3 +60,5 @@ children | ||
return Parellax; | ||
}(_react2.default.Component), _class.contextTypes = { refresh: _propTypes2.default.func }, _temp); | ||
}(_react2.default.Component); | ||
Parellax.contextTypes = { refresh: _propTypes2.default.func }; | ||
exports.default = Parellax; |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,17 +6,14 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports.default = undefined; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _class, _temp2; | ||
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"); | ||
@@ -33,3 +30,3 @@ var _skrollr2 = _interopRequireDefault(_skrollr); | ||
var Parellax = (_temp2 = _class = function (_React$Component) { | ||
var Parellax = function (_React$Component) { | ||
_inherits(Parellax, _React$Component); | ||
@@ -48,3 +45,7 @@ | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Parellax.__proto__ || Object.getPrototypeOf(Parellax)).call.apply(_ref, [this].concat(args))), _this), _this.getScrollTop = function () { | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Parellax.__proto__ || Object.getPrototypeOf(Parellax)).call.apply(_ref, [this].concat(args))), _this), _this.state = { | ||
refresh: function refresh() { | ||
return null; | ||
} | ||
}, _this.getScrollTop = function () { | ||
_this.props.getScrollTop(_this.skrollr.getScrollTop()); | ||
@@ -55,24 +56,28 @@ }, _temp), _possibleConstructorReturn(_this, _ret); | ||
_createClass(Parellax, [{ | ||
key: 'componentWillMount', | ||
value: function componentWillMount() { | ||
key: "initSkrollr", | ||
value: function initSkrollr() { | ||
this.skrollr = _skrollr2.default.init(this.props.init); | ||
this.setState({ | ||
refresh: this.skrollr.refresh | ||
}); | ||
} | ||
}, { | ||
key: 'componentDidMount', | ||
key: "componentDidMount", | ||
value: function componentDidMount() { | ||
window.addEventListener('scroll', this.getScrollTop); | ||
this.initSkrollr(); | ||
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() { | ||
return { refresh: this.skrollr.refresh }; | ||
return { refresh: this.state.refresh }; | ||
} | ||
}, { | ||
key: 'render', | ||
key: "render", | ||
value: function render() { | ||
@@ -82,3 +87,3 @@ var children = this.props.children; | ||
return _react2.default.createElement( | ||
'div', | ||
"div", | ||
null, | ||
@@ -91,6 +96,9 @@ children | ||
return Parellax; | ||
}(_react2.default.Component), _class.propTypes = { | ||
}(_react2.default.Component); | ||
Parellax.propTypes = { | ||
init: _propTypes2.default.object, | ||
getScrollTop: _propTypes2.default.func | ||
}, _class.defaultProps = { | ||
}; | ||
Parellax.defaultProps = { | ||
init: {}, | ||
@@ -100,5 +108,6 @@ getScrollTop: function getScrollTop() { | ||
} | ||
}, _class.childContextTypes = { | ||
}; | ||
Parellax.childContextTypes = { | ||
refresh: _propTypes2.default.func | ||
}, _temp2); | ||
}; | ||
exports.default = Parellax; |
{ | ||
"name": "react-skrollr", | ||
"version": "0.0.1", | ||
"version": "1.0.0", | ||
"description": "React Component parallax scrolling JavaScript library base on Skrollr", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"dev": "webpack-dev-server --hot --inline", | ||
"test": "npm run lint && mocha ./test/**/*.test.js --compilers js:babel-register", | ||
"test:watch": "mocha ./test/**/*.test.js --compilers js:babel-register --watch", | ||
"lint": "eslint ./src", | ||
"clean": "rimraf lib", | ||
"build": "npm run clean && babel src --out-dir lib", | ||
"prepublish": "npm run build" | ||
}, | ||
"author": "[GAMO] Thawatchai Kuansombat (thawatchai.deartk@gmail.com)", | ||
@@ -24,3 +15,2 @@ "license": "MIT", | ||
}, | ||
"homepage": "https://github.com/GA-MO/react-skrollr", | ||
"keywords": [ | ||
@@ -35,41 +25,25 @@ "react-skrollr", | ||
"files": [ | ||
"lib", | ||
"configs" | ||
"lib" | ||
], | ||
"dependencies": { | ||
"skrollr": "0.6.26" | ||
}, | ||
"devDependencies": { | ||
"babel": "^6.23.0", | ||
"babel-cli": "^6.26.0", | ||
"babel-core": "^6.26.0", | ||
"babel-eslint": "^7.2.3", | ||
"babel-loader": "^7.1.2", | ||
"babel-plugin-transform-decorators-legacy": "^1.3.4", | ||
"babel-polyfill": "^6.26.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-preset-react": "^6.24.1", | ||
"babel-preset-stage-0": "^6.24.1", | ||
"chai": "^4.1.2", | ||
"css-loader": "^0.28.7", | ||
"eslint": "^4.5.0", | ||
"eslint-config-standard": "^10.2.1", | ||
"eslint-config-standard-react": "^5.0.0", | ||
"eslint-plugin-import": "^2.7.0", | ||
"eslint-plugin-node": "^5.1.1", | ||
"eslint-plugin-promise": "^3.5.0", | ||
"eslint-plugin-react": "^7.3.0", | ||
"eslint-plugin-standard": "^3.0.1", | ||
"mocha": "^3.5.0", | ||
"react": "16.0.0", | ||
"react-dom": "16.0.0", | ||
"react-hot-loader": "^3.1.1", | ||
"rimraf": "^2.6.1", | ||
"style-loader": "^0.18.2", | ||
"styled-components": "^2.1.2", | ||
"url-loader": "^0.5.9", | ||
"webpack": "^3.5.5", | ||
"webpack-dev-server": "^2.7.1" | ||
"react-scripts": "1.0.0" | ||
}, | ||
"dependencies": { | ||
"react": "^16.0.0", | ||
"react-dom": "^16.0.0", | ||
"skrollr": "^0.6.26" | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"build": "react-scripts build", | ||
"serve": "serve -s build", | ||
"build-lib": "babel ./src/react-skrollr --out-dir ../lib", | ||
"test": "react-scripts test --env=jsdom", | ||
"eject": "react-scripts eject" | ||
} | ||
} |
# React Skrollr | ||
[![npm version](https://badge.fury.io/js/react-skrollr.png)](https://badge.fury.io/js/react-skrollr) | ||
React Component parallax scrolling JavaScript library base on [*Skrollr*](<https://github.com/Prinzhorn/skrollr>) | ||
See [*live demo*](<http://react-skrollr-demo.surge.sh>) | ||
### Getting Started | ||
@@ -29,3 +34,4 @@ ``` | ||
smoothScrollingDuration: 500, | ||
smoothScrolling: true | ||
smoothScrolling: true, | ||
forceHeight: false | ||
}} | ||
@@ -32,0 +38,0 @@ > |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
8
145
84
10103
5
- Removedreact@^16.0.0
- Removedreact-dom@^16.0.0
- Removedjs-tokens@4.0.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedprop-types@15.8.1(transitive)
- Removedreact@16.14.0(transitive)
- Removedreact-dom@16.14.0(transitive)
- Removedreact-is@16.13.1(transitive)
- Removedscheduler@0.19.1(transitive)
Updatedskrollr@0.6.26