Шаблон:Recipe: различия между версиями

Материал из МК14 | Space Station 14 Wiki
Нет описания правки
Нет описания правки
 
(не показано 14 промежуточных версий этого же участника)
Строка 1: Строка 1:
<includeonly>
<includeonly>
<div style="
<div style="
display:flex;
    display:inline-flex;
flex-direction:column;
    vertical-align:top;
width:100%;
    flex-direction:column;
max-width:760px;
    background:#171B22;
margin:12px auto;
    border:1px solid #FFFFFF;
background:#171b22;
    box-sizing:border-box;
border:1px solid #8995a8;
    overflow:hidden;
border-radius:6px;
    color:#FFFFFF;
box-shadow:0 2px 8px rgba(0,0,0,0.45);
    font-family:Arial,sans-serif;
overflow:hidden;
    margin:4px;
color:#e8edf5;
    width:auto;
font-family:Arial,sans-serif;
    max-width:350px;
box-sizing:border-box;
">
">


<!-- НАЗВАНИЕ -->
<!-- НАЗВАНИЕ -->
<div style="
<div style="
background:#202632;
    min-height:28px;
border-bottom:1px solid #7d899c;
    background:#202632;
padding:10px 14px;
    display:flex;
text-align:center;
    align-items:center;
box-sizing:border-box;
    justify-content:center;
    padding:3px 10px;
    box-sizing:border-box;
    border-bottom:1px solid #FFFFFF;
">
">
    <div style="
        font-size:14px;
        font-weight:bold;
        color:#FFFFFF;
        text-align:center;
        line-height:18px;
    ">{{{title|Рецепт}}}
    </div>
</div>


<!-- ОСНОВНАЯ ЧАСТЬ -->
<div style="
<div style="
font-size:20px;
    display:inline-flex;
font-weight:bold;
    align-items:center;
color:#e8edf5;
    justify-content:center;
line-height:24px;
    gap:15px;
    padding:12px;
    box-sizing:border-box;
    flex-wrap:nowrap;
">
">
{{{title|Рецепт}}}
</div>
</div>


<!-- ИНГРЕДИЕНТЫ -->
<!-- ИНГРЕДИЕНТЫ -->
<div style="
<div style="
padding:14px;
    display:flex;
box-sizing:border-box;
    align-items:flex-start;
">
    justify-content:center;
 
    gap:8px;
<div style="
    flex-wrap:wrap;
font-size:15px;
    min-width:0;
font-weight:bold;
    max-width:200px;
color:#b8c7dc;
margin-bottom:10px;
padding-bottom:6px;
border-bottom:1px solid #414b5b;
">
Ингредиенты
</div>
 
 
<!-- СЕТКА -->
<div style="
display:grid;
grid-template-columns:repeat(auto-fit,minmax(105px,1fr));
gap:8px;
width:100%;
box-sizing:border-box;
">
">


