Здесь делается вжух 🪄

test

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

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


Вы здесь » test » новый не новый » рандом


рандом

Сообщений 1 страница 15 из 15

1

[html]
<script src="https://cdn.jsdelivr.net/npm/@quadrosystems/mybb-sdk@0.9.7/lib/index.min.js"></script>

<div style="margin: 20px; padding: 15px; border: 2px dashed #00bfff; background: #f0f8ff; text-align: center;">
    <p style="font-weight: bold;">Тест Функции Постинга</p>
    <button id="testPostButton" style="padding: 10px 20px; background: #00bfff; color: white; border: none; cursor: pointer; border-radius: 5px;">
        Нажать для Отправки Тестового Сообщения
    </button>
    <p id="testStatus" style="margin-top: 10px; min-height: 20px; color: #333;"></p>
</div>

<script>
let testThreadID = null;
const statusDisplay = document.getElementById("testStatus");
const testButton = document.getElementById("testPostButton");

// 1. Асинхронная функция инициализации для получения ID темы
async function initializeTest() {
    statusDisplay.textContent = "Инициализация...";
    testButton.disabled = true;

    if (typeof MYBB !== 'undefined' && MYBB.thread) {
        try {
            const threadDetails = await MYBB.thread.getDetails();
            testThreadID = threadDetails.tid;
           
            if (testThreadID) {
                statusDisplay.textContent = `Готово к тесту! ID Темы: ${testThreadID}.`;
                testButton.disabled = false;
            } else {
                statusDisplay.textContent = "Ошибка: Не удалось получить ID темы.";
            }

        } catch (e) {
            statusDisplay.textContent = "Ошибка SDK: Не удалось получить детали темы (проверьте авторизацию).";
            console.error("SDK Error:", e);
        }
    } else {
        statusDisplay.textContent = "Критическая ошибка: MyBB SDK не загружен.";
    }
}

// 2. Функция отправки сообщения
testButton.onclick = async function() {
    if (!testThreadID) {
        statusDisplay.textContent = "Ошибка: ID темы не установлен.";
        return;
    }
   
    testButton.disabled = true;
    statusDisplay.textContent = "Отправка сообщения...";
   
    // Само сообщение, которое будет запощено
    const testContent = `
[center]✅ АВТОМАТИЧЕСКИЙ ТЕСТ ПОСТИНГА УСПЕШЕН!
Сообщение отправлено скриптом в ${new Date().toLocaleTimeString()}
[/center]
`;

    try {
        // Вызов функции постинга
        await MYBB.thread.reply(testThreadID, testContent);
       
        statusDisplay.style.color = 'green';
        statusDisplay.textContent = "УСПЕХ! Тестовое сообщение отправлено на форум.";
       
    } catch (error) {
        statusDisplay.style.color = 'red';
        statusDisplay.textContent = "СБОЙ! Проверьте, авторизованы ли вы и консоль F12.";
        console.error("Постинг СБОЙ:", error);
    } finally {
        testButton.disabled = false;
    }
};

// Запуск инициализации
initializeTest();
</script>
[/html]

0

2

