Whisper of the Void

Объявление

Whisper of the Void
Warframe
Your mind is the battlefield
Наша гордость
Текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста текст лучшего поста
С пробуждением, Герой!
Мир, что ты знал, превратился в Стальные Пустоши. Его плоть и металл поглотил Технофагис! Теперь тут правят ржавеющие – зомби, порожденные биотехногенной чумой: гибриды, кошмары инженера-извращенца (плоть + ржавый хлам + голод). Их скрежет – твой новый гимн. Хочешь выжить? Рви когтями, пали из всего, что стреляет, беги, если ноги целы! Или... Впутайся в адскую авантюру! Найди "Сердце Пустошей" – артефакт древних придурков, сотню лет назад устроивших апокалипсис. Может, оно перезапустит этот ад? Или порвёт весь мир в клочья, ко всем чертям собачьим?! Выбор за тобой, Герой... Слава, добыча или смерть? В Пустошах ставки очень высоки!
Повстанцы
Текст текст текст Текст текст текст Текст текст текстТекст текст текст Текст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текст
Аутсайдеры
Текст текст текст Текст текст текст Текст текст текстТекст текст текст Текст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текст
Скальдра
Текст текст текст Текст текст текст Текст текст текстТекст текст текст Текст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текстТекст текст текст
Заголовок новости
какой-то там очень чрезвычайно крайне важный текст новости
Заголовок новости
какой-то там очень чрезвычайно крайне важный текст новости
Заголовок новости
какой-то там очень чрезвычайно крайне важный текст новости

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.


Вы здесь » Whisper of the Void » Точка Сингулярности » Тестовое сообщение


Тестовое сообщение

Сообщений 21 страница 28 из 28

21

[html]<div id="warframe-trading">
    <!-- Заголовок -->
    <div class="trading-header">
        <div class="trading-title">🛒 РУЧНАЯ ТОРГОВАЯ СИСТЕМА</div>
        <div class="trading-balance">Платина: <span class="editable" contenteditable="true">1000</span> ♢</div>
    </div>

    <!-- Инструкция -->
    <div class="instruction-box">
        <div class="instruction-title">💡 КАК ИСПОЛЬЗОВАТЬ:</div>
        <div class="instruction-steps">
            <div>1. Редактируйте цифры прямо в ячейках</div>
            <div>2. Добавляйте/удаляйте строки таблицы</div>
            <div>3. Копируйте HTML код для сохранения</div>
        </div>
    </div>

    <!-- Торговая таблица -->
    <div class="trade-table-section">
        <div class="section-title">ТАБЛИЦА ТОРГОВЛИ</div>
       
        <div class="table-controls">
            <button class="control-btn add-row-btn" onclick="addTradeRow()">➕ Добавить строку</button>
            <button class="control-btn calculate-btn" onclick="calculateTradeTotal()">📊 Посчитать итог</button>
            <button class="control-btn clear-btn" onclick="clearTradeTable()">🗑️ Очистить таблицу</button>
        </div>

        <div class="trade-table-container">
            <table class="trade-table" id="trade-table">
                <thead>
                    <tr>
                        <th width="40">№</th>
                        <th width="200">Предмет</th>
                        <th width="100">Кол-во</th>
                        <th width="120">Цена за шт. (♢)</th>
                        <th width="120">Общая цена (♢)</th>
                        <th width="80">Действия</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="row-number">1</td>
                        <td><span class="editable" contenteditable="true">Нерв</span></td>
                        <td><span class="editable" contenteditable="true">5</span></td>
                        <td><span class="editable" contenteditable="true">2</span></td>
                        <td class="total-price">10</td>
                        <td class="actions">
                            <button class="action-btn delete-btn" onclick="deleteRow(this)">🗑️</button>
                            <button class="action-btn calc-btn" onclick="calculateRow(this)">🔢</button>
                        </td>
                    </tr>
                    <tr>
                        <td class="row-number">2</td>
                        <td><span class="editable" contenteditable="true">Разрыв</span></td>
                        <td><span class="editable" contenteditable="true">1</span></td>
                        <td><span class="editable" contenteditable="true">45</span></td>
                        <td class="total-price">45</td>
                        <td class="actions">
                            <button class="action-btn delete-btn" onclick="deleteRow(this)">🗑️</button>
                            <button class="action-btn calc-btn" onclick="calculateRow(this)">🔢</button>
                        </td>
                    </tr>
                </tbody>
                <tfoot>
                    <tr class="total-row">
                        <td colspan="4" class="total-label">ОБЩАЯ СТОИМОСТЬ:</td>
                        <td class="grand-total" id="grand-total">55</td>
                        <td></td>
                    </tr>
                </tfoot>
            </table>
        </div>
    </div>

    <!-- История сделок -->
    <div class="history-section">
        <div class="section-title">ИСТОРИЯ СДЕЛОК</div>
        <div class="history-controls">
            <button class="control-btn" onclick="addHistoryEntry()">➕ Добавить запись</button>
            <button class="control-btn export-btn" onclick="exportTradeData()">💾 Экспорт данных</button>
        </div>
        <div class="history-table-container">
            <table class="history-table" id="history-table">
                <thead>
                    <tr>
                        <th width="100">Дата</th>
                        <th>Описание сделки</th>
                        <th width="100">Сумма (♢)</th>
                        <th width="80">Действия</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td><span class="editable" contenteditable="true">01.12.2023</span></td>
                        <td><span class="editable" contenteditable="true">Продал моды новичку</span></td>
                        <td><span class="editable" contenteditable="true">+55</span></td>
                        <td class="actions">
                            <button class="action-btn delete-btn" onclick="deleteHistoryRow(this)">🗑️</button>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <!-- Шаблоны предметов -->
    <div class="templates-section">
        <div class="section-title">ШАБЛОНЫ ПРЕДМЕТОВ</div>
        <div class="templates-grid">
            <div class="template-item" onclick="insertTemplate('Нерв', 2)">⛰️ Нерв (2♢)</div>
            <div class="template-item" onclick="insertTemplate('Рубидо', 2)">🔴 Рубидо (2♢)</div>
            <div class="template-item" onclick="insertTemplate('Аура', 3)">🔵 Аура (3♢)</div>
            <div class="template-item" onclick="insertTemplate('Разрыв', 45)">💥 Разрыв (45♢)</div>
            <div class="template-item" onclick="insertTemplate('Серьезный урон', 35)">⚔️ Серьезный урон (35♢)</div>
            <div class="template-item" onclick="insertTemplate('Скорость', 25)">⚡ Скорость (25♢)</div>
            <div class="template-item" onclick="insertTemplate('Нитайн', 25)">❄️ Нитайн (25♢)</div>
            <div class="template-item" onclick="insertTemplate('Аргоны', 40)">💠 Аргоны (40♢)</div>
        </div>
    </div>
</div>

<style>
/* Основные стили */
#warframe-trading {
    background: #141316;
    border: 2px solid #2a4c6e;
    border-radius: 8px;
    padding: 20px;
    font-family: 'Roboto', sans-serif;
    color: #b8c4ce;
    max-width: 1000px;
    margin: 20px auto;
    box-shadow: 0 0 30px rgba(74, 140, 223, 0.2);
}

/* Заголовок */
.trading-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2a4c6e;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.trading-title {
    font-size: 24px;
    font-weight: bold;
    color: #4a8cdf;
    text-shadow: 0 0 10px rgba(74, 140, 223, 0.5);
}

.trading-balance {
    font-size: 18px;
    color: #d4af37;
    font-weight: bold;
}

