1
Тестовое сообщение
Сообщений 11 страница 20 из 28
Поделиться162025-10-23 19:03:15
1
2
Отредактировано Void (2025-10-23 19:03:19)
Поделиться192025-10-23 22:27:39
[html]<div id="warframe-mastery">
<!-- Способности и защита -->
<div class="abilities">
<div class="ability" data-tooltip="Огненный шар: Наносит урон огнем по области">Сп.1 <span class="ability-level">1</span></div>
<div class="ability" data-tooltip="Ледяная стена: Создает барьер из льда">Сп.2 <span class="ability-level">1</span></div>
<div class="ability" data-tooltip="Телепортация: Мгновенное перемещение">Сп.3 <span class="ability-level">3</span></div>
<div class="ability" data-tooltip="Исцеление: Восстанавливает здоровье">Сп.4 <span class="ability-level">1</span></div>
<div class="ability" data-tooltip="Невидимость: Делает персонажа невидимым">Сп.5 <span class="ability-level">1</span></div>
<div class="ability defense" data-tooltip="Защита: Рассчитывается автоматически на основе ранга и навыков">Защита <span id="defense-value">0</span></div>
</div>
<!-- Оружие -->
<div class="weapons">
<div class="weapon">Основное <span class="weapon-level">1</span></div>
<div class="weapon">Вторичное <span class="weapon-level">21</span></div>
<div class="weapon">Ближний бой <span class="weapon-level">1</span></div>
</div>
<!-- Прогресс бар -->
<div class="mastery-bar">
<div class="progress" style="width:3.3%"></div>
<div class="rank">Ранг 1</div>
</div>
</div>
<style>
#warframe-mastery {
background: #0a0a0a;
border: 1px solid #2a4c6e;
padding: 10px;
font-family: 'Roboto', sans-serif;
color: #b8c4ce;
max-width: 500px;
position: relative;
}
.abilities, .weapons {
display: flex;
gap: 5px;
margin-bottom: 10px;
justify-content: center;
}
.ability {
width: 60px;
height: 60px;
background: #1a2b3c;
border: 1px solid #2a4c6e;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
font-size: 10px;
cursor: help;
transition: all 0.3s;
position: relative;
}
.ability:hover {
border-color: #4a8cdf;
background: #2a3b4c;
}
.ability-level {
color: #4a8cdf;
font-weight: bold;
font-size: 14px;
margin-top: 2px;
}
.defense {
border-color: #df4a8c !important;
}
.defense span {
color: #df4a8c !important;
}
.weapon {
flex: 1;
background: #1a2b3c;
border: 1px solid #2a4c6e;
padding: 8px;
text-align: center;
font-size: 12px;
}
.weapon-level {
color: #4a8cdf;
font-weight: bold;
}
.mastery-bar {
background: #1a2b3c;
height: 20px;
border: 1px solid #2a4c6e;
position: relative;
margin-top: 5px;
}
.progress {
background: linear-gradient(90deg, #4a8cdf, #6ba6f0);
height: 100%;
transition: width 0.5s;
}
.rank {
position: absolute;
top: 0;
left: 0;
right: 0;
text-align: center;
font-weight: bold;
color: white;
line-height: 20px;
font-size: 12px;
text-shadow: 1px 1px 2px black;
}
/* Стили для всплывающих подсказок */
.ability::after {
content: attr(data-tooltip);
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
background: rgba(10, 10, 10, 0.98);
border: 1px solid #4a8cdf;
color: #b8c4ce;
padding: 8px 12px;
border-radius: 4px;
font-size: 12px;
white-space: normal;
width: 140px;
text-align: center;
opacity: 0;
visibility: hidden;
transition: all 0.3s;
z-index: 1000;
pointer-events: none;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.ability:hover::after {
opacity: 1;
visibility: visible;
bottom: 110%;
}
/* Для крайних элементов смещаем подсказки чтобы не выходили за границы */
.abilities .ability:nth-child(1)::after,
.abilities .ability:nth-child(2)::after {
left: 0;
transform: translateX(0);
}
.abilities .ability:nth-child(1):hover::after,
.abilities .ability:nth-child(2):hover::after {
left: 0;
transform: translateX(0);
}
.abilities .ability:nth-child(5)::after,
.abilities .ability:nth-child(6)::after {
left: auto;
right: 0;
transform: translateX(0);
}
.abilities .ability:nth-child(5):hover::after,
.abilities .ability:nth-child(6):hover::after {
left: auto;
right: 0;
transform: translateX(0);
}
</style>
<script>
// Обновление ранга при изменении уровней
function updateMastery() {
const weaponLevels = document.querySelectorAll('.weapon-level');
const abilityLevels = document.querySelectorAll('.ability-level');
let weaponSum = 0;
let abilitySum = 0;
// Суммируем уровни оружия
weaponLevels.forEach(weapon => {
weaponSum += parseInt(weapon.textContent) || 1;
});
// Суммируем уровни способностей
abilityLevels.forEach(ability => {
abilitySum += parseInt(ability.textContent) || 1;
});
// Формула: способности (1-15) + оружие (1-90) = всего (2-105)
// Преобразуем в ранг 1-30
const total = (abilitySum * 2) + weaponSum; // способности вес x2
const maxPossible = (5 * 3 * 2) + (3 * 30); // 30 + 90 = 120
const rank = Math.max(1, Math.min(30, Math.round(total / maxPossible * 29) + 1));
// Расчет защиты
const defense = ((rank * weaponSum) + ((abilitySum * 2) * 10)) / 100;
// Обновляем отображение
const progress = (rank / 30) * 100;
document.querySelector('.progress').style.width = progress + '%';
document.querySelector('.rank').textContent = `Ранг ${rank}`;
document.getElementById('defense-value').textContent = defense.toFixed(1);
}
// Для обновления уровней оружия
function setWeaponLevel(weaponIndex, level) {
const weapons = document.querySelectorAll('.weapon-level');
if (weapons[weaponIndex]) {
weapons[weaponIndex].textContent = Math.max(1, Math.min(30, level));
updateMastery();
}
}
// Для обновления уровней способностей
function setAbilityLevel(abilityIndex, level) {
const abilities = document.querySelectorAll('.ability-level');
if (abilities[abilityIndex]) {
abilities[abilityIndex].textContent = Math.max(1, Math.min(3, level));
updateMastery();
}
}
// Инициализация
updateMastery();
</script>[/html]
Поделиться202025-10-23 23:31:31
[html]<div id="resource-inventory">
<h4>Ресурсы</h4>
<div class="resources-grid">
<div class="resource">
<div class="resource-icon">⛰️</div>
<div class="resource-name">Нервы</div>
<div class="resource-count">1,245</div>
</div>
<div class="resource">
<div class="resource-icon">🔴</div>
<div class="resource-name">Рубидо</div>
<div class="resource-count">8,762</div>
</div>
<div class="resource">
<div class="resource-icon">🔵</div>
<div class="resource-name">Аура</div>
<div class="resource-count">3,421</div>
</div>
</div>
</div>
<style>
#resource-inventory {
background: #0a0a0a;
border: 1px solid #2a4c6e;
padding: 15px;
margin: 10px 0;
}
.resources-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
}
.resource {
text-align: center;
padding: 8px;
background: #1a2b3c;
border: 1px solid #2a4c6e;
}
.resource-icon {
font-size: 20px;
margin-bottom: 5px;
}
.resource-name {
font-size: 11px;
color: #b8c4ce;
}
.resource-count {
font-size: 12px;
color: #4a8cdf;
font-weight: bold;
}
</style>[/html]