Инвентарь пользователя
[html]
<style>
.usr_inv {display: grid;gap: 10px;margin-top: 10px;grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));}
.inv_item {background: ;border: 1px solid #ddd;border-radius: 4px;padding: 10px;text-align: center;}
.item-image {width: 64px;height: 64px;object-fit: cover;border-radius: 4px;}
.item-description {display: none;}
#detailed-view:checked ~ .usr_inv {grid-template-columns: 1fr;}
#detailed-view:checked ~ .usr_inv .inv_item {display: flex;align-items: center;text-align: left;gap: 15px;padding: 15px;}
#detailed-view:checked ~ .usr_inv .item-image {width: 50px;height: 50px;flex-shrink: 0;}
#detailed-view:checked ~ .usr_inv .item-description {display: block;flex: 1;}
</style>

<div>
<input type="checkbox" id="detailed-view">
<label for="detailed-view" class="view-toggle">Подробный вид</label>
<div class="usr_inv">
    <div class="inv_item">
        <img src="https://upforme.ru/uploads/001c/52/b6/2/802623.png?sec=DQ0+QTpQQEYtMiEAUWcCRz42OVcHeTwMJx49AzpUfV8uJjpCeVp3Rz42OVYvRAIMJSAXBT5ublo5DzINfmNBST8fOlArejRTJQ4TGRVrEhI=" title="Череп" alt="Череп" class="item-image">
        <div class="item-description">
            <h3>Череп</h3>
            <p>Бедный Йорик!</p>
            <div>
            <p><strong>Нашедший:</strong> admin (ID: 2)</p>
            <p><strong>Страница:</strong> <a href="https://test006.rusff.me/viewtopic.php?id=7" target="_blank">рандом</a></p>
            <p><strong>Время находки:</strong> 17.10.2025, 22:16:38</p>
            </div>
        </div>
        </div><div class="inv_item">
        <img src="https://upforme.ru/uploads/001c/52/b6/2/605998.png?sec=DQ0+QTpQQEYtMiEAUWcCRz42OVcHeTwMJx49AzpUfV8uJjpCeVp3Rz42OVYvRAIMJSAXBT5ublo5DzINfmNBST8fOlArVDRTJR4fGRVrEhI=" title="Тыква" alt="Тыква" class="item-image">
        <div class="item-description">
            <h3>Тыква</h3>
            <p>Рыжая, сочная, задорно сверающая глазами и караулящая за углом.</p>
            <div>
            <p><strong>Нашедший:</strong> admin (ID: 2)</p>
            <p><strong>Страница:</strong> <a href="https://test006.rusff.me/viewtopic.php?id=7" target="_blank">рандом</a></p>
            <p><strong>Время находки:</strong> 17.10.2025, 22:36:29</p>
            </div>
        </div>
        </div><div class="inv_item">
        <img src="https://upforme.ru/uploads/001c/52/b6/2/605998.png?sec=DQ0+QTpQQEYtMiEAUWcCRz42OVcHeTwMJx49AzpUfV8uJjpCeVp3Rz42OVYvRAIMJSATBT5ublo5DzINfmNBST8hNlAreiBTJjA5GRVrEhI=" title="Тыква" alt="Тыква" class="item-image">
        <div class="item-description">
            <h3>Тыква</h3>
            <p>Рыжая, сочная, задорно сверающая глазами и караулящая за углом.</p>
            <div>
            <p><strong>Нашедший:</strong> admin (ID: 2)</p>
            <p><strong>Страница:</strong> <a href="https://test006.rusff.me/viewtopic.php?id=7#p99" target="_blank">рандом</a></p>
            <p><strong>Время находки:</strong> 18.10.2025, 11:13:43</p>
            </div>
        </div>
        </div><div class="inv_item">
        <img src="https://upforme.ru/uploads/001c/52/b6/2/605998.png?sec=DQ0+QTpQQEYtMiEAUWcCRz42OVcHeTwMJx49AzpUfV8uJjpCeVp3Rz42OVYvRAIMJSATBT5ublo5DzINfmNBST8hNlAreg5TJQ41GRVrEhI=" title="Тыква" alt="Тыква" class="item-image">
        <div class="item-description">
            <h3>Тыква</h3>
            <p>Рыжая, сочная, задорно сверающая глазами и караулящая за углом.</p>
            <div>
            <p><strong>Нашедший:</strong> admin (ID: 2)</p>
            <p><strong>Страница:</strong> <a href="https://test006.rusff.me/viewtopic.php?id=7#p99" target="_blank">рандом</a></p>
            <p><strong>Время находки:</strong> 18.10.2025, 11:17:30</p>
            </div>
        </div>
        </div><div class="inv_item">
        <img src="https://upforme.ru/uploads/001c/52/b6/2/802623.png?sec=DQ0+QTpQQEYtMiEAUWcCRz42OVcHeTwMJx49AzpUfV8uJjpCeVp3Rz42OVYvRAIMJSATBT5ublo5DzINfmNBST8hKlArVCxTJiAlGRVrEhI=" title="Череп" alt="Череп" class="item-image">
        <div class="item-description">
            <h3>Череп</h3>
            <p>Бедный Йорик!</p>
            <div>
            <p><strong>Нашедший:</strong> admin (ID: 2)</p>
            <p><strong>Страница:</strong> <a href="https://test006.rusff.me/viewtopic.php?id=7#p99" target="_blank">рандом</a></p>
            <p><strong>Время находки:</strong> 18.10.2025, 16:30:54</p>
            </div>
        </div>
        </div><div class="inv_item">
        <img src="https://upforme.ru/uploads/001c/52/b6/2/610070.png?sec=DQ0+QTpQQEYtMiEAUWcCRz42OVcHeTwMJx49AzpUfV8uJjpCeVp3Rz42OVYvRAIMJSATBT5ublo5DzINfmNBST8hKlArVA5TJQ45GRVrEhI=" title="Зелье" alt="Зелье" class="item-image">
        <div class="item-description">
            <h3>Зелье</h3>
            <p>Второе название -- "Прощай, желудок".</p>
            <div>
            <p><strong>Нашедший:</strong> admin (ID: 2)</p>
            <p><strong>Страница:</strong> <a href="https://test006.rusff.me/viewtopic.php?id=7#p99" target="_blank">рандом</a></p>
            <p><strong>Время находки:</strong> 18.10.2025, 16:37:33</p>
            </div>
        </div>
        </div><div class="inv_item">
        <img src="https://upforme.ru/uploads/001c/52/b6/2/566605.png?sec=DQ0+QTpQQEYtMiEAUWcCRz42OVcHeTwMJx49AzpUfV8uJjpCeVp3Rz42OVYvRAIMJSATBT5ublo5DzINfmNBST8hKlAoaixTJTAlGRVrEhI=" title="Надгробие" alt="Надгробие" class="item-image">
        <div class="item-description">
            <h3>Надгробие</h3>
            <p>Сейчас это роскошь, не все достойны.</p>
            <div>
            <p><strong>Нашедший:</strong> admin (ID: 2)</p>
            <p><strong>Страница:</strong> <a href="https://test006.rusff.me/viewtopic.php?id=7#p99" target="_blank">рандом</a></p>
            <p><strong>Время находки:</strong> 18.10.2025, 16:40:04</p>
            </div>
        </div>
        </div><div class="inv_item">
        <img src="https://upforme.ru/uploads/001c/52/b6/2/605998.png?sec=DQ0+QTpQQEYtMiEAUWcCRz42OVcHeTwMJx49AzpUfV8uJjpCeVp3Rz42OVYvRAIMJSATBT5ublo5DzINfmNBST8hKlAoaihTJiAtGRVrEhI=" title="Тыква" alt="Тыква" class="item-image">
        <div class="item-description">
            <h3>Тыква</h3>
            <p>Рыжая, сочная, задорно сверающая глазами и караулящая за углом.</p>
            <div>
            <p><strong>Нашедший:</strong> admin (ID: 2)</p>
            <p><strong>Страница:</strong> <a href="https://test006.rusff.me/viewtopic.php?id=7#p99" target="_blank">рандом</a></p>
            <p><strong>Время находки:</strong> 18.10.2025, 16:41:56</p>
            </div>
        </div>
        </div><div class="inv_item">
        <img src="https://upforme.ru/uploads/001c/52/b6/2/610070.png?sec=DQ0+QTpQQEYtMiEAUWcCRz42OVcHeTwMJx49AzpUfV8uJjpCeVp3Rz42OVYvRAIMJSATBT5ublo5DzINfmNBST8hKlAoeiBTJTAtGRVrEhI=" title="Зелье" alt="Зелье" class="item-image">
        <div class="item-description">
            <h3>Зелье</h3>
            <p>Второе название -- "Прощай, желудок".</p>
            <div>
            <p><strong>Нашедший:</strong> admin (ID: 2)</p>
            <p><strong>Страница:</strong> <a href="https://test006.rusff.me/viewtopic.php?id=7" target="_blank">рандом</a></p>
            <p><strong>Время находки:</strong> 18.10.2025, 16:53:06</p>
            </div>
        </div>
        </div>
        <div class="inv_item">
        <img src="https://upforme.ru/uploads/001c/52/b6/2/605998.png?sec=DQ0+QTpQQEYtMiEAUWcCRz42OVcHeTwMJx49AzpUfV8uJjpCeVp3Rz42OVYvRAIMJSATBT5ublo5DzINfmNBST8hKlAoejhTJTA1GRVrEhI=" title="Тыква" alt="Тыква" class="item-image">
        <div class="item-description">
            <h3>Тыква</h3>
            <p>Рыжая, сочная, задорно сверающая глазами и караулящая за углом.</p>
            <div>
            <p><strong>Нашедший:</strong> admin (ID: 2)</p>
            <p><strong>Страница:</strong> <a href="https://test006.rusff.me/viewtopic.php?id=7" target="_blank">рандом</a></p>
            <p><strong>Время находки:</strong> 18.10.2025, 16:55:00</p>
            </div>
        </div>
        </div>
   
</div>
</div>
[/html]
Последнее обновление: 18.10.2025, 16:55:02

0

3

Инвентарь пользователя
[html]
<style>
.usr_inv {display: grid;gap: 10px;margin-top: 10px;grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));}
.inv_item {background: ;border: 1px solid #ddd;border-radius: 4px;padding: 10px;text-align: center;}
.item-image {width: 64px;height: 64px;object-fit: cover;border-radius: 4px;}
.item-description {display: none;}
#detailed-view-mgwqhfpwo7cl5brdm3g:checked ~ .usr_inv {grid-template-columns: 1fr;}
#detailed-view-mgwqhfpwo7cl5brdm3g:checked ~ .usr_inv .inv_item {display: flex;align-items: center;text-align: left;gap: 15px;padding: 15px;}
#detailed-view-mgwqhfpwo7cl5brdm3g:checked ~ .usr_inv .item-image {width: 50px;height: 50px;flex-shrink: 0;}
#detailed-view-mgwqhfpwo7cl5brdm3g:checked ~ .usr_inv .item-description {display: block;flex: 1;}
</style>

<div>
<input type="checkbox" id="detailed-view-mgwqhfpwo7cl5brdm3g">
<label for="detailed-view-mgwqhfpwo7cl5brdm3g" class="view-toggle">Подробный вид</label>
<div class="usr_inv">
    <div class="inv_item">
        <img src="https://upforme.ru/uploads/001c/52/b6/2/566605.png?sec=DQ0+QTpQQEYmVjkYUmdOXhAfNg8qbSdUCSMlGTxQYlw9CyEEanN/GDsfMg8qbSdVIR4bGT5uSFo5MTIBfVp3VzwmBAErRCBTJTA9Rj5QZkYSNE5J" title="Надгробие" alt="Надгробие" class="item-image">
        <div class="item-description">
            <h3>Надгробие</h3>
            <p>Сейчас это роскошь, не все достойны.</p>
            <div>
            <p><strong>Нашедший:</strong> Gremlin1 (ID: 3)</p>
            <p><strong>Страница:</strong> <a href="https://test006.rusff.me/viewtopic.php?id=8" target="_blank">Удали меня после теста</a></p>
            <p><strong>Время находки:</strong> 18.10.2025, 23:02:22</p>
            </div>
        </div>
        </div>
        <div class="inv_item">
        <img src="https://upforme.ru/uploads/001c/52/b6/2/802623.png?sec=DQ0+QTpQQEYmVjkYUmdOXhAfNg8qbSdUCSMlGTxQYlw9CyEEanN/GDsfMg8qbSdVIR4bGT5uSFo5MTIBfVp3VzwmBAErRCBTJQ49Rj5+fkYSNE5J" title="Череп" alt="Череп" class="item-image">
        <div class="item-description">
            <h3>Череп</h3>
            <p>Бедный Йорик!</p>
            <div>
            <p><strong>Нашедший:</strong> Gremlin1 (ID: 3)</p>
            <p><strong>Страница:</strong> <a href="https://test006.rusff.me/viewtopic.php?id=8" target="_blank">Удали меня после теста</a></p>
            <p><strong>Время находки:</strong> 18.10.2025, 23:32:04</p>
            </div>
        </div>
        </div>
   
</div>
</div>
[/html]
Последнее обновление: 18.10.2025, 23:32:08

0

4

[html]
<script src="https://cdn.jsdelivr.net/npm/@quadrosystems/mybb-sdk@0.9.7/lib/index.min.js"></script>

<div style="margin: 20px; padding: 15px; border: 2px dashed #00bfff; background: #f0f8ff; text-align: center;">
    <p style="font-weight: bold;">Тест Функции Постинга</p>
    <button id="testPostButton" style="padding: 10px 20px; background: #00bfff; color: white; border: none; cursor: pointer; border-radius: 5px;">
        Нажать для Отправки Тестового Сообщения
    </button>
    <p id="testStatus" style="margin-top: 10px; min-height: 20px; color: #333;"></p>
</div>

<script>
let testThreadID = null;
const statusDisplay = document.getElementById("testStatus");
const testButton = document.getElementById("testPostButton");

// 1. Асинхронная функция инициализации для получения ID темы
async function initializeTest() {
    statusDisplay.textContent = "Инициализация...";
    testButton.disabled = true;

    if (typeof MYBB !== 'undefined' && MYBB.thread) {
        try {
            const threadDetails = await MYBB.thread.getDetails();
            testThreadID = threadDetails.tid;
           
            if (testThreadID) {
                statusDisplay.textContent = `Готово к тесту! ID Темы: ${testThreadID}.`;
                testButton.disabled = false;
            } else {
                statusDisplay.textContent = "Ошибка: Не удалось получить ID темы.";
            }

        } catch (e) {
            statusDisplay.textContent = "Ошибка SDK: Не удалось получить детали темы (проверьте авторизацию).";
            console.error("SDK Error:", e);
        }
    } else {
        statusDisplay.textContent = "Критическая ошибка: MyBB SDK не загружен.";
    }
}

// 2. Функция отправки сообщения
testButton.onclick = async function() {
    if (!testThreadID) {
        statusDisplay.textContent = "Ошибка: ID темы не установлен.";
        return;
    }
   
    testButton.disabled = true;
    statusDisplay.textContent = "Отправка сообщения...";
   
    // Само сообщение, которое будет запощено
    const testContent = `
[center]✅ АВТОМАТИЧЕСКИЙ ТЕСТ ПОСТИНГА УСПЕШЕН!
Сообщение отправлено скриптом в ${new Date().toLocaleTimeString()}
[/center]
`;

    try {
        // Вызов функции постинга
        await MYBB.thread.reply(testThreadID, testContent);
       
        statusDisplay.style.color = 'green';
        statusDisplay.textContent = "УСПЕХ! Тестовое сообщение отправлено на форум.";
       
    } catch (error) {
        statusDisplay.style.color = 'red';
        statusDisplay.textContent = "СБОЙ! Проверьте, авторизованы ли вы и консоль F12.";
        console.error("Постинг СБОЙ:", error);
    } finally {
        testButton.disabled = false;
    }
};

// Запуск инициализации
initializeTest();
</script>
[/html]

0

5

[html]<div id="giftBox" style="margin:20px auto; width:250px; text-align:center;">
  <button id="giftButton" style="padding:10px 20px; font-size:18px; border-radius:8px; background:linear-gradient(45deg,#f33,#f90); color:white; border:none; cursor:pointer;">🎁 Открыть подарок</button>
  <div id="giftResult" style="margin-top:5%; font-size:16px; color:#fff;"></div>
</div>

<script>
(function(){
  const gifts = [
    "✨ Вам выпала редкая снежинка удачи!",
    "🎅 Санта прислал улыбку!",
    "🎄 Подарок: +1 к праздничному настроению!",
    "🍫 Шоколадка от эльфов!",
    "💫 Волшебная звезда освещает ваш день!"
  ];
  const INTERVAL = 0 * 60 * 60; // раз в сутки
  const lastOpen = localStorage.getItem('giftTime');
  const now = Math.floor(Date.now()/1000);

  if (lastOpen && now - parseInt(lastOpen) < INTERVAL) {
    document.getElementById('giftButton').disabled = true;
    document.getElementById('giftButton').textContent = "🎁 Уже открыт сегодня!";
  }

  document.getElementById('giftButton').onclick = () => {
    const msg = gifts[Math.floor(Math.random() * gifts.length)];
    document.getElementById('giftResult').innerHTML = msg;
    localStorage.setItem('giftTime', Math.floor(Date.now()/1000));
    document.getElementById('giftButton').disabled = true;
    document.getElementById('giftButton').textContent = "🎁 Уже открыт сегодня!";
  };
})();
</script>[/html]

0

6

[html]<div id="giftBox" style="margin:20px auto; width:260px; text-align:center;">
  <button id="giftButton"
    style="padding:12px 22px; font-size:18px; border-radius:10px;
    background:linear-gradient(45deg,#ff4e50,#f9d423);
    color:white; border:none; cursor:pointer; transition:0.3s;">
    🎁 Открыть подарок
  </button>

  <div id="giftResult"
    style="margin-top:20px; font-size:18px; color:white;
    padding:15px; border-radius:12px; display:none;
    background:rgba(255,255,255,0.15); backdrop-filter:blur(6px);
    border:1px solid rgba(255,255,255,0.3);
    box-shadow:0 0 10px rgba(255,255,255,0.2); opacity:0;
    transition:opacity 0.8s;">
  </div>
</div>

<script>
(function () {
  // Поздравления
  const gifts = [
    "✨ Вам выпала редкая снежинка удачи!",
    "🎅 Санта прислал вам тёплую улыбку!",
    "🎄 +1 к праздничному настроению!",
    "🍫 Эльфы подогнали шоколадку!",
    "💫 Волшебная звезда освещает ваш день!"
  ];

  // Время между открытиями (например 24 часа)
  const INTERVAL = 1 * 60 * 60; // сек

  const giftButton = document.getElementById("giftButton");
  const giftResult = document.getElementById("giftResult");

  const lastOpenTime = localStorage.getItem("giftTime");
  const savedMessage = localStorage.getItem("giftText");
  const now = Math.floor(Date.now() / 1000);

  // Если подарок уже был открыт — показываем сохранённый текст
  if (lastOpenTime && now - lastOpenTime < INTERVAL) {
    if (savedMessage) showMessage(savedMessage);
    lockButton();
  }

  giftButton.onclick = () => {
    const msg = gifts[Math.floor(Math.random() * gifts.length)];
    // Показать
    showMessage(msg);

    // Сохранить
    localStorage.setItem("giftTime", Math.floor(Date.now() / 1000));
    localStorage.setItem("giftText", msg);

    // Заблокировать кнопку
    lockButton();
  };

  // 🔒 Блокировка кнопки
  function lockButton() {
    giftButton.disabled = true;
    giftButton.style.cursor = "not-allowed";
    giftButton.textContent = "🎁 Уже открыт!";
    giftButton.style.opacity = "0.6";
  }

  // ✨ Показ поздравления
  function showMessage(text) {
    giftResult.innerHTML = text;
    giftResult.style.display = "block";

    // Задержка для плавного появления
    setTimeout(() => {
      giftResult.style.opacity = "1";
    }, 50);
  }
})();
</script>[/html]

0

7

[html]<div id="predictionBox" style="display:flex; align-items:center; gap:20px; font-family:Arial;">
 
  <!-- Левая часть: кнопка + таймер -->
  <div id="leftBlock" style="padding:10px 20px; background:#d9ab5a; border:3px solid #4d4a3f; width:200px; text-align:center;">
      <button id="predictButton"
        style="width:100%; padding:10px; font-size:16px; font-weight:bold;
        border:none; background:none; cursor:pointer;">
        ОТКРЫТЬ<br>ПРЕДСКАЗАНИЕ
      </button>
      <div id="timer" style="margin-top:8px; font-size:14px; color:#1e8a00; font-weight:bold; display:none;">
      </div>
  </div>

  <!-- Правая часть: предсказание -->
  <div id="predictionResult"
       style="padding:15px 20px; width:350px; min-height:40px; border:3px solid #4d4a3f; background:#ece9df; display:flex; align-items:center;">
  </div>

</div>

<script>
(function(){
  const predictions = [
    "СЕГОДНЯ ТЕБЕ ПОВЕЗЁТ",
    "УДАЧА БУДЕТ НА ТВОЕЙ СТОРОНЕ",
    "ВАС ЖДЁТ ПРИЯТНЫЙ СЮРПРИЗ",
    "ТЫ ПОЛУЧИШЬ ХОРОШУЮ НОВОСТЬ",
    "ЖЕЛАНИЕ СБУДЕТСЯ, ЕСЛИ УЛЫБНУТЬСЯ"
  ];

  const INTERVAL = 1 * 60 * 60; // 3 часа (пример по макету)

  const btn = document.getElementById("predictButton");
  const result = document.getElementById("predictionResult");
  const timerBox = document.getElementById("timer");

  const lastOpen = localStorage.getItem("predTime");
  const savedText = localStorage.getItem("predText");
  const now = Math.floor(Date.now()/1000);

  // Если уже открыто ранее — показываем предсказание
  if (lastOpen && now - lastOpen < INTERVAL) {
    result.textContent = savedText || "";
    startCountdown(INTERVAL - (now - lastOpen));
    lockButton();
  }

  // При нажатии
  btn.onclick = () => {
    const text = predictions[Math.floor(Math.random() * predictions.length)];
    result.textContent = text;

    // Сохраняем
    localStorage.setItem("predTime", Math.floor(Date.now()/1000));
    localStorage.setItem("predText", text);

    lockButton();
    startCountdown(INTERVAL);
  };

  // Блокируем кнопку
  function lockButton() {
    btn.disabled = true;
    btn.style.opacity = "0.6";
    btn.style.cursor = "not-allowed";
  }

  // Разблокируем кнопку
  function unlockButton() {
    btn.disabled = false;
    btn.style.opacity = "1";
    btn.style.cursor = "pointer";
    result.textContent = "";
  }

  // Обратный отсчёт
  function startCountdown(sec) {
    timerBox.style.display = "block";
    update();

    const int = setInterval(update, 1000);

    function update() {
      if (sec <= 0) {
        clearInterval(int);
        timerBox.style.display = "none";

        localStorage.removeItem("predTime");
        localStorage.removeItem("predText");

        unlockButton();
        return;
      }

      const h = String(Math.floor(sec / 3600)).padStart(2, '0');
      const m = String(Math.floor((sec % 3600) / 60)).padStart(2, '0');
      const s = String(sec % 60).padStart(2, '0');

      timerBox.textContent = "осталось: " + h + ":" + m + ":" + s;

      sec--;
    }
  }
})();
</script>[/html]

0

8

[html]<!-- КРАСИВЫЙ ШРИФТ -->
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap" rel="stylesheet">

<style>
  #predictionBox {
    font-family: 'Montserrat', sans-serif;
  }

  /* Блок предсказания: изначально он спрятан слева */
  #predictionResult {
    transform: translateX(-220px);
    opacity: 0;
    transition: transform 0.6s ease, opacity 0.6s ease;
  }

  /* Класс для запуска выезда */
  .slideFromLeft {
    transform: translateX(0);
    opacity: 1;
  }
