Шаблон:CategoryMenu/styles.css: различия между версиями
Материал из Space Station 14 Вики
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
Строка 18: | Строка 18: | ||
} | } | ||
/* | /* Общие стили для категорий */ | ||
.categories { | |||
position: relative; | |||
width: 100%; | |||
height: 100%; | |||
display: flex; | |||
justify-content: center; | |||
align-items: center; | |||
overflow: hidden; | |||
} | |||
.categories div { | .categories div { | ||
display: none; | display: none; /* Скрывать все категории по умолчанию */ | ||
opacity: 0; | opacity: 0; | ||
transition: opacity 0.5s ease, transform 0.5s ease; | transition: opacity 0.5s ease, transform 0.5s ease; | ||
Строка 26: | Строка 36: | ||
} | } | ||
.categories .active { | .categories .active { | ||
display: block; | display: block; /* Отображаем активную категорию */ | ||
opacity: 1; | opacity: 1; | ||
transform: translateX(0); | transform: translateX(0); | ||
Строка 55: | Строка 64: | ||
transform: translateX(-100%); | transform: translateX(-100%); | ||
opacity: 1; | opacity: 1; | ||
} | } | ||
Строка 72: | Строка 74: | ||
} | } | ||
. | .category-switcher { | ||
display: flex; | display: flex; | ||
justify-content: | justify-content: space-between; | ||
align-items: center; | align-items: center; | ||
} | } | ||
Версия от 05:33, 28 сентября 2024
.category-menu { border: 2px solid #494959; border-radius: 0.3em; background-color: #34343f; overflow: hidden; padding: 12px 10px; box-sizing: border-box; color: #e1e0e0; } .category-menu p { color: #e1e0e0; } .main-container { display: flex; width: 100%; } /* Общие стили для категорий */ .categories { position: relative; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden; } .categories div { display: none; /* Скрывать все категории по умолчанию */ opacity: 0; transition: opacity 0.5s ease, transform 0.5s ease; position: absolute; } .categories .active { display: block; /* Отображаем активную категорию */ opacity: 1; transform: translateX(0); } /* Анимация ухода категории налево */ .categories .slide-out-left { transform: translateX(-100%); opacity: 0; } /* Анимация прихода категории справа */ .categories .slide-in-right { transform: translateX(100%); opacity: 1; } /* Анимация ухода категории направо */ .categories .slide-out-right { transform: translateX(100%); opacity: 0; } /* Анимация прихода категории слева */ .categories .slide-in-left { transform: translateX(-100%); opacity: 1; } .arrow { cursor: pointer; color: #e1e0e0; font-size: 1.5em; padding: 10px; z-index: 10; } .category-switcher { display: flex; justify-content: space-between; align-items: center; } .categories .active { background-color: #717483; /* Выделение активного пункта меню */ } .menu-container { width: 300px; max-height: 600px; overflow-y: auto; padding: 2px; padding-right: 5px; box-sizing: border-box; } .menu { cursor: pointer; padding: 14px 12px; background-color: #4f4f5f; color: #d4d7db; border-radius: 0.3em; font-size: 16px; font-family: 'noto sans'; font-weight: bold; box-sizing: border-box; transition: all 0.05s; box-shadow: 0px 2px 5px 0px rgba(0,0,0,0.3); } .menu:not(:last-child) { margin-bottom: 8px; } .menu { display: none; /* Скрываем меню, если категория не выбрана */ } .menu:hover { background-color: #555565; } .menu.active { display: block; /* Отображаем активное меню */ } .menu .active { outline: 2px solid #767689; } .content { padding: 12px; width: 100%; background-color: #4b4b59; border-radius: 0.3em; min-height: 150px; max-height: 600px; overflow: auto; box-sizing: border-box; margin-left: 12px; box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.5); overflow-x: hidden; } .content > div { display: none; } .content .active { display: block; } .menu-toggle { display: none; } @media (max-width: 800px) { .menu { padding: 8px 6px; font-size: 13px; } .category-menu { position: relative; padding: 12px 10px; overflow: hidden; box-sizing: border-box; } .menu-container { position: absolute; width: calc(50% - 20px); transform: translateX(-400px); transition: transform 0.3s ease; z-index: 1; } .menu-toggle { position: absolute; display: block; left: 10px; padding: 6px 10px; background-color: #323241; z-index: 2; cursor: pointer; border-radius: 0.2em; font-size: 1em; font-weight: bold; color: #d0d0d0; margin: 4px; box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.7); transition: left 0.3s ease; } .menu-toggle.active { left: 50%; } .menu-container.active { transform: translateX(0); /* Меню плавно сдвигается в поле зрения */ } .content { width: 100%; margin-left: 0; transition: margin-left 0.3s ease; } .menu-container.active ~ .content { margin-left: 50%; } }