UNPKG

react-reveal

Version:

Really simple way to add reveal on scroll animation to your React app.

1 lines 1.6 kB
"use strict";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 HeadShake(){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,p=void 0===a?_globals.defaults.delay:a,u=e.count,l=void 0===u?_globals.defaults.count:u,s=e.forever,i=_objectWithoutProperties(e,["children","out","timeout","duration","delay","count","forever"]),d={make:make,duration:void 0===t?n:t,delay:p,forever:s,count:l,style:{animationFillMode:"both"}};return(0,_wrap2.default)(i,d,!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 0% {\n transform: translateX(0);\n }\n\n 6.5% {\n transform: translateX(-6px) rotateY(-9deg);\n }\n\n 18.5% {\n transform: translateX(5px) rotateY(7deg);\n }\n\n 31.5% {\n transform: translateX(-3px) rotateY(-5deg);\n }\n\n 43.5% {\n transform: translateX(2px) rotateY(3deg);\n }\n\n 50% {\n transform: translateX(0);\n}\n",name=!1;HeadShake.propTypes=propTypes,exports.default=HeadShake,module.exports=exports.default;