react-reveal
Version:
Really simple way to add reveal on scroll animation to your React app.
1 lines • 1.72 kB
JavaScript
function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _objectWithoutProperties(e,r){var t={};for(var o in e)r.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}function make(){return name||(name=(0,_globals.animation)(rule))}function Wobble(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_globals.defaults,r=e.children,t=(e.out,e.timeout),o=e.duration,n=void 0===o?_globals.defaults.duration:o,a=e.delay,l=void 0===a?_globals.defaults.delay:a,u=e.count,p=void 0===u?_globals.defaults.count:u,d=e.forever,s=_objectWithoutProperties(e,["children","out","timeout","duration","delay","count","forever"]),i={make:make,duration:void 0===t?n:t,delay:l,forever:d,count:p,style:{animationFillMode:"both"}};return(0,_wrap2.default)(s,i,!1,r,!0)}Object.defineProperty(exports,"__esModule",{value:!0});var _propTypes=require("prop-types"),_wrap=require("./wrap"),_wrap2=_interopRequireDefault(_wrap),_globals=require("./globals"),propTypes={duration:_propTypes.number,timeout:_propTypes.number,delay:_propTypes.number,count:_propTypes.number,forever:_propTypes.bool},rule="\n from {\n transform: none;\n }\n\n 15% {\n transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg);\n }\n\n 30% {\n transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg);\n }\n\n 45% {\n transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg);\n }\n\n 60% {\n transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg);\n }\n\n 75% {\n transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg);\n }\n\n to {\n transform: none;\n}\n",name=!1;Wobble.propTypes=propTypes,exports.default=Wobble,module.exports=exports.default;
;