Dantes (обсуждение | вклад) Нет описания правки |
Dantes (обсуждение | вклад) Нет описания правки |
||
| Строка 22: | Строка 22: | ||
} | } | ||
/* Возвращаем правило для action span */ | |||
.action span { | .action span { | ||
position: relative; | position: relative; | ||
| Строка 43: | Строка 44: | ||
display: flex; | display: flex; | ||
flex-direction: column; | flex-direction: column; | ||
flex-grow: 1; | |||
flex-basis: calc((100% - 3 * var(--gap)) / 4); | |||
margin: 10px 0; | margin: 10px 0; | ||
padding: var(--card-padding); | padding: var(--card-padding); | ||
| Строка 54: | Строка 56: | ||
transition: box-shadow 0.3s ease, background-color 0.3s ease; | transition: box-shadow 0.3s ease, background-color 0.3s ease; | ||
box-sizing: border-box; | box-sizing: border-box; | ||
min-width: | min-width: 250px; | ||
max-width: 100%; | max-width: 100%; | ||
} | } | ||
| Строка 91: | Строка 93: | ||
.recipe-block { | .recipe-block { | ||
display: flex; | display: flex; | ||
flex-wrap: nowrap; | flex-wrap: nowrap; /* Не переносим элементы, они остаются в одну строку */ | ||
align-items: center; | align-items: center; | ||
gap: 10px; | gap: 10px; | ||
| Строка 101: | Строка 103: | ||
min-width: 0; | min-width: 0; | ||
max-width: 100%; | max-width: 100%; | ||
box-sizing: border-box; | |||
overflow-x: auto; /* Позволяет прокручивать содержимое по горизонтали, если оно не помещается */ | |||
-webkit-overflow-scrolling: touch; /* Улучшает прокрутку на iOS */ | |||
} | } | ||
| Строка 116: | Строка 121: | ||
align-items: center; | align-items: center; | ||
text-align: left; | text-align: left; | ||
flex-shrink: 0; /* Не сжимаем эти блоки, они сохраняют свой размер */ | |||
flex-grow: 0; /* Не позволяем им растягиваться */ | |||
flex-basis: auto; /* Базовый размер определяется содержимым */ | |||
min-width: max-content; /* Ширина будет такой, чтобы вместить все содержимое */ | |||
max-width: none; /* Убираем ограничение max-width */ | |||
flex-direction: column; | flex-direction: column; | ||
box-sizing: border-box; | |||
} | } | ||
| Строка 125: | Строка 133: | ||
.result div { | .result div { | ||
display: flex; | display: flex; | ||
justify-content: flex-start; | justify-content: flex-start; | ||
align-items: center; | align-items: center; | ||
padding: 2px 0; | padding: 2px 0; | ||
| Строка 131: | Строка 139: | ||
width: 100%; | width: 100%; | ||
box-sizing: border-box; | box-sizing: border-box; | ||
word-break: break-word; /* перенос слов внутри самого DIV */ | |||
} | } | ||
.mat-name { | .mat-name { | ||
font-weight: bold; | font-weight: bold; | ||
flex-grow: 1; | flex-grow: 1; | ||
overflow: | overflow: visible; | ||
text-overflow: | text-overflow: unset; | ||
white-space: | white-space: normal; | ||
word-break: break-word; | |||
min-width: 0; | |||
} | } | ||
| Строка 144: | Строка 155: | ||
color: var(--subtext-color); | color: var(--subtext-color); | ||
font-size: 0.95em; | font-size: 0.95em; | ||
width: | width: 50px; | ||
text-align: right; | text-align: right; | ||
flex-shrink: 0; | flex-shrink: 0; | ||
margin-left: 12px; | margin-left: 12px; | ||
box-sizing: border-box; | box-sizing: border-box; | ||
| Строка 152: | Строка 163: | ||
.action { | .action { | ||
flex: 0 0 auto; | flex: 0 0 auto; /* Убираем фиксированную ширину, позволяя ей быть авто */ | ||
padding: 0; | padding: 0; | ||
display: flex; | display: flex; | ||
| Строка 165: | Строка 176: | ||
} | } | ||
.action span | /* Правило для .action span возвращено в начале файла */ | ||
.section { | .section { | ||
| Строка 186: | Строка 195: | ||
@media (max-width: 1200px) { | @media (max-width: 1200px) { | ||
.infoblock { | .infoblock { | ||
flex-basis: calc((100% - 2 * var(--gap)) / 3); | |||
} | } | ||
} | } | ||
| Строка 192: | Строка 201: | ||
@media (max-width: 960px) { | @media (max-width: 960px) { | ||
.infoblock { | .infoblock { | ||
flex-basis: calc((100% - var(--gap)) / 2); | |||
} | } | ||
} | } | ||
| Строка 198: | Строка 207: | ||
@media (max-width: 600px) { | @media (max-width: 600px) { | ||
.infoblock { | .infoblock { | ||
flex-basis: 100%; | |||
margin: 10px 0; | |||
} | } | ||
Версия от 05:06, 9 июля 2025
:root {
--width-layout: 100vw;
--card-padding: 12px;
--gap: 14px;
--primary-bg: #1a1a1a;
--secondary-bg: #2a2a2a;
--text-color: #e0e0e0;
--subtext-color: #b0b0b0;
--border-color: #444444;
--shadow-color: rgba(0, 0, 0, 0.4);
--header-bg: #333333;
--accent-color: #76c7c0;
--recipe-bg: #222222;
}
body {
font-family: sans-serif;
margin: 0;
padding: 0;
color: var(--text-color);
font-size: 14px;
}
/* Возвращаем правило для action span */
.action span {
position: relative;
top: 10px;
margin-left: 0;
}
.chem-container {
display: flex;
flex-wrap: wrap;
gap: var(--gap);
justify-content: flex-start;
max-width: 100%;
overflow-x: hidden;
margin: 0 auto;
padding: 14px;
box-sizing: border-box;
}
.infoblock {
display: flex;
flex-direction: column;
flex-grow: 1;
flex-basis: calc((100% - 3 * var(--gap)) / 4);
margin: 10px 0;
padding: var(--card-padding);
background: var(--primary-bg);
border: 1px solid var(--border-color);
border-radius: 10px;
box-shadow: 0 1px 6px var(--shadow-color);
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
color: var(--text-color);
transition: box-shadow 0.3s ease, background-color 0.3s ease;
box-sizing: border-box;
min-width: 250px;
max-width: 100%;
}
.infoblock:hover {
box-shadow: 0 4px 12px var(--shadow-color);
}
.header {
display: flex;
align-items: center;
gap: 6px;
margin-bottom: 10px;
padding: 4px 10px;
font-size: 1.1em;
font-weight: 700;
background: var(--header-bg);
border-radius: 6px;
color: var(--accent-color);
user-select: none;
}
.title {
font-weight: bold;
user-select: none;
}
.content {
flex-grow: 1;
display: flex;
flex-direction: column;
gap: 10px;
margin-bottom: 16px;
}
.recipe-block {
display: flex;
flex-wrap: nowrap; /* Не переносим элементы, они остаются в одну строку */
align-items: center;
gap: 10px;
margin-bottom: 10px;
padding: 10px;
background-color: var(--recipe-bg);
border: 1px solid var(--border-color);
border-radius: 6px;
min-width: 0;
max-width: 100%;
box-sizing: border-box;
overflow-x: auto; /* Позволяет прокручивать содержимое по горизонтали, если оно не помещается */
-webkit-overflow-scrolling: touch; /* Улучшает прокрутку на iOS */
}
.materials,
.result,
.action {
background: var(--secondary-bg);
border-radius: 6px;
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1);
color: var(--text-color);
font-size: 0.9em;
padding: 8px 12px;
display: flex;
justify-content: flex-start;
align-items: center;
text-align: left;
flex-shrink: 0; /* Не сжимаем эти блоки, они сохраняют свой размер */
flex-grow: 0; /* Не позволяем им растягиваться */
flex-basis: auto; /* Базовый размер определяется содержимым */
min-width: max-content; /* Ширина будет такой, чтобы вместить все содержимое */
max-width: none; /* Убираем ограничение max-width */
flex-direction: column;
box-sizing: border-box;
}
.materials div,
.result div {
display: flex;
justify-content: flex-start;
align-items: center;
padding: 2px 0;
line-height: 1.3;
width: 100%;
box-sizing: border-box;
word-break: break-word; /* перенос слов внутри самого DIV */
}
.mat-name {
font-weight: bold;
flex-grow: 1;
overflow: visible;
text-overflow: unset;
white-space: normal;
word-break: break-word;
min-width: 0;
}
.mat-qty {
color: var(--subtext-color);
font-size: 0.95em;
width: 50px;
text-align: right;
flex-shrink: 0;
margin-left: 12px;
box-sizing: border-box;
}
.action {
flex: 0 0 auto; /* Убираем фиксированную ширину, позволяя ей быть авто */
padding: 0;
display: flex;
justify-content: center;
align-items: center;
font-weight: 100;
color: var(--subtext-color);
user-select: none;
cursor: default;
line-height: 1;
margin-top: 4px;
}
/* Правило для .action span возвращено в начале файла */
.section {
background: var(--secondary-bg);
padding: 8px 10px;
border-radius: 6px;
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1);
color: var(--text-color);
font-size: 0.85em;
margin-top: 16px;
}
.section-title {
font-weight: bold;
margin-bottom: 4px;
}
@media (max-width: 1200px) {
.infoblock {
flex-basis: calc((100% - 2 * var(--gap)) / 3);
}
}
@media (max-width: 960px) {
.infoblock {
flex-basis: calc((100% - var(--gap)) / 2);
}
}
@media (max-width: 600px) {
.infoblock {
flex-basis: 100%;
margin: 10px 0;
}