</style>

<div id="predictionBox" style="display:flex; align-items:center; gap:20px;">

  <!-- ЛЕВАЯ ЧАСТЬ -->
  <div id="leftBlock"
       style="padding:10px 20px; background:#d9ab5a; border:3px solid #4d4a3f;
       width:200px; text-align:center; border-radius:4px;">
     
      <button id="predictButton"
        style="width:100%; padding:10px; font-size:16px; font-weight:700;
        border:none; background:none; cursor:pointer;">
        ОТКРЫТЬ<br>ПРЕДСКАЗАНИЕ
      </button>

      <div id="timer"
        style="margin-top:8px; font-size:14px; color:#1e8a00; font-weight:600; display:none;">
      </div>
  </div>

  <!-- ПРАВАЯ ЧАСТЬ -->
  <div id="predictionResult"
       style="padding:15px 20px; width:350px; min-height:40px;
       border:3px solid #4d4a3f; background:#f6f4ee; border-radius:4px; display:flex; align-items:center;">
  </div>

</div>

<script>
(function(){
  const predictions = [
    "СЕГОДНЯ ТЕБЕ ПОВЕЗЁТ",
    "УДАЧА БУДЕТ НА ТВОЕЙ СТОРОНЕ",
    "ТЕБЯ ЖДЁТ ПРИЯТНЫЙ ПОВОРОТ",
    "СКОРО СЛУЧИТСЯ ХОРОШЕЕ",
    "ЖЕЛАНИЕ СБУДЕТСЯ — ВЕРЬ В СЕБЯ"
  ];

  const INTERVAL = 0 * 60 * 60; // 3 часа

  const btn = document.getElementById("predictButton");
  const result = document.getElementById("predictionResult");
  const timerBox = document.getElementById("timer");

  const lastOpen = localStorage.getItem("predTime");
  const savedText = localStorage.getItem("predText");
  const now = Math.floor(Date.now()/1000);

  // Если предсказание сохранено — выезжает сразу
  if (lastOpen && now - lastOpen < INTERVAL) {
    if (savedText) slidePrediction(savedText);
    lockButton();
    startCountdown(INTERVAL - (now - lastOpen));
  }

  btn.onclick = () => {
    const text = predictions[Math.floor(Math.random() * predictions.length)];

    slidePrediction(text);

    localStorage.setItem("predTime", Math.floor(Date.now()/1000));
    localStorage.setItem("predText", text);

    lockButton();
    startCountdown(INTERVAL);
  };

  // Функция выезда справа
  function slidePrediction(text) {
    result.textContent = text;

    // сбрасываем анимацию
    result.classList.remove("slideFromLeft");
    void result.offsetWidth;
    result.classList.add("slideFromLeft");
  }

  function lockButton() {
    btn.disabled = true;
    btn.style.opacity = "0.6";
    btn.style.cursor = "not-allowed";
  }

  function unlockButton() {
    btn.disabled = false;
    btn.style.opacity = "1";
    btn.style.cursor = "pointer";
    result.textContent = "";
    result.classList.remove("slideFromLeft");
  }

  function startCountdown(sec) {
    timerBox.style.display = "block";
    update();

    const int = setInterval(update, 1000);

    function update() {
      if (sec <= 0) {
        clearInterval(int);
        timerBox.style.display = "none";
        localStorage.removeItem("predTime");
        localStorage.removeItem("predText");
        unlockButton();
        return;
      }

      const h = String(Math.floor(sec / 3600)).padStart(2, '0');
      const m = String(Math.floor((sec % 3600) / 60)).padStart(2, '0');
      const s = String(sec % 60).padStart(2, '0');

      timerBox.textContent = "осталось: " + h + ":" + m + ":" + s;

      sec--;
    }
  }
})();
</script>[/html]

0

9

[html]<div class="fortune-wrapper">
  <button id="fortune-btn">
    <span id="btn-text">ОТКРЫТЬ<br>ПРЕДСКАЗАНИЕ</span>
    <span id="btn-timer" style="display:none;"></span>
  </button>

  <div id="fortune-block">
    <div id="fortune-text"></div>
  </div>
</div>

<style>
.fortune-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  overflow: visible; /* важно! */
  font-family: "Trebuchet MS", sans-serif;
}

/* Кнопка */
#fortune-btn {
  width: 230px;
  height: 80px;
  background: linear-gradient(#e3b56a, #c89a4a);
  border: 3px solid #6d624a;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

#btn-timer {
  font-size: 20px;
  color: #1a7f1a;
}

/* Правый блок */
#fortune-block {
  width: 350px;
  height: 80px;
  background: #f5f2eb;
  border: 3px solid #6d624a;
  display: flex;
  align-items: center;
  padding: 0 20px;
  margin-left: -20px;

  position: relative;
  left: -280px;        /* ←  скрыт ПОД кнопкой */
  opacity: 0;

  transition: left 0.65s ease, opacity 0.65s ease;
}

#fortune-block.active {
  left: 10px;         /* ← выезд */
  opacity: 1;
}
</style>

<script>
let canOpen = true;
let timerInterval = null;
let duration = 60; // поставила 10 секунд для теста — легко проверять

const btn = document.getElementById("fortune-btn");
const btnText = document.getElementById("btn-text");
const btnTimer = document.getElementById("btn-timer");
const block = document.getElementById("fortune-block");
const fortuneText = document.getElementById("fortune-text");

const predictions = [
  "Скоро случится неожиданная удача!",
  "Ты получишь приятную новость.",
  "Сегодня день благоприятен для желаний.",
  "Тебя ждёт маленькое чудо."
];

btn.addEventListener("click", () => {
  if (!canOpen) return;

  canOpen = false;

  fortuneText.textContent =
    predictions[Math.floor(Math.random() * predictions.length)];

  // меняем текст кнопки на таймер
  btnText.style.display = "none";
  btnTimer.style.display = "block";

  // показываем правый блок
  block.classList.add("active");

  startTimer();
});

function startTimer() {
  let remaining = duration;
  updateTimerDisplay(remaining);

  timerInterval = setInterval(() => {
    remaining--;
    updateTimerDisplay(remaining);

    if (remaining <= 0) {
      clearInterval(timerInterval);

      btnText.style.display = "block";
      btnTimer.style.display = "none";

      block.classList.remove("active");

      canOpen = true;
    }
  }, 1000);
}

function updateTimerDisplay(sec) {
  const m = String(Math.floor(sec / 60)).padStart(2, "0");
  const s = String(sec % 60).padStart(2, "0");
  btnTimer.textContent = `${m}:${s}`;
}
</script>
[/html]

0

10

[html]<div class="fortune-wrapper">
  <button id="fortune-btn">
    <span id="btn-text">ОТКРЫТЬ<br>ПРЕДСКАЗАНИЕ</span>
    <span id="btn-timer" style="display:none;"></span>
  </button>

  <div id="fortune-block">
    <div id="fortune-text"></div>
  </div>
</div>

<style>
.fortune-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  overflow: visible;
  font-family: "Trebuchet MS", sans-serif;
}

/* Кнопка */
#fortune-btn {
  width: 230px;
  height: 80px;
  background: linear-gradient(#e3b56a, #c89a4a);
  border: 3px solid #6d624a;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

#btn-timer {
  font-size: 20px;
  color: #1a7f1a;
}

/* Блок предсказания */
#fortune-block {
  width: 350px;
  height: 70px;
  background: #f5f2eb;
  border: 3px solid #6d624a;
  display: flex;
  align-items: center;
  padding: 0 20px;
  margin-left: -20px;

  position: relative;
  left: -280px;
  opacity: 0;

  transition: left 0.65s ease, opacity 0.65s ease;
}

#fortune-block.active {
  left: 10px;
  opacity: 1;
}
</style>

<script>
/* -----------------------------
   НАСТРОЙКА ВРЕМЕНИ
   ----------------------------- */
const HOURS = 0;
const MINUTES = 2;

// Переводим в секунды
const INTERVAL = HOURS * 3600 + MINUTES * 60;

/* -----------------------------
   ЭЛЕМЕНТЫ
   ----------------------------- */
const btn = document.getElementById("fortune-btn");
const btnText = document.getElementById("btn-text");
const btnTimer = document.getElementById("btn-timer");
const block = document.getElementById("fortune-block");
const fortuneText = document.getElementById("fortune-text");

let timerInterval = null;

const predictions = [
  "Скоро случится неожиданная удача!",
  "Тебя ждёт приятная новость!",
  "День благоприятен для желаний.",
  "Скоро произойдёт маленькое чудо!",
];

/* -----------------------------
   ЗАГРУЗКА СОСТОЯНИЯ
   ----------------------------- */
const savedTime = localStorage.getItem("fortuneTime");
const savedText = localStorage.getItem("fortuneText");
const now = Math.floor(Date.now() / 1000);

// Если предсказание активно
if (savedTime && now < savedTime) {
  const remaining = savedTime - now;

  // показать сохранённое предсказание
  if (savedText) {
    fortuneText.textContent = savedText;
    block.classList.add("active");
  }

  // включить таймер
  btnText.style.display = "none";
  btnTimer.style.display = "block";

  startTimer(remaining, false);
}

/* -----------------------------
   КНОПКА
   ----------------------------- */
btn.addEventListener("click", () => {
  // Если уже идёт таймер — не срабатывает
  if (btnTimer.style.display === "block") return;

  const msg = predictions[Math.floor(Math.random() * predictions.length)];
  fortuneText.textContent = msg;
  block.classList.add("active");

  btnText.style.display = "none";
  btnTimer.style.display = "block";

  const newEndTime = Math.floor(Date.now() / 1000) + INTERVAL;

  localStorage.setItem("fortuneText", msg);
  localStorage.setItem("fortuneTime", newEndTime);

  startTimer(INTERVAL, true);
});

/* -----------------------------
   ТАЙМЕР
   ----------------------------- */
function startTimer(duration, isNewClick) {
  let remaining = duration;

  updateTimerDisplay(remaining);

  timerInterval = setInterval(() => {
    remaining--;
    updateTimerDisplay(remaining);

    if (remaining <= 0) {
      clearInterval(timerInterval);
      localStorage.removeItem("fortuneText");
      localStorage.removeItem("fortuneTime");

      btnTimer.style.display = "none";
      btnText.style.display = "block";

      block.classList.remove("active");
    }
  }, 1000);
}

function updateTimerDisplay(sec) {
  const m = String(Math.floor(sec / 60)).padStart(2, "0");
  const s = String(sec % 60).padStart(2, "0");
  btnTimer.textContent = `${m}:${s}`;
}
</script>[/html]

0

11

[html]<style>
/* -------------------------------------------------------------------
|  ОБЩИЕ СТИЛИ КОНТЕЙНЕРА И ВКЛАДОК
|-------------------------------------------------------------------- */
.tab-container {
    display: flex;
    width: 100%;
    max-width: 100%;
    margin: 20px auto;
    border: 1px solid #3d3b37;
    background: #e7e3d8;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
    font-family: Arial, sans-serif;
}

.tab-sidebar {
    width: 18%; /* Установил фиксированную ширину, чтобы избежать проблем с 25% */
    flex-shrink: 0;
    background: #474747;
    padding-top: 5px;
}

.tab-content-area {
    flex-grow: 1;
    padding: 10px;
    min-height: 600px;
    position: relative;
}

.tab-radio {
    display: none;
}

/* Стили для меток-вкладок */
.tab-label {
    display: block;
    padding: 10% 10%;
    text-align: left;
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
    background: #5b5b5b;
    border-bottom: 1px solid #3d3b37;
    transition: background 0.2s;
}

.tab-label:hover {
    background: #4a4a4a;
}

/* --- Логика активации вкладок --- */
#tab1:checked ~ .tab-sidebar .label-1,
#tab2:checked ~ .tab-sidebar .label-2,
#tab3:checked ~ .tab-sidebar .label-3,
#tab4:checked ~ .tab-sidebar .label-4,
#tab5:checked ~ .tab-sidebar .label-5,
#tab6:checked ~ .tab-sidebar .label-6 {
    background: #3a3a3a;
}

.tab-content {
    display: none;
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background: #f0ede1;
    padding: 10px;
    overflow: auto;
}

#tab1:checked ~ .tab-content-area .content-1,
#tab2:checked ~ .tab-content-area .content-2,
#tab3:checked ~ .tab-content-area .content-3,
#tab4:checked ~ .tab-content-area .content-4,
#tab5:checked ~ .tab-content-area .content-5,
#tab6:checked ~ .tab-content-area .content-6 {
    display: block;
}

/* -------------------------------------------------------------------
|  СТИЛИ ДЛЯ КОНТЕНТА 1 (ИНГРЕДИЕНТЫ)
|-------------------------------------------------------------------- */

.ingredients-list-header {
    background: #a8a39a;
    border: 1px solid #3d3b37;
    padding: 5px 10px;
    text-align: center;
    font-weight: bold;
    margin-bottom: 10px;
}

.ingredients-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
    padding-left: 5px;
}

.ingredient-item {
    text-align: center;
    width: 80px;
}

.ingredient-item {
    text-align: center;
    width: 80px;
}

.ingredient-img {
    width: 50px;
    height: 50px;
    border: 1px solid #3d3b37;
    object-fit: cover;
    margin-bottom: 5px;
}

.ingredient-item span {
    display: block;
    font-size: 12px;
    font-weight: bold;
}


/* -------------------------------------------------------------------
|  СТИЛИ ДЛЯ РЕЦЕПТОВ (КОНТЕНТ 2, 3, 4)
|-------------------------------------------------------------------- */

.recipe-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.recipe-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.recipe-image-side {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border: 2px solid #3d3b37;
    background: #b4a378;
}

.recipe-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-header {
    background: #a8a39a;
    border: 1px solid #3d3b37;
    padding: 5px;
    margin-bottom: 5px;
    display: flex;
    flex-direction: column;
}

.recipe-title-line {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 14px;
    padding-bottom: 2px;
}

.recipe-description {
    font-weight: normal;
    font-size: 12px;
    line-height: 1.2;
    padding-left: 27px;
}

.recipe-ingredients {
    display: flex;
    gap: 5px;
    padding: 0;
}

/* Стиль для IMG тегов, используемых как иконки ингредиентов */
.ingredient-icon-img {
    width: 45px;
    height: 45px;
    border: 1px solid #3d3b37;
}

/* --- Стили для Квадратика (Чекбокса) --- */
.done-checkbox {
    display: none;
}
.checkbox-label {
    display: block;
    width: 20px;
    height: 20px;
    border: 2px solid #3a3a3a;
    background: #f0ede1;
    cursor: pointer;
    line-height: 18px;
    text-align: center;
    font-size: 14px;
    color: green;
    margin-right: 5px;
    flex-shrink: 0;
}
.checkbox-label::after {
    content: '✓';
    display: none;
}
.done-checkbox:checked + .checkbox-label::after {
    display: inline;
}

</style>

<div class="tab-container">
    <input type="radio" id="tab1" name="tab-group" class="tab-radio" checked>
    <input type="radio" id="tab2" name="tab-group" class="tab-radio">
    <input type="radio" id="tab3" name="tab-group" class="tab-radio">
    <input type="radio" id="tab4" name="tab-group" class="tab-radio">
    <input type="radio" id="tab5" name="tab-group" class="tab-radio">
    <input type="radio" id="tab6" name="tab-group" class="tab-radio">

    <div class="tab-sidebar">
        <label for="tab1" class="tab-label label-1">БЛЮДА И<br>ИНГРЕДИЕНТЫ</label>
        <label for="tab2" class="tab-label label-2">ПРОСТЫЕ<br>БЛЮДА</label>
        <label for="tab3" class="tab-label label-3">РЕДКИЕ<br>БЛЮДА</label>
        <label for="tab4" class="tab-label label-4">ПРОФЕССИОНАЛЬНЫЕ<br>БЛЮДА</label>
        <label for="tab5" class="tab-label label-5">ЭКСКЛЮЗИВНЫЕ<br>БЛЮДА</label>
        <label for="tab6" class="tab-label label-6">ОСОБЕННЫЕ<br>БЛЮДА</label>
    </div>

    <div class="tab-content-area">
       
<div class="tab-content content-1">
    <p style="border: 1px solid #3d3b37; background: #f0ede1; padding: 15px; margin-bottom: 10px;">
        Выберите вкладку слева, чтобы увидеть рецепты.
    </p>

    <div class="ingredients-list-header">ИНГРЕДИЕНТЫ</div>

    <div class="ingredients-grid">
        <div class="ingredient-item">
            <img src="https://upforme.ru/uploads/001c/84/76/2/871685.png" alt="Ингредиент" class="ingredient-img">
            <span>картофель</span>
        </div>
        <div class="ingredient-item">
            <img src="https://upforme.ru/uploads/001c/84/76/2/512221.png" alt="Ингредиент" class="ingredient-img">
            <span>лук</span>
        </div>
        <div class="ingredient-item">
            <img src="https://upforme.ru/uploads/001c/84/76/2/447452.png" alt="Ингредиент" class="ingredient-img">
            <span>вода</span>
        </div>
        <div class="ingredient-item">
            <img src="https://upforme.ru/uploads/001c/84/76/2/162271.png" alt="Ингредиент" class="ingredient-img">
            <span>мука</span>
        </div>
        <div class="ingredient-item">
            <img src="https://upforme.ru/uploads/001c/84/76/2/314387.png" alt="Ингредиент" class="ingredient-img">
            <span>соль</span>
        </div>
        <div class="ingredient-item">
            <img src="https://upforme.ru/uploads/001c/84/76/2/161773.png" alt="Ингредиент" class="ingredient-img">
            <span>рыба</span>
        </div>
        <div class="ingredient-item">
            <img src="https://upforme.ru/uploads/001c/84/76/2/851541.png" alt="Ингредиент" class="ingredient-img">
            <span>яйцо</span>
        </div>
        <div class="ingredient-item">
            <img src="https://upforme.ru/uploads/001c/80/ee/3/573120.png" alt="Ингредиент" class="ingredient-img">
            <span>ягоды</span>
        </div>
        <div class="ingredient-item">
            <img src="https://upforme.ru/uploads/001c/84/76/2/395835.png" alt="Ингредиент" class="ingredient-img">
            <span>крот</span>
        </div>
        <div class="ingredient-item">
            <img src="https://upforme.ru/uploads/001c/84/76/2/998025.png" alt="Ингредиент" class="ingredient-img">
            <span>томат</span>
        </div>
        <div class="ingredient-item">
            <img src="https://upforme.ru/uploads/001c/84/76/2/262394.png" alt="Ингредиент" class="ingredient-img">
            <span>молоко</span>
        </div>
        <div class="ingredient-item">
            <img src="https://upforme.ru/uploads/001c/84/76/2/926759.png" alt="Ингредиент" class="ingredient-img">
            <span>масло</span>
        </div>
        <div class="ingredient-item">
            <img src="https://upforme.ru/uploads/001c/80/ee/3/611401.png" alt="Ингредиент" class="ingredient-img">
            <span>гриб</span>
        </div>
        <div class="ingredient-item">
            <img src="https://upforme.ru/uploads/001c/84/76/2/230162.png" alt="Ингредиент" class="ingredient-img">
            <span>голубь</span>
        </div>
        <div class="ingredient-item">
            <img src="https://upforme.ru/uploads/001c/84/76/2/59138.png" alt="Ингредиент" class="ingredient-img">
            <span>старый сапог</span>
        </div>
        <div class="ingredient-item">
            <img src="https://upforme.ru/uploads/001c/84/76/2/278170.png" alt="Ингредиент" class="ingredient-img">
            <span>спирт</span>
        </div>
        <div class="ingredient-item">
            <img src="https://upforme.ru/uploads/001c/84/76/2/383221.png" alt="Ингредиент" class="ingredient-img">
            <span>пропавшее мясо</span>
        </div>
        <div class="ingredient-item">
            <img src="https://upforme.ru/uploads/001c/84/76/2/956123.png" alt="Ингредиент" class="ingredient-img">
            <span>тухлое яйцо</span>
        </div>
    </div>
</div>

        <div class="tab-content content-2">
           
            <div class="recipe-line">
                <div class="recipe-details">
                    <div class="recipe-header">
                        <div class="recipe-title-line">
                            <input type="checkbox" id="recipe1_done" class="done-checkbox">
                            <label for="recipe1_done" class="checkbox-label"></label>
                            <span>Вода из лужи (кипячёная, наверное)</span>
                        </div>
                        <div class="recipe-description">
                            На вкус как дождь, грязь и сомнения. Кипятили? Возможно. Живы? Пока да
                        </div>
                    </div>
                   
                    <div class="recipe-ingredients">
                        <img src="https://upforme.ru/uploads/001c/84/76/2/447452.png" alt="вода" class="ingredient-icon-img">
                        <img src="https://upforme.ru/uploads/001c/84/76/2/314387.png" alt="соль" class="ingredient-icon-img">
                        <img src="https://upforme.ru/uploads/001c/84/76/2/512221.png" alt="лук" class="ingredient-icon-img">
                    </div>
                </div>
               
                <div class="recipe-image-side">
                    <img src="https://upforme.ru/uploads/001c/80/ee/3/562280.png" class="recipe-image">
                </div>
            </div>
           
            <div class="recipe-line">
                <div class="recipe-details">
                    <div class="recipe-header">
                        <div class="recipe-title-line">
                            <input type="checkbox" id="recipe2_done" class="done-checkbox">
                            <label for="recipe2_done" class="checkbox-label"></label>
                            <span>Яичница бюджетная</span>
                        </div>
                        <div class="recipe-description">
                            Дешево, сердито и немного грустно
                        </div>
                    </div>
                   
                    <div class="recipe-ingredients">
                        <img src="https://upforme.ru/uploads/001c/84/76/2/851541.png" alt="яйцо" class="ingredient-icon-img">
                        <img src="https://upforme.ru/uploads/001c/84/76/2/851541.png" alt="яйцо" class="ingredient-icon-img">
                        <img src="https://upforme.ru/uploads/001c/84/76/2/314387.png" alt="соль" class="ingredient-icon-img">
                    </div>
                </div>
               
                <div class="recipe-image-side">
                    <img src="https://upforme.ru/uploads/001c/80/ee/3/769985.png" class="recipe-image">
                </div>
            </div>

           <div class="recipe-line">
                <div class="recipe-details">
                    <div class="recipe-header">
                        <div class="recipe-title-line">
                            <input type="checkbox" id="recipe3_done" class="done-checkbox">
                            <label for="recipe3_done" class="checkbox-label"></label>
                            <span>Картофельный суп-пюре</span>
                        </div>
                        <div class="recipe-description">
                            Классика выживания. Прост, как лопата
                        </div>
                    </div>
                   
                    <div class="recipe-ingredients">
                        <img src="https://upforme.ru/uploads/001c/84/76/2/871685.png" alt="картофель" class="ingredient-icon-img">
                        <img src="https://upforme.ru/uploads/001c/84/76/2/447452.png" alt="вода" class="ingredient-icon-img">
                        <img src="https://upforme.ru/uploads/001c/84/76/2/512221.png" alt="лук" class="ingredient-icon-img">
                    </div>
                </div>
               
                <div class="recipe-image-side">
                    <img src="https://upforme.ru/uploads/001c/80/ee/3/443480.png" class="recipe-image">
                </div>
            </div>

            <div class="recipe-line">
                <div class="recipe-details">
                    <div class="recipe-header">
                        <div class="recipe-title-line">
                            <input type="checkbox" id="recipe4_done" class="done-checkbox">
                            <label for="recipe4_done" class="checkbox-label"></label>
                            <span>Жареные овощи</span>
                        </div>
                        <div class="recipe-description">
                            Простое и сытное блюдо, если удалось не спалить
                        </div>
                    </div>
                   
                    <div class="recipe-ingredients">
                        <img src="https://upforme.ru/uploads/001c/84/76/2/871685.png" alt="картофель" class="ingredient-icon-img">
                        <img src="https://upforme.ru/uploads/001c/84/76/2/998025.png" alt="томат" class="ingredient-icon-img">
                        <img src="https://upforme.ru/uploads/001c/84/76/2/512221.png" alt="лук" class="ingredient-icon-img">
                        <img src="https://upforme.ru/uploads/001c/80/ee/3/611401.png" alt="гриб" class="ingredient-icon-img">
                    </div>
                </div>
               
                <div class="recipe-image-side">
                    <img src="https://upforme.ru/uploads/001c/84/76/2/157323.png" class="recipe-image">
                </div>
            </div>

            <div class="recipe-line">
                <div class="recipe-details">
                    <div class="recipe-header">
                        <div class="recipe-title-line">
                            <input type="checkbox" id="recipe5_done" class="done-checkbox">
                            <label for="recipe5_done" class="checkbox-label"></label>
                            <span>Рыба и фри</span>
                        </div>
                        <div class="recipe-description">
                            Ностальгия по старым временам и фастфуду
                        </div>
                    </div>
                   
                    <div class="recipe-ingredients">
                        <img src="https://upforme.ru/uploads/001c/84/76/2/161773.png" alt="рыба" class="ingredient-icon-img">
                        <img src="https://upforme.ru/uploads/001c/84/76/2/871685.png" alt="картофель" class="ingredient-icon-img">
                        <img src="https://upforme.ru/uploads/001c/84/76/2/926759.png" alt="масло" class="ingredient-icon-img">
                    </div>
                </div>
               
                <div class="recipe-image-side">
                    <img src="https://upforme.ru/uploads/001c/84/76/2/157323.png" class="recipe-image">
                </div>
            </div>

        </div>

        <div class="tab-content content-3">
             <p style="padding: 15px; border: 1px solid #3d3b37; background: #f0ede1; font-style: italic;">
                [ЗДЕСЬ МОЖНО ДОБАВИТЬ РЕДКИЕ РЕЦЕПТЫ]
            </p>
        </div>

        <div class="tab-content content-4">
           
             <div class="recipe-line">
                <div class="recipe-details">
                    <div class="recipe-header">
                        <div class="recipe-title-line">
                            <input type="checkbox" id="recipe4_done" class="done-checkbox">
                            <label for="recipe4_done" class="checkbox-label"></label>
                            <span>Сложный профессиональный суп</span>
                        </div>
                        <div class="recipe-description">
                            Рецепт для настоящих мастеров.
                        </div>
                    </div>
                   
                    <div class="recipe-ingredients">
                        <img src="https://upforme.ru/uploads/001c/84/76/2/857076.png" alt="Картошка" class="ingredient-icon-img">
                        <img src="https://upforme.ru/uploads/001c/84/76/2/709377.png" alt="Морковка" class="ingredient-icon-img">
                        <img src="https://upforme.ru/uploads/001c/84/76/2/709377.png" alt="Лук" class="ingredient-icon-img">
                    </div>
                </div>
               
                <div class="recipe-image-side">
                    <img src="https://i.imgur.com/jS72S9F.png" alt="Профессиональный суп" class="recipe-image">
                </div>
            </div>
            </div>

        <div class="tab-content content-5">
           
             <div class="recipe-line">
                <div class="recipe-details">
                    <div class="recipe-header">
                        <div class="recipe-title-line">
                            <input type="checkbox" id="recipe5_done" class="done-checkbox">
                            <label for="recipe5_done" class="checkbox-label"></label>
                            <span>ЧТО ТО профессиональный суп</span>
                        </div>
                        <div class="recipe-description">
                            Рецепт для настоящих мастеров.
                        </div>
                    </div>
                   
                    <div class="recipe-ingredients">
                        <img src="https://upforme.ru/uploads/001c/84/76/2/857076.png" alt="Картошка" class="ingredient-icon-img">
                        <img src="https://upforme.ru/uploads/001c/84/76/2/709377.png" alt="Морковка" class="ingredient-icon-img">
                        <img src="https://upforme.ru/uploads/001c/84/76/2/709377.png" alt="Лук" class="ingredient-icon-img">
                    </div>
                </div>
               
                <div class="recipe-image-side">
                    <img src="https://i.imgur.com/jS72S9F.png" alt="Профессиональный суп" class="recipe-image">
                </div>
            </div>
            </div>

        <div class="tab-content content-6">
             <p style="padding: 15px; border: 1px solid #3d3b37; background: #f0ede1; font-style: italic;">
                [ЗДЕСЬ МОЖНО ДОБАВИТЬ РЕДКИЕ РЕЦЕПТЫ]
            </p>
        </div>

        </div>
    </div>