/* Инструкция */
.instruction-box {
    background: linear-gradient(135deg, #1a1a1d, #0a0a0c);
    border: 1px solid #2a4c6e;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.instruction-title {
    color: #4a8cdf;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 14px;
}

.instruction-steps {
    font-size: 12px;
    color: #8b9bb4;
}

.instruction-steps div {
    margin: 4px 0;
}

/* Секции */
.section-title {
    background: linear-gradient(90deg, #2a4c6e, #1a1a1d);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 15px;
    border-left: 3px solid #4a8cdf;
}

/* Кнопки управления */
.table-controls, .history-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.control-btn {
    background: linear-gradient(135deg, #2a4c6e, #1a1a1d);
    border: 1px solid #4a8cdf;
    color: #b8c4ce;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: linear-gradient(135deg, #4a8cdf, #2a4c6e);
    transform: translateY(-1px);
}

.calculate-btn {
    background: linear-gradient(135deg, #4a8cdf, #2a4c6e);
}

.clear-btn {
    background: linear-gradient(135deg, #df4a8c, #8c2a4a);
}

.export-btn {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
}

/* Таблицы */
.trade-table-container, .history-table-container {
    background: #1a1a1d;
    border: 1px solid #2a4c6e;
    border-radius: 6px;
    overflow: hidden;
}

.trade-table, .history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.trade-table th, .history-table th {
    background: linear-gradient(135deg, #2a4c6e, #1a1a1d);
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #2a4c6e;
    color: #4a8cdf;
    font-weight: bold;
}

.trade-table td, .history-table td {
    padding: 8px;
    border-bottom: 1px solid #2a4c6e;
    vertical-align: middle;
}

.trade-table tbody tr:hover, .history-table tbody tr:hover {
    background: rgba(74, 140, 223, 0.1);
}

/* Редактируемые ячейки */
.editable {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 3px;
    border: 1px dashed transparent;
    min-width: 40px;
    display: inline-block;
    transition: all 0.3s ease;
}

.editable:focus {
    outline: none;
    border-color: #4a8cdf;
    background: rgba(74, 140, 223, 0.2);
}

/* Цены и итоги */
.total-price, .grand-total {
    color: #d4af37;
    font-weight: bold;
    font-size: 13px;
}

.total-row {
    background: rgba(212, 175, 55, 0.1) !important;
}

.total-label {
    color: #d4af37;
    font-weight: bold;
    text-align: right;
    padding-right: 20px !important;
}

.grand-total {
    font-size: 16px;
    color: #d4af37;
}

/* Кнопки действий */
.actions {
    text-align: center;
}

.action-btn {
    background: none;
    border: 1px solid #2a4c6e;
    color: #b8c4ce;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    margin: 0 2px;
    transition: all 0.3s ease;
}

.action-btn:hover {
    transform: scale(1.1);
}

.delete-btn:hover {
    border-color: #df4a8c;
    color: #df4a8c;
}

.calc-btn:hover {
    border-color: #4a8cdf;
    color: #4a8cdf;
}

/* Шаблоны предметов */
.templates-section {
    margin-top: 20px;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.template-item {
    background: #1a1a1d;
    border: 1px solid #2a4c6e;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.template-item:hover {
    border-color: #4a8cdf;
    background: rgba(74, 140, 223, 0.2);
    transform: translateY(-1px);
}

/* Номера строк */
.row-number {
    color: #8b9bb4;
    font-size: 11px;
    text-align: center;
}

/* Адаптивность */
@media (max-width: 768px) {
    .trading-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
   
    .table-controls, .history-controls {
        flex-direction: column;
    }
   
    .trade-table-container {
        overflow-x: auto;
    }
   
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
</style>

<script>
// Добавление новой строки в таблицу торговли
function addTradeRow() {
    const table = document.getElementById('trade-table').getElementsByTagName('tbody')[0];
    const rowCount = table.rows.length + 1;
   
    const newRow = table.insertRow();
    newRow.innerHTML = `
        <td class="row-number">${rowCount}</td>
        <td><span class="editable" contenteditable="true">Новый предмет</span></td>
        <td><span class="editable" contenteditable="true">1</span></td>
        <td><span class="editable" contenteditable="true">0</span></td>
        <td class="total-price">0</td>
        <td class="actions">
            <button class="action-btn delete-btn" onclick="deleteRow(this)">🗑️</button>
            <button class="action-btn calc-btn" onclick="calculateRow(this)">🔢</button>
        </td>
    `;
   
    updateRowNumbers();
}

// Удаление строки из таблицы торговли
function deleteRow(button) {
    const row = button.closest('tr');
    row.remove();
    updateRowNumbers();
    calculateTradeTotal();
}

// Удаление строки из истории
function deleteHistoryRow(button) {
    const row = button.closest('tr');
    row.remove();
}

// Расчет одной строки
function calculateRow(button) {
    const row = button.closest('tr');
    const cells = row.getElementsByTagName('td');
   
    const quantity = parseInt(cells[2].textContent) || 0;
    const price = parseInt(cells[3].textContent) || 0;
    const total = quantity * price;
   
    cells[4].textContent = total;
    calculateTradeTotal();
}

// Расчет общей стоимости
function calculateTradeTotal() {
    const totalCells = document.querySelectorAll('.total-price');
    let grandTotal = 0;
   
    totalCells.forEach(cell => {
        grandTotal += parseInt(cell.textContent) || 0;
    });
   
    document.getElementById('grand-total').textContent = grandTotal;
}

// Обновление номеров строк
function updateRowNumbers() {
    const rows = document.querySelectorAll('.trade-table tbody tr');
    rows.forEach((row, index) => {
        row.querySelector('.row-number').textContent = index + 1;
    });
}

// Очистка таблицы
function clearTradeTable() {
    if (confirm('Очистить всю таблицу торговли?')) {
        const table = document.getElementById('trade-table').getElementsByTagName('tbody')[0];
        table.innerHTML = '';
        addTradeRow(); // Добавляем одну пустую строку
        calculateTradeTotal();
    }
}

// Добавление записи в историю
function addHistoryEntry() {
    const table = document.getElementById('history-table').getElementsByTagName('tbody')[0];
    const now = new Date();
    const dateStr = `${now.getDate().toString().padStart(2, '0')}.${(now.getMonth()+1).toString().padStart(2, '0')}.${now.getFullYear()}`;
   
    const newRow = table.insertRow();
    newRow.innerHTML = `
        <td><span class="editable" contenteditable="true">${dateStr}</span></td>
        <td><span class="editable" contenteditable="true">Новая сделка</span></td>
        <td><span class="editable" contenteditable="true">+0</span></td>
        <td class="actions">
            <button class="action-btn delete-btn" onclick="deleteHistoryRow(this)">🗑️</button>
        </td>
    `;
}

// Вставка шаблона предмета
function insertTemplate(name, price) {
    addTradeRow();
    const table = document.getElementById('trade-table').getElementsByTagName('tbody')[0];
    const lastRow = table.rows[table.rows.length - 1];
   
    lastRow.cells[1].querySelector('.editable').textContent = name;
    lastRow.cells[3].querySelector('.editable').textContent = price;
    calculateRow(lastRow.cells[5].querySelector('.calc-btn'));
}

// Экспорт данных (имитация)
function exportTradeData() {
    const tradeData = {
        balance: document.querySelector('.trading-balance .editable').textContent,
        trades: [],
        history: []
    };
   
    // Собираем данные торгов
    const tradeRows = document.querySelectorAll('.trade-table tbody tr');
    tradeRows.forEach(row => {
        const cells = row.cells;
        tradeData.trades.push({
            item: cells[1].textContent,
            quantity: cells[2].textContent,
            price: cells[3].textContent,
            total: cells[4].textContent
        });
    });
   
    // Собираем историю
    const historyRows = document.querySelectorAll('.history-table tbody tr');
    historyRows.forEach(row => {
        const cells = row.cells;
        tradeData.history.push({
            date: cells[0].textContent,
            description: cells[1].textContent,
            amount: cells[2].textContent
        });
    });
   
    alert('Данные готовы для копирования!\n\nСкопируйте весь HTML код этого блока для сохранения.');
    console.log('Данные для сохранения:', tradeData);
}

// Автоматический расчет при изменении значений
document.addEventListener('input', function(e) {
    if (e.target.classList.contains('editable')) {
        const row = e.target.closest('tr');
        if (row && row.querySelector('.calc-btn')) {
            setTimeout(() => calculateRow(row.querySelector('.calc-btn')), 100);
        }
    }
});

// Инициализация
document.addEventListener('DOMContentLoaded', function() {
    calculateTradeTotal();
});
</script>[/html]

0

22

[html]<div id="warframe-trading">
    <!-- Заголовок -->
    <div class="trading-header">
        <div class="trading-title">🛒 РУЧНАЯ ТОРГОВАЯ СИСТЕМА</div>
        <div class="trading-balance">Платина: <span class="editable" contenteditable="true">1000</span> ♢</div>
    </div>

    <!-- Инструкция -->
    <div class="instruction-box">
        <div class="instruction-title">💡 КАК ИСПОЛЬЗОВАТЬ:</div>
        <div class="instruction-steps">
            <div>1. Редактируйте цифры прямо в ячейках</div>
            <div>2. Добавляйте/удаляйте строки таблицы</div>
            <div>3. Копируйте HTML код для сохранения</div>
        </div>
    </div>

    <!-- Торговая таблица -->
    <div class="trade-table-section">
        <div class="section-title">ТАБЛИЦА ТОРГОВЛИ</div>
       
        <div class="table-controls">
            <button class="control-btn add-row-btn" onclick="addTradeRow()">➕ Добавить строку</button>
            <button class="control-btn calculate-btn" onclick="calculateTradeTotal()">📊 Посчитать итог</button>
            <button class="control-btn clear-btn" onclick="clearTradeTable()">🗑️ Очистить таблицу</button>
        </div>

        <div class="trade-table-container">
            <table class="trade-table" id="trade-table">
                <thead>
                    <tr>
                        <th width="40">№</th>
                        <th width="200">Предмет</th>
                        <th width="100">Кол-во</th>
                        <th width="120">Цена за шт. (♢)</th>
                        <th width="120">Общая цена (♢)</th>
                        <th width="80">Действия</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="row-number">1</td>
                        <td><span class="editable" contenteditable="true">Нерв</span></td>
                        <td><span class="editable" contenteditable="true">5</span></td>
                        <td><span class="editable" contenteditable="true">2</span></td>
                        <td class="total-price">10</td>
                        <td class="actions">
                            <button class="action-btn delete-btn" onclick="deleteRow(this)">🗑️</button>
                            <button class="action-btn calc-btn" onclick="calculateRow(this)">🔢</button>
                        </td>
                    </tr>
                    <tr>
                        <td class="row-number">2</td>
                        <td><span class="editable" contenteditable="true">Разрыв</span></td>
                        <td><span class="editable" contenteditable="true">1</span></td>
                        <td><span class="editable" contenteditable="true">45</span></td>
                        <td class="total-price">45</td>
                        <td class="actions">
                            <button class="action-btn delete-btn" onclick="deleteRow(this)">🗑️</button>
                            <button class="action-btn calc-btn" onclick="calculateRow(this)">🔢</button>
                        </td>
                    </tr>
                </tbody>
                <tfoot>
                    <tr class="total-row">
                        <td colspan="4" class="total-label">ОБЩАЯ СТОИМОСТЬ:</td>
                        <td class="grand-total" id="grand-total">55</td>
                        <td></td>
                    </tr>
                </tfoot>
            </table>
        </div>
    </div>

    <!-- История сделок -->
    <div class="history-section">
        <div class="section-title">ИСТОРИЯ СДЕЛОК</div>
        <div class="history-controls">
            <button class="control-btn" onclick="addHistoryEntry()">➕ Добавить запись</button>
            <button class="control-btn export-btn" onclick="exportTradeData()">💾 Экспорт данных</button>
        </div>
        <div class="history-table-container">
            <table class="history-table" id="history-table">
                <thead>
                    <tr>
                        <th width="100">Дата</th>
                        <th>Описание сделки</th>
                        <th width="100">Сумма (♢)</th>
                        <th width="80">Действия</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td><span class="editable" contenteditable="true">01.12.2023</span></td>
                        <td><span class="editable" contenteditable="true">Продал моды новичку</span></td>
                        <td><span class="editable" contenteditable="true">+55</span></td>
                        <td class="actions">
                            <button class="action-btn delete-btn" onclick="deleteHistoryRow(this)">🗑️</button>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <!-- Шаблоны предметов -->
    <div class="templates-section">
        <div class="section-title">ШАБЛОНЫ ПРЕДМЕТОВ</div>
        <div class="templates-grid">
            <div class="template-item" onclick="insertTemplate('Нерв', 2)">⛰️ Нерв (2♢)</div>
            <div class="template-item" onclick="insertTemplate('Рубидо', 2)">🔴 Рубидо (2♢)</div>
            <div class="template-item" onclick="insertTemplate('Аура', 3)">🔵 Аура (3♢)</div>
            <div class="template-item" onclick="insertTemplate('Разрыв', 45)">💥 Разрыв (45♢)</div>
            <div class="template-item" onclick="insertTemplate('Серьезный урон', 35)">⚔️ Серьезный урон (35♢)</div>
            <div class="template-item" onclick="insertTemplate('Скорость', 25)">⚡ Скорость (25♢)</div>
            <div class="template-item" onclick="insertTemplate('Нитайн', 25)">❄️ Нитайн (25♢)</div>
            <div class="template-item" onclick="insertTemplate('Аргоны', 40)">💠 Аргоны (40♢)</div>
        </div>
    </div>
</div>

<style>
/* Основные стили */
#warframe-trading {
    background: #141316;
    border: 2px solid #2a4c6e;
    border-radius: 8px;
    padding: 20px;
    font-family: 'Roboto', sans-serif;
    color: #b8c4ce;
    max-width: 1000px;
    margin: 20px auto;
    box-shadow: 0 0 30px rgba(74, 140, 223, 0.2);
}

/* Заголовок */
.trading-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2a4c6e;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.trading-title {
    font-size: 24px;
    font-weight: bold;
    color: #4a8cdf;
    text-shadow: 0 0 10px rgba(74, 140, 223, 0.5);
}

.trading-balance {
    font-size: 18px;
    color: #d4af37;
    font-weight: bold;
}

/* Инструкция */
.instruction-box {
    background: linear-gradient(135deg, #1a1a1d, #0a0a0c);
    border: 1px solid #2a4c6e;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.instruction-title {
    color: #4a8cdf;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 14px;
}

.instruction-steps {
    font-size: 12px;
    color: #8b9bb4;
}

.instruction-steps div {
    margin: 4px 0;
}

/* Секции */
.section-title {
    background: linear-gradient(90deg, #2a4c6e, #1a1a1d);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 15px;
    border-left: 3px solid #4a8cdf;
}

/* Кнопки управления */
.table-controls, .history-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.control-btn {
    background: linear-gradient(135deg, #2a4c6e, #1a1a1d);
    border: 1px solid #4a8cdf;
    color: #b8c4ce;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: linear-gradient(135deg, #4a8cdf, #2a4c6e);
    transform: translateY(-1px);
}

.calculate-btn {
    background: linear-gradient(135deg, #4a8cdf, #2a4c6e);
}

.clear-btn {
    background: linear-gradient(135deg, #df4a8c, #8c2a4a);
}

.export-btn {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
}

/* Таблицы */
.trade-table-container, .history-table-container {
    background: #1a1a1d;
    border: 1px solid #2a4c6e;
    border-radius: 6px;
    overflow: hidden;
}

.trade-table, .history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.trade-table th, .history-table th {
    background: linear-gradient(135deg, #2a4c6e, #1a1a1d);
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #2a4c6e;
    color: #4a8cdf;
    font-weight: bold;
}

.trade-table td, .history-table td {
    padding: 8px;
    border-bottom: 1px solid #2a4c6e;
    vertical-align: middle;
}

.trade-table tbody tr:hover, .history-table tbody tr:hover {
    background: rgba(74, 140, 223, 0.1);
}

/* Редактируемые ячейки */
.editable {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 3px;
    border: 1px dashed transparent;
    min-width: 40px;
    display: inline-block;
    transition: all 0.3s ease;
}

.editable:focus {
    outline: none;
    border-color: #4a8cdf;
    background: rgba(74, 140, 223, 0.2);
}

/* Цены и итоги */
.total-price, .grand-total {
    color: #d4af37;
    font-weight: bold;
    font-size: 13px;
}

.total-row {
    background: rgba(212, 175, 55, 0.1) !important;
}

.total-label {
    color: #d4af37;
    font-weight: bold;
    text-align: right;
    padding-right: 20px !important;
}

.grand-total {
    font-size: 16px;
    color: #d4af37;
}

/* Кнопки действий */
.actions {
    text-align: center;
}

.action-btn {
    background: none;
    border: 1px solid #2a4c6e;
    color: #b8c4ce;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    margin: 0 2px;
    transition: all 0.3s ease;
}

.action-btn:hover {
    transform: scale(1.1);
}

.delete-btn:hover {
    border-color: #df4a8c;
    color: #df4a8c;
}

.calc-btn:hover {
    border-color: #4a8cdf;
    color: #4a8cdf;
}

/* Шаблоны предметов */
.templates-section {
    margin-top: 20px;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.template-item {
    background: #1a1a1d;
    border: 1px solid #2a4c6e;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.template-item:hover {
    border-color: #4a8cdf;
    background: rgba(74, 140, 223, 0.2);
    transform: translateY(-1px);
}

/* Номера строк */
.row-number {
    color: #8b9bb4;
    font-size: 11px;
    text-align: center;
}

/* Адаптивность */
@media (max-width: 768px) {
    .trading-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
   
    .table-controls, .history-controls {
        flex-direction: column;
    }
   
    .trade-table-container {
        overflow-x: auto;
    }
   
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
</style>

<script>
// Добавление новой строки в таблицу торговли
function addTradeRow() {
    const table = document.getElementById('trade-table').getElementsByTagName('tbody')[0];
    const rowCount = table.rows.length + 1;
   
    const newRow = table.insertRow();
    newRow.innerHTML = `
        <td class="row-number">${rowCount}</td>
        <td><span class="editable" contenteditable="true">Новый предмет</span></td>
        <td><span class="editable" contenteditable="true">1</span></td>
        <td><span class="editable" contenteditable="true">0</span></td>
        <td class="total-price">0</td>
        <td class="actions">
            <button class="action-btn delete-btn" onclick="deleteRow(this)">🗑️</button>
            <button class="action-btn calc-btn" onclick="calculateRow(this)">🔢</button>
        </td>
    `;
   
    updateRowNumbers();
}

// Удаление строки из таблицы торговли
function deleteRow(button) {
    const row = button.closest('tr');
    row.remove();
    updateRowNumbers();
    calculateTradeTotal();
}

// Удаление строки из истории
function deleteHistoryRow(button) {
    const row = button.closest('tr');
    row.remove();
}

// Расчет одной строки
function calculateRow(button) {
    const row = button.closest('tr');
    const cells = row.getElementsByTagName('td');
   
    const quantity = parseInt(cells[2].textContent) || 0;
    const price = parseInt(cells[3].textContent) || 0;
    const total = quantity * price;
   
    cells[4].textContent = total;
    calculateTradeTotal();
}

// Расчет общей стоимости
function calculateTradeTotal() {
    const totalCells = document.querySelectorAll('.total-price');
    let grandTotal = 0;
   
    totalCells.forEach(cell => {
        grandTotal += parseInt(cell.textContent) || 0;
    });
   
    document.getElementById('grand-total').textContent = grandTotal;
}

// Обновление номеров строк
function updateRowNumbers() {
    const rows = document.querySelectorAll('.trade-table tbody tr');
    rows.forEach((row, index) => {
        row.querySelector('.row-number').textContent = index + 1;
    });
}

// Очистка таблицы
function clearTradeTable() {
    if (confirm('Очистить всю таблицу торговли?')) {
        const table = document.getElementById('trade-table').getElementsByTagName('tbody')[0];
        table.innerHTML = '';
        addTradeRow(); // Добавляем одну пустую строку
        calculateTradeTotal();
    }
}

// Добавление записи в историю
function addHistoryEntry() {
    const table = document.getElementById('history-table').getElementsByTagName('tbody')[0];
    const now = new Date();
    const dateStr = `${now.getDate().toString().padStart(2, '0')}.${(now.getMonth()+1).toString().padStart(2, '0')}.${now.getFullYear()}`;
   
    const newRow = table.insertRow();
    newRow.innerHTML = `
        <td><span class="editable" contenteditable="true">${dateStr}</span></td>
        <td><span class="editable" contenteditable="true">Новая сделка</span></td>
        <td><span class="editable" contenteditable="true">+0</span></td>
        <td class="actions">
            <button class="action-btn delete-btn" onclick="deleteHistoryRow(this)">🗑️</button>
        </td>
    `;
}

// Вставка шаблона предмета
function insertTemplate(name, price) {
    addTradeRow();
    const table = document.getElementById('trade-table').getElementsByTagName('tbody')[0];
    const lastRow = table.rows[table.rows.length - 1];
   
    lastRow.cells[1].querySelector('.editable').textContent = name;
    lastRow.cells[3].querySelector('.editable').textContent = price;
    calculateRow(lastRow.cells[5].querySelector('.calc-btn'));
}

// Экспорт данных (имитация)
function exportTradeData() {
    const tradeData = {
        balance: document.querySelector('.trading-balance .editable').textContent,
        trades: [],
        history: []
    };
   
    // Собираем данные торгов
    const tradeRows = document.querySelectorAll('.trade-table tbody tr');
    tradeRows.forEach(row => {
        const cells = row.cells;
        tradeData.trades.push({
            item: cells[1].textContent,
            quantity: cells[2].textContent,
            price: cells[3].textContent,
            total: cells[4].textContent
        });
    });
   
    // Собираем историю
    const historyRows = document.querySelectorAll('.history-table tbody tr');
    historyRows.forEach(row => {
        const cells = row.cells;
        tradeData.history.push({
            date: cells[0].textContent,
            description: cells[1].textContent,
            amount: cells[2].textContent
        });
    });
   
    alert('Данные готовы для копирования!\n\nСкопируйте весь HTML код этого блока для сохранения.');
    console.log('Данные для сохранения:', tradeData);
}

// Автоматический расчет при изменении значений
document.addEventListener('input', function(e) {
    if (e.target.classList.contains('editable')) {
        const row = e.target.closest('tr');
        if (row && row.querySelector('.calc-btn')) {
            setTimeout(() => calculateRow(row.querySelector('.calc-btn')), 100);
        }
    }
});

// Инициализация
document.addEventListener('DOMContentLoaded', function() {
    calculateTradeTotal();
});
</script>[/html]

0

23

[html]<!-- Добавьте этот стиль в CSS -->
<style>
.export-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
}

.export-modal-content {
    background: #141316;
    border: 2px solid #4a8cdf;
    border-radius: 8px;
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.export-modal-header {
    background: linear-gradient(90deg, #2a4c6e, #1a1a1d);
    padding: 15px 20px;
    border-bottom: 1px solid #4a8cdf;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.export-modal-body {
    padding: 20px;
}

.export-data {
    background: #1a1a1d;
    border: 1px solid #2a4c6e;
    border-radius: 4px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #b8c4ce;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.export-instructions {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid #d4af37;
    border-radius: 4px;
    padding: 12px;
    font-size: 11px;
    color: #d4af37;
    margin-bottom: 15px;
}

.export-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
</style>

<!-- Добавьте этот модальный блок перед закрывающим тегом </div> -->
<div id="export-modal" class="export-modal">
    <div class="export-modal-content">
        <div class="export-modal-header">
            <h3>💾 ЭКСПОРТ ДАННЫХ</h3>
            <span class="close-export-modal" onclick="closeExportModal()">&times;</span>
        </div>
        <div class="export-modal-body">
            <div class="export-instructions">
                📋 <strong>Как сохранить:</strong><br>
                1. Выделите и скопируйте код ниже (Ctrl+A → Ctrl+C)<br>
                2. Сохраните в текстовом файле<br>
                3. Для восстановления - вставьте код обратно в HTML
            </div>
            <textarea id="export-data" class="export-data" readonly rows="15"></textarea>
            <div class="export-buttons">
                <button class="control-btn" onclick="selectAllExportData()">📄 Выделить всё</button>
                <button class="control-btn" onclick="copyExportData()">📋 Копировать</button>
                <button class="control-btn" onclick="closeExportModal()">❌ Закрыть</button>
            </div>
        </div>
    </div>
</div>

<script>
// Улучшенная функция экспорта данных
function exportTradeData() {
    const exportData = {
        timestamp: new Date().toISOString(),
        balance: document.querySelector('.trading-balance .editable').textContent,
        currentTrades: [],
        tradeHistory: []
    };
   
    // Собираем текущие сделки
    const tradeRows = document.querySelectorAll('.trade-table tbody tr');
    tradeRows.forEach((row, index) => {
        const cells = row.cells;
        exportData.currentTrades.push({
            id: index + 1,
            item: cells[1].textContent.trim(),
            quantity: cells[2].textContent.trim(),
            pricePerUnit: cells[3].textContent.trim(),
            totalPrice: cells[4].textContent.trim()
        });
    });
   
    // Собираем историю сделок
    const historyRows = document.querySelectorAll('.history-table tbody tr');
    historyRows.forEach((row, index) => {
        const cells = row.cells;
        exportData.tradeHistory.push({
            id: index + 1,
            date: cells[0].textContent.trim(),
            description: cells[1].textContent.trim(),
            amount: cells[2].textContent.trim()
        });
    });
   
    // Форматируем данные для красивого отображения
    const formattedData = formatExportData(exportData);
   
    // Показываем модальное окно с данными
    document.getElementById('export-data').value = formattedData;
    document.getElementById('export-modal').style.display = 'block';
}

// Форматирование данных для экспорта
function formatExportData(data) {
    let result = '=== WARFRAME TRADING DATA EXPORT ===\n';
    result += `Экспорт от: ${new Date().toLocaleString()}\n`;
    result += `Баланс: ${data.balance} ♢\n\n`;
   
    result += '=== ТЕКУЩИЕ СДЕЛКИ ===\n';
    if (data.currentTrades.length === 0) {
        result += 'Нет активных сделок\n';
    } else {
        data.currentTrades.forEach(trade => {
            result += `[${trade.id}] ${trade.item} | Кол-во: ${trade.quantity} | Цена: ${trade.pricePerUnit}♢ | Итого: ${trade.totalPrice}♢\n`;
        });
    }
   
    result += '\n=== ИСТОРИЯ СДЕЛОК ===\n';
    if (data.tradeHistory.length === 0) {
        result += 'История пуста\n';
    } else {
        data.tradeHistory.forEach(history => {
            result += `[${history.date}] ${history.description} | ${history.amount}♢\n`;
        });
    }
   
    result += `\n=== СВОДКА ===\n`;
    result += `Всего сделок: ${data.currentTrades.length}\n`;
    result += `Записей в истории: ${data.tradeHistory.length}\n`;
    result += `Общий баланс: ${data.balance}♢\n`;
   
    result += `\n// Для импорта сохраните этот код и используйте при необходимости`;
   
    return result;
}

// Функция для копирования данных в буфер обмена
function copyExportData() {
    const exportTextarea = document.getElementById('export-data');
    exportTextarea.select();
    exportTextarea.setSelectionRange(0, 99999); // Для мобильных устройств
   
    try {
        const successful = document.execCommand('copy');
        if (successful) {
            alert('✅ Данные скопированы в буфер обмена!');
        } else {
            alert('❌ Не удалось скопировать данные');
        }
    } catch (err) {
        alert('❌ Ошибка при копировании: ' + err);
    }
}

// Выделить все данные
function selectAllExportData() {
    const exportTextarea = document.getElementById('export-data');
    exportTextarea.select();
}

// Закрыть модальное окно экспорта
function closeExportModal() {
    document.getElementById('export-modal').style.display = 'none';
}

// Закрытие при клике вне окна
window.addEventListener('click', function(event) {
    const modal = document.getElementById('export-modal');
    if (event.target === modal) {
        closeExportModal();
    }
});

// Функция импорта данных (дополнительно)
function importTradeData(importString) {
    try {
        // Это упрощенная версия импорта - в реальности нужно парсить данные
        console.log('Импорт данных:', importString);
        alert('Функция импорта в разработке. Пока используйте ручное копирование HTML.');
    } catch (error) {
        alert('Ошибка импорта данных: ' + error.message);
    }
}
</script>[/html]

0

24

[html]<div id="trading-post">
    <!-- Заголовок -->
    <div class="trading-header">
        <div class="trading-title">🏪 ТОРГОВЫЙ ПОСТ</div>
        <div class="trading-subtitle">Орбитальный релейный узел</div>
    </div>

    <!-- Участники сделки -->
    <div class="traders-section">
        <div class="trader trader-1">
            <div class="trader-header">
                <span class="trader-label">УЧАСТНИК 1</span>
                <span class="trader-name editable" contenteditable="true">Введите имя игрока</span>
            </div>
        </div>
       
        <div class="vs-separator">
            <div class="vs-circle">🔄</div>
        </div>

        <div class="trader trader-2">
            <div class="trader-header">
                <span class="trader-label">УЧАСТНИК 2</span>
                <span class="trader-name editable" contenteditable="true">Введите имя игрока</span>
            </div>
        </div>
    </div>

    <!-- Торговые таблицы -->
    <div class="trading-tables">
        <!-- Предложение участника 1 -->
        <div class="offer-section offer-1">
            <div class="offer-title">📦 ПРЕДЛОЖЕНИЕ <span class="trader-1-name">УЧАСТНИКА 1</span></div>
            <div class="table-controls">
                <button class="control-btn add-row-btn" onclick="addOfferRow(1)">➕ Добавить предмет</button>
                <button class="control-btn calculate-btn" onclick="calculateOfferTotal(1)">📊 Посчитать итог</button>
            </div>
           
            <div class="offer-table-container">
                <table class="offer-table" id="offer-table-1">
                    <thead>
                        <tr>
                            <th width="250">Предмет торговли</th>
                            <th width="80">Кол-во</th>
                            <th width="100">Цена (♢)</th>
                            <th width="120">Стоимость (♢)</th>
                            <th width="60">Действия</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td><span class="editable" contenteditable="true">Пример: Нерв</span></td>
                            <td><span class="editable" contenteditable="true">5</span></td>
                            <td><span class="editable" contenteditable="true">2</span></td>
                            <td class="item-total">10</td>
                            <td class="actions">
                                <button class="action-btn delete-btn" onclick="deleteOfferRow(this, 1)">🗑️</button>
                            </td>
                        </tr>
                    </tbody>
                    <tfoot>
                        <tr class="total-row">
                            <td colspan="3" class="total-label">ОБЩАЯ СТОИМОСТЬ:</td>
                            <td class="offer-total" id="offer-total-1">10</td>
                            <td></td>
                        </tr>
                    </tfoot>
                </table>
            </div>
        </div>

        <!-- Предложение участника 2 -->
        <div class="offer-section offer-2">
            <div class="offer-title">📦 ПРЕДЛОЖЕНИЕ <span class="trader-2-name">УЧАСТНИКА 2</span></div>
            <div class="table-controls">
                <button class="control-btn add-row-btn" onclick="addOfferRow(2)">➕ Добавить предмет</button>
                <button class="control-btn calculate-btn" onclick="calculateOfferTotal(2)">📊 Посчитать итог</button>
            </div>
           
            <div class="offer-table-container">
                <table class="offer-table" id="offer-table-2">
                    <thead>
                        <tr>
                            <th width="250">Предмет торговли</th>
                            <th width="80">Кол-во</th>
                            <th width="100">Цена (♢)</th>
                            <th width="120">Стоимость (♢)</th>
                            <th width="60">Действия</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td><span class="editable" contenteditable="true">Пример: Платина</span></td>
                            <td><span class="editable" contenteditable="true">50</span></td>
                            <td><span class="editable" contenteditable="true">1</span></td>
                            <td class="item-total">50</td>
                            <td class="actions">
                                <button class="action-btn delete-btn" onclick="deleteOfferRow(this, 2)">🗑️</button>
                            </td>
                        </tr>
                    </tbody>
                    <tfoot>
                        <tr class="total-row">
                            <td colspan="3" class="total-label">ОБЩАЯ СТОИМОСТЬ:</td>
                            <td class="offer-total" id="offer-total-2">50</td>
                            <td></td>
                        </tr>
                    </tfoot>
                </table>
            </div>
        </div>
    </div>

    <!-- Шаблоны предметов -->
    <div class="templates-section">
        <div class="section-title">⚡ БЫСТРЫЕ ШАБЛОНЫ</div>
        <div class="templates-controls">
            <select id="template-select" class="template-select">
                <option value="">Выберите шаблон...</option>
                <option value="resources">📦 Набор ресурсов</option>
                <option value="mods">🎯 Набор модов</option>
                <option value="prime">👑 Прайм детали</option>
                <option value="arcane">✨ Арканы</option>
            </select>
            <button class="control-btn" onclick="addTemplateToBoth()">➕ Добавить в обе сделки</button>
            <button class="control-btn" onclick="addTemplateToOffer(1)">⬅️ Только участнику 1</button>
            <button class="control-btn" onclick="addTemplateToOffer(2)">➡️ Только участнику 2</button>
        </div>
    </div>

    <!-- Управление сделкой -->
    <div class="deal-controls">
        <button class="deal-btn export-deal-btn" onclick="exportDeal()">💾 СФОРМИРОВАТЬ СДЕЛКУ</button>
        <button class="deal-btn clear-deal-btn" onclick="clearDeal()">🗑️ ОЧИСТИТЬ ВСЁ</button>
    </div>

    <!-- Модальное окно экспорта -->
    <div id="export-modal" class="export-modal">
        <div class="export-modal-content">
            <div class="export-modal-header">
                <h3>📝 ГОТОВАЯ СДЕЛКА</h3>
                <span class="close-export-modal" onclick="closeExportModal()">&times;</span>
            </div>
            <div class="export-modal-body">
                <div class="export-instructions">
                    📋 <strong>Инструкция:</strong><br>
                    1. Скопируйте текст ниже (Ctrl+A → Ctrl+C)<br>
                    2. Вставьте в сообщение на форуме<br>
                    3. Отправьте для подтверждения сделки
                </div>
                <textarea id="export-data" class="export-data" readonly rows="12"></textarea>
                <div class="export-buttons">
                    <button class="control-btn" onclick="selectAllExportData()">📄 Выделить всё</button>
                    <button class="control-btn" onclick="copyExportData()">📋 Копировать в буфер</button>
                    <button class="control-btn" onclick="closeExportModal()">❌ Закрыть</button>
                </div>
            </div>
        </div>
    </div>
</div>

<style>
/* Основные стили */
#trading-post {
    background: #141316;
    border: 2px solid #2a4c6e;
    border-radius: 8px;
    padding: 20px;
    font-family: 'Roboto', sans-serif;
    color: #b8c4ce;
    max-width: 1000px;
    margin: 20px auto;
    box-shadow: 0 0 30px rgba(74, 140, 223, 0.2);
}

/* Заголовок */
.trading-header {
    text-align: center;
    border-bottom: 1px solid #2a4c6e;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.trading-title {
    font-size: 28px;
    font-weight: bold;
    color: #4a8cdf;
    text-shadow: 0 0 10px rgba(74, 140, 223, 0.5);
    margin-bottom: 5px;
}

.trading-subtitle {
    font-size: 14px;
    color: #8b9bb4;
    font-style: italic;
}

/* Участники */
.traders-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    gap: 20px;
}

.trader {
    flex: 1;
    background: #1a1a1d;
    border: 1px solid #2a4c6e;
    border-radius: 8px;
    padding: 15px;
}

.trader-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.trader-label {
    font-size: 12px;
    color: #8b9bb4;
    text-transform: uppercase;
}

.trader-name {
    font-size: 18px;
    font-weight: bold;
    color: #4a8cdf;
    text-align: center;
    min-width: 150px;
}

.trader-1 .trader-name {
    color: #4a8cdf;
}

.trader-2 .trader-name {
    color: #df4a8c;
}

.vs-separator {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs-circle {
    background: #1a1a1d;
    border: 2px solid #d4af37;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Торговые таблицы */
.trading-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.offer-section {
    background: #1a1a1d;
    border: 1px solid #2a4c6e;
    border-radius: 8px;
    padding: 15px;
}

.offer-1 {
    border-left: 4px solid #4a8cdf;
}

.offer-2 {
    border-left: 4px solid #df4a8c;
}

.offer-title {
    background: linear-gradient(90deg, #2a4c6e, #1a1a1d);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #b8c4ce;
}

.offer-1 .offer-title {
    border-left: 3px solid #4a8cdf;
}

.offer-2 .offer-title {
    border-left: 3px solid #df4a8c;
}

/* Таблицы */
.offer-table-container {
    background: #0a0a0c;
    border: 1px solid #2a4c6e;
    border-radius: 6px;
    overflow: hidden;
}

.offer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.offer-table th {
    background: linear-gradient(135deg, #2a4c6e, #1a1a1d);
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #2a4c6e;
    color: #4a8cdf;
    font-weight: bold;
}

.offer-table td {
    padding: 8px;
    border-bottom: 1px solid #2a4c6e;
    vertical-align: middle;
}

.offer-table tbody tr:hover {
    background: rgba(74, 140, 223, 0.1);
}

/* Редактируемые ячейки */
.editable {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 3px;
    border: 1px dashed transparent;
    min-width: 40px;
    display: inline-block;
    transition: all 0.3s ease;
}

.editable:focus {
    outline: none;
    border-color: #4a8cdf;
    background: rgba(74, 140, 223, 0.2);
}

/* Итоги */
.item-total, .offer-total {
    color: #d4af37;
    font-weight: bold;
}

.total-row {
    background: rgba(212, 175, 55, 0.1) !important;
}

.total-label {
    color: #d4af37;
    font-weight: bold;
    text-align: right;
    padding-right: 20px !important;
}

/* Кнопки */
.table-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.control-btn {
    background: linear-gradient(135deg, #2a4c6e, #1a1a1d);
    border: 1px solid #4a8cdf;
    color: #b8c4ce;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: linear-gradient(135deg, #4a8cdf, #2a4c6e);
    transform: translateY(-1px);
}

.actions {
    text-align: center;
}

.action-btn {
    background: none;
    border: 1px solid #2a4c6e;
    color: #b8c4ce;
    padding: 4px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.3s ease;
}

.action-btn:hover {
    transform: scale(1.1);
}

.delete-btn:hover {
    border-color: #df4a8c;
    color: #df4a8c;
}

/* Шаблоны */
.templates-section {
    margin-bottom: 20px;
}

.section-title {
    background: linear-gradient(90deg, #2a4c6e, #1a1a1d);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 15px;
    border-left: 3px solid #4a8cdf;
}

.templates-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.template-select {
    background: #1a1a1d;
    border: 1px solid #2a4c6e;
    color: #b8c4ce;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    min-width: 150px;
}

/* Управление сделкой */
.deal-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.deal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.export-deal-btn {
    background: linear-gradient(135deg, #4a8cdf, #2a4c6e);
    color: white;
}

.clear-deal-btn {
    background: linear-gradient(135deg, #df4a8c, #8c2a4a);
    color: white;
}

.deal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Модальное окно экспорта */
.export-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
}

.export-modal-content {
    background: #141316;
    border: 2px solid #4a8cdf;
    border-radius: 8px;
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
}

.export-modal-header {
    background: linear-gradient(90deg, #2a4c6e, #1a1a1d);
    padding: 15px 20px;
    border-bottom: 1px solid #4a8cdf;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.export-modal-body {
    padding: 20px;
}

.export-data {
    background: #1a1a1d;
    border: 1px solid #2a4c6e;
    border-radius: 4px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #b8c4ce;
    white-space: pre-wrap;
    word-break: break-all;
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 200px;
    margin-bottom: 15px;
}

.export-instructions {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid #d4af37;
    border-radius: 4px;
    padding: 12px;
    font-size: 11px;
    color: #d4af37;
    margin-bottom: 15px;
}

.export-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Адаптивность */
@media (max-width: 768px) {
    .traders-section {
        flex-direction: column;
    }
   
    .trading-tables {
        grid-template-columns: 1fr;
    }
   
    .templates-controls {
        flex-direction: column;
        align-items: stretch;
    }
   
    .deal-controls {
        flex-direction: column;
    }
}
</style>

<script>
// База шаблонов предметов
const itemTemplates = {
    resources: [
        { name: "Нерв", price: 2 },
        { name: "Рубидо", price: 2 },
        { name: "Аура", price: 3 },
        { name: "Нитайн", price: 25 },
        { name: "Аргоны", price: 40 }
    ],
    mods: [
        { name: "Разрыв", price: 45 },
        { name: "Серьезный урон", price: 35 },
        { name: "Скорость", price: 25 },
        { name: "Прицеливание", price: 30 },
        { name: "Мультивыстрел", price: 50 }
    ],
    prime: [
        { name: "Некрос Прайм: Системы", price: 80 },
        { name: "Некрос Прайм: Шасси", price: 60 },
        { name: "Некрос Прайм: Нейрооптика", price: 70 },
        { name: "Некрос Прайм: Чертеж", price: 40 }
    ],
    arcane: [
        { name: "Аркана Пробуждение", price: 120 },
        { name: "Аркана Ярость", price: 150 },
        { name: "Аркана Барьер", price: 200 },
        { name: "Аркана Энерджиз", price: 180 }
    ]
};

// Добавление строки в предложение
function addOfferRow(offerNumber) {
    const table = document.getElementById(`offer-table-${offerNumber}`).getElementsByTagName('tbody')[0];
   
    const newRow = table.insertRow();
    newRow.innerHTML = `
        <td><span class="editable" contenteditable="true">Новый предмет</span></td>
        <td><span class="editable" contenteditable="true">1</span></td>
        <td><span class="editable" contenteditable="true">0</span></td>
        <td class="item-total">0</td>
        <td class="actions">
            <button class="action-btn delete-btn" onclick="deleteOfferRow(this, ${offerNumber})">🗑️</button>
        </td>
    `;
   
    // Добавляем обработчики для автоматического расчета
    const editables = newRow.querySelectorAll('.editable');
    editables.forEach(editable => {
        editable.addEventListener('input', () => {
            setTimeout(() => calculateRowTotal(newRow), 100);
        });
    });
}

// Удаление строки из предложения
function deleteOfferRow(button, offerNumber) {
    const row = button.closest('tr');
    row.remove();
    calculateOfferTotal(offerNumber);
}

// Расчет стоимости строки
function calculateRowTotal(row) {
    const cells = row.cells;
    const quantity = parseInt(cells[1].textContent) || 0;
    const price = parseInt(cells[2].textContent) || 0;
    const total = quantity * price;
   
    cells[3].textContent = total;
   
    // Пересчитываем общий итог для этого предложения
    const offerNumber = row.closest('table').id.split('-')[2];
    calculateOfferTotal(offerNumber);
}

// Расчет общего итога предложения
function calculateOfferTotal(offerNumber) {
    const table = document.getElementById(`offer-table-${offerNumber}`);
    const totalCells = table.querySelectorAll('.item-total');
    let offerTotal = 0;
   
    totalCells.forEach(cell => {
        offerTotal += parseInt(cell.textContent) || 0;
    });
   
    document.getElementById(`offer-total-${offerNumber}`).textContent = offerTotal;
}

// Добавление шаблона в предложение
function addTemplateToOffer(offerNumber) {
    const templateSelect = document.getElementById('template-select');
    const templateName = templateSelect.value;
   
    if (!templateName) {
        alert('Выберите шаблон из списка!');
        return;
    }
   
    const items = itemTemplates[templateName];
    items.forEach(item => {
        addOfferRow(offerNumber);
        const table = document.getElementById(`offer-table-${offerNumber}`).getElementsByTagName('tbody')[0];
        const lastRow = table.rows[table.rows.length - 1];
       
        lastRow.cells[0].querySelector('.editable').textContent = item.name;
        lastRow.cells[2].querySelector('.editable').textContent = item.price;
        calculateRowTotal(lastRow);
    });
   
    templateSelect.value = '';
}

// Добавление шаблона в оба предложения
function addTemplateToBoth() {
    addTemplateToOffer(1);
    addTemplateToOffer(2);
}

// Обновление имен участников в заголовках
function updateTraderNames() {
    const trader1Name = document.querySelector('.trader-1 .trader-name').textContent;
    const trader2Name = document.querySelector('.trader-2 .trader-name').textContent;
   
    document.querySelector('.trader-1-name').textContent = trader1Name;
    document.querySelector('.trader-2-name').textContent = trader2Name;
}

// Экспорт сделки
function exportDeal() {
    updateTraderNames();
   
    const trader1Name = document.querySelector('.trader-1 .trader-name').textContent;
    const trader2Name = document.querySelector('.trader-2 .trader-name').textContent;
    const trader1Total = document.getElementById('offer-total-1').textContent;
    const trader2Total = document.getElementById('offer-total-2').textContent;
   
    let exportText = `🏪 ТОРГОВАЯ СДЕЛКА\n`;
    exportText += `═══════════════════════════════\n\n`;
    exportText += `👤 ${trader1Name} ⟷ 👤 ${trader2Name}\n\n`;
   
    // Предложение участника 1
    exportText += `📦 ПРЕДЛОЖЕНИЕ ${trader1Name}:\n`;
    const offer1Rows = document.querySelectorAll('#offer-table-1 tbody tr');
    if (offer1Rows.length === 0) {
        exportText += `   Нет предметов\n`;
    } else {
        offer1Rows.forEach(row => {
            const cells = row.cells;
            exportText += `   ▫️ ${cells[0].textContent} | ${cells[1].textContent} шт. | ${cells[2].textContent}♢ | ${cells[3].textContent}♢\n`;
        });
    }
    exportText += `   💰 Общая стоимость: ${trader1Total}♢\n\n`;
   
    // Предложение участника 2
    exportText += `📦 ПРЕДЛОЖЕНИЕ ${trader2Name}:\n`;
    const offer2Rows = document.querySelectorAll('#offer-table-2 tbody tr');
    if (offer2Rows.length === 0) {
        exportText += `   Нет предметов\n`;
    } else {
        offer2Rows.forEach(row => {
            const cells = row.cells;
            exportText += `   ▫️ ${cells[0].textContent} | ${cells[1].textContent} шт. | ${cells[2].textContent}♢ | ${cells[3].textContent}♢\n`;
        });
    }
    exportText += `   💰 Общая стоимость: ${trader2Total}♢\n\n`;
   
    exportText += `⚖️ СВОДКА СДЕЛКИ:\n`;
    exportText += `   ${trader1Name} получает: ${trader2Total}♢ стоимости\n`;
    exportText += `   ${trader2Name} получает: ${trader1Total}♢ стоимости\n\n`;
   
    exportText += `✅ Сделка согласована: ___________\n`;
    exportText += `📅 Дата: ${new Date().toLocaleDateString()}\n`;
    exportText += `🕒 Время: ${new Date().toLocaleTimeString()}\n\n`;
    exportText += `═══════════════════════════════`;
   
    // Показываем модальное окно с текстом сделки
    document.getElementById('export-data').value = exportText;
    document.getElementById('export-modal').style.display = 'block';
}

// Очистка всей сделки
function clearDeal() {
    if (confirm('Очистить всю сделку? Это удалит все предметы и сбросит имена участников.')) {
        // Очищаем таблицы
        document.querySelector('#offer-table-1 tbody').innerHTML = '';
        document.querySelector('#offer-table-2 tbody').innerHTML = '';
       
        // Сбрасываем имена участников
        document.querySelector('.trader-1 .trader-name').textContent = 'Введите имя игрока';
        document.querySelector('.trader-2 .trader-name').textContent = 'Введите имя игрока';
       
        // Сбрасываем итоги
        document.getElementById('offer-total-1').textContent = '0';
        document.getElementById('offer-total-2').textContent = '0';
       
        // Добавляем по одной пустой строке в каждую таблицу
        addOfferRow(1);
        addOfferRow(2);
       
        updateTraderNames();
    }
}

// Функции для работы с модальным окном
function closeExportModal() {
    document.getElementById('export-modal').style.display = 'none';
}

function selectAllExportData() {
    document.getElementById('export-data').select();
}

function copyExportData() {
    const exportTextarea = document.getElementById('export-data');
    exportTextarea.select();
    exportTextarea.setSelectionRange(0, 99999);
   
    try {
        const successful = document.execCommand('copy');
        if (successful) {
            alert('✅ Текст сделки скопирован в буфер обмена!');
        } else {
            alert('❌ Не удалось скопировать текст');
        }
    } catch (err) {
        alert('❌ Ошибка при копировании: ' + err);
    }
}

// Закрытие модального окна при клике вне его
window.addEventListener('click', function(event) {
    const modal = document.getElementById('export-modal');
    if (event.target === modal) {
        closeExportModal();
    }
});

// Автоматический расчет при изменении значений
document.addEventListener('input', function(e) {
    if (e.target.classList.contains('editable')) {
        const row = e.target.closest('tr');
        if (row) {
            setTimeout(() => calculateRowTotal(row), 100);
        }
    }
   
    // Обновление имен в заголовках при редактировании
    if (e.target.classList.contains('trader-name')) {
        setTimeout(updateTraderNames, 100);
    }
});

// Инициализация
document.addEventListener('DOMContentLoaded', function() {
    // Добавляем начальные строки
    addOfferRow(1);
    addOfferRow(2);
   
    // Обновляем имена в заголовках
    updateTraderNames();
});
</script>[/html]

0

25

🏪 ТОРГОВАЯ СДЕЛКА
═══════════════════════════════

👤 Элеонора Найтингейл ⟷ 👤 Артур Найтингейл

📦 ПРЕДЛОЖЕНИЕ Элеонора Найтингейл:
   ▫️ Оружие | 5 шт. | 20♢ | 100♢
   💰 Общая стоимость: 100♢

📦 ПРЕДЛОЖЕНИЕ Артур Найтингейл:
   ▫️ Пример: Платина | 50 шт. | 19♢ | 950♢
   💰 Общая стоимость: 950♢

⚖️ СВОДКА СДЕЛКИ:
   Элеонора Найтингейл получает: 950♢ стоимости
   Артур Найтингейл получает: 100♢ стоимости

✅ Сделка согласована: ___________
📅 Дата: 24.10.2025
🕒 Время: 02:33:50

═══════════════════════════════

0

26

[html]<style>
#season-widget {
    width: 200px;
    height: 200px;
    border: 2px solid;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: Arial, sans-serif;
    font-weight: bold;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    padding: 10px;
    text-align: center;
    margin: 10px;
}

/* Стили для сезонов */
#season-widget.winter {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-color: #90caf9;
    color: #1565c0;
}

#season-widget.spring {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    border-color: #81c784;
    color: #2e7d32;
}

#season-widget.summer {
    background: linear-gradient(135deg, #fff3e0, #ffcc80);
    border-color: #ffb74d;
    color: #ef6c00;
}

#season-widget.autumn {
    background: linear-gradient(135deg, #fbe9e7, #ffab91);
    border-color: #ff8a65;
    color: #d84315;
}

.season-name {
    font-size: 24px;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.season-timer {
    font-size: 12px;
    text-align: center;
}

.days-left {
    font-size: 16px;
    color: #d32f2f;
    font-weight: bold;
    display: block;
    margin-top: 5px;
}

/* Декоративные элементы */
.season-decor::before {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    opacity: 0.5;
}

.winter .season-decor::before {
    content: "❄️";
}

.spring .season-decor::before {
    content: "🌱";
}

.summer .season-decor::before {
    content: "☀️";
}

.autumn .season-decor::before {
    content: "🍂";
}
</style>

<div id="season-widget" class="autumn">
    <div class="season-name">ОСЕНЬ</div>
    <div class="season-timer">
        ВРЕМЯ ДО ОКОНЧАНИЯ СЕЗОНА:
        <span class="days-left">100</span> ДНЕЙ
    </div>
    <div class="season-decor"></div>
</div>

<script>
// Конфигурация
const SEASONS = ['autumn', 'winter', 'spring', 'summer'];
const SEASON_NAMES = {
    'autumn': 'ОСЕНЬ',
    'winter': 'ЗИМА',
    'spring': 'ВЕСНА',
    'summer': 'ЛЕТО'
};
const SEASON_DURATION = 100; // дней
const START_DATE = new Date('2025-11-01T00:00:00'); // 1 ноября 2025

function calculateCurrentSeason() {
    const now = new Date();
    const startTime = START_DATE.getTime();
    const currentTime = now.getTime();
   
    // Разница в миллисекундах
    const diffMs = currentTime - startTime;
   
    // Если дата раньше начала
    if (diffMs < 0) {
        return {
            season: 'autumn',
            daysRemaining: 0
        };
    }
   
    // Разница в днях
    const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
   
    // Определяем текущий сезон
    const seasonIndex = Math.floor(diffDays / SEASON_DURATION) % SEASONS.length;
    const currentSeason = SEASONS[seasonIndex];
   
    // Дней прошло в текущем сезоне
    const daysInCurrentSeason = diffDays % SEASON_DURATION;
    const daysRemaining = SEASON_DURATION - daysInCurrentSeason;
   
    return {
        season: currentSeason,
        daysRemaining: daysRemaining
    };
}

function updateSeasonWidget() {
    const seasonInfo = calculateCurrentSeason();
    const widget = document.getElementById('season-widget');
    const seasonName = widget.querySelector('.season-name');
    const daysLeft = widget.querySelector('.days-left');
   
    // Обновляем данные
    seasonName.textContent = SEASON_NAMES[seasonInfo.season];
    daysLeft.textContent = seasonInfo.daysRemaining;
   
    // Обновляем классы для стилей
    widget.className = '';
    widget.classList.add(seasonInfo.season);
   
    console.log('Сезон обновлен:', seasonInfo);
}

// Запускаем при загрузке
document.addEventListener('DOMContentLoaded', function() {
    console.log('Загрузка сезонного виджета...');
    updateSeasonWidget();
   
    // Обновляем каждые 24 часа
    setInterval(updateSeasonWidget, 24 * 60 * 60 * 1000);
});

// Также обновляем при каждой загрузке страницы
window.addEventListener('load', updateSeasonWidget);
</script>[/html]

0

27

[html]<div id="test-widget" style="width:200px;height:200px;border:2px solid red;display:flex;flex-direction:column;justify-content:center;align-items:center;">
    <div id="test-name">ТЕСТ</div>
    <div>Дней осталось: <span id="test-days">100</span></div>
</div>

<script>
console.log("Тестовый скрипт запущен!");
document.getElementById('test-name').textContent = 'РАБОТАЕТ!';
document.getElementById('test-days').textContent = '50';
</script>[/html]

0

28

[html]<style>
#season-widget {
    width: 200px;
    height: 200px;
    border: 2px solid;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: Arial, sans-serif;
    font-weight: bold;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    padding: 10px;
    text-align: center;
    margin: 10px;
}

/* Стили для сезонов */
.season-autumn {
    background: linear-gradient(135deg, #fbe9e7, #ffab91);
    border-color: #ff8a65;
    color: #d84315;
}

.season-winter {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-color: #90caf9;
    color: #1565c0;
}

.season-spring {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    border-color: #81c784;
    color: #2e7d32;
}

.season-summer {
    background: linear-gradient(135deg, #fff3e0, #ffcc80);
    border-color: #ffb74d;
    color: #ef6c00;
}

.season-name {
    font-size: 24px;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.season-timer {
    font-size: 12px;
    text-align: center;
}

.days-left {
    font-size: 16px;
    color: #d32f2f;
    font-weight: bold;
    display: block;
    margin-top: 5px;
}

/* Декоративные элементы */
.decor {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    opacity: 0.5;
}
</style>

<div id="season-widget" class="season-autumn">
    <div class="season-name">ОСЕНЬ</div>
    <div class="season-timer">
        ВРЕМЯ ДО ОКОНЧАНИЯ СЕЗОНА:
        <span class="days-left">100</span> ДНЕЙ
    </div>
    <div class="decor">🍂</div>
</div>

<script>
// Простая и надежная версия расчета сезонов
function getSeasonInfo() {
    // Начальная дата - 1 ноября 2025
    const startDate = new Date('2025-11-01');
    const now = new Date();
   
    // Разница в днях
    const diffTime = now - startDate;
    const diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24));
   
    // Если дата раньше начала
    if (diffDays < 0) {
        return { season: 'autumn', name: 'ОСЕНЬ', decor: '🍂', daysLeft: 100 };
    }
   
    // Определяем текущий сезон (каждые 100 дней)
    const seasonCycle = Math.floor(diffDays / 100) % 4;
    const daysInSeason = diffDays % 100;
    const daysLeft = 100 - daysInSeason;
   
    const seasons = [
        { season: 'autumn', name: 'ОСЕНЬ', decor: '🍂' },
        { season: 'winter', name: 'ЗИМА', decor: '❄️' },
        { season: 'spring', name: 'ВЕСНА', decor: '🌱' },
        { season: 'summer', name: 'ЛЕТО', decor: '☀️' }
    ];
   
    return {
        ...seasons[seasonCycle],
        daysLeft: daysLeft
    };
}

function updateSeasonWidget() {
    const seasonInfo = getSeasonInfo();
    const widget = document.getElementById('season-widget');
   
    if (!widget) {
        console.error('Виджет не найден!');
        return;
    }
   
    // Обновляем содержимое
    widget.querySelector('.season-name').textContent = seasonInfo.name;
    widget.querySelector('.days-left').textContent = seasonInfo.daysLeft;
    widget.querySelector('.decor').textContent = seasonInfo.decor;
   
    // Обновляем классы
    widget.className = 'season-' + seasonInfo.season;
   
    console.log('Сезон обновлен:', seasonInfo);
}

// Запускаем при загрузке
document.addEventListener('DOMContentLoaded', function() {
    console.log('Документ загружен, обновляем виджет...');
    updateSeasonWidget();
});

// Дублируем запуск на всякий случай
window.onload = updateSeasonWidget;

// Для отладки - выводим информацию
console.log('Скрипт сезонов загружен, текущий сезон:', getSeasonInfo());
</script>[/html]

0


Вы здесь » Whisper of the Void » Точка Сингулярности » Тестовое сообщение


Рейтинг форумов | Создать форум бесплатно