index.sjs 634 B

1234567891011121314151617181920
  1. function getContentStyle(position, animation, duration, width, height) {
  2. var style = '';
  3. if (animation) {
  4. style += "-webkit-animation-duration:".concat(duration, "ms; animation-duration:").concat(duration, "ms;");
  5. }
  6. if (position === 'top' || position === 'bottom') {
  7. if (typeof height !== 'undefined' && height !== null) {
  8. style += "height:".concat(height, "px");
  9. }
  10. }
  11. if (position === 'left' || position === 'right') {
  12. if (typeof width !== 'undefined' && width !== null) {
  13. style += "width:".concat(width, "px");
  14. }
  15. }
  16. return style;
  17. }
  18. export default {
  19. getContentStyle: getContentStyle
  20. };