<!-- ИНГРЕДИЕНТ 1 -->
<!-- ИНГРЕДИЕНТ 1 -->
{{#if:{{{ingredient1_name|}}}|
{{#if:{{{ingredient1_name|}}}|
<div style="
<div style="
background:#202632;
    display:flex;
border:1px solid #5f6b7d;
    flex-direction:column;
border-radius:4px;
    align-items:center;
padding:8px 6px;
    width:70px;
box-sizing:border-box;
text-align:center;
">
">
 
    <div style="
<div style="
        width:58px;
width:64px;
        height:58px;
height:64px;
        display:flex;
margin:0 auto;
        align-items:center;
background:#151a21;
        justify-content:center;
border:1px solid #667386;
        overflow:hidden;
border-radius:4px;
    ">[[File:{{{ingredient1_img}}}|46px]]
display:flex;
    </div>
align-items:center;
    <div style="
justify-content:center;
        font-size:12px;
overflow:hidden;
        color:#FFFFFF;
box-sizing:border-box;
        text-align:center;
">
        margin-top:5px;
[[File:{{{ingredient1_img}}}|48px]]
        line-height:16px;
</div>
    ">{{{ingredient1_name}}}{{#if:{{{ingredient1_amount|}}}|&nbsp;[{{{ingredient1_amount}}}]|}}
 
    </div>
<div style="
font-size:13px;
color:#e2e7ef;
line-height:17px;
margin-top:7px;
word-break:break-word;
">
{{{ingredient1_name}}}
{{#if:{{{ingredient1_amount|}}}|<br><span style="color:#9eabc0;">× {{{ingredient1_amount}}}</span>|}}
</div>
 
</div>
</div>
|}}
|}}


<!-- ИНГРЕДИЕНТ 2 -->
<!-- ИНГРЕДИЕНТ 2 -->
{{#if:{{{ingredient2_name|}}}|
{{#if:{{{ingredient2_name|}}}|
<div style="
<div style="
background:#202632;
    display:flex;
border:1px solid #5f6b7d;
    flex-direction:column;
border-radius:4px;
    align-items:center;
padding:8px 6px;
    width:70px;
box-sizing:border-box;
text-align:center;
">
">
 
    <div style="
<div style="
        width:58px;
width:64px;
        height:58px;
height:64px;
        display:flex;
margin:0 auto;
        align-items:center;
background:#151a21;
        justify-content:center;
border:1px solid #667386;
        overflow:hidden;
border-radius:4px;
    ">[[File:{{{ingredient2_img}}}|46px]]
display:flex;
    </div>
align-items:center;
    <div style="
justify-content:center;
        font-size:12px;
overflow:hidden;
        color:#FFFFFF;
box-sizing:border-box;
        text-align:center;
">
        margin-top:5px;
[[File:{{{ingredient2_img}}}|48px]]
        line-height:16px;
</div>
    ">{{{ingredient2_name}}}{{#if:{{{ingredient2_amount|}}}|&nbsp;[{{{ingredient2_amount}}}]|}}
 
    </div>
<div style="
font-size:13px;
color:#e2e7ef;
line-height:17px;
margin-top:7px;
word-break:break-word;
">
{{{ingredient2_name}}}
{{#if:{{{ingredient2_amount|}}}|<br><span style="color:#9eabc0;">× {{{ingredient2_amount}}}</span>|}}
</div>
 
</div>
</div>
|}}
|}}


<!-- ИНГРЕДИЕНТ 3 -->
<!-- ИНГРЕДИЕНТ 3 -->
{{#if:{{{ingredient3_name|}}}|
{{#if:{{{ingredient3_name|}}}|
<div style="
<div style="
background:#202632;
    display:flex;
border:1px solid #5f6b7d;
    flex-direction:column;
border-radius:4px;
    align-items:center;
padding:8px 6px;
    width:70px;
box-sizing:border-box;
text-align:center;
">
 
<div style="
width:64px;
height:64px;
margin:0 auto;
background:#151a21;
border:1px solid #667386;
border-radius:4px;
display:flex;
align-items:center;
justify-content:center;
overflow:hidden;
box-sizing:border-box;
">
">
[[File:{{{ingredient3_img}}}|48px]]
    <div style="
</div>
        width:58px;
 
        height:58px;
<div style="
        display:flex;
font-size:13px;
        align-items:center;
color:#e2e7ef;
        justify-content:center;
line-height:17px;
        overflow:hidden;
margin-top:7px;
    ">[[File:{{{ingredient3_img}}}|46px]]
word-break:break-word;
    </div>
">
    <div style="
{{{ingredient3_name}}}
        font-size:12px;
{{#if:{{{ingredient3_amount|}}}|<br><span style="color:#9eabc0;">× {{{ingredient3_amount}}}</span>|}}
        color:#FFFFFF;
</div>
        text-align:center;
 
        margin-top:5px;
        line-height:16px;
    ">{{{ingredient3_name}}}{{#if:{{{ingredient3_amount|}}}|&nbsp;[{{{ingredient3_amount}}}]|}}
    </div>
</div>
</div>
|}}
|}}


<!-- ИНГРЕДИЕНТ 4 -->
<!-- ИНГРЕДИЕНТ 4 -->
{{#if:{{{ingredient4_name|}}}|
{{#if:{{{ingredient4_name|}}}|
<div style="
<div style="
background:#202632;
    display:flex;
border:1px solid #5f6b7d;
    flex-direction:column;
border-radius:4px;
    align-items:center;
padding:8px 6px;
    width:70px;
box-sizing:border-box;
text-align:center;
">
 
<div style="
width:64px;
height:64px;
margin:0 auto;
background:#151a21;
border:1px solid #667386;
border-radius:4px;
display:flex;
align-items:center;
justify-content:center;
overflow:hidden;
box-sizing:border-box;
">
[[File:{{{ingredient4_img}}}|48px]]
</div>
 
<div style="
font-size:13px;
color:#e2e7ef;
line-height:17px;
margin-top:7px;
word-break:break-word;
">
">
{{{ingredient4_name}}}
    <div style="
{{#if:{{{ingredient4_amount|}}}|<br><span style="color:#9eabc0;">× {{{ingredient4_amount}}}</span>|}}
        width:58px;
</div>
        height:58px;
 
        display:flex;
        align-items:center;
        justify-content:center;
        overflow:hidden;
    ">[[File:{{{ingredient4_img}}}|46px]]
    </div>
    <div style="
        font-size:12px;
        color:#FFFFFF;
        text-align:center;
        margin-top:5px;
        line-height:16px;
    ">{{{ingredient4_name}}}{{#if:{{{ingredient4_amount|}}}|&nbsp;[{{{ingredient4_amount}}}]|}}
    </div>
</div>
</div>
|}}
|}}


<!-- ИНГРЕДИЕНТ 5 -->
<!-- ИНГРЕДИЕНТ 5 -->
{{#if:{{{ingredient5_name|}}}|
{{#if:{{{ingredient5_name|}}}|
<div style="
<div style="
background:#202632;
    display:flex;
border:1px solid #5f6b7d;
    flex-direction:column;
border-radius:4px;
    align-items:center;
padding:8px 6px;
    width:70px;
box-sizing:border-box;
text-align:center;
">
">
 
    <div style="
<div style="
        width:58px;
width:64px;
        height:58px;
height:64px;
        display:flex;
margin:0 auto;
        align-items:center;
background:#151a21;
        justify-content:center;
border:1px solid #667386;
        overflow:hidden;
border-radius:4px;
    ">[[File:{{{ingredient5_img}}}|46px]]
display:flex;
    </div>
align-items:center;
    <div style="
justify-content:center;
        font-size:12px;
overflow:hidden;
        color:#FFFFFF;
box-sizing:border-box;
        text-align:center;
">
        margin-top:5px;
[[File:{{{ingredient5_img}}}|48px]]
        line-height:16px;
</div>
    ">{{{ingredient5_name}}}{{#if:{{{ingredient5_amount|}}}|&nbsp;[{{{ingredient5_amount}}}]|}}
 
    </div>
<div style="
font-size:13px;
color:#e2e7ef;
line-height:17px;
margin-top:7px;
word-break:break-word;
">
{{{ingredient5_name}}}
{{#if:{{{ingredient5_amount|}}}|<br><span style="color:#9eabc0;">× {{{ingredient5_amount}}}</span>|}}
</div>
 
</div>
</div>
|}}
|}}


<!-- ИНГРЕДИЕНТ 6 -->
{{#if:{{{ingredient6_name|}}}|
<div style="
background:#202632;
border:1px solid #5f6b7d;
border-radius:4px;
padding:8px 6px;
box-sizing:border-box;
text-align:center;
">
<div style="
width:64px;
height:64px;
margin:0 auto;
background:#151a21;
border:1px solid #667386;
border-radius:4px;
display:flex;
align-items:center;
justify-content:center;
overflow:hidden;
box-sizing:border-box;
">
[[File:{{{ingredient6_img}}}|48px]]
</div>
</div>


<!-- СПОСОБ ПРИГОТОВЛЕНИЯ -->
<div style="
<div style="
font-size:13px;
    display:flex;
color:#e2e7ef;
    flex-direction:column;
line-height:17px;
    align-items:center;
margin-top:7px;
    justify-content:center;
word-break:break-word;
    flex-shrink:0;
    min-width:70px;
    border-left:1px solid #FFFFFF;
    padding-left:10px;
">
">
{{{ingredient6_name}}}
{{#if:{{{ingredient6_amount|}}}|<br><span style="color:#9eabc0;">× {{{ingredient6_amount}}}</span>|}}
</div>
</div>
|}}


 
<!-- АВТОМАТИЧЕСКАЯ КАРТИНКА МЕТОДА (с fallback) -->
<!-- ИНГРЕДИЕНТ 7 -->
{{#if:{{{ingredient7_name|}}}|
<div style="
<div style="
background:#202632;
    width:60px;
border:1px solid #5f6b7d;
    height:60px;
border-radius:4px;
    display:flex;
padding:8px 6px;
    align-items:center;
box-sizing:border-box;
    justify-content:center;
text-align:center;
    overflow:hidden;
">
">{{#switch:{{{method_name|}}}
 
|Микроволновка={{#ifexist:File:Microwave.gif|[[File:Microwave.gif|60px]]|[[File:Microwave.png|60px]]}}
<div style="
|Смешивание={{#ifexist:File:Beaker.png|[[File:Beaker.png|60px]]|[[File:Beaker.gif|60px]]}}
width:64px;
|Нож={{#ifexist:File:Knife.png|[[File:Knife.png|60px]]|[[File:Knife.gif|60px]]}}
height:64px;
|Скалка={{#ifexist:File:RollingPin.png|[[File:RollingPin.png|60px]]|[[File:RollingPin.gif|60px]]}}
margin:0 auto;
|#default=[[File:Microwave.gif|60px]]
background:#151a21;
}}
border:1px solid #667386;
border-radius:4px;
display:flex;
align-items:center;
justify-content:center;
overflow:hidden;
box-sizing:border-box;
">
[[File:{{{ingredient7_img}}}|48px]]
</div>
 
<div style="
font-size:13px;
color:#e2e7ef;
line-height:17px;
margin-top:7px;
word-break:break-word;
">
{{{ingredient7_name}}}
{{#if:{{{ingredient7_amount|}}}|<br><span style="color:#9eabc0;">× {{{ingredient7_amount}}}</span>|}}
</div>
 
</div>
|}}
 
 
<!-- ИНГРЕДИЕНТ 8 -->
{{#if:{{{ingredient8_name|}}}|
<div style="
background:#202632;
border:1px solid #5f6b7d;
border-radius:4px;
padding:8px 6px;
box-sizing:border-box;
text-align:center;
">
 
<div style="
width:64px;
height:64px;
margin:0 auto;
background:#151a21;
border:1px solid #667386;
border-radius:4px;
display:flex;
align-items:center;
justify-content:center;
overflow:hidden;
box-sizing:border-box;
">
[[File:{{{ingredient8_img}}}|48px]]
</div>
 
<div style="
font-size:13px;
color:#e2e7ef;
line-height:17px;
margin-top:7px;
word-break:break-word;
">
{{{ingredient8_name}}}
{{#if:{{{ingredient8_amount|}}}|<br><span style="color:#9eabc0;">× {{{ingredient8_amount}}}</span>|}}
</div>
 
</div>
|}}
 
 
<!-- ИНГРЕДИЕНТ 9 -->
{{#if:{{{ingredient9_name|}}}|
<div style="
background:#202632;
border:1px solid #5f6b7d;
border-radius:4px;
padding:8px 6px;
box-sizing:border-box;
text-align:center;
">
 
<div style="
width:64px;
height:64px;
margin:0 auto;
background:#151a21;
border:1px solid #667386;
border-radius:4px;
display:flex;
align-items:center;
justify-content:center;
overflow:hidden;
box-sizing:border-box;
">
[[File:{{{ingredient9_img}}}|48px]]
</div>
</div>


<div style="
<div style="
font-size:13px;
    font-size:13px;
color:#e2e7ef;
    font-weight:bold;
line-height:17px;
    line-height:17px;
margin-top:7px;
    text-align:center;
word-break:break-word;
    color:#FFFFFF;
">
    margin-top:4px;
{{{ingredient9_name}}}
">{{{method_name|Приготовление}}}{{#if:{{{method_time|}}}|<br>{{{method_time}}}|}}
{{#if:{{{ingredient9_amount|}}}|<br><span style="color:#9eabc0;">× {{{ingredient9_amount}}}</span>|}}
</div>
</div>


</div>
</div>
|}}
<!-- ИНГРЕДИЕНТ 10 -->
{{#if:{{{ingredient10_name|}}}|
<div style="
background:#202632;
border:1px solid #5f6b7d;
border-radius:4px;
padding:8px 6px;
box-sizing:border-box;
text-align:center;
">
<div style="
width:64px;
height:64px;
margin:0 auto;
background:#151a21;
border:1px solid #667386;
border-radius:4px;
display:flex;
align-items:center;
justify-content:center;
overflow:hidden;
box-sizing:border-box;
">
[[File:{{{ingredient10_img}}}|48px]]
</div>
<div style="
font-size:13px;
color:#e2e7ef;
line-height:17px;
margin-top:7px;
word-break:break-word;
">
{{{ingredient10_name}}}
{{#if:{{{ingredient10_amount|}}}|<br><span style="color:#9eabc0;">× {{{ingredient10_amount}}}</span>|}}
</div>
</div>
|}}
<!-- ИНГРЕДИЕНТ 11 -->
{{#if:{{{ingredient11_name|}}}|
<div style="
background:#202632;
border:1px solid #5f6b7d;
border-radius:4px;
padding:8px 6px;
box-sizing:border-box;
text-align:center;
">
<div style="
width:64px;
height:64px;
margin:0 auto;
background:#151a21;
border:1px solid #667386;
border-radius:4px;
display:flex;
align-items:center;
justify-content:center;
overflow:hidden;
box-sizing:border-box;
">
[[File:{{{ingredient11_img}}}|48px]]
</div>
<div style="
font-size:13px;
color:#e2e7ef;
line-height:17px;
margin-top:7px;
word-break:break-word;
">
{{{ingredient11_name}}}
{{#if:{{{ingredient11_amount|}}}|<br><span style="color:#9eabc0;">× {{{ingredient11_amount}}}</span>|}}
</div>
</div>
|}}
<!-- ИНГРЕДИЕНТ 12 -->
{{#if:{{{ingredient12_name|}}}|
<div style="
background:#202632;
border:1px solid #5f6b7d;
border-radius:4px;
padding:8px 6px;
box-sizing:border-box;
text-align:center;
">
<div style="
width:64px;
height:64px;
margin:0 auto;
background:#151a21;
border:1px solid #667386;
border-radius:4px;
display:flex;
align-items:center;
justify-content:center;
overflow:hidden;
box-sizing:border-box;
">
[[File:{{{ingredient12_img}}}|48px]]
</div>
<div style="
font-size:13px;
color:#e2e7ef;
line-height:17px;
margin-top:7px;
word-break:break-word;
">
{{{ingredient12_name}}}
{{#if:{{{ingredient12_amount|}}}|<br><span style="color:#9eabc0;">× {{{ingredient12_amount}}}</span>|}}
</div>
</div>
|}}
</div>
</div>
<!-- СПОСОБ + РЕЗУЛЬТАТ -->
<div style="
border-top:1px solid #414b5b;
background:#1d222b;
padding:12px 14px;
box-sizing:border-box;
">
<div style="
display:flex;
align-items:center;
justify-content:center;
gap:18px;
flex-wrap:wrap;
">
<!-- СПОСОБ -->
<div style="
display:flex;
align-items:center;
gap:10px;
min-width:170px;
">
<div style="
width:58px;
height:58px;
background:#151a21;
border:1px solid #667386;
border-radius:4px;
display:flex;
align-items:center;
justify-content:center;
overflow:hidden;
flex-shrink:0;
">
[[File:{{{method_img|Microwave.gif}}}|48px]]
</div>
<div style="text-align:left;">
<div style="
font-size:12px;
color:#8f9bae;
line-height:16px;
">
Способ приготовления
</div>
<div style="
font-size:15px;
font-weight:bold;
color:#e8edf5;
line-height:19px;
">
{{{method_name|Приготовление}}}
</div>
{{#if:{{{method_time|}}}|
<div style="
font-size:13px;
color:#aeb9ca;
line-height:17px;
margin-top:2px;
">
{{{method_time}}}
</div>
|}}
</div>
</div>
<!-- РАЗДЕЛИТЕЛЬ -->
<div style="
font-size:22px;
color:#68758a;
">
</div>


<!-- РЕЗУЛЬТАТ -->
<!-- РЕЗУЛЬТАТ -->
<div style="
<div style="
display:flex;
    display:flex;
align-items:center;
    align-items:flex-start;
gap:10px;
    justify-content:center;
min-width:170px;
    border-left:1px solid #FFFFFF;
">
    padding-left:10px;
 
<div style="
width:58px;
height:58px;
background:#151a21;
border:1px solid #667386;
border-radius:4px;
display:flex;
align-items:center;
justify-content:center;
overflow:hidden;
flex-shrink:0;
">
">
[[File:{{{result_img}}}|48px]]
    <div style="
</div>
        display:flex;
 
        flex-direction:column;
<div style="text-align:left;">
        align-items:center;
 
        width:75px;
<div style="
    ">
font-size:12px;
        <div style="
color:#8f9bae;
            width:58px;
line-height:16px;
            height:58px;
">
            display:flex;
Результат
            align-items:center;
</div>
            justify-content:center;
 
            overflow:hidden;
<div style="
        ">[[File:{{{result_img}}}|46px]]
font-size:15px;
        </div>
font-weight:bold;
color:#e8edf5;
line-height:19px;
">
{{{result_name|Результат}}}
</div>


        <div style="
            font-size:12px;
            color:#FFFFFF;
            text-align:center;
            margin-top:5px;
            line-height:16px;
        ">{{{result_name|Результат}}}
        </div>
    </div>
</div>
</div>
</div>


</div>
</div>
</div>
</div>
</div>
</includeonly>
</includeonly>
<noinclude>
__NOTOC__
== Recipe — шаблон рецепта ==
Шаблон для отображения рецептов в стиле интерфейса вики.
Ингредиенты автоматически размещаются в адаптивной сетке. В зависимости от доступной ширины помещается примерно 2–3 карточки в ряд.
=== Параметры ===
{| class="wikitable"
! Параметр !! Описание !! Обязательный
|-
| <code>title</code> || Название рецепта || Да
|-
| <code>ingredient1_name</code> ... <code>ingredient12_name</code> || Названия ингредиентов || Да для используемых ингредиентов
|-
| <code>ingredient1_img</code> ... <code>ingredient12_img</code> || Изображения ингредиентов || Да для используемых ингредиентов
|-
| <code>ingredient1_amount</code> ... <code>ingredient12_amount</code> || Количество ингредиентов || Нет
|-
| <code>method_name</code> || Способ приготовления || Да
|-
| <code>method_img</code> || Изображение способа приготовления || Нет
|-
| <code>method_time</code> || Время приготовления || Нет
|-
| <code>result_name</code> || Название результата || Да
|-
| <code>result_img</code> || Изображение результата || Да
|}
=== Способ приготовления ===
Если <code>method_img</code> не указан, используется:
<code>Microwave.gif</code>
Пример:
<pre>
|method_name=Микроволновка
|method_time=10 сек.
</pre>
Другой способ:
<pre>
|method_name=Нож
|method_img=Knife.png
</pre>
=== Пример ===
<pre>
{{Recipe
|title=Пельмени
|ingredient1_name=Тесто
|ingredient1_img=FoodDough.png
|ingredient1_amount=2
|ingredient2_name=Мясо
|ingredient2_img=FoodMeat.png
|ingredient2_amount=2
|ingredient3_name=Лук
|ingredient3_img=FoodOnion.png
|ingredient3_amount=1
|ingredient4_name=Соль
|ingredient4_img=FoodSalt.png
|ingredient4_amount=1
|ingredient5_name=Перец
|ingredient5_img=FoodPepper.png
|ingredient5_amount=1
|ingredient6_name=Вода
|ingredient6_img=FoodWater.png
|ingredient6_amount=1
|method_name=Микроволновка
|method_img=Microwave.gif
|method_time=10 сек.
|result_name=Пельмени
|result_img=FoodDumplings.png
}}
</pre>
[[Категория:Шаблоны]]
</noinclude>

Текущая версия от 02:46, 14 августа 2026