header.scss 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. header {
  2. padding: 0 !important;
  3. .top-nav {
  4. display: flex;
  5. flex-direction: row;
  6. align-items: center;
  7. justify-content: space-between;
  8. color: #000;
  9. height: 100px;
  10. padding: 1em;
  11. }
  12. .menu {
  13. display: flex;
  14. flex-direction: row;
  15. list-style-type: none;
  16. margin: 0;
  17. padding: 0;
  18. a {
  19. color: #000;
  20. text-decoration: none;
  21. &:hover {
  22. text-decoration: underline;
  23. }
  24. }
  25. }
  26. .menu > li {
  27. margin: 0 1rem;
  28. overflow: hidden;
  29. }
  30. .menu-button-container {
  31. display: none;
  32. height: 100%;
  33. width: 30px;
  34. cursor: pointer;
  35. flex-direction: column;
  36. justify-content: center;
  37. align-items: center;
  38. }
  39. #menu-toggle {
  40. display: none;
  41. }
  42. .menu-button,
  43. .menu-button::before,
  44. .menu-button::after {
  45. display: block;
  46. background-color: #000;
  47. position: absolute;
  48. height: 4px;
  49. width: 30px;
  50. transition: transform 1s cubic-bezier(0.23, 1, 0.32, 1);
  51. border-radius: 2px;
  52. }
  53. .menu-button::before {
  54. content: "";
  55. margin-top: -8px;
  56. }
  57. .menu-button::after {
  58. content: "";
  59. margin-top: 8px;
  60. }
  61. #menu-toggle:checked + .menu-button-container .menu-button::before {
  62. margin-top: 0px;
  63. transform: rotate(405deg);
  64. }
  65. #menu-toggle:checked + .menu-button-container .menu-button {
  66. background: rgba(255, 255, 255, 0);
  67. }
  68. #menu-toggle:checked + .menu-button-container .menu-button::after {
  69. margin-top: 0px;
  70. transform: rotate(-405deg);
  71. }
  72. @media (max-width: 700px) {
  73. .menu-button-container {
  74. display: flex;
  75. }
  76. .menu {
  77. position: absolute;
  78. top: 50px;
  79. margin-top: 50px;
  80. left: 0;
  81. flex-direction: column;
  82. width: 100%;
  83. justify-content: center;
  84. align-items: center;
  85. li {
  86. display: flex;
  87. justify-content: center;
  88. align-items: center;
  89. a {
  90. color: #fff !important;
  91. }
  92. }
  93. }
  94. #menu-toggle ~ .menu li {
  95. height: 0;
  96. margin: 0;
  97. padding: 0;
  98. border: 0;
  99. transition: height 400ms cubic-bezier(0.23, 1, 0.32, 1);
  100. }
  101. #menu-toggle:checked ~ .menu li {
  102. border: 1px solid #333;
  103. height: 2.5em;
  104. padding: 0.5em;
  105. transition: height 400ms cubic-bezier(0.23, 1, 0.32, 1);
  106. }
  107. .menu > li {
  108. display: flex;
  109. justify-content: center;
  110. margin: 0;
  111. padding: 0.5em 0;
  112. width: 100%;
  113. background-color: #222;
  114. }
  115. .menu > li:not(:last-child) {
  116. border-bottom: 1px solid #444;
  117. }
  118. }
  119. }