easeIn.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. "use strict";
  2. exports.__esModule = true;
  3. exports["default"] = easeIn;
  4. var functionsMap = {
  5. back: 'cubic-bezier(0.600, -0.280, 0.735, 0.045)',
  6. circ: 'cubic-bezier(0.600, 0.040, 0.980, 0.335)',
  7. cubic: 'cubic-bezier(0.550, 0.055, 0.675, 0.190)',
  8. expo: 'cubic-bezier(0.950, 0.050, 0.795, 0.035)',
  9. quad: 'cubic-bezier(0.550, 0.085, 0.680, 0.530)',
  10. quart: 'cubic-bezier(0.895, 0.030, 0.685, 0.220)',
  11. quint: 'cubic-bezier(0.755, 0.050, 0.855, 0.060)',
  12. sine: 'cubic-bezier(0.470, 0.000, 0.745, 0.715)'
  13. };
  14. /**
  15. * String to represent common easing functions as demonstrated here: (github.com/jaukia/easie).
  16. *
  17. * @example
  18. * // Styles as object usage
  19. * const styles = {
  20. * 'transitionTimingFunction': easeIn('quad')
  21. * }
  22. *
  23. * // styled-components usage
  24. * const div = styled.div`
  25. * transitionTimingFunction: ${easeIn('quad')};
  26. * `
  27. *
  28. * // CSS as JS Output
  29. *
  30. * 'div': {
  31. * 'transitionTimingFunction': 'cubic-bezier(0.550, 0.085, 0.680, 0.530)',
  32. * }
  33. */
  34. function easeIn(functionName) {
  35. return functionsMap[functionName.toLowerCase().trim()];
  36. }
  37. module.exports = exports.default;