</div>

<script>
// Функция для сохранения состояния чекбокса
function saveCheckboxState(checkbox) {
    localStorage.setItem(checkbox.id, checkbox.checked);
}

// Функция для загрузки состояния чекбокса
function loadCheckboxState(checkbox) {
    const savedState = localStorage.getItem(checkbox.id);
    if (savedState !== null) {
        checkbox.checked = (savedState === 'true');
    }
}

// Находим все чекбоксы с классом 'done-checkbox'
const checkboxes = document.querySelectorAll('.done-checkbox');

// Применяем логику ко всем найденным чекбоксам
checkboxes.forEach(checkbox => {
    loadCheckboxState(checkbox);
   
    checkbox.addEventListener('change', () => {
        saveCheckboxState(checkbox);
    });
});
</script>[/html]

0

12

[html]<div class="fortune-wrapper">
  <button id="fortune-btn">
    <span id="btn-text">ОТКРЫТЬ<br>ПРЕДСКАЗАНИЕ</span>
    <span id="btn-timer" style="display:none;"></span>
  </button>

  <div id="fortune-block">
    <div id="fortune-text"></div>
  </div>
</div>

<style>
.fortune-wrapper {
  position: relative;
  width: 100%;
  font-family: "Trebuchet MS", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Кнопка */
#fortune-btn {
  width: 450px;
  height: 80px;
  background: linear-gradient(#e3b56a, #c89a4a);
  border: 3px solid #6d624a;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  position: relative;
  z-index: 3;
}

#btn-timer {
  font-size: 20px;
  color: #1a7f1a;
}

/* --- РАСКРЫВАЮЩИЙСЯ БЛОК ПРЕДСКАЗАНИЯ --- */
#fortune-block {
  width: 350px;
  background: #f5f2eb;
  border: 3px solid #6d624a;
  border-top: none; /* примыкание к кнопке */
  overflow: hidden;

  max-height: 0;       /* блок скрыт */
  opacity: 0;

  transition: max-height 0.6s ease, opacity 0.4s ease;
  position: relative;
  z-index: 1;
}

#fortune-block.active {
  max-height: 200px;   /* раскрываем вниз */
  opacity: 1;
}

#fortune-text {
  padding: 15px 20px;
  font-size: 16px;
  line-height: 1.3;
  text-align: center;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.4s ease 0.2s, transform 0.4s ease 0.2s;
}

#fortune-block.active #fortune-text {
  opacity: 1;
  transform: translateY(0);
}
</style>

<script>
/* -----------------------------
   НАСТРОЙКА ВРЕМЕНИ
----------------------------- */
const HOURS = 0;
const MINUTES = 1;
const INTERVAL = HOURS * 3600 + MINUTES * 60;

/* -----------------------------
   ЭЛЕМЕНТЫ
----------------------------- */
const btn = document.getElementById("fortune-btn");
const btnText = document.getElementById("btn-text");
const btnTimer = document.getElementById("btn-timer");
const block = document.getElementById("fortune-block");
const fortuneText = document.getElementById("fortune-text");

let timerInterval = null;

const predictions = [
  "Скоро случится неожиданная удача!",
  "Тебя ждёт приятная новость!",
  "День благоприятен для желаний.",
  "Скоро произойдёт маленькое чудо!",
];

/* -----------------------------
   ЗАГРУЗКА СОСТОЯНИЯ
----------------------------- */
const savedTime = localStorage.getItem("fortuneTime");
const savedText = localStorage.getItem("fortuneText");
const now = Math.floor(Date.now() / 1000);

if (savedTime && now < savedTime) {
  const remaining = savedTime - now;

  if (savedText) {
    fortuneText.textContent = savedText;
    block.classList.add("active");
  }

  btnText.style.display = "none";
  btnTimer.style.display = "block";

  startTimer(remaining);
}

/* -----------------------------
   КНОПКА
----------------------------- */
btn.addEventListener("click", () => {
  if (btnTimer.style.display === "block") return;

  const msg = predictions[Math.floor(Math.random() * predictions.length)];
  fortuneText.textContent = msg;

  block.classList.add("active");

  btnText.style.display = "none";
  btnTimer.style.display = "block";

  const newEndTime = Math.floor(Date.now() / 1000) + INTERVAL;

  localStorage.setItem("fortuneText", msg);
  localStorage.setItem("fortuneTime", newEndTime);

  startTimer(INTERVAL);
});

/* -----------------------------
   ТАЙМЕР
----------------------------- */
function startTimer(duration) {
  let remaining = duration;

  updateTimerDisplay(remaining);

  timerInterval = setInterval(() => {
    remaining--;
    updateTimerDisplay(remaining);

    if (remaining <= 0) {
      clearInterval(timerInterval);

      localStorage.removeItem("fortuneText");
      localStorage.removeItem("fortuneTime");

      btnTimer.style.display = "none";
      btnText.style.display = "block";

      block.classList.remove("active");
    }
  }, 1000);
}

function updateTimerDisplay(sec) {
  const m = String(Math.floor(sec / 60)).padStart(2, "0");
  const s = String(sec % 60).padStart(2, "0");
  btnTimer.textContent = `${m}:${s}`;
}
</script>

[/html]

0

13

[html]<div class="fortune-wrapper">
  <button id="fortune-btn">
    <span id="btn-text">ОТКРЫТЬ<br>ПРЕДСКАЗАНИЕ</span>
    <span id="btn-timer" style="display:none;"></span>
  </button>

  <div id="fortune-block">
    <div id="fortune-text"></div>
  </div>
</div>

<style>
.fortune-wrapper {
  position: relative;
  width: 100%;
  font-family: "Trebuchet MS", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Кнопка */
#fortune-btn {
  width: 420px;
  height: 80px;
  background: linear-gradient(#e3b56a, #c89a4a);
  border: 3px solid #6d624a;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  position: relative;
  z-index: 3;
}

#btn-timer {
  font-size: 20px;
  color: #1a7f1a;
}

/* --- РАСКРЫВАЮЩИЙСЯ ПРУЖИНЯЩИЙСЯ БЛОК --- */
#fortune-block {
  width: 350px;
  background: #f5f2eb;
  border: 3px solid #6d624a;
  border-top: none;
  overflow: hidden;

  /* закрыто */
  max-height: 0;
  opacity: 0;

  /* эффект */
  transition:
    max-height 0.6s cubic-bezier(.26, .72, .35, 1.3),
    opacity 0.4s ease;
  position: relative;
  z-index: 1;
}

