Udoro

Custom mobile menu CSS

Mar 10th, 2022 (edited)
526
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.22 KB | None | 0 0
  1. /*TOGGLE*/
  2.  
  3. #toggle{
  4.     cursor: pointer;
  5.     position: relative;
  6.    
  7. }
  8.  
  9. #toggle::before{
  10.     content: '';
  11.     position: absolute;
  12.     left: 0;
  13.     right: 0;
  14.     top: 50%;
  15.     background: white; 
  16.     height: 2px;
  17.     transform: translateY(-5px);
  18.    
  19. }
  20.  
  21.  
  22. #toggle::after{
  23.     content: '';
  24.     position: absolute;
  25.     left: 0;
  26.     right: 0;
  27.     top: 50%;
  28.     background: white; 
  29.     height: 2px;
  30.     transform: translateY(5px);
  31.    
  32. }
  33.  
  34. #toggle::before,
  35. #toggle::after{
  36.     transition: transform 0.2s;
  37. }
  38.  
  39.  
  40. #toggle.active::before{
  41.     transform: translateY(0) rotate(45deg);
  42.  
  43. }
  44. #toggle.active::after{
  45.     transform: translateY(0) rotate(-45deg);
  46.  
  47. }
  48.  
  49.  
  50. /*MENU WRAPPER*/
  51.  
  52. #mobile_menu_wrapper.active{
  53.     height: 420px;
  54.     box-shadow:
  55.   0px 5.6px 1.6px rgba(0, 0, 0, 0.026),
  56.   0px 12.8px 3.6px rgba(0, 0, 0, 0.038),
  57.   0px 22.3px 6.3px rgba(0, 0, 0, 0.047),
  58.   0px 35.4px 10px rgba(0, 0, 0, 0.055),
  59.   0px 54.7px 15.5px rgba(0, 0, 0, 0.063),
  60.   0px 85.3px 24.1px rgba(0, 0, 0, 0.072),
  61.   0px 141.6px 40px rgba(0, 0, 0, 0.084),
  62.   0px 283px 80px rgba(0, 0, 0, 0.11)
  63. ;
  64.  
  65. }
  66.  
  67.  
  68. @media (min-width:600px){
  69.  
  70.     #mobile_menu_wrapper .oxy-nav-menu-list{
  71.     flex-direction: row;
  72.     justify-content: center;
  73. }
  74.  
  75. #mobile_menu_wrapper.active{
  76.     height:80px
  77. }
  78.  
  79.  
  80. }
  81.  
  82.  
  83.  
Add Comment
Please, Sign In to add comment