home.css 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. body {
  2. display: grid;
  3. grid-gap: 20px;
  4. grid-template-areas:
  5. "header"
  6. "main"
  7. "footer";
  8. /* Fix height */
  9. height: 100vh;
  10. grid-template-rows: auto 1fr auto;
  11. /* fix top and bottom */
  12. margin-left: 1rem;
  13. margin-right: 1rem;
  14. }
  15. a:link {
  16. color: var(--link);
  17. }
  18. a:visited {
  19. color: var(--link-visited);
  20. }
  21. input[type="text"],
  22. input[type="search"] {
  23. background: var(--background);
  24. border: 1px solid var(--button-border);
  25. border-radius: 5px;
  26. padding: 0.4rem 0.4rem;
  27. font-size: 15px;
  28. color: var(--search-text);
  29. outline: none;
  30. box-shadow: none;
  31. }
  32. input[type='search'] {
  33. border-bottom: 1px solid var(--button-border);
  34. border-top: 0px;
  35. border-left: 0px;
  36. border-right: 0px;
  37. border-radius: 0px;
  38. }
  39. header {
  40. display: grid;
  41. grid-gap: 1px;
  42. grid-template-areas:
  43. "home"
  44. "form";
  45. grid-area: header;
  46. }
  47. .home {
  48. grid-area: home;
  49. margin-left: auto;
  50. margin-right: auto;
  51. margin-bottom: 1rem;
  52. margin-top: 1rem;
  53. }
  54. .form {
  55. display: grid;
  56. grid-gap: 4px;
  57. grid-template-areas:
  58. "search-box"
  59. "search-button"
  60. "dropdown";
  61. grid-area: form;
  62. }
  63. .search-box {
  64. grid-area: search-box;
  65. }
  66. .search-button {
  67. grid-area: search-button;
  68. cursor: pointer;
  69. padding-bottom: 6px;
  70. padding-left: .75em;
  71. padding-right: .75em;
  72. padding-top: 6px;
  73. text-align: center;
  74. white-space: nowrap;
  75. background-color: var(--buttom);
  76. border: 1px solid var(--button-border);
  77. color: var(--buttom-text);
  78. border-radius: 5px;
  79. }
  80. .search-button:hover {
  81. background-color: var(--buttom-hover);
  82. }
  83. .dropdown {
  84. display: grid;
  85. grid-gap: 1px;
  86. grid-template-areas:
  87. "dropdown-label"
  88. "dropdown-content";
  89. grid-area: dropdown;
  90. }
  91. .dropdown-label {
  92. grid-area: dropdown-label;
  93. padding-bottom: 6px;
  94. padding-left: .75em;
  95. padding-right: .75em;
  96. padding-top: 6px;
  97. text-align: center;
  98. white-space: nowrap;
  99. background-color: var(--buttom);
  100. border: 1px solid var(--button-border);
  101. color: var(--buttom-text);
  102. border-radius: 5px;
  103. }
  104. .dropdown-label:hover {
  105. background-color: var(--buttom-hover);
  106. }
  107. /* ------------- Menu Mobile sin JS ---------------- */
  108. /* input hidden */
  109. .opt-box {
  110. display: none;
  111. }
  112. .dropdown-content {
  113. display: none;
  114. grid-area: dropdown-content;
  115. }
  116. label[for=options-toggle-cbox] {
  117. cursor: pointer;
  118. -webkit-touch-callout: none;
  119. -webkit-user-select: none;
  120. -khtml-user-select: none;
  121. -moz-user-select: none;
  122. -ms-user-select: none;
  123. user-select: none;
  124. }
  125. #options-toggle-cbox:checked ~ .dropdown-content {
  126. display: block;
  127. white-space: nowrap;
  128. background: var(--secondary-background);
  129. padding: 0.5rem 1rem;
  130. }
  131. /*- ----------- End Menu Mobile sin JS ------------- */
  132. .main {
  133. grid-area: main;
  134. margin: 0 auto;
  135. max-width: 80ch;
  136. }
  137. .code-error {
  138. background: var(--secondary-background);
  139. padding: 1rem;
  140. }
  141. .footer {
  142. grid-area: footer;
  143. display: grid;
  144. grid-template-columns: auto;
  145. align-items: center;
  146. justify-content: center;
  147. margin: auto;
  148. text-align: center;
  149. }
  150. .footer > p {
  151. text-align: center;
  152. }
  153. @media (min-width: 780px) {
  154. body {
  155. display: grid;
  156. grid-template-columns: 0.3fr 2fr 1fr 0.3fr;
  157. grid-template-rows: auto 1fr auto;
  158. grid-template-areas:
  159. "header header header header"
  160. "main main main main"
  161. "footer footer footer footer";
  162. }
  163. .form {
  164. display: grid;
  165. grid-gap: 1px;
  166. grid-template-columns: 1fr 1.4fr 0.3fr 1.3fr;
  167. grid-template-areas: ". search-box search-button dropdown";
  168. grid-area: form;
  169. position: relative;
  170. }
  171. .dropdown {
  172. display: grid;
  173. grid-gap: 1px;
  174. grid-template-columns: 100px auto;
  175. grid-template-areas:
  176. "dropdown-label"
  177. "dropdown-content";
  178. grid-area: dropdown;
  179. position: absolute;
  180. background: var(--background);
  181. padding-right: 4rem;
  182. z-index: 1;
  183. }
  184. #options-toggle-cbox:checked ~ .dropdown-content {
  185. width: calc(100% + 100px);
  186. max-height: 80vh;
  187. overflow-y: scroll;
  188. }
  189. .footer {
  190. display: grid;
  191. grid-template-columns: repeat(3, 1fr);
  192. grid-column-gap: 2rem;
  193. align-items: center;
  194. justify-content: center;
  195. text-align: center;
  196. margin-top: 1rem;
  197. margin-bottom: 1rem;
  198. }
  199. }