Advertisement
Guest User

Untitled

a guest
May 27th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.       function setContainerAlignment(alignment) {
  2.         let x = setHorizontalContainerAlignment(alignment)
  3.         let y = setVerticalContainerAlignment(alignment)
  4.         return {'justify-content': x, 'align-items': y}
  5.       }
  6.  
  7.       function setHorizontalContainerAlignment(alignment) {
  8.         let y = 'center'
  9.  
  10.         if (alignment.includes('top')) {
  11.           y = 'flex-start';
  12.         } else if (alignment.includes('bottom')) {
  13.           y = 'flex-end';
  14.         }
  15.  
  16.         return y;
  17.       }
  18.  
  19.       function setVerticalContainerAlignment(alignment) {
  20.         let x = 'center';
  21.  
  22.         if (alignment.includes('left')) {
  23.           x = 'flex-start';
  24.         } else if (alignment.includes('right')) {
  25.           x = 'flex-end';
  26.         }
  27.  
  28.         return x;
  29.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement