Шаблон:CategoryMenu/styles.css: различия между версиями

Материал из Space Station 14 Вики
мНет описания правки
мНет описания правки
Строка 1: Строка 1:
.category-menu {
.category-menu {
border: 2px solid #494959;
    border: 2px solid #494959;
border-radius: 0.3em;
    border-radius: 0.3em;
background-color: #34343f;
    background-color: #34343f;
overflow: hidden;
    overflow: hidden;
padding: 12px 10px;
    padding: 12px 10px;
box-sizing: border-box;
    box-sizing: border-box;
color: #e1e0e0;
    color: #e1e0e0;
}
 
.category-menu p {
color: #e1e0e0;
}
}


.main-container {
.main-container {
display: flex;
    display: grid;
width: 100%;
    grid-template-columns: 300px 1fr;
    grid-template-rows: auto;
    gap: 12px;
    width: 100%;
}
}


.categories {
.categories {
display: flex;
    grid-column: 1 / 3;
justify-content: center;
    display: flex;
padding: 6px;
    justify-content: center;
display: none;
    padding: 6px;
}
}


.categories div {
.categories div {
cursor: pointer;
    cursor: pointer;
padding: 10px 20px;
    padding: 10px 20px;
margin: 0 8px;
    margin: 0 8px;
background-color: #43434d;
    background-color: #43434d;
border-radius: 0.3em;
    border-radius: 0.3em;
}
}


.categories .active {
.categories .active {
background-color: #717483; /* Выделение активного пункта меню */
    background-color: #717483; /* Выделение активного пункта меню */
}
}


.menu-container {
.menu-container {
width: 300px;
    max-height: 600px;
max-height: 600px;
    overflow-y: auto;
overflow-y: auto;
    padding: 2px;
padding: 2px;
    padding-right: 5px;
padding-right: 5px;
    box-sizing: border-box;
box-sizing: border-box;
}
}


.menu div {
.menu div {
cursor: pointer;
    cursor: pointer;
padding: 14px 12px;
    padding: 14px 12px;
background-color: #4f4f5f;
    background-color: #4f4f5f;
color: #d4d7db;
    color: #d4d7db;
border-radius: 0.3em;
    border-radius: 0.3em;
font-size: 15.5px;
    font-size: 15.5px;
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;
}
 
.menu {
display: none; /* Скрываем меню, если категория не выбрана */
}
 
.menu div:hover {
background-color: #555565;
}
}


.menu.active {
.menu.active {
display: block; /* Отображаем активное меню */
    display: block; /* Отображаем активное меню */
}
}


.menu .active {
.content {
outline: 2px solid #767689;
    padding: 12px;
    background-color: #4b4b59;
    border-radius: 0.3em;
    min-height: 150px;
    max-height: 600px;
    overflow: auto;
    box-sizing: border-box;
    box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.5);
    overflow-x: hidden;
}
}


.content {
/* Сохранённые стили мобильной версии */
padding: 12px;
@media (max-width: 800px) {
width: 100%;
    .menu div {
background-color: #4b4b59;
        padding: 8px 6px;
border-radius: 0.3em;
        font-size: 12px;
min-height: 150px;
    }
max-height: 600px;
   
overflow: auto;
    .category-menu {
box-sizing: border-box;
        position: relative;
margin-left: 12px;
        padding: 12px 10px;
box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.5);
        overflow: hidden;
overflow-x: hidden;
        box-sizing: border-box;
}
    }


.content > div {
    .menu-container {
display: none;
        position: absolute;
}
        width: calc(50% - 20px);
        transform: translateX(-400px);
        transition: transform 0.3s ease;
        z-index: 1;
    }


.content .active {
    .menu-toggle {
display: block;
        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 {
    .menu-toggle.active {
display: none;
        left: 50%;  
}
    }


@media (max-width: 800px) {
    .menu-container.active {
.menu div {
        transform: translateX(0); /* Меню плавно сдвигается в поле зрения */
padding: 8px 6px;
    }
font-size: 12px;
}
.category-menu {
position: relative;
padding: 12px 10px;
overflow: hidden;
box-sizing: border-box;
}


.menu-container {
    .content {
position: absolute;
        width: 100%;
width: calc(50% - 20px);
        margin-left: 0;
transform: translateX(-400px);
        transition: margin-left 0.3s ease;
transition: transform 0.3s ease;
    }
z-index: 1;
}


.menu-toggle {
    .menu-container.active ~ .content {
position: absolute;
        margin-left: 50%;
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 {
@media (min-width: 801px) {
left: 50%;  
    .main-container {
}
        display: grid;
        grid-template-columns: 300px 1fr;
        grid-template-rows: auto;
        gap: 12px;
        width: 100%;
    }


.menu-container.active {
    .categories {
transform: translateX(0); /* Меню плавно сдвигается в поле зрения */
        grid-column: 1 / 3; /* Малый блок на всю ширину */
}
    }


.content {
    .menu-container {
width: 100%;
        grid-column: 1;
margin-left: 0;
    }
transition: margin-left 0.3s ease;
}


.menu-container.active ~ .content {
    .content {
margin-left: 50%;
        grid-column: 2;
}
    }
}
}

Версия от 03:02, 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;
}

.main-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    grid-template-rows: auto;
    gap: 12px;
    width: 100%;
}

.categories {
    grid-column: 1 / 3; 
    display: flex;
    justify-content: center;
    padding: 6px;
}

.categories div {
    cursor: pointer;
    padding: 10px 20px;
    margin: 0 8px;
    background-color: #43434d;
    border-radius: 0.3em;
}

.categories .active {
    background-color: #717483; /* Выделение активного пункта меню */
}

.menu-container {
    max-height: 600px;
    overflow-y: auto;
    padding: 2px;
    padding-right: 5px;
    box-sizing: border-box;
}

.menu div {
    cursor: pointer;
    padding: 14px 12px;
    background-color: #4f4f5f;
    color: #d4d7db;
    border-radius: 0.3em;
    font-size: 15.5px;
    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.active {
    display: block; /* Отображаем активное меню */
}

.content {
    padding: 12px;
    background-color: #4b4b59;
    border-radius: 0.3em;
    min-height: 150px;
    max-height: 600px;
    overflow: auto;
    box-sizing: border-box;
    box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.5);
    overflow-x: hidden;
}

/* Сохранённые стили мобильной версии */
@media (max-width: 800px) {
    .menu div {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    .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%;
    }
}

@media (min-width: 801px) {
    .main-container {
        display: grid;
        grid-template-columns: 300px 1fr;
        grid-template-rows: auto;
        gap: 12px;
        width: 100%;
    }

    .categories {
        grid-column: 1 / 3; /* Малый блок на всю ширину */
    }

    .menu-container {
        grid-column: 1;
    }

    .content {
        grid-column: 2;
    }
}