Dantes (обсуждение | вклад) Нет описания правки |
Dantes (обсуждение | вклад) Нет описания правки |
||
| Строка 1: | Строка 1: | ||
/* | /* Общий контейнер, если нужно вывести несколько карточек */ | ||
.recipe-container { | |||
display: flex; | |||
flex-wrap: wrap; | |||
gap: 1em; | |||
justify-content: center; | |||
} | |||
/* Карточка рецепта */ | |||
.recipe-card { | .recipe-card { | ||
width: 100%; | position: relative; | ||
flex: 1 1 300px; | |||
max-width: 100%; | |||
min-width: 250px; | |||
box-sizing: border-box; | box-sizing: border-box; | ||
background-color: #2a2a2a; | background-color: #2a2a2a; | ||
border: 2px solid #444; | border: 2px solid #444; | ||
border-radius: 6px; | border-radius: 6px; | ||
padding: 1em; | |||
color: #f5f5f5; | color: #f5f5f5; | ||
font-size: | font-size: 1rem; | ||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); | box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); | ||
} | } | ||
/* | /* Название вещества сверху */ | ||
.card-substance { | |||
font-size: 1.1rem; | |||
font-weight: bold; | |||
text-align: center; | |||
margin-bottom: 0.5em; | |||
color: inherit; | |||
} | |||
/* Цветная линия под названием */ | |||
.card-substance::after { | |||
content: ""; | |||
display: block; | |||
height: 4px; | |||
width: 50%; | |||
margin: 0.3em auto 0; | |||
background-color: currentColor; | |||
border-radius: 2px; | |||
} | |||
/* Блоки внутри карточки */ | |||
.collapsible-block { | .collapsible-block { | ||
margin-bottom: 1em; | margin-bottom: 1em; | ||
} | } | ||
/* Заголовок | /* Заголовок (кнопка) */ | ||
.collapsible-header { | .collapsible-header { | ||
display: flex; | |||
align-items: center; | |||
background-color: #444; | background-color: #444; | ||
border: none; | border: none; | ||
border-radius: 4px; | |||
cursor: pointer; | |||
transition: background-color 0.3s; | |||
padding: 0.6em 1em; | |||
font-weight: bold; | font-weight: bold; | ||
text-transform: uppercase; | |||
color: #81d4fa; | color: #81d4fa; | ||
} | } | ||
/* | /* Иконка-спрайт */ | ||
.collapsible-header .sprite { | .collapsible-header .sprite { | ||
width: 32px; | display: inline-block; | ||
width: 32px; | |||
height: 32px; | height: 32px; | ||
background-image: url('path_to_beaker_image.png'); | margin-right: 0.6em; | ||
background-image: url('path_to_beaker_image.png'); | |||
background-size: contain; | background-size: contain; | ||
background-repeat: no-repeat; | background-repeat: no-repeat; | ||
} | } | ||
/* Ховер | /* Мелкая иконка в списке */ | ||
.instruction .sprite.small { | |||
width: 20px; | |||
height: 20px; | |||
margin-right: 0.4em; | |||
} | |||
/* Ховер */ | |||
.collapsible-header:hover { | .collapsible-header:hover { | ||
background-color: #555; | background-color: #555; | ||
| Строка 52: | Строка 87: | ||
} | } | ||
/* Контент | /* Линия под заголовком, цвет зависит от data-border */ | ||
.collapsible-header::after { | |||
content: ""; | |||
display: block; | |||
height: 3px; | |||
background-color: currentColor; | |||
margin-top: 0.4em; | |||
border-radius: 2px; | |||
} | |||
/* Контент */ | |||
.collapsible-content { | .collapsible-content { | ||
display: none; | display: none; | ||
margin-top: | margin-top: 0.8em; | ||
padding-left: 1. | padding-left: 1.2em; | ||
border-left: | border-left: 3px solid #81d4fa; | ||
max-height: 0; | |||
max-height: | overflow: hidden; | ||
overflow | |||
transition: max-height 0.3s ease; | transition: max-height 0.3s ease; | ||
} | } | ||
/* | /* Активное состояние */ | ||
.collapsible-content.show { | .collapsible-content.show { | ||
display: block; | display: block; | ||
| Строка 70: | Строка 114: | ||
} | } | ||
/* Описание | /* Описание */ | ||
.recipe-description { | .recipe-description { | ||
font-size: 0.9rem; | |||
font-size: | |||
color: #b0bec5; | color: #b0bec5; | ||
margin-top: 0.5em; | |||
} | } | ||
/* | /* Список рецепта */ | ||
.recipe-list { | .recipe-list { | ||
list-style: none; | |||
list-style | |||
padding: 0; | padding: 0; | ||
margin: 0; | margin: 0; | ||
} | } | ||
.recipe-list li { | |||
. | margin-bottom: 0.4em; | ||
} | } | ||
Версия от 18:05, 3 мая 2025
/* Общий контейнер, если нужно вывести несколько карточек */
.recipe-container {
display: flex;
flex-wrap: wrap;
gap: 1em;
justify-content: center;
}
/* Карточка рецепта */
.recipe-card {
position: relative;
flex: 1 1 300px;
max-width: 100%;
min-width: 250px;
box-sizing: border-box;
background-color: #2a2a2a;
border: 2px solid #444;
border-radius: 6px;
padding: 1em;
color: #f5f5f5;
font-size: 1rem;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
/* Название вещества сверху */
.card-substance {
font-size: 1.1rem;
font-weight: bold;
text-align: center;
margin-bottom: 0.5em;
color: inherit;
}
/* Цветная линия под названием */
.card-substance::after {
content: "";
display: block;
height: 4px;
width: 50%;
margin: 0.3em auto 0;
background-color: currentColor;
border-radius: 2px;
}
/* Блоки внутри карточки */
.collapsible-block {
margin-bottom: 1em;
}
/* Заголовок (кнопка) */
.collapsible-header {
display: flex;
align-items: center;
background-color: #444;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s;
padding: 0.6em 1em;
font-weight: bold;
text-transform: uppercase;
color: #81d4fa;
}
/* Иконка-спрайт */
.collapsible-header .sprite {
display: inline-block;
width: 32px;
height: 32px;
margin-right: 0.6em;
background-image: url('path_to_beaker_image.png');
background-size: contain;
background-repeat: no-repeat;
}
/* Мелкая иконка в списке */
.instruction .sprite.small {
width: 20px;
height: 20px;
margin-right: 0.4em;
}
/* Ховер */
.collapsible-header:hover {
background-color: #555;
color: #b3e5fc;
}
/* Линия под заголовком, цвет зависит от data-border */
.collapsible-header::after {
content: "";
display: block;
height: 3px;
background-color: currentColor;
margin-top: 0.4em;
border-radius: 2px;
}
/* Контент */
.collapsible-content {
display: none;
margin-top: 0.8em;
padding-left: 1.2em;
border-left: 3px solid #81d4fa;
max-height: 0;
overflow: hidden;
transition: max-height 0.3s ease;
}
/* Активное состояние */
.collapsible-content.show {
display: block;
max-height: 500px;
}
/* Описание */
.recipe-description {
font-size: 0.9rem;
color: #b0bec5;
margin-top: 0.5em;
}
/* Список рецепта */
.recipe-list {
list-style: none;
padding: 0;
margin: 0;
}
.recipe-list li {
margin-bottom: 0.4em;
}