UNPKG

eff-anim

Version:

eff-anim es un componente donde le puedes pasar distintas animaciones para la vista usando el viewport

12 lines (11 loc) 18.9 kB
"use strict";var r,e=require("react"),t={exports:{}},n={};var o,a,i={}; /** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */function s(){return o||(o=1,"production"!==process.env.NODE_ENV&&function(){var r=e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),c=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),d=Symbol.for("react.offscreen"),v=Symbol.iterator;var g=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];!function(r,e,t){var n=g.ReactDebugCurrentFrame,o=n.getStackAddendum();""!==o&&(e+="%s",t=t.concat([o]));var a=t.map((function(r){return String(r)}));a.unshift("Warning: "+e),Function.prototype.apply.call(console[r],console,a)}("error",r,t)}var h;function _(r){return r.displayName||"Context"}function k(r){if(null==r)return null;if("number"==typeof r.tag&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof r)return r.displayName||r.name||null;if("string"==typeof r)return r;switch(r){case o:return"Fragment";case n:return"Portal";case s:return"Profiler";case a:return"StrictMode";case l:return"Suspense";case u:return"SuspenseList"}if("object"==typeof r)switch(r.$$typeof){case c:return _(r)+".Consumer";case f:return _(r._context)+".Provider";case p:return function(r,e,t){var n=r.displayName;if(n)return n;var o=e.displayName||e.name||"";return""!==o?t+"("+o+")":t}(r,r.render,"ForwardRef");case y:var e=r.displayName||null;return null!==e?e:k(r.type)||"Memo";case m:var t=r,i=t._payload,d=t._init;try{return k(d(i))}catch(r){return null}}return null}h=Symbol.for("react.module.reference");var w,S,x,O,j,R,E,T=Object.assign,P=0;function C(){}C.__reactDisabledLog=!0;var $,N=g.ReactCurrentDispatcher;function D(r,e,t){if(void 0===$)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);$=n&&n[1]||""}return"\n"+$+r}var F,z=!1,I="function"==typeof WeakMap?WeakMap:Map;function Y(r,e){if(!r||z)return"";var t,n=F.get(r);if(void 0!==n)return n;z=!0;var o,a=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=N.current,N.current=null,function(){if(0===P){w=console.log,S=console.info,x=console.warn,O=console.error,j=console.group,R=console.groupCollapsed,E=console.groupEnd;var r={configurable:!0,enumerable:!0,value:C,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}P++}();try{if(e){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(i,[])}catch(r){t=r}Reflect.construct(r,[],i)}else{try{i.call()}catch(r){t=r}r.call(i.prototype)}}else{try{throw Error()}catch(r){t=r}r()}}catch(e){if(e&&t&&"string"==typeof e.stack){for(var s=e.stack.split("\n"),f=t.stack.split("\n"),c=s.length-1,p=f.length-1;c>=1&&p>=0&&s[c]!==f[p];)p--;for(;c>=1&&p>=0;c--,p--)if(s[c]!==f[p]){if(1!==c||1!==p)do{if(c--,--p<0||s[c]!==f[p]){var l="\n"+s[c].replace(" at new "," at ");return r.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",r.displayName)),"function"==typeof r&&F.set(r,l),l}}while(c>=1&&p>=0);break}}}finally{z=!1,N.current=o,function(){if(0==--P){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:T({},r,{value:w}),info:T({},r,{value:S}),warn:T({},r,{value:x}),error:T({},r,{value:O}),group:T({},r,{value:j}),groupCollapsed:T({},r,{value:R}),groupEnd:T({},r,{value:E})})}P<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=a}var u=r?r.displayName||r.name:"",y=u?D(u):"";return"function"==typeof r&&F.set(r,y),y}function L(r,e,t){if(null==r)return"";if("function"==typeof r)return Y(r,!(!(n=r.prototype)||!n.isReactComponent));var n;if("string"==typeof r)return D(r);switch(r){case l:return D("Suspense");case u:return D("SuspenseList")}if("object"==typeof r)switch(r.$$typeof){case p:return Y(r.render,!1);case y:return L(r.type,e,t);case m:var o=r,a=o._payload,i=o._init;try{return L(i(a),e,t)}catch(r){}}return""}F=new I;var W=Object.prototype.hasOwnProperty,X={},A=g.ReactDebugCurrentFrame;function U(r){if(r){var e=r._owner,t=L(r.type,r._source,e?e.type:null);A.setExtraStackFrame(t)}else A.setExtraStackFrame(null)}var B=Array.isArray;function M(r){return B(r)}function V(r){return""+r}function q(r){if(function(r){try{return V(r),!1}catch(r){return!0}}(r))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(r){return"function"==typeof Symbol&&Symbol.toStringTag&&r[Symbol.toStringTag]||r.constructor.name||"Object"}(r)),V(r)}var J,K,H,G=g.ReactCurrentOwner,Q={key:!0,ref:!0,__self:!0,__source:!0};H={};function Z(r,e,n,o,a){var i,s={},f=null,c=null;for(i in void 0!==n&&(q(n),f=""+n),function(r){if(W.call(r,"key")){var e=Object.getOwnPropertyDescriptor(r,"key").get;if(e&&e.isReactWarning)return!1}return void 0!==r.key}(e)&&(q(e.key),f=""+e.key),function(r){if(W.call(r,"ref")){var e=Object.getOwnPropertyDescriptor(r,"ref").get;if(e&&e.isReactWarning)return!1}return void 0!==r.ref}(e)&&(c=e.ref,function(r,e){if("string"==typeof r.ref&&G.current&&e&&G.current.stateNode!==e){var t=k(G.current.type);H[t]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',k(G.current.type),r.ref),H[t]=!0)}}(e,a)),e)W.call(e,i)&&!Q.hasOwnProperty(i)&&(s[i]=e[i]);if(r&&r.defaultProps){var p=r.defaultProps;for(i in p)void 0===s[i]&&(s[i]=p[i])}if(f||c){var l="function"==typeof r?r.displayName||r.name||"Unknown":r;f&&function(r,e){var t=function(){J||(J=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",e))};t.isReactWarning=!0,Object.defineProperty(r,"key",{get:t,configurable:!0})}(s,l),c&&function(r,e){var t=function(){K||(K=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",e))};t.isReactWarning=!0,Object.defineProperty(r,"ref",{get:t,configurable:!0})}(s,l)}return function(r,e,n,o,a,i,s){var f={$$typeof:t,type:r,key:e,ref:n,props:s,_owner:i,_store:{}};return Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(f,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(f,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f}(r,f,c,a,o,G.current,s)}var rr,er=g.ReactCurrentOwner,tr=g.ReactDebugCurrentFrame;function nr(r){if(r){var e=r._owner,t=L(r.type,r._source,e?e.type:null);tr.setExtraStackFrame(t)}else tr.setExtraStackFrame(null)}function or(r){return"object"==typeof r&&null!==r&&r.$$typeof===t}function ar(){if(er.current){var r=k(er.current.type);if(r)return"\n\nCheck the render method of `"+r+"`."}return""}rr=!1;var ir={};function sr(r,e){if(r._store&&!r._store.validated&&null==r.key){r._store.validated=!0;var t=function(r){var e=ar();if(!e){var t="string"==typeof r?r:r.displayName||r.name;t&&(e="\n\nCheck the top-level render call using <"+t+">.")}return e}(e);if(!ir[t]){ir[t]=!0;var n="";r&&r._owner&&r._owner!==er.current&&(n=" It was passed a child from "+k(r._owner.type)+"."),nr(r),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),nr(null)}}}function fr(r,e){if("object"==typeof r)if(M(r))for(var t=0;t<r.length;t++){var n=r[t];or(n)&&sr(n,e)}else if(or(r))r._store&&(r._store.validated=!0);else if(r){var o=function(r){if(null===r||"object"!=typeof r)return null;var e=v&&r[v]||r["@@iterator"];return"function"==typeof e?e:null}(r);if("function"==typeof o&&o!==r.entries)for(var a,i=o.call(r);!(a=i.next()).done;)or(a.value)&&sr(a.value,e)}}function cr(r){var e,t=r.type;if(null!=t&&"string"!=typeof t){if("function"==typeof t)e=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==p&&t.$$typeof!==y)return;e=t.propTypes}if(e){var n=k(t);!function(r,e,t,n,o){var a=Function.call.bind(W);for(var i in r)if(a(r,i)){var s=void 0;try{if("function"!=typeof r[i]){var f=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}s=r[i](e,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(r){s=r}!s||s instanceof Error||(U(o),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof s),U(null)),s instanceof Error&&!(s.message in X)&&(X[s.message]=!0,U(o),b("Failed %s type: %s",t,s.message),U(null))}}(e,r.props,"prop",n,r)}else if(void 0!==t.PropTypes&&!rr){rr=!0,b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",k(t)||"Unknown")}"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}var pr={};function lr(r,e,n,i,v,g){var _=function(r){return"string"==typeof r||"function"==typeof r||r===o||r===s||r===a||r===l||r===u||r===d||"object"==typeof r&&null!==r&&(r.$$typeof===m||r.$$typeof===y||r.$$typeof===f||r.$$typeof===c||r.$$typeof===p||r.$$typeof===h||void 0!==r.getModuleId)}(r);if(!_){var w="";(void 0===r||"object"==typeof r&&null!==r&&0===Object.keys(r).length)&&(w+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var S;w+=ar(),null===r?S="null":M(r)?S="array":void 0!==r&&r.$$typeof===t?(S="<"+(k(r.type)||"Unknown")+" />",w=" Did you accidentally export a JSX literal instead of a component?"):S=typeof r,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",S,w)}var x=Z(r,e,n,v,g);if(null==x)return x;if(_){var O=e.children;if(void 0!==O)if(i)if(M(O)){for(var j=0;j<O.length;j++)fr(O[j],r);Object.freeze&&Object.freeze(O)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else fr(O,r)}if(W.call(e,"key")){var R=k(r),E=Object.keys(e).filter((function(r){return"key"!==r})),T=E.length>0?"{key: someKey, "+E.join(": ..., ")+": ...}":"{key: someKey}";if(!pr[R+T])b('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',T,R,E.length>0?"{"+E.join(": ..., ")+": ...}":"{}",R),pr[R+T]=!0}return r===o?function(r){for(var e=Object.keys(r.props),t=0;t<e.length;t++){var n=e[t];if("children"!==n&&"key"!==n){nr(r),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),nr(null);break}}null!==r.ref&&(nr(r),b("Invalid attribute `ref` supplied to `React.Fragment`."),nr(null))}(x):cr(x),x}var ur=function(r,e,t){return lr(r,e,t,!1)},yr=function(r,e,t){return lr(r,e,t,!0)};i.Fragment=o,i.jsx=ur,i.jsxs=yr}()),i}var f=(a||(a=1,"production"===process.env.NODE_ENV?t.exports=function(){if(r)return n;r=1;var t=e,o=Symbol.for("react.element"),a=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function c(r,e,t){var n,a={},c=null,p=null;for(n in void 0!==t&&(c=""+t),void 0!==e.key&&(c=""+e.key),void 0!==e.ref&&(p=e.ref),e)i.call(e,n)&&!f.hasOwnProperty(n)&&(a[n]=e[n]);if(r&&r.defaultProps)for(n in e=r.defaultProps)void 0===a[n]&&(a[n]=e[n]);return{$$typeof:o,type:r,key:c,ref:p,props:a,_owner:s.current}}return n.Fragment=a,n.jsx=c,n.jsxs=c,n}():t.exports=s()),t.exports);!function(r,e){void 0===e&&(e={});var t=e.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=r:o.appendChild(document.createTextNode(r))}}("/* default effects */\r\n\r\n.eff-left {\r\n transform: translate3d(100px, 0, 0);\r\n opacity: 0;\r\n transition-property: opacity, transform;\r\n transition: transform 0.5s, opacity 0.5s;\r\n\r\n}\r\n\r\n.eff-right {\r\n transform: translate3d(-100px, 0, 0);\r\n opacity: 0;\r\n transition-property: opacity, transform;\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n.eff-bottom {\r\n transform: translate3d(0, 100px, 0);\r\n opacity: 0;\r\n transition-property: opacity, transform;\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n.eff-top {\r\n transform: translate3d(0, -100px, 0);\r\n opacity: 0;\r\n transition-property: opacity, transform;\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n\r\n/* default active animations */\r\n\r\n\r\n.eff-left.animation {\r\n opacity: 1;\r\n transform: none;\r\n transition: transform 0.5s, opacity 0.5s;\r\n\r\n}\r\n\r\n.eff-right.animation {\r\n opacity: 1;\r\n transform: none;\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n.eff-bottom.animation {\r\n opacity: 1;\r\n transform: none;\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n.eff-top.animation {\r\n opacity: 1;\r\n transform: none;\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n\r\n\r\n/* zoom effects */\r\n\r\n\r\n.eff-zoom {\r\n transform: scale(0.6);\r\n opacity: 0;\r\n transition-property: opacity, transform;\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n.eff-z-left {\r\n transform: translate3d(100px, 0, 0) scale(0.6);\r\n opacity: 0;\r\n transition-property: opacity, transform;\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n.eff-z-right {\r\n transform: translate3d(-100px, 0, 0) scale(0.6);\r\n opacity: 0;\r\n transition-property: opacity, transform;\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n.eff-z-top {\r\n transform: translate3d(0, -100px, 0) scale(0.6);\r\n opacity: 0;\r\n transition-property: opacity, transform;\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n\r\n.eff-z-bottom {\r\n transform: translate3d(0, 100px, 0) scale(0.6);\r\n opacity: 0;\r\n transition-property: opacity, transform;\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n/* zoom active animations */\r\n\r\n\r\n.eff-zoom.animation {\r\n opacity: 1;\r\n transform: scale(1);\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n.eff-z-left.animation {\r\n opacity: 1;\r\n transform: translate3d(0, 0, 0) scale(1);\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n.eff-z-right.animation {\r\n opacity: 1;\r\n transform: translate3d(0, 0, 0) scale(1);\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n.eff-z-top.animation {\r\n opacity: 1;\r\n transform: translate3d(0, 0, 0) scale(1);\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n.eff-z-bottom.animation {\r\n opacity: 1;\r\n transform: translate3d(0, 0, 0) scale(1);\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n\r\n/* flip effects */\r\n\r\n.eff-flip {\r\n transform: perspective(2500px) rotateY(-100deg);\r\n transition-property: transform;\r\n opacity: 0;\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n.eff-f-left {\r\n transform: perspective(2500px) rotateY(-100deg) translateX(100px);\r\n transition-property: transform;\r\n opacity: 0;\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n.eff-f-right {\r\n transform: perspective(2500px) rotateY(100deg) translateX(-100px);\r\n transition-property: transform;\r\n opacity: 0;\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n.eff-f-top {\r\n transform: perspective(2500px) rotateX(-100deg) translateY(-100px);\r\n transition-property: transform;\r\n opacity: 0;\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n.eff-f-bottom {\r\n transform: perspective(2500px) rotateX(100deg) translateY(100px);\r\n transition-property: transform;\r\n opacity: 0;\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n/* flip active animations */\r\n\r\n.eff-flip.animation {\r\n transform: perspective(2500px) rotateY(0);\r\n opacity: 1;\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n.eff-f-left.animation {\r\n transform: perspective(2500px) rotateY(0) translateX(0);\r\n opacity: 1;\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n.eff-f-right.animation {\r\n transform: perspective(2500px) rotateY(0) translateX(0);\r\n opacity: 1;\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n.eff-f-top.animation {\r\n transform: perspective(2500px) rotateX(0) translateY(0);\r\n opacity: 1;\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n\r\n.eff-f-bottom.animation {\r\n transform: perspective(2500px) rotateX(0) translateY(0);\r\n opacity: 1;\r\n transition: transform 0.5s, opacity 0.5s;\r\n}\r\n");exports.ContainerViews=function(r){var t=r.children,n=r.threshold,o=void 0===n?.9:n,a=r.effect,i=void 0===a?"":a,s=e.useRef(null),c=e.useState(!1),p=c[0],l=c[1];return e.useEffect((function(){var r=s.current;if(r){var e=new IntersectionObserver((function(r){var e=r[0];l(e.isIntersecting)}),{threshold:o});return e.observe(r),function(){e.disconnect()}}}),[o]),f.jsx("section",{ref:s,className:"content ".concat(i," ").concat(p?"animation":""),children:t})}; //# sourceMappingURL=index.js.map