[hideprofile][html]<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Генератор анкеты персонажа</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<style>
:root{
--gold:#b8860b;
--dark:#111111;
--dark2:#1e1e1e;
--dark3:#2e2e2e;
--light:#ececec;
}
*{box-sizing:border-box;}
body{
margin:0; padding:24px 12px;
background:#0d0d0d;
font-family:'Segoe UI','Helvetica Neue',Arial,sans-serif;
color:var(--light);
}
.builder{
max-width:920px; margin:0 auto;
background:var(--light);
color:var(--dark);
border:2px solid var(--dark);
}
.builder-head{
background:var(--dark2);
color:var(--light);
padding:14px 20px;
border-bottom:5px solid var(--gold);
font-weight:bold;
letter-spacing:.5px;
font-size:15px;
text-align: center;
}
.builder-head i{color:var(--gold); margin-right:8px;}
.builder-tabs{
display:flex; flex-wrap:wrap; gap:1px;
background:var(--dark2);
border-bottom:5px solid var(--gold);
}
.builder-tab{
background:var(--dark3);
border:none;
padding:10px 22px;
font-size:14px;
font-weight:bold;
color:var(--light);
cursor:pointer;
transition:all .25s ease;
font-family:inherit;
}
.builder-tab i{margin-right:8px;}
.builder-tab:hover{background:#1e4a76; color:#ffffff;}
.builder-tab.active{background:var(--dark); color:var(--gold);}
.builder-panel{display:none; padding:18px 20px;}
.builder-panel.active{display:block; animation:fadeSlide .3s ease-out;}
@keyframes fadeSlide{from{opacity:0;transform:translateY(6px);}to{opacity:1;transform:translateY(0);}}
.field{margin-bottom:14px;}
.field > label{
display:block;
font-weight:bold;
font-size:13px;
color:#2e2e2e;
margin-bottom:5px;
}
.field > label .hint{
font-weight:normal;
font-style:italic;
color:#666666;
font-size:11px;
}
.field input[type="text"],
.field textarea{
width:100%;
padding:8px 10px;
border:1px solid #b0b0b0;
background:#ffffff;
font-family:inherit;
font-size:13px;
color:var(--dark);
border-radius:0;
}
.field textarea{resize:vertical; line-height:1.45;}
.field input:focus, .field textarea:focus{
outline:none;
border-color:var(--gold);
box-shadow:0 0 0 2px rgba(184,134,11,.25);
}
.grid2{display:grid; grid-template-columns:1fr 1fr; gap:0 14px;}
.grid3{display:grid; grid-template-columns:repeat(3,1fr); gap:0 14px;}
@media(max-width:640px){
.grid2,.grid3{grid-template-columns:1fr;}
.builder-tab{padding:8px 12px;font-size:12px;}
}
.builder-actions{
padding:18px 20px 24px;
border-top:5px solid var(--gold);
background:#e2e2e2;
}
.btn{
display:inline-block;
border:none;
padding:11px 26px;
font-size:14px;
font-weight:bold;
font-family:inherit;
cursor:pointer;
transition:all .2s ease;
margin-right:10px;
margin-bottom:10px;
}
.btn-primary{background:var(--dark); color:var(--gold); border:2px solid var(--dark);}
.btn-primary:hover{background:#000000; color:#e0b94a;}
.btn-gold{background:var(--gold); color:var(--dark); border:2px solid var(--gold);}
.btn-gold:hover{background:#d9a218;}
.code-hint{
margin:8px 0 4px 0;
font-size:12px;
color:#2e2e2e;
font-style:italic;
line-height:1.5;
}
.code-hint code{
background:#111111;
color:#e0b94a;
padding:1px 7px;
font-family:'Consolas','Monaco',monospace;
font-size:12px;
font-style:normal;
border-radius:2px;
}
#code{
width:100%;
min-height:240px;
margin-top:6px;
padding:12px;
border:2px solid var(--dark);
background:#111111;
color:#c9d1a3;
font-family:'Consolas','Monaco',monospace;
font-size:12px;
line-height:1.5;
resize:vertical;
white-space:pre;
overflow:auto;
}
</style>
</head>
<body>
<div class="builder">
<div class="builder-head">
<i class="fa-solid fa-scroll"></i> Генератор анкеты персонажа
</div>
<div class="builder-tabs">
<button class="builder-tab active" data-tab="b-general"><i class="fa-solid fa-bars"></i> Общее</button>
<button class="builder-tab" data-tab="b-appearance"><i class="fa-solid fa-bars"></i> Внешность</button>
<button class="builder-tab" data-tab="b-personality"><i class="fa-solid fa-bars"></i> Характер</button>
<button class="builder-tab" data-tab="b-bio"><i class="fa-solid fa-bars"></i> Биография</button>
<button class="builder-tab" data-tab="b-dop"><i class="fa-solid fa-bars"></i> Дополнительно</button>
</div>
<!-- ================= ОБЩЕЕ ================= -->
<div class="builder-panel active" data-panel="b-general">
<div class="field">
<label>Ссылка на изображение <span class="hint">(портрет)</span></label>
<input type="text" id="pic" placeholder="https://...">
</div>
<div class="field">
<label>Цитата / девиз <span class="hint">(если заполнить, отобразится перед общей информацией)</span></label>
<input type="text" id="quote" placeholder="Вера в сверхъестественный источник зла не нужна…">
</div>
<div class="grid2">
<div class="field"><label>Имя <span class="hint">(Русский / Транслитерация)</span></label><input type="text" id="imya"></div>
<div class="field"><label>Прозвища <span class="hint">(если заполнить, отобразится)</span></label><input type="text" id="prozvishche"></div>
<div class="field"><label>Возраст, дата</label><input type="text" id="vozrast"></div>
<div class="field"><label>Ранг, уровень</label><input type="text" id="rang"></div>
<div class="field"><label>Скрытая деревня</label><input type="text" id="derevnya"></div>
<div class="field"><label>Прототип внешности <span class="hint">(если заполнить, отобразится)</span></label><input type="text" id="prototip"></div>
</div>
</div>
<!-- ================= ВНЕШНОСТЬ ================= -->
<div class="builder-panel" data-panel="b-appearance">
<div class="grid3">
<div class="field"><label>Рост</label><input type="text" id="rost"></div>
<div class="field"><label>Вес</label><input type="text" id="ves"></div>
<div class="field"><label>Волосы</label><input type="text" id="volosy"></div>
<div class="field"><label>Глаза</label><input type="text" id="glaza"></div>
<div class="field"><label>Группа крови</label><input type="text" id="krov"></div>
<div class="field"><label>Протектор</label><input type="text" id="protektor"></div>
</div>
<div class="field">
<label>Особенности <span class="hint">(шрамы, татуировки, пирсинг, протезы и т.п.)</span></label>
<input type="text" id="osobennosti">
</div>
<div class="field">
<label>Описание внешности <span class="hint">(каждая строка — отдельный абзац)</span></label>
<textarea id="appearance_text" rows="8" spellcheck="true"></textarea>
</div>
</div>
<!-- ================= ХАРАКТЕР ================= -->
<div class="builder-panel" data-panel="b-personality">
<div class="field"><label>Хобби</label><input type="text" id="hobbi"></div>
<div class="field"><label>Любит</label><input type="text" id="lyubit"></div>
<div class="field"><label>Не любит</label><input type="text" id="nelubit"></div>
<div class="field">
<label>Описание характера <span class="hint">(каждая строка — отдельный абзац)</span></label>
<textarea id="personality_text" rows="6" spellcheck="true"></textarea>
</div>
<div class="field">
<label>Страна/деревня <span class="hint">(каждая строка — отдельный абзац)</span></label>
<textarea id="country_text" rows="4" spellcheck="true"></textarea>
</div>
<div class="field">
<label>Ремесло ниндзя <span class="hint">(каждая строка — отдельный абзац)</span></label>
<textarea id="craft_text" rows="4" spellcheck="true"></textarea>
</div>
</div>
<!-- ================= БИОГРАФИЯ ================= -->
<div class="builder-panel" data-panel="b-bio">
<div class="field">
<label>Слот <span class="hint">(например: Учиха Саске или Орочимару)</span></label>
<input type="text" id="slot">
</div>
<div class="field">
<label>Биография <span class="hint">(каждая строка = отдельный абзац; не забудьте про обязательные пункты)</span></label>
<textarea id="bio_text" rows="10" spellcheck="true"></textarea>
</div>
</div>
<!-- ================= ДОПОЛНИТЕЛЬНО ================= -->
<div class="builder-panel" data-panel="b-dop">
<div class="field">
<label>Активность <span class="hint">(каждая строка = отдельный абзац)</span></label>
<textarea id="activity_text" rows="5" spellcheck="true" placeholder="онлайн, частота постов, участие в сюжетах, время ответа…"></textarea>
</div>
<div class="field">
<label>Связь с вами <span class="hint">(каждая строка = отдельный абзац)</span></label>
<textarea id="contact_text" rows="5" spellcheck="true" placeholder="discord, telegram, лс на форуме…"></textarea>
</div>
</div>
<!-- ================= РЕЗУЛЬТАТ ================= -->
<div class="builder-actions">
<button type="button" class="btn btn-primary" onclick="buildProfile()">
<i class="fa-solid fa-wand-magic-sparkles"></i> Сформировать
</button>
<button type="button" class="btn btn-gold" onclick="copyCode()">
<i class="fa-solid fa-copy"></i> Скопировать код
</button>
<p class="code-hint">
Данный код необходимо вставить между тегами <code>[ html ]</code> и <code>[ /html ]</code>.
</p>
<textarea id="code" rows="12" spellcheck="false"></textarea>
</div>
</div>
<script>
/* ---------------- ХЕЛПЕРЫ ---------------- */
function val(id){
var el = document.getElementById(id);
return el ? el.value.trim() : '';
}
function raw(id){
var el = document.getElementById(id);
return el ? el.value : '';
}
function esc(s){
return String(s == null ? '' : s)
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
}
/* строка = абзац */
function paras(text){
var out = [];
String(text || '').split(/\r?\n/).forEach(function(line){
line = line.trim();
if (line) out.push('<p>' + esc(line) + '</p>');
});
return out.join('\n ');
}
/* строка = абзац, опционально {fa-icon} в начале */
function iconParas(text){
var out = [];
String(text || '').split(/\r?\n/).forEach(function(line){
line = line.trim();
if (!line) return;
var m = line.match(/^\{([A-Za-z0-9\-_]+)\}\s*([\s\S]+)$/);
if (m) {
out.push('<p><i class="fa-solid ' + esc(m[1]) + '"></i> ' + esc(m[2]) + '</p>');
} else {
out.push('<p>' + esc(line) + '</p>');
}
});
return out.join('\n ');
}
/* обёртка «h2 + абзацы»; если пусто — вернёт '' */
function section(title, text, useIcons){
var body = useIcons ? iconParas(text) : paras(text);
if (!body) return '';
return '<h2>' + esc(title) + '</h2>\n ' + body;
}
/* ---------------- СБОРКА АНКЕТЫ ---------------- */
function buildProfile(){
var pic = val('pic');
var quote = val('quote');
var imya = val('imya');
var prozvishche = val('prozvishche');
var vozrast = val('vozrast');
var rang = val('rang');
var derevnya = val('derevnya');
var prototip = val('prototip');
var rost = val('rost');
var ves = val('ves');
var volosy = val('volosy');
var glaza = val('glaza');
var krov = val('krov');
var protektor = val('protektor');
var osobennosti = val('osobennosti');
var appearanceText = raw('appearance_text');
var hobbi = val('hobbi');
var lyubit = val('lyubit');
var nelubit = val('nelubit');
var personalityText= raw('personality_text');
var countryText = raw('country_text');
var craftText = raw('craft_text');
var slot = val('slot');
var bioText = raw('bio_text');
var activityText = raw('activity_text');
var contactText = raw('contact_text');
/* --- блок «Общее»: список сведений --- */
var infoArr = [];
function infoRow(label, value){
if (!value) return;
infoArr.push(
'<li><strong><i class="fa fa-check-square" aria-hidden="true"></i> ' +
esc(label) + ':</strong> ' + esc(value) + '</li>'
);
}
infoRow('Имя', imya);
infoRow('Прозвища', prozvishche);
infoRow('Возраст, дата', vozrast);
infoRow('Ранг, уровень', rang);
infoRow('Скрытая деревня', derevnya);
infoRow('Прототип внешности', prototip);
var infoHtml = infoArr.join('\n ');
var quoteHtml = quote ? '<h2>' + esc(quote) + '</h2>' : '';
/* --- бейджи --- */
function makeBadges(pairs){
var arr = [];
pairs.forEach(function(p){
if (p[1]) {
arr.push('<span class="badge"><strong>' + esc(p[0]) + ':</strong> ' + esc(p[1]) + '</span>');
}
});
return arr;
}
function badgesHtml(pairs){
var arr = makeBadges(pairs);
return arr.length
? '<p>\n ' + arr.join('\n ') + '\n </p>'
: '';
}
/* --- блок «Внешность» --- */
var appBadgesHtml = badgesHtml([
['Рост', rost], ['Вес', ves], ['Волосы', volosy],
['Глаза', glaza], ['Кровь', krov], ['Протектор', protektor],
['Особенности', osobennosti]
]);
var appearanceParasHtml = paras(appearanceText);
/* --- блок «Характер» --- */
var persBadgesHtml = badgesHtml([
['Хобби', hobbi], ['Любит', lyubit], ['Не любит', nelubit]
]);
var personalityParasHtml = paras(personalityText);
var countrySectionHtml = section('Страна/деревня', countryText, false);
var craftSectionHtml = section('Ремесло ниндзя', craftText, false);
/* --- блок «Биография» --- */
var slotBadgeHtml = slot
? '<p>\n <span class="badge"><strong>Слот:</strong> ' + esc(slot) + '</span>\n </p>'
: '';
var bioParasHtml = iconParas(bioText);
/* --- блок «Дополнительно» --- */
var activitySectionHtml = section('Активность', activityText, false);
var contactSectionHtml = section('Связь с вами', contactText, false);
var dopInnerHtml = [activitySectionHtml, contactSectionHtml]
.filter(Boolean)
.join('\n ');
if (!dopInnerHtml) dopInnerHtml = '<p>—</p>';
/* --- итоговый код --- */
var out = '<div class="html-inner">\n' +
' <div class="html-content">\n' +
' <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">\n' +
'\n' +
' <div class="character-profile">\n' +
' <div class="tabs">\n' +
' <button class="tab-button active" data-tab="general"><i class="fa-solid fa-bars"></i> Общее</button>\n' +
' <button class="tab-button" data-tab="appearance"><i class="fa-solid fa-bars"></i> Внешность</button>\n' +
' <button class="tab-button" data-tab="personality"><i class="fa-solid fa-bars"></i> Характер</button>\n' +
' <button class="tab-button" data-tab="bio"><i class="fa-solid fa-bars"></i> Биография</button>\n' +
' <button class="tab-button" data-tab="dop"><i class="fa-solid fa-bars"></i> Дополнительно</button>\n' +
' </div>\n' +
'\n' +
' <!-- Вкладка: Общее -->\n' +
' <div class="tab-content active" data-tab-id="general">\n' +
' <div class="two-columns">\n' +
' <div class="portrait">\n' +
' <img src="' + esc(pic) + '" alt="Внешность">\n' +
' </div>\n' +
' <div class="info">\n' +
' ' + quoteHtml + '\n' +
' <ul class="info-list">\n' +
' ' + infoHtml + '\n' +
' </ul>\n' +
' </div>\n' +
' </div>\n' +
' </div>\n' +
'\n' +
' <!-- Вкладка: Внешность -->\n' +
' <div class="tab-content" data-tab-id="appearance">\n' +
' ' + appBadgesHtml + '\n' +
' ' + appearanceParasHtml + '\n' +
' </div>\n' +
'\n' +
' <!-- Вкладка: Характер -->\n' +
' <div class="tab-content" data-tab-id="personality">\n' +
' ' + persBadgesHtml + '\n' +
' ' + personalityParasHtml + '\n' +
' ' + (countrySectionHtml ? '\n ' + countrySectionHtml : '') + '\n' +
' ' + (craftSectionHtml ? '\n ' + craftSectionHtml : '') + '\n' +
' </div>\n' +
'\n' +
' <!-- Вкладка: Биография -->\n' +
' <div class="tab-content" data-tab-id="bio">\n' +
' ' + slotBadgeHtml + '\n' +
' ' + bioParasHtml + '\n' +
' </div>\n' +
'\n' +
' <!-- Вкладка: Дополнительно -->\n' +
' <div class="tab-content" data-tab-id="dop">\n' +
' ' + dopInnerHtml + '\n' +
' </div>\n' +
'\n' +
' </div>\n' +
' </div>\n' +
'</div>\n' +
'\n' +
'<style>\n' +
' .character-profile {\n' +
' background: #ececec;\n' +
' color: #111111;\n' +
" font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;\n" +
' border: 2px solid #111111;\n' +
' box-sizing: border-box;\n' +
' }\n' +
' .character-profile *,\n' +
' .character-profile *::before,\n' +
' .character-profile *::after { box-sizing: border-box; }\n' +
'\n' +
' .character-profile .tabs {\n' +
' display: flex;\n' +
' background: #1e1e1e;\n' +
' border-bottom: 5px solid #b8860b;\n' +
' margin-bottom: 10px;\n' +
' gap: 1px;\n' +
' flex-wrap: wrap;\n' +
' }\n' +
' .character-profile .tab-button {\n' +
' background: #2e2e2e;\n' +
' border: none;\n' +
' padding: 10px 29px;\n' +
' font-size: 14px;\n' +
' font-weight: bold;\n' +
' color: #ececec;\n' +
' cursor: pointer;\n' +
' transition: all 0.25s ease;\n' +
' font-family: inherit;\n' +
' }\n' +
' .character-profile .tab-button i { margin-right: 8px; }\n' +
' .character-profile .tab-button:hover { color: #ffffff; background: #1e4a76; }\n' +
' .character-profile .tab-button.active { color: #b8860b; background: #111111; }\n' +
'\n' +
' .character-profile .tab-content {\n' +
' display: none;\n' +
' line-height: 1.5;\n' +
' padding: 10px 20px 20px 20px;\n' +
' }\n' +
' .character-profile .tab-content.active {\n' +
' display: block;\n' +
' animation: fadeSlide 0.35s ease-out;\n' +
' }\n' +
' @keyframes fadeSlide {\n' +
' from { opacity: 0; transform: translateY(6px); }\n' +
' to { opacity: 1; transform: translateY(0); }\n' +
' }\n' +
'\n' +
' .character-profile .two-columns {\n' +
' display: flex;\n' +
' gap: 30px;\n' +
' flex-wrap: wrap;\n' +
' }\n' +
' .character-profile .three-columns {\n' +
' display: flex;\n' +
' gap: 30px;\n' +
' flex-wrap: wrap;\n' +
' justify-content: center;\n' +
' }\n' +
' .character-profile .portrait {\n' +
' flex: 0 0 180px;\n' +
' text-align: center;\n' +
' }\n' +
' .character-profile .portrait img {\n' +
' width: 100%;\n' +
' max-width: 180px;\n' +
' border: 2px solid #000000;\n' +
' box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);\n' +
' object-fit: cover;\n' +
' display: block;\n' +
' margin: 0 auto;\n' +
' }\n' +
' .character-profile .info {\n' +
' flex: 1;\n' +
' min-width: 200px;\n' +
' }\n' +
'\n' +
' .character-profile .info-list {\n' +
' list-style: none;\n' +
' padding: 0;\n' +
' margin: 0 0 14px 0;\n' +
' }\n' +
' .character-profile .info-list li {\n' +
' padding: 6px 0;\n' +
' border-bottom: 1px solid #b8860b;\n' +
' display: flex;\n' +
' align-items: baseline;\n' +
' gap: 8px;\n' +
' flex-wrap: wrap;\n' +
' margin: 0;\n' +
' }\n' +
' .character-profile .info-list li strong {\n' +
' color: #2e2e2e;\n' +
' width: 170px;\n' +
' display: inline-flex;\n' +
' align-items: center;\n' +
' gap: 8px;\n' +
' }\n' +
' .character-profile .info-list li strong i {\n' +
' width: 20px;\n' +
' text-align: center;\n' +
' }\n' +
'\n' +
' .character-profile .badge {\n' +
' display: inline-block;\n' +
' background: rgb(184, 134, 11);\n' +
' border-radius: 40px;\n' +
' padding: 3px 9px;\n' +
' font-size: 10px;\n' +
' color: #111111;\n' +
' margin: 0 5px 5px 0;\n' +
' }\n' +
' .character-profile .badge a { color: #111111; }\n' +
'\n' +
' .character-profile h2 {\n' +
' color: #000000;\n' +
' font-size: 16px;\n' +
' margin-top: 0;\n' +
' border-left: 5px solid #b8860b;\n' +
' padding-left: 16px;\n' +
' display: flex;\n' +
' align-items: center;\n' +
' gap: 12px;\n' +
' }\n' +
' .character-profile h2 i { font-size: 14px; color: #8a678e; }\n' +
'\n' +
' .character-profile p,\n' +
' .character-profile ul { margin: 0; padding: 0 0 10px 0;}\n' +
' .character-profile ul { padding-left: 24px; }\n' +
' .character-profile li { margin: 8px 0; }\n' +
' .character-profile strong i {\n' +
' margin-right: 5px;\n' +
' margin-left: 5px;\n' +
' color: #654166;\n' +
' }\n' +
'\n' +
' @media (max-width: 600px) {\n' +
' .character-profile { padding: 16px; }\n' +
' .character-profile .tab-button { padding: 6px 14px; font-size: 0.85rem; }\n' +
' .character-profile .info-list li strong { width: 140px; }\n' +
' .character-profile .portrait { flex-basis: 120px; }\n' +
' }\n' +
'</style>\n' +
'\n' +
'<script>\n' +
'(function () {\n' +
' function initProfile(profile) {\n' +
" if (profile.getAttribute('data-tabs-ready') === '1') return;\n" +
" profile.setAttribute('data-tabs-ready', '1');\n" +
" var buttons = profile.querySelectorAll('.tab-button');\n" +
" var contents = profile.querySelectorAll('.tab-content');\n" +
' if (!buttons.length) return;\n' +
'\n' +
' function switchTab(tabId) {\n' +
' var i;\n' +
' for (i = 0; i < buttons.length; i++) buttons[i].classList.remove(\'active\');\n' +
' for (i = 0; i < contents.length; i++) contents[i].classList.remove(\'active\');\n' +
' for (i = 0; i < buttons.length; i++) {\n' +
" if (buttons[i].getAttribute('data-tab') === tabId) buttons[i].classList.add('active');\n" +
' }\n' +
" var target = profile.querySelector('.tab-content[data-tab-id=\"' + tabId + '\"]');\n" +
" if (target) target.classList.add('active');\n" +
' }\n' +
'\n' +
' for (var k = 0; k < buttons.length; k++) {\n' +
' (function (btn) {\n' +
" btn.addEventListener('click', function () {\n" +
" var tabId = btn.getAttribute('data-tab');\n" +
' if (tabId) switchTab(tabId);\n' +
' });\n' +
' })(buttons[k]);\n' +
' }\n' +
' }\n' +
'\n' +
' function initAll() {\n' +
" var profiles = document.querySelectorAll('.character-profile');\n" +
' for (var i = 0; i < profiles.length; i++) initProfile(profiles[i]);\n' +
' }\n' +
'\n' +
" if (document.readyState === 'loading') {\n" +
" document.addEventListener('DOMContentLoaded', initAll);\n" +
' } else {\n' +
' initAll();\n' +
' }\n' +
'})();\n' +
'<\/script>';
document.getElementById('code').value = out;
}
/* ---------------- КОПИРОВАНИЕ ---------------- */
function copyCode(){
var ta = document.getElementById('code');
if (!ta.value) {
alert('Сначала сформируйте код.');
return;
}
ta.removeAttribute('readonly');
ta.select();
ta.setSelectionRange(0, ta.value.length);
var ok = false;
try { ok = document.execCommand('copy'); } catch (e) { ok = false; }
if (!ok && navigator.clipboard) {
navigator.clipboard.writeText(ta.value).then(function(){
alert('Код скопирован в буфер');
}, function(){
alert('Не удалось скопировать. Выделите код вручную и нажмите Ctrl+C.');
});
} else if (ok) {
alert('Код скопирован в буфер');
}
window.getSelection().removeAllRanges();
}
/* ---------------- ПЕРЕКЛЮЧЕНИЕ ВКЛАДОК ФОРМЫ ---------------- */
(function(){
var tabs = document.querySelectorAll('.builder-tab');
var panels = document.querySelectorAll('.builder-panel');
for (var i = 0; i < tabs.length; i++) {
(function(btn){
btn.addEventListener('click', function(){
var id = btn.getAttribute('data-tab');
for (var j = 0; j < tabs.length; j++) tabs[j].classList.remove('active');
for (var k = 0; k < panels.length; k++) panels[k].classList.remove('active');
btn.classList.add('active');
var panel = document.querySelector('.builder-panel[data-panel="' + id + '"]');
if (panel) panel.classList.add('active');
});
})(tabs[i]);
}
})();
</script>
</body>
</html>[/html]