Стартовый пост
Хранилище
Сообщений 1 страница 10 из 10
Поделиться22026-07-29 09:43:03
[hideprofile][html]<style>
:root {
--text: #232d24;
--link: #39423c;
--link-hover: #4d5a55;
--link-light: #d5d4d1;
--zelen: #b8bbb9;
--scroll: #2f3229;
--back: #848a87;
--noblack: #39423c;
--zelenlight: #cfcfca;
--addition-area: #aeafa8;
--addition-area-hover: #676a52;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
ul, li { list-style: none; }
body {
background: #e8e7e3;
font-family: 'Arial', 'Book Antiqua', sans-serif;
font-size: 12px;
color: var(--text);
min-height: 100vh;
display: flex;
justify-content: center;
align-items: flex-start;
padding: 20px;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-thumb { background-color: var(--scroll); border-radius: 10px; }
.forum-window {
width: 900px;
max-width: 100%;
padding: 25px;
}
.inner-panel {
background: var(--link-light);
border-radius: 5px;
padding: 25px 20px 20px;
}
/* ===== КАРТОЧКА ТРЕНЕРА ===== */
.trainer-card {
background: #e3e2de;
border: 1px solid var(--addition-area);
border-radius: 8px;
padding: 25px 20px 20px;
margin-bottom: 15px;
display: flex;
flex-direction: column;
align-items: center;
gap: 15px;
}
.trainer-top-row {
display: flex;
align-items: center;
justify-content: center;
gap: 25px;
width: 100%;
flex-wrap: wrap;
}
.trainer-avatar {
width: 90px;
height: 90px;
background: var(--zelenlight);
border: 2px solid var(--addition-area);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 40px;
flex-shrink: 0;
overflow: hidden;
}
.trainer-avatar img {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 50%;
}
.trainer-divider {
width: 1px;
height: 70px;
border-left: 2px dashed var(--addition-area-hover);
flex-shrink: 0;
}
.trainer-info {
text-align: center;
min-width: 160px;
}
.trainer-name {
font-family: 'Book Antiqua', serif;
font-size: 20px;
font-weight: 700;
color: var(--noblack);
margin-bottom: 4px;
}
.trainer-title {
display: inline-block;
padding: 5px 16px;
border-radius: 12px;
font-size: 11px;
font-weight: 700;
letter-spacing: 1px;
margin-bottom: 10px;
color: #fff;
}
.title-newbie { background: #A8A878; }
.title-rookie { background: #78C850; }
.title-catcher { background: #6890F0; }
.title-expert { background: #A890F0; }
.title-elite { background: #B8A038; }
.title-master { background: #F08030; }
.title-champion { background: #A040A0; }
.title-legend { background: linear-gradient(135deg, #F8D030, #F08030); }
.trainer-stats-row {
display: flex;
gap: 15px;
flex-wrap: wrap;
justify-content: center;
margin-bottom: 8px;
}
.trainer-stat {
font-size: 11px;
color: var(--noblack);
}
.trainer-stat strong {
color: var(--link-hover);
font-size: 14px;
font-family: 'Book Antiqua', serif;
}
.trainer-exp-bar {
width: 100%;
max-width: 350px;
margin: 0 auto;
}
.exp-bar-label {
display: flex;
justify-content: space-between;
font-size: 10px;
color: var(--back);
margin-bottom: 3px;
}
.exp-bar-bg {
width: 100%;
height: 10px;
background: var(--back);
border-radius: 10px;
overflow: hidden;
border: 1px solid var(--addition-area-hover);
}
.exp-bar-fill {
height: 100%;
background: linear-gradient(90deg, #48bb78, #38a169, #F8D030);
border-radius: 10px;
transition: width 0.5s ease;
}
.pokemon-count-breakdown {
display: flex;
gap: 8px;
flex-wrap: wrap;
justify-content: center;
font-size: 10px;
color: var(--back);
width: 100%;
}
.pokemon-count-breakdown span {
background: var(--zelenlight);
padding: 3px 10px;
border-radius: 10px;
border: 1px solid var(--addition-area);
color: var(--noblack);
font-size: 10px;
}
.pokemon-count-breakdown span strong {
color: var(--link-hover);
}
.pokemon-count-breakdown span small {
font-size: 9px;
}
/* ===== ХРАНИЛИЩЕ ===== */
.storage-section {
margin-top: 0;
}
.storage-header {
background: #e3e2de;
border: 1px solid var(--addition-area);
border-radius: 5px 5px 0 0;
padding: 14px 20px;
font-family: 'Book Antiqua', serif;
font-size: 16px;
font-weight: 700;
color: var(--noblack);
text-align: center;
}
.storage-scroll {
height: 320px;
overflow-y: auto;
background: #dcdbd6;
border: 1px solid var(--addition-area);
border-top: none;
border-radius: 0 0 5px 5px;
padding: 15px;
}
.pokemon-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
gap: 10px;
padding: 0;
background: transparent;
border: none;
border-radius: 0;
}
.pet-card {
background: #e3e2de;
border: 1px solid var(--addition-area);
border-radius: 5px;
padding: 10px;
text-align: center;
transition: transform 0.3s ease;
}
.pet-card:hover {
transform: translateY(-2px);
}
.pet-image {
width: 64px;
height: 64px;
margin: 0 auto 8px;
display: flex;
justify-content: center;
align-items: center;
background: var(--zelenlight);
border-radius: 5px;
padding: 4px;
border: 2px solid var(--addition-area);
transition: transform 0.3s ease;
}
.pet-image img {
max-width: 100%;
max-height: 100%;
object-fit: contain;
image-rendering: auto;
border-radius: 3px;
}
.pet-image:hover {
transform: scale(1.05);
}
.pet-name {
font-size: 13px;
font-weight: 700;
color: var(--noblack);
font-family: 'Book Antiqua', serif;
margin: 6px 0 2px;
}
.pet-type {
font-size: 10px;
color: var(--link);
margin-bottom: 6px;
font-style: italic;
}
.life-bar-container {
background-color: var(--back);
border-radius: 20px;
height: 8px;
width: 100%;
margin: 4px 0;
overflow: hidden;
border: 1px solid var(--addition-area-hover);
}
.life-bar-fill {
height: 100%;
width: 0%;
background: linear-gradient(90deg, #fc8181, #e53e3e);
border-radius: 20px;
transition: width 0.3s ease;
}
.xp-bar-container {
background-color: var(--back);
border-radius: 20px;
height: 8px;
width: 100%;
margin: 4px 0;
overflow: hidden;
border: 1px solid var(--addition-area-hover);
}
.xp-bar-fill {
height: 100%;
width: 0%;
background: linear-gradient(90deg, #48bb78, #38a169);
border-radius: 20px;
transition: width 0.3s ease;
}
.pet-stats {
display: flex;
justify-content: space-between;
font-size: 9px;
color: var(--noblack);
margin: 4px 0;
gap: 4px;
}
.stat-item {
background: var(--zelenlight);
padding: 3px 6px;
border-radius: 3px;
border: 1px solid var(--addition-area);
white-space: nowrap;
}
.stat-label {
font-size: 9px;
color: var(--noblack);
text-align: left;
margin-top: 2px;
font-weight: 600;
}
.stage-indicator {
font-size: 10px;
color: var(--noblack);
background: var(--zelenlight);
display: inline-block;
padding: 3px 10px;
border-radius: 3px;
font-weight: 600;
margin-top: 6px;
border: 1px solid var(--addition-area);
font-family: 'Book Antiqua', serif;
}
.type-badge {
display: inline-block;
padding: 2px 6px;
border-radius: 3px;
font-size: 9px;
font-weight: 600;
color: #fff;
margin: 1px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.type-normal { background: #A8A878; }
.type-fire { background: #F08030; }
.type-water { background: #6890F0; }
.type-electric { background: #F8D030; color: #333; }
.type-grass { background: #78C850; }
.type-ice { background: #98D8D8; color: #333; }
.type-fighting { background: #C03028; }
.type-poison { background: #A040A0; }
.type-ground { background: #E0C068; color: #333; }
.type-flying { background: #A890F0; }
.type-psychic { background: #F85888; }
.type-bug { background: #A8B820; }
.type-rock { background: #B8A038; }
.type-ghost { background: #705898; }
.type-dragon { background: #7038F8; }
.type-steel { background: #B8B8D0; color: #333; }
.type-fairy { background: #EE99AC; }
</style>
<div class="forum-window">
<div class="inner-panel">
<!-- ===== КАРТОЧКА ТРЕНЕРА ===== -->
<div class="trainer-card">
<div class="trainer-top-row">
<div class="trainer-avatar">
<img src="https://via.placeholder.com/90" alt="Аватар тренера">
</div>
<div class="trainer-divider"></div>
<div class="trainer-info">
<div class="trainer-name">Имя тренера</div>
<div class="trainer-title title-rookie" id="trainerTitle">Начинающий</div>
<div class="trainer-stats-row">
<div class="trainer-stat">Покемонов: <strong id="totalPokemon">1</strong></div>
<div class="trainer-stat">Опыт: <strong id="totalExp">20</strong> / 500</div>
</div>
<div class="trainer-exp-bar">
<div class="exp-bar-label">
<span>Опыт тренера</span>
<span id="expLabel">20 / 500</span>
</div>
<div class="exp-bar-bg">
<div class="exp-bar-fill" id="expFill" style="width: 4%;"></div>
</div>
</div>
</div>
</div>
<div class="pokemon-count-breakdown" id="countBreakdown"
data-common="0"
data-uncommon="1"
data-rare="0"
data-elite="0"
data-legendary="0">
<span>🟢 Обычных: <strong class="cnt-common">0</strong> <small style="color:#848a87;">(+10 XP)</small></span>
<span>🔵 Необычных: <strong class="cnt-uncommon">1</strong> <small style="color:#848a87;">(+20 XP)</small></span>
<span>🟣 Редких: <strong class="cnt-rare">0</strong> <small style="color:#848a87;">(+35 XP)</small></span>
<span>🟡 Элитных: <strong class="cnt-elite">0</strong> <small style="color:#848a87;">(+50 XP)</small></span>
<span>🔴 Легендарных: <strong class="cnt-legendary">0</strong> <small style="color:#848a87;">(+75 XP)</small></span>
</div>
</div>
<!-- ===== ХРАНИЛИЩЕ ПОКЕМОНОВ ===== -->
<div class="storage-section">
<div class="storage-header">🎒 Хранилище покемонов</div>
<div class="storage-scroll">
<div class="pokemon-grid">
<div class="pet-card">
<div class="pet-image">
<img src="https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/1.png" alt="Бульбазавр">
</div>
<div class="pet-name">Бульбазавр</div>
<div class="pet-type">
<span class="type-badge type-grass">Трава</span>
<span class="type-badge type-poison">Яд</span>
</div>
<div class="stat-label">HP</div>
<div class="life-bar-container">
<div class="life-bar-fill" style="width: 100%;"></div>
</div>
<div class="pet-stats">
<span class="stat-item">45 / 45</span>
</div>
<div class="stat-label">XP</div>
<div class="xp-bar-container">
<div class="xp-bar-fill" style="width: 35%;"></div>
</div>
<div class="pet-stats">
<span class="stat-item">35 / 100</span>
</div>
<div class="pet-stats">
<span class="stat-item">Ур. 12</span>
<span class="stat-item">Сила 49</span>
</div>
<div class="stage-indicator">Необычный</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
// Автоматический расчёт шкал HP, XP и опыта тренера
(function() {
function updatePokemonBars() {
var allCards = document.querySelectorAll('.pet-card');
allCards.forEach(function(card) {
var allStats = card.querySelectorAll('.pet-stats .stat-item');
allStats.forEach(function(stat) {
var text = stat.textContent.trim();
var match = text.match(/(\d+)\s*\/\s*(\d+)/);
if(match) {
var current = parseInt(match[1]);
var max = parseInt(match[2]);
var percent = Math.round((current / max) * 100);
if(max === 100) {
var xpBar = card.querySelector('.xp-bar-fill');
if(xpBar) xpBar.style.width = percent + '%';
} else {
var hpBar = card.querySelector('.life-bar-fill');
if(hpBar) hpBar.style.width = percent + '%';
}
}
});
});
}
function updateTrainerExp() {
var breakdown = document.getElementById('countBreakdown');
if(!breakdown) return;
var common = parseInt(breakdown.getAttribute('data-common')) || 0;
var uncommon = parseInt(breakdown.getAttribute('data-uncommon')) || 0;
var rare = parseInt(breakdown.getAttribute('data-rare')) || 0;
var elite = parseInt(breakdown.getAttribute('data-elite')) || 0;
var legendary = parseInt(breakdown.getAttribute('data-legendary')) || 0;
var totalExp = common * 10 + uncommon * 20 + rare * 35 + elite * 50 + legendary * 75;
var totalPokemon = common + uncommon + rare + elite + legendary;
var expPercent = Math.round((totalExp / 500) * 100);
var cntCommon = breakdown.querySelector('.cnt-common');
var cntUncommon = breakdown.querySelector('.cnt-uncommon');
var cntRare = breakdown.querySelector('.cnt-rare');
var cntElite = breakdown.querySelector('.cnt-elite');
var cntLegendary = breakdown.querySelector('.cnt-legendary');
if(cntCommon) cntCommon.textContent = common;
if(cntUncommon) cntUncommon.textContent = uncommon;
if(cntRare) cntRare.textContent = rare;
if(cntElite) cntElite.textContent = elite;
if(cntLegendary) cntLegendary.textContent = legendary;
var totalPokemonEl = document.getElementById('totalPokemon');
var totalExpEl = document.getElementById('totalExp');
var expLabel = document.getElementById('expLabel');
var expFill = document.getElementById('expFill');
if(totalPokemonEl) totalPokemonEl.textContent = totalPokemon;
if(totalExpEl) totalExpEl.textContent = totalExp;
if(expLabel) expLabel.textContent = totalExp + ' / 500';
if(expFill) expFill.style.width = expPercent + '%';
var titleEl = document.getElementById('trainerTitle');
if(titleEl) {
var titleName = '', titleClass = '';
if(totalExp >= 500) { titleName = 'Легендарный тренер'; titleClass = 'title-legend'; }
else if(totalExp >= 421) { titleName = 'Чемпион'; titleClass = 'title-champion'; }
else if(totalExp >= 321) { titleName = 'Мастер'; titleClass = 'title-master'; }
else if(totalExp >= 221) { titleName = 'Элитный тренер'; titleClass = 'title-elite'; }
else if(totalExp >= 131) { titleName = 'Эксперт'; titleClass = 'title-expert'; }
else if(totalExp >= 61) { titleName = 'Ловец'; titleClass = 'title-catcher'; }
else if(totalExp >= 1) { titleName = 'Начинающий'; titleClass = 'title-rookie'; }
else { titleName = 'Новичок'; titleClass = 'title-newbie'; }
titleEl.textContent = titleName;
titleEl.className = 'trainer-title ' + titleClass;
}
}
function init() {
updatePokemonBars();
updateTrainerExp();
}
if(document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init);
} else {
init();
}
})();
</script>[/html]
Поделиться32026-07-29 11:49:30
[hideprofile][html]<style>
:root {
--text: #232d24;
--link: #39423c;
--link-hover: #4d5a55;
--link-light: #d5d4d1;
--zelen: #b8bbb9;
--scroll: #2f3229;
--back: #848a87;
--noblack: #39423c;
--zelenlight: #cfcfca;
--addition-area: #aeafa8;
--addition-area-hover: #676a52;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
ul, li { list-style: none; }
body {
background: #e8e7e3;
font-family: 'Arial', 'Book Antiqua', sans-serif;
font-size: 12px;
color: var(--text);
min-height: 100vh;
display: flex;
justify-content: center;
align-items: flex-start;
padding: 20px;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-thumb { background-color: var(--scroll); border-radius: 10px; }
.forum-window {
width: 900px;
max-width: 100%;
padding: 25px;
}
.inner-panel {
background: var(--link-light);
border-radius: 5px;
padding: 25px 20px 20px;
}
/* ===== КАРТОЧКА ТРЕНЕРА ===== */
.trainer-card {
background: #e3e2de;
border: 1px solid var(--addition-area);
border-radius: 8px;
padding: 25px 20px 20px;
margin-bottom: 15px;
display: flex;
flex-direction: column;
align-items: center;
gap: 15px;
}
.trainer-top-row {
display: flex;
align-items: center;
justify-content: center;
gap: 25px;
width: 100%;
flex-wrap: wrap;
}
.trainer-avatar {
width: 90px;
height: 90px;
background: var(--zelenlight);
border: 2px solid var(--addition-area);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 40px;
flex-shrink: 0;
overflow: hidden;
}
.trainer-avatar img {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 50%;
}
.trainer-divider {
width: 1px;
height: 70px;
border-left: 2px dashed var(--addition-area-hover);
flex-shrink: 0;
}
.trainer-info {
text-align: center;
min-width: 160px;
}
.trainer-name {
font-family: 'Book Antiqua', serif;
font-size: 20px;
font-weight: 700;
color: var(--noblack);
margin-bottom: 4px;
}
.trainer-title {
display: inline-block;
padding: 5px 16px;
border-radius: 12px;
font-size: 11px;
font-weight: 700;
letter-spacing: 1px;
margin-bottom: 10px;
color: #fff;
}
.title-newbie { background: #A8A878; }
.title-rookie { background: #78C850; }
.title-catcher { background: #6890F0; }
.title-expert { background: #A890F0; }
.title-elite { background: #B8A038; }
.title-master { background: #F08030; }
.title-champion { background: #A040A0; }
.title-legend { background: linear-gradient(135deg, #F8D030, #F08030); }
.trainer-stats-row {
display: flex;
gap: 15px;
flex-wrap: wrap;
justify-content: center;
margin-bottom: 8px;
}
.trainer-stat {
font-size: 11px;
color: var(--noblack);
}
.trainer-stat strong {
color: var(--link-hover);
font-size: 14px;
font-family: 'Book Antiqua', serif;
}
.trainer-exp-bar {
width: 100%;
max-width: 350px;
margin: 0 auto;
}
.exp-bar-label {
display: flex;
justify-content: space-between;
font-size: 10px;
color: var(--back);
margin-bottom: 3px;
}
.exp-bar-bg {
width: 100%;
height: 10px;
background: var(--back);
border-radius: 10px;
overflow: hidden;
border: 1px solid var(--addition-area-hover);
}
.exp-bar-fill {
height: 100%;
background: linear-gradient(90deg, #48bb78, #38a169, #F8D030);
border-radius: 10px;
transition: width 0.5s ease;
}
.pokemon-count-breakdown {
display: flex;
gap: 8px;
flex-wrap: wrap;
justify-content: center;
font-size: 10px;
color: var(--back);
width: 100%;
}
.pokemon-count-breakdown span {
background: var(--zelenlight);
padding: 3px 10px;
border-radius: 10px;
border: 1px solid var(--addition-area);
color: var(--noblack);
font-size: 10px;
}
.pokemon-count-breakdown span strong {
color: var(--link-hover);
}
.pokemon-count-breakdown span small {
font-size: 9px;
}
/* ===== ХРАНИЛИЩЕ ===== */
.storage-section {
margin-top: 0;
}
.storage-header {
background: #e3e2de;
border: 1px solid var(--addition-area);
border-radius: 5px 5px 0 0;
padding: 14px 20px;
font-family: 'Book Antiqua', serif;
font-size: 16px;
font-weight: 700;
color: var(--noblack);
text-align: center;
}
.storage-scroll {
height: 320px;
overflow-y: auto;
background: #dcdbd6;
border: 1px solid var(--addition-area);
border-top: none;
border-radius: 0 0 5px 5px;
padding: 15px;
}
.pokemon-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
gap: 10px;
padding: 0;
background: transparent;
border: none;
border-radius: 0;
}
.pet-card {
background: #e3e2de;
border: 1px solid var(--addition-area);
border-radius: 5px;
padding: 10px;
text-align: center;
transition: transform 0.3s ease;
}
.pet-card:hover {
transform: translateY(-2px);
}
.pet-image {
width: 64px;
height: 64px;
margin: 0 auto 8px;
display: flex;
justify-content: center;
align-items: center;
background: var(--zelenlight);
border-radius: 5px;
padding: 4px;
border: 2px solid var(--addition-area);
transition: transform 0.3s ease;
}
.pet-image img {
max-width: 100%;
max-height: 100%;
object-fit: contain;
image-rendering: auto;
border-radius: 3px;
}
.pet-image:hover {
transform: scale(1.05);
}
.pet-name {
font-size: 13px;
font-weight: 700;
color: var(--noblack);
font-family: 'Book Antiqua', serif;
margin: 6px 0 2px;
}
.pet-type {
font-size: 10px;
color: var(--link);
margin-bottom: 6px;
font-style: italic;
}
.life-bar-container {
background-color: var(--back);
border-radius: 20px;
height: 8px;
width: 100%;
margin: 4px 0;
overflow: hidden;
border: 1px solid var(--addition-area-hover);
}
.life-bar-fill {
height: 100%;
width: 0%;
background: linear-gradient(90deg, #fc8181, #e53e3e);
border-radius: 20px;
transition: width 0.3s ease;
}
.xp-bar-container {
background-color: var(--back);
border-radius: 20px;
height: 8px;
width: 100%;
margin: 4px 0;
overflow: hidden;
border: 1px solid var(--addition-area-hover);
}
.xp-bar-fill {
height: 100%;
width: 0%;
background: linear-gradient(90deg, #48bb78, #38a169);
border-radius: 20px;
transition: width 0.3s ease;
}
.pet-stats {
display: flex;
justify-content: space-between;
font-size: 9px;
color: var(--noblack);
margin: 4px 0;
gap: 4px;
}
.stat-item {
background: var(--zelenlight);
padding: 3px 6px;
border-radius: 3px;
border: 1px solid var(--addition-area);
white-space: nowrap;
}
.stat-label {
font-size: 9px;
color: var(--noblack);
text-align: left;
margin-top: 2px;
font-weight: 600;
}
.stage-indicator {
font-size: 10px;
color: var(--noblack);
background: var(--zelenlight);
display: inline-block;
padding: 3px 10px;
border-radius: 3px;
font-weight: 600;
margin-top: 6px;
border: 1px solid var(--addition-area);
font-family: 'Book Antiqua', serif;
}
.type-badge {
display: inline-block;
padding: 2px 6px;
border-radius: 3px;
font-size: 9px;
font-weight: 600;
color: #fff;
margin: 1px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.type-normal { background: #A8A878; }
.type-fire { background: #F08030; }
.type-water { background: #6890F0; }
.type-electric { background: #F8D030; color: #333; }
.type-grass { background: #78C850; }
.type-ice { background: #98D8D8; color: #333; }
.type-fighting { background: #C03028; }
.type-poison { background: #A040A0; }
.type-ground { background: #E0C068; color: #333; }
.type-flying { background: #A890F0; }
.type-psychic { background: #F85888; }
.type-bug { background: #A8B820; }
.type-rock { background: #B8A038; }
.type-ghost { background: #705898; }
.type-dragon { background: #7038F8; }
.type-steel { background: #B8B8D0; color: #333; }
.type-fairy { background: #EE99AC; }
</style>
<div class="forum-window">
<div class="inner-panel">
<!-- ===== КАРТОЧКА ТРЕНЕРА ===== -->
<div class="trainer-card">
<div class="trainer-top-row">
<div class="trainer-avatar">
<img src="https://forumavatars.ru/img/avatars/0004/e7/0d/4057-1769806138.png" alt="Аватар тренера">
</div>
<div class="trainer-divider"></div>
<div class="trainer-info">
<div class="trainer-name">Разгром</div>
<div class="trainer-title title-rookie" id="trainerTitle">загрузка данных...</div>
<div class="trainer-stats-row">
<div class="trainer-stat">Покемонов: <strong id="totalPokemon">1</strong></div>
<div class="trainer-stat">Опыт: <strong id="totalExp">20</strong> / 500</div>
</div>
<div class="trainer-exp-bar">
<div class="exp-bar-label">
<span>Опыт тренера</span>
<span id="expLabel">20 / 500</span>
</div>
<div class="exp-bar-bg">
<div class="exp-bar-fill" id="expFill" style="width: 4%;"></div>
</div>
</div>
</div>
</div>
<div class="pokemon-count-breakdown" id="countBreakdown"
data-common="1"
data-uncommon="0"
data-rare="0"
data-elite="0"
data-legendary="0">
<span>🟢 Обычных: <strong class="cnt-common">1</strong> <small style="color:#848a87;">(+10 XP)</small></span>
<span>🔵 Необычных: <strong class="cnt-uncommon">0</strong> <small style="color:#848a87;">(+20 XP)</small></span>
<span>🟣 Редких: <strong class="cnt-rare">0</strong> <small style="color:#848a87;">(+35 XP)</small></span>
<span>🟡 Элитных: <strong class="cnt-elite">0</strong> <small style="color:#848a87;">(+50 XP)</small></span>
<span>🔴 Легендарных: <strong class="cnt-legendary">0</strong> <small style="color:#848a87;">(+75 XP)</small></span>
</div>
</div>
<!-- ===== ХРАНИЛИЩЕ ПОКЕМОНОВ ===== -->
<div class="storage-section">
<div class="storage-header">🎒 Хранилище покемонов</div>
<div class="storage-scroll">
<div class="pokemon-grid">
<!-- ===== Вульпикс ===== -->
<div class="pet-card">
<div class="pet-image">
<img src="https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/37.png" alt="Вульпикс">
</div>
<div class="pet-name">Вульпикс</div>
<div class="pet-type">
<span class="type-badge type-fire">Огонь</span>
</div>
<div class="stat-label">HP</div>
<div class="life-bar-container">
<div class="life-bar-fill" style="width: 100%;"></div>
</div>
<div class="pet-stats">
<span class="stat-item">38 / 38</span>
</div>
<div class="stat-label">XP</div>
<div class="xp-bar-container">
<div class="xp-bar-fill" style="width: 35%;"></div>
</div>
<div class="pet-stats">
<span class="stat-item">0 / 100</span>
</div>
<div class="pet-stats">
<span class="stat-item">Ур. 1</span>
<span class="stat-item">Атака 41</span>
</div>
<div class="stage-indicator">Обычный</div>
</div>
<!-- ===== конец карточки ===== -->
</div>
</div>
</div>
</div>
</div>
<script>
// Автоматический расчёт шкал HP, XP и опыта тренера
(function() {
function updatePokemonBars() {
var allCards = document.querySelectorAll('.pet-card');
allCards.forEach(function(card) {
var allStats = card.querySelectorAll('.pet-stats .stat-item');
allStats.forEach(function(stat) {
var text = stat.textContent.trim();
var match = text.match(/(\d+)\s*\/\s*(\d+)/);
if(match) {
var current = parseInt(match[1]);
var max = parseInt(match[2]);
var percent = Math.round((current / max) * 100);
if(max === 100) {
var xpBar = card.querySelector('.xp-bar-fill');
if(xpBar) xpBar.style.width = percent + '%';
} else {
var hpBar = card.querySelector('.life-bar-fill');
if(hpBar) hpBar.style.width = percent + '%';
}
}
});
});
}
function updateTrainerExp() {
var breakdown = document.getElementById('countBreakdown');
if(!breakdown) return;
var common = parseInt(breakdown.getAttribute('data-common')) || 0;
var uncommon = parseInt(breakdown.getAttribute('data-uncommon')) || 0;
var rare = parseInt(breakdown.getAttribute('data-rare')) || 0;
var elite = parseInt(breakdown.getAttribute('data-elite')) || 0;
var legendary = parseInt(breakdown.getAttribute('data-legendary')) || 0;
var totalExp = common * 10 + uncommon * 20 + rare * 35 + elite * 50 + legendary * 75;
var totalPokemon = common + uncommon + rare + elite + legendary;
var expPercent = Math.round((totalExp / 500) * 100);
var cntCommon = breakdown.querySelector('.cnt-common');
var cntUncommon = breakdown.querySelector('.cnt-uncommon');
var cntRare = breakdown.querySelector('.cnt-rare');
var cntElite = breakdown.querySelector('.cnt-elite');
var cntLegendary = breakdown.querySelector('.cnt-legendary');
if(cntCommon) cntCommon.textContent = common;
if(cntUncommon) cntUncommon.textContent = uncommon;
if(cntRare) cntRare.textContent = rare;
if(cntElite) cntElite.textContent = elite;
if(cntLegendary) cntLegendary.textContent = legendary;
var totalPokemonEl = document.getElementById('totalPokemon');
var totalExpEl = document.getElementById('totalExp');
var expLabel = document.getElementById('expLabel');
var expFill = document.getElementById('expFill');
if(totalPokemonEl) totalPokemonEl.textContent = totalPokemon;
if(totalExpEl) totalExpEl.textContent = totalExp;
if(expLabel) expLabel.textContent = totalExp + ' / 500';
if(expFill) expFill.style.width = expPercent + '%';
var titleEl = document.getElementById('trainerTitle');
if(titleEl) {
var titleName = '', titleClass = '';
if(totalExp >= 500) { titleName = 'Легендарный тренер'; titleClass = 'title-legend'; }
else if(totalExp >= 421) { titleName = 'Чемпион'; titleClass = 'title-champion'; }
else if(totalExp >= 321) { titleName = 'Мастер'; titleClass = 'title-master'; }
else if(totalExp >= 221) { titleName = 'Элитный тренер'; titleClass = 'title-elite'; }
else if(totalExp >= 131) { titleName = 'Эксперт'; titleClass = 'title-expert'; }
else if(totalExp >= 61) { titleName = 'Ловец'; titleClass = 'title-catcher'; }
else if(totalExp >= 1) { titleName = 'Начинающий'; titleClass = 'title-rookie'; }
else { titleName = 'Новичок'; titleClass = 'title-newbie'; }
titleEl.textContent = titleName;
titleEl.className = 'trainer-title ' + titleClass;
}
}
function init() {
updatePokemonBars();
updateTrainerExp();
}
if(document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init);
} else {
init();
}
})();
</script>[/html]
Поделиться42026-07-29 12:18:52
[html]<div style="box-sizing:border-box;max-width:650px;margin:20px auto;background:#e3e2de;border:1px solid #aeafa8;border-radius:8px;padding:25px;font-family:'Book Antiqua',serif;color:#39423c;font-size:14px;line-height:1.6;"><div style="display:flex;align-items:flex-start;gap:15px;margin-bottom:15px;"><div style="width:52px;height:52px;background:#cfcfca;border:1px solid #aeafa8;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:24px;flex-shrink:0;">💧</div><div><p style="margin:0 0 6px 0;font-weight:700;color:#39423c;font-size:15px;text-transform:uppercase;">Результат теста тренера:</p><p style="margin:0;font-style:italic;color:#39423c;">Выявлены склонности к следующим стихиям:</p></div></div><p style="margin:15px 0;text-align:center;font-weight:700;font-size:18px;text-transform:uppercase;color:#6890F0;letter-spacing:1px;">💧 ТИП: ВОДА</p><p style="margin:0 0 8px 0;font-size:12px;font-weight:700;color:#39423c;text-align:center;">Распределение стихий:</p><p style="margin:0;text-align:center;"><span style="display:inline-block;background:#6890F0;color:#fff;padding:4px 12px;border-radius:12px;font-size:11px;font-weight:700;margin:3px;">💧 Вода: 4</span> <span style="display:inline-block;background:#A8B820;color:#fff;padding:4px 12px;border-radius:12px;font-size:11px;font-weight:700;margin:3px;">🐛 Насекомое: 3</span> <span style="display:inline-block;background:#F08030;color:#fff;padding:4px 12px;border-radius:12px;font-size:11px;font-weight:700;margin:3px;">🔥 Огонь: 2</span> </p></div>[/html]
Поделиться52026-07-29 12:46:12
[hideprofile][html]<style>
:root {
--text: #232d24;
--link: #39423c;
--link-hover: #4d5a55;
--link-light: #d5d4d1;
--zelen: #b8bbb9;
--scroll: #2f3229;
--back: #848a87;
--noblack: #39423c;
--zelenlight: #cfcfca;
--addition-area: #aeafa8;
--addition-area-hover: #676a52;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
ul, li { list-style: none; }
body {
background: #e8e7e3;
font-family: 'Arial', 'Book Antiqua', sans-serif;
font-size: 12px;
color: var(--text);
min-height: 100vh;
display: flex;
justify-content: center;
align-items: flex-start;
padding: 20px;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-thumb { background-color: var(--scroll); border-radius: 10px; }
.forum-window {
width: 900px;
max-width: 100%;
padding: 25px;
}
.inner-panel {
background: var(--link-light);
border-radius: 5px;
padding: 25px 20px 20px;
}
/* ===== КАРТОЧКА ТРЕНЕРА ===== */
.trainer-card {
background: #e3e2de;
border: 1px solid var(--addition-area);
border-radius: 8px;
padding: 25px 20px 20px;
margin-bottom: 15px;
display: flex;
flex-direction: column;
align-items: center;
gap: 15px;
}
.trainer-top-row {
display: flex;
align-items: center;
justify-content: center;
gap: 25px;
width: 100%;
flex-wrap: wrap;
}
.trainer-avatar {
width: 90px;
height: 90px;
background: var(--zelenlight);
border: 2px solid var(--addition-area);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 40px;
flex-shrink: 0;
overflow: hidden;
}
.trainer-avatar img {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 50%;
}
.trainer-divider {
width: 1px;
height: 70px;
border-left: 2px dashed var(--addition-area-hover);
flex-shrink: 0;
}
.trainer-info {
text-align: center;
min-width: 160px;
}
.trainer-name {
font-family: 'Book Antiqua', serif;
font-size: 20px;
font-weight: 700;
color: var(--noblack);
margin-bottom: 4px;
}
.trainer-title {
display: inline-block;
padding: 5px 16px;
border-radius: 12px;
font-size: 11px;
font-weight: 700;
letter-spacing: 1px;
margin-bottom: 10px;
color: #fff;
}
.title-newbie { background: #A8A878; }
.title-rookie { background: #78C850; }
.title-catcher { background: #6890F0; }
.title-expert { background: #A890F0; }
.title-elite { background: #B8A038; }
.title-master { background: #F08030; }
.title-champion { background: #A040A0; }
.title-legend { background: linear-gradient(135deg, #F8D030, #F08030); }
.trainer-stats-row {
display: flex;
gap: 15px;
flex-wrap: wrap;
justify-content: center;
margin-bottom: 8px;
}
.trainer-stat {
font-size: 11px;
color: var(--noblack);
}
.trainer-stat strong {
color: var(--link-hover);
font-size: 14px;
font-family: 'Book Antiqua', serif;
}
.trainer-exp-bar {
width: 100%;
max-width: 350px;
margin: 0 auto;
}
.exp-bar-label {
display: flex;
justify-content: space-between;
font-size: 10px;
color: var(--back);
margin-bottom: 3px;
}
.exp-bar-bg {
width: 100%;
height: 10px;
background: var(--back);
border-radius: 10px;
overflow: hidden;
border: 1px solid var(--addition-area-hover);
}
.exp-bar-fill {
height: 100%;
background: linear-gradient(90deg, #48bb78, #38a169, #F8D030);
border-radius: 10px;
transition: width 0.5s ease;
}
.pokemon-count-breakdown {
display: flex;
gap: 8px;
flex-wrap: wrap;
justify-content: center;
font-size: 10px;
color: var(--back);
width: 100%;
}
.pokemon-count-breakdown span {
background: var(--zelenlight);
padding: 3px 10px;
border-radius: 10px;
border: 1px solid var(--addition-area);
color: var(--noblack);
font-size: 10px;
}
.pokemon-count-breakdown span strong {
color: var(--link-hover);
}
.pokemon-count-breakdown span small {
font-size: 9px;
}
/* ===== ХРАНИЛИЩЕ ===== */
.storage-section {
margin-top: 0;
}
.storage-header {
background: #e3e2de;
border: 1px solid var(--addition-area);
border-radius: 5px 5px 0 0;
padding: 14px 20px;
font-family: 'Book Antiqua', serif;
font-size: 16px;
font-weight: 700;
color: var(--noblack);
text-align: center;
}
.storage-scroll {
height: 320px;
overflow-y: auto;
background: #dcdbd6;
border: 1px solid var(--addition-area);
border-top: none;
border-radius: 0 0 5px 5px;
padding: 15px;
}
.pokemon-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
gap: 10px;
padding: 0;
background: transparent;
border: none;
border-radius: 0;
}
.pet-card {
background: #e3e2de;
border: 1px solid var(--addition-area);
border-radius: 5px;
padding: 10px;
text-align: center;
transition: transform 0.3s ease;
}
.pet-card:hover {
transform: translateY(-2px);
}
.pet-image {
width: 64px;
height: 64px;
margin: 0 auto 8px;
display: flex;
justify-content: center;
align-items: center;
background: var(--zelenlight);
border-radius: 5px;
padding: 4px;
border: 2px solid var(--addition-area);
transition: transform 0.3s ease;
}
.pet-image img {
max-width: 100%;
max-height: 100%;
object-fit: contain;
image-rendering: auto;
border-radius: 3px;
}
.pet-image:hover {
transform: scale(1.05);
}
.pet-name {
font-size: 13px;
font-weight: 700;
color: var(--noblack);
font-family: 'Book Antiqua', serif;
margin: 6px 0 2px;
}
.pet-type {
font-size: 10px;
color: var(--link);
margin-bottom: 6px;
font-style: italic;
}
.life-bar-container {
background-color: var(--back);
border-radius: 20px;
height: 8px;
width: 100%;
margin: 4px 0;
overflow: hidden;
border: 1px solid var(--addition-area-hover);
}
.life-bar-fill {
height: 100%;
width: 0%;
background: linear-gradient(90deg, #fc8181, #e53e3e);
border-radius: 20px;
transition: width 0.3s ease;
}
.xp-bar-container {
background-color: var(--back);
border-radius: 20px;
height: 8px;
width: 100%;
margin: 4px 0;
overflow: hidden;
border: 1px solid var(--addition-area-hover);
}
.xp-bar-fill {
height: 100%;
width: 0%;
background: linear-gradient(90deg, #48bb78, #38a169);
border-radius: 20px;
transition: width 0.3s ease;
}
.pet-stats {
display: flex;
justify-content: space-between;
font-size: 9px;
color: var(--noblack);
margin: 4px 0;
gap: 4px;
}
.stat-item {
background: var(--zelenlight);
padding: 3px 6px;
border-radius: 3px;
border: 1px solid var(--addition-area);
white-space: nowrap;
}
.stat-label {
font-size: 9px;
color: var(--noblack);
text-align: left;
margin-top: 2px;
font-weight: 600;
}
.stage-indicator {
font-size: 10px;
color: var(--noblack);
background: var(--zelenlight);
display: inline-block;
padding: 3px 10px;
border-radius: 3px;
font-weight: 600;
margin-top: 6px;
border: 1px solid var(--addition-area);
font-family: 'Book Antiqua', serif;
}
.type-badge {
display: inline-block;
padding: 2px 6px;
border-radius: 3px;
font-size: 9px;
font-weight: 600;
color: #fff;
margin: 1px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.type-normal { background: #A8A878; }
.type-fire { background: #F08030; }
.type-water { background: #6890F0; }
.type-electric { background: #F8D030; color: #333; }
.type-grass { background: #78C850; }
.type-ice { background: #98D8D8; color: #333; }
.type-fighting { background: #C03028; }
.type-poison { background: #A040A0; }
.type-ground { background: #E0C068; color: #333; }
.type-flying { background: #A890F0; }
.type-psychic { background: #F85888; }
.type-bug { background: #A8B820; }
.type-rock { background: #B8A038; }
.type-ghost { background: #705898; }
.type-dragon { background: #7038F8; }
.type-steel { background: #B8B8D0; color: #333; }
.type-fairy { background: #EE99AC; }
</style>
<div class="forum-window">
<div class="inner-panel">
<!-- ===== КАРТОЧКА ТРЕНЕРА ===== -->
<div class="trainer-card">
<div class="trainer-top-row">
<div class="trainer-avatar">
<img src="https://forumavatars.ru/img/avatars/0004/e7/0d/4028-1781867124.png" alt="Аватар тренера">
</div>
<div class="trainer-divider"></div>
<div class="trainer-info">
<div class="trainer-name">Пепел</div>
<div class="trainer-title title-rookie" id="trainerTitle">загрузка данных...</div>
<div class="trainer-stats-row">
<div class="trainer-stat">Покемонов: <strong id="totalPokemon">1</strong></div>
<div class="trainer-stat">Опыт: <strong id="totalExp">20</strong> / 500</div>
</div>
<div class="trainer-exp-bar">
<div class="exp-bar-label">
<span>Опыт тренера</span>
<span id="expLabel">20 / 500</span>
</div>
<div class="exp-bar-bg">
<div class="exp-bar-fill" id="expFill" style="width: 4%;"></div>
</div>
</div>
</div>
</div>
<div class="pokemon-count-breakdown" id="countBreakdown"
data-common="1"
data-uncommon="0"
data-rare="0"
data-elite="0"
data-legendary="0">
<span>🟢 Обычных: <strong class="cnt-common">1</strong> <small style="color:#848a87;">(+10 XP)</small></span>
<span>🔵 Необычных: <strong class="cnt-uncommon">0</strong> <small style="color:#848a87;">(+20 XP)</small></span>
<span>🟣 Редких: <strong class="cnt-rare">0</strong> <small style="color:#848a87;">(+35 XP)</small></span>
<span>🟡 Элитных: <strong class="cnt-elite">0</strong> <small style="color:#848a87;">(+50 XP)</small></span>
<span>🔴 Легендарных: <strong class="cnt-legendary">0</strong> <small style="color:#848a87;">(+75 XP)</small></span>
</div>
</div>
<!-- ===== ХРАНИЛИЩЕ ПОКЕМОНОВ ===== -->
<div class="storage-section">
<div class="storage-header">🎒 Хранилище покемонов</div>
<div class="storage-scroll">
<div class="pokemon-grid">
<!-- ===== Эканс (#023) ===== -->
<div class="pet-card">
<div class="pet-image"><img src="https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/23.png" alt="Эканс"></div>
<div class="pet-name">Эканс</div>
<div class="pet-type"><span class="type-badge type-poison">Яд</span></div>
<div class="stat-label">HP</div><div class="life-bar-container"><div class="life-bar-fill" style="width:100%;"></div></div>
<div class="pet-stats"><span class="stat-item">35 / 35</span></div>
<div class="stat-label">XP</div><div class="xp-bar-container"><div class="xp-bar-fill" style="width:0%;"></div></div>
<div class="pet-stats"><span class="stat-item">0 / 100</span></div>
<div class="pet-stats"><span class="stat-item">Ур. 1</span><span class="stat-item">Атака 60</span></div>
<div class="stage-indicator">Обычный</div>
</div>
<!-- ===== конец карточки ===== -->
</div>
</div>
</div>
</div>
</div>
<script>
// Автоматический расчёт шкал HP, XP и опыта тренера
(function() {
function updatePokemonBars() {
var allCards = document.querySelectorAll('.pet-card');
allCards.forEach(function(card) {
var allStats = card.querySelectorAll('.pet-stats .stat-item');
allStats.forEach(function(stat) {
var text = stat.textContent.trim();
var match = text.match(/(\d+)\s*\/\s*(\d+)/);
if(match) {
var current = parseInt(match[1]);
var max = parseInt(match[2]);
var percent = Math.round((current / max) * 100);
if(max === 100) {
var xpBar = card.querySelector('.xp-bar-fill');
if(xpBar) xpBar.style.width = percent + '%';
} else {
var hpBar = card.querySelector('.life-bar-fill');
if(hpBar) hpBar.style.width = percent + '%';
}
}
});
});
}
function updateTrainerExp() {
var breakdown = document.getElementById('countBreakdown');
if(!breakdown) return;
var common = parseInt(breakdown.getAttribute('data-common')) || 0;
var uncommon = parseInt(breakdown.getAttribute('data-uncommon')) || 0;
var rare = parseInt(breakdown.getAttribute('data-rare')) || 0;
var elite = parseInt(breakdown.getAttribute('data-elite')) || 0;
var legendary = parseInt(breakdown.getAttribute('data-legendary')) || 0;
var totalExp = common * 10 + uncommon * 20 + rare * 35 + elite * 50 + legendary * 75;
var totalPokemon = common + uncommon + rare + elite + legendary;
var expPercent = Math.round((totalExp / 500) * 100);
var cntCommon = breakdown.querySelector('.cnt-common');
var cntUncommon = breakdown.querySelector('.cnt-uncommon');
var cntRare = breakdown.querySelector('.cnt-rare');
var cntElite = breakdown.querySelector('.cnt-elite');
var cntLegendary = breakdown.querySelector('.cnt-legendary');
if(cntCommon) cntCommon.textContent = common;
if(cntUncommon) cntUncommon.textContent = uncommon;
if(cntRare) cntRare.textContent = rare;
if(cntElite) cntElite.textContent = elite;
if(cntLegendary) cntLegendary.textContent = legendary;
var totalPokemonEl = document.getElementById('totalPokemon');
var totalExpEl = document.getElementById('totalExp');
var expLabel = document.getElementById('expLabel');
var expFill = document.getElementById('expFill');
if(totalPokemonEl) totalPokemonEl.textContent = totalPokemon;
if(totalExpEl) totalExpEl.textContent = totalExp;
if(expLabel) expLabel.textContent = totalExp + ' / 500';
if(expFill) expFill.style.width = expPercent + '%';
var titleEl = document.getElementById('trainerTitle');
if(titleEl) {
var titleName = '', titleClass = '';
if(totalExp >= 500) { titleName = 'Легендарный тренер'; titleClass = 'title-legend'; }
else if(totalExp >= 421) { titleName = 'Чемпион'; titleClass = 'title-champion'; }
else if(totalExp >= 321) { titleName = 'Мастер'; titleClass = 'title-master'; }
else if(totalExp >= 221) { titleName = 'Элитный тренер'; titleClass = 'title-elite'; }
else if(totalExp >= 131) { titleName = 'Эксперт'; titleClass = 'title-expert'; }
else if(totalExp >= 61) { titleName = 'Ловец'; titleClass = 'title-catcher'; }
else if(totalExp >= 1) { titleName = 'Начинающий'; titleClass = 'title-rookie'; }
else { titleName = 'Новичок'; titleClass = 'title-newbie'; }
titleEl.textContent = titleName;
titleEl.className = 'trainer-title ' + titleClass;
}
}
function init() {
updatePokemonBars();
updateTrainerExp();
}
if(document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init);
} else {
init();
}
})();
</script>[/html]
Поделиться62026-07-29 20:59:43
html-низ
<script>
// Только для зарегистрированных пользователей
if(document.querySelector('a[href*="member.php?action=logout"]') ||
document.querySelector('.welcome') ||
document.body.innerHTML.includes('logout')) {
var pokemons = [
// ===== ОБЫЧНЫЕ (weight 18-35, catchChance по HP: чем выше HP, тем сложнее) =====
{name: 'Кейтерпи', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/10.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/caterpie.gif', weight: 30, catchChance: 45}, // HP 45
{name: 'Видл', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/13.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/weedle.gif', weight: 30, catchChance: 46}, // HP 40
{name: 'Пиджи', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/16.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/pidgey.gif', weight: 35, catchChance: 46}, // HP 40
{name: 'Раттата', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/19.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/rattata.gif', weight: 35, catchChance: 50}, // HP 30
{name: 'Спироу', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/21.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/spearow.gif', weight: 30, catchChance: 46}, // HP 40
{name: 'Эканс', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/23.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/ekans.gif', weight: 25, catchChance: 47}, // HP 35
{name: 'Сэндшрю', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/27.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/sandshrew.gif', weight: 22, catchChance: 44}, // HP 50
{name: 'Нидоран♀', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/29.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/nidoran-f.gif', weight: 22, catchChance: 43}, // HP 55
{name: 'Нидоран♂', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/32.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/nidoran-m.gif', weight: 22, catchChance: 45}, // HP 46
{name: 'Вульпикс', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/37.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/vulpix.gif', weight: 20, catchChance: 47}, // HP 38
{name: 'Джигглипуфф', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/39.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/jigglypuff.gif', weight: 20, catchChance: 50}, // HP 115 — исключение
{name: 'Зубат', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/41.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/zubat.gif', weight: 35, catchChance: 46}, // HP 40
{name: 'Оддиш', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/43.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/oddish.gif', weight: 25, catchChance: 45}, // HP 45
{name: 'Парас', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/46.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/paras.gif', weight: 22, catchChance: 47}, // HP 35
{name: 'Венонат', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/48.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/venonat.gif', weight: 22, catchChance: 42}, // HP 60
{name: 'Диглетт', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/50.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/diglett.gif', weight: 22, catchChance: 50}, // HP 10
{name: 'Мяут', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/52.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/meowth.gif', weight: 20, catchChance: 46}, // HP 40
{name: 'Псидак', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/54.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/psyduck.gif', weight: 22, catchChance: 44}, // HP 50
{name: 'Манки', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/56.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/mankey.gif', weight: 22, catchChance: 46}, // HP 40
{name: 'Поливаг', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/60.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/poliwag.gif', weight: 25, catchChance: 46}, // HP 40
{name: 'Беллспраут', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/69.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/bellsprout.gif', weight: 25, catchChance: 44}, // HP 50
{name: 'Тентакул', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/72.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/tentacool.gif', weight: 25, catchChance: 46}, // HP 40
{name: 'Геодуд', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/74.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/geodude.gif', weight: 25, catchChance: 46}, // HP 40
{name: 'Слоупок', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/79.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/slowpoke.gif', weight: 20, catchChance: 38}, // HP 90
{name: 'Магнемайт', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/81.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/magnemite.gif', weight: 20, catchChance: 50}, // HP 25
{name: 'Додуо', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/84.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/doduo.gif', weight: 18, catchChance: 47}, // HP 35
{name: 'Сил', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/86.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/seel.gif', weight: 18, catchChance: 41}, // HP 65
{name: 'Граймер', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/88.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/grimer.gif', weight: 18, catchChance: 39}, // HP 80
{name: 'Шеллдер', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/90.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/shellder.gif', weight: 18, catchChance: 50}, // HP 30
{name: 'Дроузи', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/96.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/drowzee.gif', weight: 20, catchChance: 42}, // HP 60
{name: 'Крабби', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/98.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/krabby.gif', weight: 22, catchChance: 50}, // HP 30
{name: 'Волторб', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/100.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/voltorb.gif', weight: 18, catchChance: 46}, // HP 40
{name: 'Экзеггют', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/102.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/exeggcute.gif', weight: 12, catchChance: 42}, // HP 60
{name: 'Кьюбон', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/104.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/cubone.gif', weight: 12, catchChance: 44}, // HP 50
{name: 'Коффинг', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/109.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/koffing.gif', weight: 18, catchChance: 46}, // HP 40
{name: 'Хорси', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/116.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/horsea.gif', weight: 20, catchChance: 50}, // HP 30
{name: 'Голдин', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/118.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/goldeen.gif', weight: 20, catchChance: 45}, // HP 45
{name: 'Старью', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/120.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/staryu.gif', weight: 18, catchChance: 50}, // HP 30
{name: 'Маджикарп', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/129.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/magikarp.gif', weight: 35, catchChance: 50}, // HP 20
// ===== НЕОБЫЧНЫЕ (weight 8-18, catchChance по HP) =====
{name: 'Бульбазавр', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/1.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/bulbasaur.gif', weight: 15, catchChance: 45}, // HP 45
{name: 'Чармандер', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/4.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/charmander.gif', weight: 15, catchChance: 47}, // HP 39
{name: 'Сквиртл', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/7.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/squirtle.gif', weight: 15, catchChance: 45}, // HP 44
{name: 'Пикачу', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/25.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/pikachu.gif', weight: 15, catchChance: 47}, // HP 35
{name: 'Клефейри', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/35.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/clefairy.gif', weight: 12, catchChance: 39}, // HP 70
{name: 'Гроулит', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/58.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/growlithe.gif', weight: 15, catchChance: 43}, // HP 55
{name: 'Абра', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/63.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/abra.gif', weight: 10, catchChance: 50}, // HP 25
{name: 'Мачоп', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/66.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/machop.gif', weight: 18, catchChance: 39}, // HP 70
{name: 'Понита', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/77.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/ponyta.gif', weight: 15, catchChance: 44}, // HP 50
{name: 'Гастли', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/92.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/gastly.gif', weight: 12, catchChance: 50}, // HP 30
{name: 'Оникс', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/95.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/onix.gif', weight: 8, catchChance: 47}, // HP 35
{name: 'Ликитунг', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/108.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/lickitung.gif', weight: 8, catchChance: 38}, // HP 90
{name: 'Тангела', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/114.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/tangela.gif', weight: 12, catchChance: 41}, // HP 65
{name: 'Мистер Майм', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/122.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/mr-mime.gif', weight: 6, catchChance: 46}, // HP 40
{name: 'Иви', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/133.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/eevee.gif', weight: 12, catchChance: 43}, // HP 55
{name: 'Оманайт', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/138.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/omanyte.gif', weight: 8, catchChance: 47}, // HP 35
{name: 'Кабуто', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/140.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/kabuto.gif', weight: 8, catchChance: 50}, // HP 30
// ===== РЕДКИЕ (weight 5-12, catchChance по HP) =====
{name: 'Фарфетчд', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/83.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/farfetchd.gif', weight: 8, catchChance: 43}, // HP 52
{name: 'Хитмонли', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/106.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/hitmonlee.gif', weight: 6, catchChance: 44}, // HP 50
{name: 'Хитмончан', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/107.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/hitmonchan.gif', weight: 6, catchChance: 44}, // HP 50
{name: 'Райхорн', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/111.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/rhyhorn.gif', weight: 12, catchChance: 39}, // HP 80
{name: 'Ченси', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/113.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/chansey.gif', weight: 5, catchChance: 30}, // HP 250
{name: 'Скайтер', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/123.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/scyther.gif', weight: 6, catchChance: 39}, // HP 70
{name: 'Джинкс', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/124.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/jynx.gif', weight: 6, catchChance: 41}, // HP 65
{name: 'Электабазз', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/125.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/electabuzz.gif', weight: 6, catchChance: 41}, // HP 65
{name: 'Магмар', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/126.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/magmar.gif', weight: 6, catchChance: 41}, // HP 65
{name: 'Пинсир', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/127.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/pinsir.gif', weight: 6, catchChance: 41}, // HP 65
{name: 'Таурос', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/128.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/tauros.gif', weight: 6, catchChance: 38}, // HP 75
{name: 'Дитто', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/132.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/ditto.gif', weight: 10, catchChance: 44}, // HP 48
{name: 'Поригон', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/137.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/porygon.gif', weight: 5, catchChance: 41}, // HP 65
{name: 'Дратини', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/147.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/dratini.gif', weight: 3, catchChance: 46}, // HP 41
// ===== ЭЛИТНЫЕ (weight 3-5, catchChance по HP) =====
{name: 'Кангасхан', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/115.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/kangaskhan.gif', weight: 5, catchChance: 32}, // HP 105
{name: 'Аэродактиль', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/142.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/aerodactyl.gif', weight: 5, catchChance: 39}, // HP 80
{name: 'Снорлакс', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/143.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/snorlax.gif', weight: 5, catchChance: 30}, // HP 160
// ===== ЛЕГЕНДАРНЫЕ (weight 1, catchChance по HP) =====
{name: 'Артикуно', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/144.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/articuno.gif', weight: 1, catchChance: 38}, // HP 90
{name: 'Запдос', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/145.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/zapdos.gif', weight: 1, catchChance: 38}, // HP 90
{name: 'Молтрес', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/146.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/moltres.gif', weight: 1, catchChance: 38}, // HP 90
{name: 'Мьюту', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/150.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/mewtwo.gif', weight: 1, catchChance: 35}, // HP 106
{name: 'Мью', image: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/151.png', bbImage: 'https://img.pokemondb.net/sprites/black-white/anim/normal/mew.gif', weight: 1, catchChance: 36} // HP 100
];
var spawnChance = 20;
var caughtPokemon = null;
// Проверяем localStorage
if(localStorage.getItem('pokemonDisabled') === 'true') {
document.getElementById('disablePokemon').checked = true;
} else {
if(Math.random() * 100 < spawnChance) {
selectAndShowPokemon();
}
}
}
function selectAndShowPokemon() {
var totalWeight = 0;
for(var i = 0; i < pokemons.length; i++) {
totalWeight += pokemons[i].weight;
}
var rand = Math.random() * totalWeight;
var currentWeight = 0;
var selected = null;
for(var i = 0; i < pokemons.length; i++) {
currentWeight += pokemons[i].weight;
if(rand <= currentWeight) {
selected = pokemons[i];
break;
}
}
if(selected) {
showPokemonModal(selected);
}
}
function showPokemonModal(pokemon) {
caughtPokemon = null;
document.getElementById('pokemonImage').src = pokemon.image;
document.getElementById('pokemonImage').style.display = 'inline-block';
document.getElementById('pokemonName').innerText = pokemon.name;
document.getElementById('catchResult').innerHTML = '';
document.getElementById('catchButton').style.display = 'inline-block';
document.getElementById('closeButton').style.display = 'none';
document.getElementById('successButton').style.display = 'none';
document.getElementById('pokemonModal').style.display = 'block';
// Крестик закрытия
document.getElementById('modalCloseX').onclick = function() {
document.getElementById('pokemonModal').style.display = 'none';
};
document.getElementById('catchButton').onclick = function() {
var roll = Math.floor(Math.random() * 100) + 1;
if(roll <= pokemon.catchChance) {
caughtPokemon = pokemon;
document.getElementById('catchResult').innerHTML = 'Ура, ' + pokemon.name + ' пойман!';
document.getElementById('catchButton').style.display = 'none';
document.getElementById('closeButton').style.display = 'none';
document.getElementById('successButton').style.display = 'inline-block';
} else {
caughtPokemon = null;
document.getElementById('catchResult').innerHTML = 'Эх, ' + pokemon.name + ' сбежал...';
document.getElementById('pokemonImage').style.display = 'none';
document.getElementById('catchButton').style.display = 'none';
document.getElementById('successButton').style.display = 'none';
document.getElementById('closeButton').style.display = 'inline-block';
}
};
document.getElementById('closeButton').onclick = function() {
document.getElementById('pokemonModal').style.display = 'none';
};
document.getElementById('successButton').onclick = function() {
if(caughtPokemon) {
copyBBCode(caughtPokemon);
}
document.getElementById('pokemonModal').style.display = 'none';
};
}
function copyBBCode(pokemon) {
var closeTag = '[' + '/html]';
var bbcode = '[html]<div style="box-sizing:border-box;max-width:420px;margin:10px auto;background:#e3e2de;border:1px solid #aeafa8;border-radius:8px;padding:15px;font-family:\'Book Antiqua\',serif;text-align:center;">';
bbcode += '<div style="font-weight:700;color:#676a52;text-transform:uppercase;font-size:12px;letter-spacing:1px;margin-bottom:8px;">Покемон пойман</div>';
bbcode += '<img src="' + pokemon.bbImage + '" style="width:56px;height:56px;image-rendering:auto;object-fit:contain;background:#cfcfca;border-radius:8px;padding:6px;border:1px solid #aeafa8;">';
bbcode += '<br><div style="font-weight:700;font-size:16px;margin-top:6px;color:#39423c;">Мной пойман ' + pokemon.name.toUpperCase() + '!</div>';
bbcode += '</div>' + closeTag;
if(navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(bbcode).then(function() {
showCopyNotification('BB-код скопирован в буфер обмена!');
}).catch(function() {
fallbackCopy(bbcode);
});
} else {
fallbackCopy(bbcode);
}
}
function fallbackCopy(text) {
var textarea = document.createElement('textarea');
textarea.value = text;
textarea.style.position = 'fixed';
textarea.style.top = '-9999px';
textarea.style.left = '-9999px';
document.body.appendChild(textarea);
textarea.focus();
textarea.select();
try {
document.execCommand('copy');
showCopyNotification('BB-код скопирован в буфер обмена!');
} catch(e) {
showCopyNotification('Не удалось скопировать код.');
console.log('BB-код:\n' + text);
}
document.body.removeChild(textarea);
}
function showCopyNotification(message) {
var notif = document.createElement('div');
notif.innerText = message;
notif.style.cssText = 'position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:#4CAF50;color:white;padding:12px 25px;border-radius:25px;font-weight:bold;z-index:99999;box-shadow:0 3px 10px rgba(0,0,0,0.3);font-family:Arial,sans-serif;font-size:14px;';
document.body.appendChild(notif);
setTimeout(function() {
notif.style.opacity = '0';
notif.style.transition = 'opacity 0.5s';
setTimeout(function() {
if(notif.parentNode) document.body.removeChild(notif);
}, 500);
}, 2000);
}
function togglePokemonMenu() {
var panel = document.getElementById('pokemonMenuPanel');
panel.style.display = (panel.style.display === 'block') ? 'none' : 'block';
}
function togglePokemonDisabled(disabled) {
localStorage.setItem('pokemonDisabled', disabled);
}
</script>Поделиться72026-07-29 23:03:43
Весь хтмл-низ из теста
${bgUrl}`);
}
}
// Иконка
const iconUrl = document.getElementById('hvFr-icon-custom')?.value;
if (iconUrl) {
const iconPrice = isStandardIcon(iconUrl) ? prices.icon_standard : prices.icon_custom;
total += iconPrice;
smetaParts.push(`Иконка: ${iconPrice}`);
codeParts.push(`Иконка:\n
${iconUrl}`);
}
// ЛЗ - добавляем только если выбран режим "Сменить ЛЗ"
if (lzAction === 'change') {
const lzHtml = document.getElementById('hvFr-lz-html').value;
if (lzHtml && lzHtml !== originalProfileData.lzHtml) {
codeParts.push(`Личное звание:\n
${lzHtml}`);
}
}
let result = '----------------------------------------------------- СМЕТА -----------------------------------------------------\n';
if (smetaParts.length > 0) {
result += smetaParts.join('\n') + '\n';
}
result += `Итого: ${total}\n\n`;
if (codeParts.length > 0) {
result += '----------------------------------------------------- КОДЫ -----------------------------------------------------\n';
result += codeParts.join('\n\n');
}
window.insert(result);
}
});
// Обработчик изменения радиокнопок ЛЗ
wrapper.addEventListener('change', event => {
if (event.target.name === 'lz-action') {
lzAction = event.target.value;
console.log('LZ action changed to:', lzAction);
}
});
// Обработчик ввода в поля
wrapper.addEventListener('input', event => {
if (event.target.id === 'hvFr-background-custom') {
document.querySelectorAll('.hvFittingRoom-option[data-type="background"]').forEach(opt => {
opt.classList.remove('selected');
});
updateBackground(event.target.value);
}
if (event.target.id === 'hvFr-icon-custom') {
document.querySelectorAll('.hvFittingRoom-option[data-type="icon"]').forEach(opt => {
opt.classList.remove('selected');
});
updateIcon(event.target.value);
}
});
}
// ВЫЗОВ ФУНКЦИИ - ЗАМЕНИТЕ topicId НА НОМЕР ВАШЕЙ ТЕМЫ!
hvFittingRoomV2({
topicId: 18, // ← ИЗМЕНИТЕ ЭТО ЧИСЛО!
// Ваши анимированные фоны
animatedBackgrounds: [
{ name: 'Фон 1', url: 'https://upforme.ru/uploads/0004/e7/0d/2/854454.gif' },
{ name: 'Фон 2', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/469746.gif' },
{ name: 'Фон 3', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/276006.gif' },
{ name: 'Фон 4', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/242831.gif' },
{ name: 'Фон 5', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/440057.gif' },
{ name: 'Фон 6', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/422465.gif' },
{ name: 'Фон 7', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/967213.gif' },
{ name: 'Фон 8', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/369630.gif' },
{ name: 'Фон 9', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/670495.gif' },
{ name: 'Фон 10', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/690205.gif' },
{ name: 'Фон 11', url: 'https://upforme.ru/uploads/0004/e7/0d/1569/549872.gif' },
{ name: 'Фон 12', url: 'https://upforme.ru/uploads/0004/e7/0d/1569/602662.gif' },
{ name: 'Фон 13', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/342398.gif' },
{ name: 'Фон 14', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/515811.gif' },
{ name: 'Фон 15', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/671907.gif' },
{ name: 'Фон 16', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/208766.gif' }
],
// Ваши статичные фоны
staticBackgrounds: [
{ name: '1.1', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/225949.webp' },
{ name: '1.2', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/557043.webp' },
{ name: '1.3', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/234940.webp' },
{ name: '1.4', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/836934.webp' },
{ name: '1.5', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/429096.webp' },
{ name: '1.6', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/832066.webp' },
{ name: '1.7', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/816169.webp' },
{ name: '1.8', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/851873.webp' },
{ name: '1.9', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/891930.webp' },
{ name: '1.10', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/995644.webp' },
{ name: '2.1', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/962671.webp' },
{ name: '2.2', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/368944.webp' },
{ name: '2.3', url: 'https://forumstatic.ru/files/0004/e7/0d/56293.webp' },
{ name: '2.4', url: 'https://forumstatic.ru/files/0004/e7/0d/67632.webp' },
{ name: '2.5', url: 'https://forumstatic.ru/files/0004/e7/0d/29705.webp' },
{ name: '2.6', url: 'https://forumstatic.ru/files/0004/e7/0d/32948.webp' },
{ name: '2.7', url: 'https://forumstatic.ru/files/0004/e7/0d/59320.webp' },
{ name: '2.8', url: 'https://forumstatic.ru/files/0004/e7/0d/21480.webp' },
{ name: '2.9', url: 'https://forumstatic.ru/files/0004/e7/0d/99564.webp' },
{ name: '2.10', url: 'https://forumstatic.ru/files/0004/e7/0d/78207.webp' },
{ name: '2.11', url: 'https://forumstatic.ru/files/0004/e7/0d/37292.webp' },
{ name: '2.12', url: 'https://upforme.ru/uploads/0004/e7/0d/3943/204554.webp' },
{ name: '2.13', url: 'https://forumstatic.ru/files/0004/e7/0d/37462.webp' }
],
// Ваши иконки
icons: [
{ name: 'Чудо в детской', url: 'https://forumstatic.ru/files/0004/e7/0d/34542.svg' },
{ name: 'Туннельщик', url: 'https://forumstatic.ru/files/0004/e7/0d/53957.svg' },
{ name: 'Прирожденный рыболов (вар 1)', url: 'https://forumstatic.ru/files/0004/e7/0d/18933.svg' },
{ name: 'Прирожденный рыболов (вар 2)', url: 'https://forumstatic.ru/files/0004/e7/0d/15765.svg' },
{ name: 'Прирожденный охотник', url: 'https://forumstatic.ru/files/0004/e7/0d/69517.svg' },
{ name: 'Лайкер', url: 'https://forumstatic.ru/files/0004/e7/0d/45746.svg' },
{ name: 'Обаятельная кошка', url: 'https://forumstatic.ru/files/0004/e7/0d/11695.svg' },
{ name: 'Мастер романтических отыгрышей', url: 'https://forumstatic.ru/files/0004/e7/0d/31901.svg' },
{ name: 'Защитник племени', url: 'https://forumstatic.ru/files/0004/e7/0d/48536.svg' },
{ name: 'Елена Троянская', url: 'https://forumstatic.ru/files/0004/e7/0d/98262.svg' },
{ name: 'Дон Жуан', url: 'https://forumstatic.ru/files/0004/e7/0d/96403.svg' },
{ name: 'Прирожденный охотник (вар 2)', url: 'https://forumstatic.ru/files/0004/e7/0d/50323.svg' }
],
prices: {
background_animated: 500,
background_static: 300,
background_custom_static: 400,
background_custom_animated: 500,
icon_standard: 200,
icon_custom: 400,
lz: 0
}
});
</script>
<!-- Контейнер кнопок (отдельно от структуры форума) -->
<div id="header-controls-wrapper">
<div class="header-dot" data-index="random" title="Случайная"></div>
<div class="header-dot" data-index="0"></div>
<div class="header-dot" data-index="1"></div>
<div class="header-dot" data-index="2"></div>
<div class="header-dot" data-index="3"></div>
<div class="header-dot" data-index="4"></div>
<div class="header-dot" data-index="5"></div>
</div>
<style>
#header-controls-wrapper {
position: absolute; /* Кнопки летают над форумом */
display: none; /* По умолчанию скрыты */
gap: 8px;
z-index: 9999;
padding: 5px;
pointer-events: auto;
}
.header-dot {
width: 10px;
height: 10px;
background-color: #fff;
border-radius: 50%;
cursor: pointer;
border: 1px solid rgba(0,0,0,0.5);
box-shadow: 0 0 2px rgba(0,0,0,0.3);
transition: transform 0.2s;
}
.header-dot.active {
background-color: #333;
box-shadow: 0 0 0 2px #fff;
transform: scale(1.2);
}
</style>
<script>
(function() {
const images = [
"https://forumstatic.ru/files/0004/e7/0d/35713.webp",
"https://forumstatic.ru/files/0004/e7/0d/75243.webp",
"https://forumstatic.ru/files/0004/e7/0d/12000.webp",
"https://upforme.ru/uploads/001c/34/47/2/103647.webp",
"https://upforme.ru/uploads/001c/34/47/2/807220.webp",
"https://forumstatic.ru/files/0004/e7/0d/24290.webp"
];
const controls = document.getElementById('header-controls-wrapper');
// Функция точного позиционирования кнопок поверх шапки
function positionControls() {
const header = document.querySelector('.header-box');
if (header && controls && controls.style.display !== 'none') {
const rect = header.getBoundingClientRect();
// Вычисляем позицию относительно документа (учитываем прокрутку)
controls.style.top = (rect.top + window.scrollY + -50) + 'px';
controls.style.left = (rect.left + window.scrollX + -10) + 'px';
}
}
function updateHeader() {
const header = document.querySelector('.header-box');
const isDark = document.body.classList.contains("dark") || document.body.classList.contains("evening");
if (isDark || !header) {
if (controls) controls.style.display = 'none';
if (header) header.style.backgroundImage = '';
return;
}
controls.style.display = 'flex';
positionControls();
const saved = localStorage.getItem('selectedHeader') || 'random';
let idx;
if (saved === 'random') {
if (!window.hdrRnd) window.hdrRnd = Math.floor(Math.random() * images.length);
idx = window.hdrRnd;
} else {
idx = parseInt(saved);
}
header.style.backgroundImage = "url('" + images[idx] + "')";
header.style.backgroundSize = "cover";
header.style.backgroundPosition = "center";
document.querySelectorAll('.header-dot').forEach(dot => {
dot.classList.toggle('active', dot.getAttribute('data-index') === saved);
});
}
// Следим за темами
new MutationObserver(updateHeader).observe(document.body, { attributes: true, attributeFilter: ['class'] });
// Перерисовываем позицию при скролле и ресайзе, чтобы кнопки не отставали
window.addEventListener('scroll', positionControls, {passive: true});
window.addEventListener('resize', positionControls);
document.addEventListener('click', function(e) {
if (e.target.classList.contains('header-dot')) {
localStorage.setItem('selectedHeader', e.target.getAttribute('data-index'));
if (e.target.getAttribute('data-index') === 'random') window.hdrRnd = null;
updateHeader();
}
});
window.addEventListener("load", updateHeader);
// Дополнительный вызов для быстрой отрисовки
setTimeout(updateHeader, 500);
})();
</script>
<script src="https://forumstatic.ru/files/001c/34/47/43054.js"></script>
<script>
// ===== НАСТРОЙКИ =====
var allowedUsers = [2]; // ID пользователей
var spawnChance = 99; // Шанс появления окна (%)
// ===== ОПРЕДЕЛЯЕМ ID ПОЛЬЗОВАТЕЛЯ =====
var currentUserId = null;
var profileLink = document.querySelector('a[href*="profile.php?id="]');
if(profileLink) {
var uidMatch = profileLink.href.match(/id=(\d+)/);
if(uidMatch) currentUserId = parseInt(uidMatch[1]);
}
if(!currentUserId) {
var memberLink = document.querySelector('a[href*="member.php?action=profile"]');
if(memberLink) {
var mUidMatch = memberLink.href.match(/uid=(\d+)/);
if(mUidMatch) currentUserId = parseInt(mUidMatch[1]);
}
}
// ===== СИНХРОНИЗАЦИЯ ГАЛОЧКИ С localStorage =====
if(localStorage.getItem('pokemonDisabled') === 'true') {
var disableCheckbox = document.getElementById('disablePokemon');
if(disableCheckbox) {
disableCheckbox.checked = true;
}
}
// ===== ЗАПУСК =====
if(currentUserId && allowedUsers.indexOf(currentUserId) !== -1) {
if(localStorage.getItem('pokemonDisabled') !== 'true') {
if(Math.random() * 100 < spawnChance) {
selectAndShowPokemon();
}
}
}
</script>
Поделиться82026-07-29 23:05:38
Весь хтмл-верх теста
<!-- Модальное окно с покемоном -->
<div id="pokemonModal" class="pokemon-modal" style="display:none;">
<div class="pokemon-modal-content">
<span id="modalCloseX" class="pokemon-close-x">×</span>
<div class="pokemon-header">Дикий покемон появился!</div>
<div class="pokemon-body">
<img id="pokemonImage" src="" alt="Pokemon">
<p id="pokemonName"></p>
<button id="catchButton" class="pokemon-btn-catch">Попытаться поймать</button>
<p id="catchResult"></p>
<button id="closeButton" class="pokemon-btn-close" style="display:none;">ОК</button>
<button id="successButton" class="pokemon-btn-success" style="display:none;">Отлично</button>
</div>
</div>
</div>
<!-- Меню управления покемонами (кнопка-шестерёнка вверху справа) -->
<button class="pokemon-menu-btn" onclick="togglePokemonMenu()" title="Настройки покемонов">⚙</button>
<div id="pokemonMenuPanel" class="pokemon-menu-panel">
<label>
<input type="checkbox" id="disablePokemon" onchange="togglePokemonDisabled(this.checked)">
Отключить появление покемонов
</label>
</div>
<!-- Аватар для гостя и по умолчанию, в статусе и уведомления / Переменные -->
<script>
var defaultAvatar = 'https://forumstatic.ru/files/000f/b5/b9/64978.webp';
var guestAvatar = 'https://forumstatic.ru/files/000f/b5/b9/64978.webp';
</script>
<script>
(function () {
const avatarUrl = (GroupID == '3' || UserAvatar === '') ? defaultAvatar : UserAvatar;
const user = document.createElement('div');
user.id = 'user';
user.innerHTML = `
<div class="ava-block">
<div class="ava" id="notify-link" data-number-unread="0"
style="filter: grayscale(0.5); background-image: url('${avatarUrl}');">
<a href="javascript://"></a>
<em></em>
</div>
</div>
`;
user.classList.add('visible');
const waitForTarget = setInterval(() => {
const container = document.querySelector('#pun-status .container');
if (container) {
clearInterval(waitForTarget);
container.prepend(user);
user.style.display = '';
}
}, 10);
})();
</script>
<!--// Быстроплюсы v.2 РЕНО by Deff //-->
<script type="text/javascript" src="https://forumstatic.ru/files/0012/d8/04/58219.js" addcomment="1"></script>
<!--Скрытие профиля в теме тегом-->
<style type="text/css">.hideprofile .post-author,.hideprofile .pl-email,.hideprofile .pl-website{display:none!important}
.hideprofile .post-body{grid-column: 1 / -1; }.hideprofile .post-content {width: 100%} .hideprofile .post-links ul,.post.hideprofile h3>span{margin-left:0!important}</style>
<script>
FORUM.set('editor.addition.tags.hideprofile',{name:'Скрыть минипрофиль',onclick:function(){insert('[hideprofile]');}});
$().pun_mainReady(function(){$('.post:contains("[hideprofile]")').addClass('hideprofile').html(function(){return $(this).html().replace(/\[hideprofile\]/gim,'')})});
</script>
<!-- Инструмент для добавления bb-кодов -->
<script src="https://mybb.kozhilya.ru/script/mybbcode.min.js"></script>
<!-- END Инструмент для добавления bb-кодов -->
<script>
// ===== Обтекание изображения текстом =====
MyBBCode.addTag('float', elem => {
elem.css('float', elem.attr('alt'));
});
MyBBCode.addEditorButton('float', {
name: "Обтекание",
onclick: _ => changeVisibility('float-area'),
floats: {
"left": {
"icon": "https://forumstatic.ru/files/0015/dd/40/52315.png",
"text": "Выравнивание слева",
},
"right": {
"icon": "https://forumstatic.ru/files/0015/dd/40/32241.png",
"text": "Выравнивание справа",
},
}
}, 'link');
const floatContainer = $(`<div class="container" id="float-area" style="display:none" onclick="changeVisibility('float-area')"></div>`);
floatContainer.html(((floats) => {
let html = "";
for (const [dir, data] of Object.entries(floats)) {
html += `<img src="${data.icon}" alt="${data.text}" title="${data.text}" onclick="bbcode('[float=${dir}]', '[/float]')">`;
}
return html;
})(FORUM.editor.float.floats));
$(document).on('pun_main_ready', _ => $('form#post #tags').append(floatContainer));
});
});
</script>
<!-- стилизованные кнопки вверх/вниз © ForumD.ru, Gerda -->
<div class="scrollbuttons"><div class="go-up" id='ToTop'><i class="fa-solid fa-chevron-up"></i></div><div class="go-down" id='OnBottom'><i class="fa-solid fa-chevron-down"></i></div>
<script type="text/javascript">
$(function(){
if ($(window).scrollTop()>="200") $("#ToTop").addClass("show")
$(window).scroll(function(){
if ($(window).scrollTop()<="200") $("#ToTop").removeClass("show")
else $("#ToTop").addClass("show")
});
if ($(window).scrollTop()<=$(document).height()-"999") $("#OnBottom").addClass("show")
$(window).scroll(function(){
if ($(window).scrollTop()>=$(document).height()-"999") $("#OnBottom").removeClass("show")
else $("#OnBottom").addClass("show")
});
$("#ToTop").click(function(){$("html,body").animate({scrollTop:0},"slow")})
$("#OnBottom").click(function(){$("html,body").animate({scrollTop:$(document).height()},"slow")})
});
</script>
<!--выделить код. Alex_63 new.2019 -->
<script type="text/javascript" src="https://forumstatic.ru/files/0015/c4/3f/26102.js"></script>
<script>eval(select_text.toString().replace(/\}$/,'try{document.execCommand("copy")}catch(e){}}'))</script>
<script type="text/javascript">select_text.linkText = 'Скопировать [копируется сразу]' //текст ссылки</script>
<!-- конец -->
<!-- личная страничка -->
<script src="https://forumstatic.ru/files/0011/e9/e1/56920.js" type="text/javascript"></script>
<!-- конец -->
<!-- Смена стиля, (с) ForumD.ru, satsana -->
<style>
/* 1. Создаем невидимый каркас, который повторяет поведение вашего сайта */
.stylelist-wrapper {
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%); /* Центрируем обертку */
width: 100%;
max-width: 1200px; /* Установите здесь ширину вашего контента (например, 1000px или 1200px) */
pointer-events: none; /* Чтобы контейнер не мешал кликать по сайту */
z-index: 10000;
}
/* 2. Сами кнопки привязываем к краю этого каркаса */
#stylelist {
position: absolute;
top: 320px;
right: -50px; /* Смещение вправо от края контента. Если нужно внутри — поставьте 20px */
margin: 0;
padding: 0;
list-style-type: none;
display: flex !important;
flex-direction: column; /* В столбик для стабильности */
gap: 10px;
pointer-events: auto; /* Возвращаем кликабельность кнопкам */
}
#stylelist a {
display: block !important;
width: 30px;
height: 30px;
font-size: 0;
border-radius: 9px;
transition: transform 0.2s ease;
box-sizing: border-box;
}
#stylelist a:hover {
transform: scale(1.1);
}
/* Цвета кнопок */
#stylelist [data="day"] a { background-color: #314b40; border: 2px solid #d8d7dc; }
#stylelist [data="dark"] a { background-color: #25324b; border: 2px solid #b4b8ad; }
#stylelist [data="evening"] a { background-color: #4f3f48; border: 2px solid #698475; }
/* На мобильных устройствах прижимаем к краю экрана, чтобы не вылетали */
@media (max-width: 1300px) {
#stylelist {
right: 10px;
}
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function () {
var styleList = [
{ class: 'day', name: 'весна' },
{ class: 'evening', name: 'лето' },
{ class: 'dark', name: 'зима' }
];
function setStyle(styleClass) {
document.body.classList.remove('day', 'evening', 'dark');
document.body.classList.add(styleClass);
localStorage.setItem('selStyle', styleClass);
}
// Создаем контейнер-обертку и список
if (!document.getElementById('stylelist')) {
var wrapper = document.createElement('div');
wrapper.className = 'stylelist-wrapper';
var ul = document.createElement('ul');
ul.id = 'stylelist';
wrapper.appendChild(ul);
document.body.prepend(wrapper);
styleList.forEach(function(style) {
var li = document.createElement('li');
li.setAttribute('data', style.class);
var a = document.createElement('a');
a.href = "#";
a.addEventListener("click", function(e){
e.preventDefault();
setStyle(style.class);
});
li.appendChild(a);
ul.appendChild(li);
});
}
var savedStyle = localStorage.getItem('selStyle');
if (savedStyle) {
setStyle(savedStyle);
}
});
</script>
<!-- Смена стиля - END -->Поделиться92026-07-29 23:15:57
С Отголосков удалила пока
.news-plash {
display: flex;
overflow-x: auto;
/* Разрешаем элементам сжиматься, если их слишком много */
flex-wrap: nowrap;
}/* Центрируем элементы внутри флекс-контейнера */
.news-plash::before,
.news-plash::after {
content: "";
margin: auto;
}Поделиться102026-07-29 23:34:59
Работающий код на Отголосках
<script src="https://forumstatic.ru/files/001c/34/47/43054.js"></script>
<script>
// ===== НАСТРОЙКИ =====
var spawnChance = 30; // Шанс появления окна (%)
// ===== ЗАПУСК ДЛЯ ВСЕХ ЗАРЕГИСТРИРОВАННЫХ =====
if(document.querySelector('a[href*="member.php?action=logout"]') ||
document.querySelector('.welcome') ||
document.body.innerHTML.includes('logout')) {
if(localStorage.getItem('pokemonDisabled') !== 'true') {
if(Math.random() * 100 < spawnChance) {
function trySpawn() {
if(typeof selectAndShowPokemon === 'function') {
selectAndShowPokemon();
} else {
setTimeout(trySpawn, 200);
}
}
setTimeout(trySpawn, 300);
}
}
}
// ===== СИНХРОНИЗАЦИЯ ГАЛОЧКИ =====
if(localStorage.getItem('pokemonDisabled') === 'true') {
var disableCheckbox = document.getElementById('disablePokemon');
if(disableCheckbox) {
disableCheckbox.checked = true;
}
}
</script>