Шаблон:CategoryMenu/styles.css: различия между версиями
Материал из Space Station 14 Вики
Pok (обсуждение | вклад) Нет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
Строка 13: | Строка 13: | ||
} | } | ||
.main-container { | .main-container { | ||
display: flex; | display: flex; | ||
Строка 23: | Строка 22: | ||
justify-content: center; | justify-content: center; | ||
padding: 6px; | padding: 6px; | ||
display: none; | display: none; | ||
} | } | ||
Строка 39: | Строка 37: | ||
} | } | ||
.menu-container { | .menu-container { | ||
width: 300px; | width: 300px; | ||
Строка 46: | Строка 43: | ||
padding: 2px; | padding: 2px; | ||
padding-right: 5px; | padding-right: 5px; | ||
box-sizing: border-box; | |||
} | } | ||
Строка 56: | Строка 54: | ||
font-family: 'noto sans'; | font-family: 'noto sans'; | ||
font-weight: bold; | font-weight: bold; | ||
box-sizing: border-box; | box-sizing: border-box; | ||
transition: all 0.05s; | transition: all 0.05s; | ||
box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.3); | box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.3); | ||
} | } | ||
.menu div:not(:last-child) { | .menu div:not(:last-child) { | ||
margin-bottom: 8px; | margin-bottom: 8px; | ||
Строка 80: | Строка 79: | ||
} | } | ||
.content { | .content { | ||
padding: 10px; | padding: 10px; | ||
Строка 108: | Строка 106: | ||
@media (max-width: 800px) { | @media (max-width: 800px) { | ||
.category-menu { | |||
position: relative; | |||
padding: 12px 10px; | |||
overflow: hidden; | |||
box-sizing: border-box; | |||
} | |||
.menu-container { | |||
position: absolute; | |||
top: 0; | |||
left: 0; | |||
width: 320px; /* Увеличиваем ширину для мобильных устройств */ | |||
transform: translateX(-320px); /* Прячем за границей экрана */ | |||
transition: transform 0.3s ease; | |||
z-index: 1; | |||
box-sizing: border-box; | |||
} | |||
.menu-toggle { | |||
display: block; | |||
padding: 10px; | |||
background-color: #333; | |||
color: #fff; | |||
font-size: 24px; | |||
position: absolute; | |||
top: 10px; | |||
left: 10px; | |||
z-index: 1001; | |||
cursor: pointer; | |||
} | |||
.menu-container.active { | |||
transform: translateX(0); /* Меню плавно сдвигается в поле зрения */ | |||
} | |||
.content { | |||
width: 100%; | |||
margin-left: 0; | |||
transition: margin-left 0.3s ease; | |||
} | |||
.menu-container.active ~ .content { | |||
margin-left: 320px; | |||
} | |||
} | } |
Версия от 04:36, 27 сентября 2024
.category-menu { border: 2px solid #464a59; border-radius: 0.3em; background-color: #33333d; overflow: hidden; padding: 12px 10px; box-sizing: border-box; color: #e1e0e0; } .category-menu p { color: #e1e0e0; } .main-container { display: flex; width: 100%; } .categories { display: flex; justify-content: center; padding: 6px; display: none; } .categories div { cursor: pointer; padding: 10px 20px; margin: 0 8px; background-color: #43434d; border-radius: 0.3em; } .categories .active { background-color: #717483; /* Выделение активного пункта меню */ } .menu-container { width: 300px; max-height: 500px; overflow-y: auto; padding: 2px; padding-right: 5px; box-sizing: border-box; } .menu div { cursor: pointer; padding: 12px 10px; background-color: #515161; border-radius: 0.3em; font-size: 15px; 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 div:not(:last-child) { margin-bottom: 8px; } .menu { display: none; /* Скрываем меню, если категория не выбрана */ } .menu div:hover { background-color: #575767; } .menu.active { display: block; /* Отображаем активное меню */ } .menu .active { outline: 2px solid #7b7e8f; } .content { padding: 10px; width: 100%; background-color: #494957; border-radius: 0.3em; min-height: 150px; max-height: 500px; overflow: auto; box-sizing: border-box; margin-left: 12px; box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.4); overflow-x: hidden; } .content > div { display: none; } .content .active { display: block; } .menu-toggle { display: none; } @media (max-width: 800px) { .category-menu { position: relative; padding: 12px 10px; overflow: hidden; box-sizing: border-box; } .menu-container { position: absolute; top: 0; left: 0; width: 320px; /* Увеличиваем ширину для мобильных устройств */ transform: translateX(-320px); /* Прячем за границей экрана */ transition: transform 0.3s ease; z-index: 1; box-sizing: border-box; } .menu-toggle { display: block; padding: 10px; background-color: #333; color: #fff; font-size: 24px; position: absolute; top: 10px; left: 10px; z-index: 1001; cursor: pointer; } .menu-container.active { transform: translateX(0); /* Меню плавно сдвигается в поле зрения */ } .content { width: 100%; margin-left: 0; transition: margin-left 0.3s ease; } .menu-container.active ~ .content { margin-left: 320px; } }