Шаблон:CategoryMenu/styles.css
Материал из Space Station 14 Вики
/* Весь блок */ .navigation { display: grid; grid-template-columns: 1fr 5fr; grid-template-rows: auto auto; gap: 10px; border: 2px solid #494959; border-radius: 0.3em; padding: 12px 10px; box-sizing: border-box; overflow: hidden; background-color: #34343f; color: #e1e1e1; } .navigation p { color: #e1e1e1; } /* Категории */ .navigation__switcher { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 3px solid #202029; border-radius: 0.2em; font-family: "noto sans"; background: #2b2b35; } /* Стрелки */ .navigation__arrow { cursor: pointer; color: #c3c3c9; font-size: 1.4em; } .navigation__arrow.disabled { color: #7d7d81; cursor: default; } /* Категории */ .navigation__categories { position: relative; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden; } .navigation__categories > div { display: none; font-weight: bold; font-size: 1em; } .navigation__categories div.active { display: block; /* Отображаем активную категорию */ } /* Меню */ .navigation__menu { grid-column: 1; grid-row: 2; height: 450px; overflow-y: auto; box-sizing: border-box; padding: 0 2px 4px 2px; } .navigation__menu > div { cursor: pointer; padding: 14px 12px; border-radius: 0.4em; font-size: 15px; font-family: 'noto sans'; font-weight: bold; box-sizing: border-box; transition: all 0.05s; box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.3); background-color: #4d4d5d; color: #e7e6e6; } .navigation__menu > div:not(:last-child) { margin-bottom: 8px; } .navigation__menu > div:hover { background-color: #525263; } .navigation__menu > div.active { border-left: 5px solid #6d6d7f; } .navigation__menu { display: none; /* Скрываем меню, если категория не выбрана */ } .navigation__menu.active { display: block; /* Отображаем активное меню */ } /* Контент */ .navigation__content { grid-column: 2; grid-row: 1 / 3; height: 515px; padding: 12px; width: 100%; min-height: 400px; overflow: auto; box-sizing: border-box; overflow-x: hidden; border-radius: 0.3em; background-color: #4b4b59; box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.5); } .navigation__content > div { display: none; } .navigation__content .active { display: block; } .navigation__menu-toggle { display: none; } @media (max-width: 900px) { .navigation { grid-template-columns: 1fr 1fr; position: relative; padding: 12px 10px; overflow: hidden; box-sizing: border-box; } /* Кнопка отображения меню */ .navigation__menu-toggle { position: absolute; display: block; top: 75px; left: 15px; padding: 6px 10px; z-index: 2; cursor: pointer; font-size: 1em; font-weight: bold; color: #d0d0d0; margin: 4px; background-color: #323241; border-radius: 0.2em; box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.7); transition: left 0.3s; } .navigation__menu-toggle.active { left: 72%; } .navigation__switcher { grid-column: 1 / 3; padding: 10px 12px; } .navigation__categories > div { font-size: 0.9em; } .navigation__arrow { font-size: 1.1em; } .navigation__menu { grid-column: 1 / 3; grid-row: 2; width: calc(70%); height: max-content; padding: 10px; top: 8px; left: 8px; max-height: 350px; position: absolute; transform: translateX(-200%); background: #353541; border: 2px solid #494959; border-radius: 0.5em; box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.8); z-index: 1; transition: transform 0.3s; } .navigation__menu.active { transform: translateX(0); } .navigation__menu > div { padding: 10px 8px; font-size: 14px; box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.3); } .navigation__content { grid-row: 2; grid-column: 1 / 3; width: 100%; margin-left: 0; } }