Dantes (обсуждение | вклад) Нет описания правки |
Dantes (обсуждение | вклад) Нет описания правки |
||
| Строка 1: | Строка 1: | ||
$(function () { | $(function () { | ||
$('.chem-recipe').each(function () { | $('.chem-recipe').each(function () { | ||
var | var recipeBox = $(this); | ||
var | var name = recipeBox.find('.chem-name').text(); | ||
var recipe = recipeBox.find('.chem-recipe-body').html(); | |||
var effects = recipeBox.find('.chem-effects').html(); | |||
var description = recipeBox.find('.chem-description').html(); | |||
var html = '<div style="border:1px solid #aaa; border-radius:8px; padding:10px; margin:10px 0; background:#f9f9f9;">'; | |||
html += '<div style="font-weight:bold; font-size:1.2em; margin-bottom:6px;">' + name + '</div>'; | |||
if (recipe) { | if (recipe) { | ||
html += '<div style="margin-bottom:5px;"><b>Рецепт:</b><br>' + recipe + '</div>'; | |||
} | } | ||
if (effects) { | if (effects) { | ||
html += '<div style="margin-bottom:5px;"><b>Эффекты:</b><br>' + effects + '</div>'; | |||
} | } | ||
if (description) { | if (description) { | ||
html += '<div style="color:#555;"><em>' + description + '</em></div>'; | |||
} | } | ||
html += '</div>'; | |||
recipeBox.replaceWith(html); | |||
}); | }); | ||
}); | }); | ||
Версия от 13:55, 19 апреля 2025
$(function () {
$('.chem-recipe').each(function () {
var recipeBox = $(this);
var name = recipeBox.find('.chem-name').text();
var recipe = recipeBox.find('.chem-recipe-body').html();
var effects = recipeBox.find('.chem-effects').html();
var description = recipeBox.find('.chem-description').html();
var html = '<div style="border:1px solid #aaa; border-radius:8px; padding:10px; margin:10px 0; background:#f9f9f9;">';
html += '<div style="font-weight:bold; font-size:1.2em; margin-bottom:6px;">' + name + '</div>';
if (recipe) {
html += '<div style="margin-bottom:5px;"><b>Рецепт:</b><br>' + recipe + '</div>';
}
if (effects) {
html += '<div style="margin-bottom:5px;"><b>Эффекты:</b><br>' + effects + '</div>';
}
if (description) {
html += '<div style="color:#555;"><em>' + description + '</em></div>';
}
html += '</div>';
recipeBox.replaceWith(html);
});
});