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

Материал из Space Station 14 Вики
мНет описания правки
мНет описания правки
Метка: ручная отмена
Строка 18: Строка 18:
}
}


/* Общие стили для категорий */
.categories {
.categories {
order: 1; /* Убедитесь, что категории находятся на первом месте */
position: relative;
width: 100%;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
}
}


.menu-container {
.categories div {
order: 2; /* Меню будет вторым элементом */
display: none;
width: 300px; /* Ширина меню */
transition: opacity 0.5s ease, transform 0.5s ease;
max-height: 600px;
width: 100%;
overflow-y: auto;
height: 100%;  
padding: 2px;
text-align: center;
padding-right: 5px;
font-weight: bold;
box-sizing: border-box;
}
}


.content {
/* Отображаем активную категорию */
order: 3; /* Контент будет третьим элементом */
.categories div.active {
padding: 12px;
display: block;
width: calc(100% - 320px); /* Учитываем ширину меню и отступы */
background-color: #4a4a57;
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;
}
}


Строка 65: Строка 60:
}
}


/* Общие стили для категорий */
/* Меню */
.categories {
.menu-container {
position: relative;
width: 300px;
height: auto; /* Автоматическая высота */
max-height: 600px;
display: flex;
overflow-y: auto;
justify-content: center;
padding: 2px;
align-items: center;
padding-right: 5px;
overflow: hidden;
box-sizing: border-box;
}
}


.categories div {
display: none;
transition: opacity 0.5s ease, transform 0.5s ease;
width: 100%;
height: 100%;
text-align: center;
font-weight: bold;
}
/* Отображаем активную категорию */
.categories div.active {
display: block;
}
/* Меню */
.menu div {
.menu div {
cursor: pointer;
cursor: pointer;
Строка 122: Строка 102:
.menu.active {
.menu.active {
display: block; /* Отображаем активное меню */
display: block; /* Отображаем активное меню */
}
.content {
padding: 12px;
width: 100%;
background-color: #4a4a57;
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;
}
}


Строка 129: Строка 131:


@media (max-width: 800px) {
@media (max-width: 800px) {
.menu div {
.menu div{
padding: 8px 6px;
padding: 8px 6px;
font-size: 13px;
font-size: 13px;

Версия от 07:10, 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: #d9d9d9;
}

.category-menu p {
	color: #d9d9d9;
}

.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;
	transition: opacity 0.5s ease, transform 0.5s ease;
	width: 100%;
	height: 100%; 
	text-align: center;
	font-weight: bold;
}

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

.arrow {
	cursor: pointer;
	color: #d9d9d9;
	font-size: 1.5em;
	padding: 10px;
}

.category-switcher {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
	background: #2d2d37;
	border-bottom: 3px solid #22222b;
	border-radius: 0.2em;
}

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

.menu div {
	cursor: pointer;
	padding: 14px 10px;
	background-color: #4a4a59;
	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 4px 0px rgba(0,0,0,0.4);
}

.menu div:not(:last-child) {
	margin-bottom: 8px;
}

.menu div:hover {
	background-color: #4f4f5f;
}

.menu div.active {
	border-left: 4px solid #6b6b7d;
}

.menu {
	display: none; /* Скрываем меню, если категория не выбрана */
}

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

.content {
	padding: 12px;
	width: 100%;
	background-color: #4a4a57;
	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 div{
		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%;
	}
}