/* открыто */
#fortune-block.active {
  max-height: 220px; /* раскрытие вниз */
  opacity: 1;
}

/* текст */
#fortune-text {
  padding: 15px 20px;
  font-size: 16px;
  line-height: 1.3;
  text-align: center;
  white-space: pre-line;
  min-height: 40px;
}
</style>

<script>
/* -----------------------------
   НАСТРОЙКА ВРЕМЕНИ
----------------------------- */
const HOURS = 0;
const MINUTES = 1;
const INTERVAL = HOURS * 3600 + MINUTES * 60;

/* -----------------------------
   ЭЛЕМЕНТЫ
----------------------------- */
const btn = document.getElementById("fortune-btn");
const btnText = document.getElementById("btn-text");
const btnTimer = document.getElementById("btn-timer");
const block = document.getElementById("fortune-block");
const fortuneText = document.getElementById("fortune-text");

let timerInterval = null;
let typingInterval = null;

const predictions = [
  "Скоро случится неожиданная удача!",
  "Тебя ждёт приятная новость!",
  "День благоприятен для желаний.",
  "Скоро произойдёт маленькое чудо!",
];

/* -----------------------------
   ПЕЧАТЬ ТЕКСТА ПО БУКВАМ
----------------------------- */
function typeText(text) {
  clearInterval(typingInterval);
  fortuneText.textContent = "";
  let i = 0;

  typingInterval = setInterval(() => {
    fortuneText.textContent += text[i];
    i++;
    if (i >= text.length) clearInterval(typingInterval);
  }, 35); // скорость печати
}

/* -----------------------------
   ЗАГРУЗКА СОСТОЯНИЯ
----------------------------- */
const savedTime = localStorage.getItem("fortuneTime");
const savedText = localStorage.getItem("fortuneText");
const now = Math.floor(Date.now() / 1000);

if (savedTime && now < savedTime) {
  const remaining = savedTime - now;

  if (savedText) {
    fortuneText.textContent = savedText;
    block.classList.add("active");
  }

  btnText.style.display = "none";
  btnTimer.style.display = "block";

  startTimer(remaining);
}

/* -----------------------------
   КНОПКА
----------------------------- */
btn.addEventListener("click", () => {
  if (btnTimer.style.display === "block") return;

  const msg = predictions[Math.floor(Math.random() * predictions.length)];

  block.classList.add("active");

  typeText(msg);

  btnText.style.display = "none";
  btnTimer.style.display = "block";

  const newEndTime = Math.floor(Date.now() / 1000) + INTERVAL;

  localStorage.setItem("fortuneText", msg);
  localStorage.setItem("fortuneTime", newEndTime);

  startTimer(INTERVAL);
});

/* -----------------------------
   ТАЙМЕР
----------------------------- */
function startTimer(duration) {
  let remaining = duration;

  updateTimerDisplay(remaining);

  timerInterval = setInterval(() => {
    remaining--;
    updateTimerDisplay(remaining);

    if (remaining <= 0) {
      clearInterval(timerInterval);

      localStorage.removeItem("fortuneText");
      localStorage.removeItem("fortuneTime");

      btnTimer.style.display = "none";
      btnText.style.display = "block";

      block.classList.remove("active");
      fortuneText.textContent = "";
    }
  }, 1000);
}

function updateTimerDisplay(sec) {
  const m = String(Math.floor(sec / 60)).padStart(2, "0");
  const s = String(sec % 60).padStart(2, "0");
  btnTimer.textContent = `${m}:${s}`;
}
</script>[/html]

0

14

[html]<style>
  .fortune-container {
    text-align:center;
    margin:20px auto;
    max-width:400px;
    font-family: "Segoe UI", sans-serif;
  }

  .fortune-btn {
    background: linear-gradient(135deg, #ff2e63, #ff7bd5);
    color:#fff;
    padding:12px 20px;
    border:none;
    cursor:pointer;
    font-size:18px;
    border-radius:10px;
    box-shadow:0 4px 12px rgba(255,0,120,0.4);
    transition: transform .2s;
  }
  .fortune-btn:hover {
    transform: scale(1.05);
  }

  /* блок предсказания */
  .fortune-box {
    overflow:hidden;
    max-height:0;
    opacity:0;
    margin-top:10px;
    background:rgba(255,255,255,0.95);
    border-radius:12px;
    border:2px solid #ff7bd5;
    box-shadow:0 0 15px rgba(255,0,180,0.4);
    padding:0 20px;
    transform-origin: top;
    transition:
       max-height .6s cubic-bezier(.34,1.56,.64,1),
       opacity .4s ease;
  }

  .fortune-box.open {
    max-height:300px;
    opacity:1;
    padding:20px;
  }

  /* текст */
  .fortune-text {
    font-size:18px;
    color:#c2185b;
    font-weight:600;
    white-space:pre-wrap;
    line-height:1.4em;
    min-height:40px;
  }

  /* праздничные искры */
  @keyframes sparkle {
    0%{opacity:0.4; transform:scale(1);}
    50%{opacity:1; transform:scale(1.3);}
    100%{opacity:0.4; transform:scale(1);}
  }
  .sparkles {
    position:absolute;
    top:-10px; left:50%;
    transform:translateX(-50%);
    display:flex; gap:6px;
  }
  .sparkles span {
    width:8px; height:8px;
    background:#ff7bd5;
    border-radius:50%;
    animation:sparkle 1.4s infinite ease-in-out;
  }
  .sparkles span:nth-child(2){animation-delay:.2s;}
  .sparkles span:nth-child(3){animation-delay:.4s;}
</style>

<div class="fortune-container">
  <button class="fortune-btn" id="fortuneBtn">Получить предсказание</button>

  <div class="fortune-box" id="fortuneBox">
    <div class="sparkles"><span></span><span></span><span></span></div>
    <div class="fortune-text" id="fortuneText"></div>
  </div>
</div>

<script>
(function(){
  const btn = document.getElementById("fortuneBtn");
  const box = document.getElementById("fortuneBox");
  const textEl = document.getElementById("fortuneText");

  const fortunes = [
    "Сегодня удача обнимет тебя теплее зимнего пледа!",
    "К праздникам тебя ждёт сюрприз, который перевернёт настроение!",
    "Новогоднее чудо уже идёт к тебе — будь готова!",
    "Твоя звезда сияет ярче гирлянды — всё получится!",
    "Скоро случится что-то очень тёплое и доброе."
  ];

  let lastFortune = "";
  let lastTime = 10;
  const cooldown = 15000; // 15 секунд

  function typeWriter(text){
    textEl.innerHTML = "";
    let i = 0;
    function type() {
      if (i < text.length) {
        textEl.innerHTML += text.charAt(i);
        i++;
        setTimeout(type, 35);
      }
    }
    type();
  }

  btn.addEventListener("click", function(){
    const now = Date.now();

    // если коробка закрыта → просто открыть / закрыть
    if (box.classList.contains("open")) {
      box.classList.remove("open");
      return;
    }

    // если время не вышло → показываем старое
    if (now - lastTime < cooldown) {
      box.classList.add("open");
      typeWriter(lastFortune);
      return;
    }

    // новое предсказание
    lastFortune = fortunes[Math.floor(Math.random()*fortunes.length)];
    lastTime = now;

    box.classList.add("open");
    typeWriter(lastFortune);
  });
})();
</script>[/html]

0

15

Инвентарь пользователя
[html]
<style>
.usr_inv {display: grid;gap: 10px;margin-top: 10px;grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));}
.inv_item {background: ;border: 1px solid #ddd;border-radius: 4px;padding: 10px;text-align: center;}
.item-image {width: 64px;height: 64px;object-fit: cover;border-radius: 4px;}
.item-description {display: none;}
#detailed-view-mj6ywskge1rgf7x6g3i:checked ~ .usr_inv {grid-template-columns: 1fr;}
#detailed-view-mj6ywskge1rgf7x6g3i:checked ~ .usr_inv .inv_item {display: flex;align-items: center;text-align: left;gap: 15px;padding: 15px;}
#detailed-view-mj6ywskge1rgf7x6g3i:checked ~ .usr_inv .item-image {width: 50px;height: 50px;flex-shrink: 0;}
#detailed-view-mj6ywskge1rgf7x6g3i:checked ~ .usr_inv .item-description {display: block;flex: 1;}
</style>

<div>

<div class="usr_inv">
   
        <div class="inv_item">
        <img src="https://upforme.ru/uploads/001c/52/b6/2/566605.png?sec=DQ0+QTpQQEYtMiEAUWcCRz42OVcHeTwMJx49AzpUfV8uJjpCeVp3Rz42OVYvRAIMJSAhBT5uZlo5DzINfmNBST8hOlAoajxTJjAtGRVrEhI=" title="Надгробие" alt="Надгробие" class="item-image">

        </div>
   
</div>
</div>
[/html]
Последнее обновление: 15.12.2025, 12:45:08

0


Вы здесь » test » новый не новый » рандом


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