/
Редактирование внешнего вида LGT при помощи HTML, CSS, JavaScript

Редактирование внешнего вида LGT при помощи HTML, CSS, JavaScript

Как добавть на LGT внешний скрипт?

Если вам не хватает встроенных возможностей редактора для изменения внешнего вида встроенных форм, виджетов и всплывающих окон LGT на вашем сайте и вам требуется полная интеграция с дизайном вашего сайта, вы можете следовать нескольким простым шагам:

  1. Откройте ваш LGT перейдите во вкладку "Содержимое"

  2. Нажмите “+ Блок“ и выберите “Пользовательский HTML-блок“

  3. Выберите один из шаблонов и скопируйте код

  4. Вставтье код на LGT во вкладке “Содержимое“ в поле “HTML-код“

Готовые шаблоны:

Кастомизированя кнопка покупки

Анімація1-20250402-143304.gif

Демо: просмотр

Описание: Этот код изменяет стандартную кнопку оффера.

Предварительная настройка LGT:

  1. Перейти на LGT во вкладку “Содержимое“

  2. Добавить блок “Offer button“

  3. Указать название кнопки

  4. Выбрать предложение

Вставте код в поле “Пользовательский HTML-блок“:

<style> .form-button { width: 220px; height: 50px; border: none; outline: none; color: #fff; background: #111; cursor: pointer; position: relative; z-index: 0; border-radius: 10px; display: block; /* Додаємо block */ margin: 0 auto; /* Центруємо по горизонталі */ } .form-button:before { content: ''; background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000); position: absolute; top: -2px; left:-2px; background-size: 400%; z-index: -1; filter: blur(5px); width: calc(100% + 4px); height: calc(100% + 4px); animation: glowing 20s linear infinite; opacity: 0; transition: opacity .3s ease-in-out; border-radius: 10px; } .form-button:active { color: #000 } .form-button:active:after { background: transparent; } .form-button:hover:before { opacity: 1; } .form-button:after { z-index: -1; content: ''; position: absolute; width: 100%; height: 100%; background: #111; left: 0; top: 0; border-radius: 10px; } @keyframes glowing { 0% { background-position: 0 0; } 50% { background-position: 400% 0; } 100% { background-position: 0 0; } } </style>

Анимированя кнопка покупки

Анімація1-20250403-131216.gif

Демо: просмотр

Описание: Этот код изменяет стандартную кнопку оффера.

Предварительная настройка LGT:

  1. Перейти на LGT во вкладку “Содержимое“

  2. Добавить блок “Offer button“

  3. Указать название кнопки

  4. Выбрать предложение

Вставте код в поле “Пользовательский HTML-блок“:

<!-- ################################# CSS ################################# --> <style> body { background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url(https://images.pexels.com/photos/2166927/pexels-photo-2166927.jpeg?cs=srgb&dl=animal-aquarium-aquatic-2166927.jpg&fm=jpg) no-repeat center center/cover; font-family: Arial, Helvetica, sans-serif; } .form-button { text-decoration: none; border: 1px solid rgb(146, 148, 248); position: relative; overflow: hidden; } /* Світловий ефект буде працювати постійно */ .form-button:before { content: ""; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient( 120deg, transparent, rgba(146, 148, 248, 0.4), transparent ); animation: moving-light 2s infinite linear; } @keyframes moving-light { 0% { left: -100%; } 100% { left: 100%; } } </style>

Карусель

Анімація1-20250402-211035.gif

Демо: просмотр

Описание: Этот код создает интерактивный слайдер с тремя шагами, который рассказывает о криптоинвестициях.

Каждый слайд содержит иконку, заголовок и описание. Пользователь может переключаться между слайдами с помощью стрелок.

Вставте код в поле “Пользовательский HTML-блок“:

<style> .container { position: relative; width: 385px; margin: 0 auto; } .step { background: white; padding: 20px; text-align: center; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); transition: opacity 0.5s, transform 0.5s; } .icon { font-size: 40px; margin-bottom: 10px; } .title { font-size: 18px; font-weight: bold; color: #2c3e50; margin-bottom: 10px; } .description { font-size: 14px; color: #7f8c8d; } .hidden { opacity: 0; transform: scale(0.9); } .visible { opacity: 1; transform: scale(1); } .arrow { position: absolute; top: 50%; transform: translateY(-50%); cursor: pointer; background: black; width: 14px; height: 14px; border: none; clip-path: polygon(100% 50%, 0 100%, 0 0); } .arrow-left { left: -20px; transform: translateY(-50%) rotate(180deg); } .arrow-right { right: -20px; } </style> <div class="container"> <div class="arrow arrow-left" onclick="prevSlide()"></div> <div class="step visible" id="slide"> <div class="icon">📲</div> <div class="title"></div> <div class="description"></div> </div> <div class="arrow arrow-right" onclick="nextSlide()"></div> </div> <script> const slidesData = [ { icon: "📲", title: "Why Crypto Investments Are #1 Opportunity? 🚀", description: "<p>🔹 Cryptocurrency is the financial future!</p>" }, { icon: "💳", title: "What Will You Learn in the Course? 🎓", description: "<p>✅ How to buy and sell cryptocurrency without risks</p>" }, { icon: "🌍", title: "The Course Starts Soon! ⏳", description: "<p>📅 The course starts on February 25, 2025!</p>" } ]; let currentSlide = 0; const slideElement = document.getElementById('slide'); function updateSlide() { slideElement.classList.remove('visible'); slideElement.classList.add('hidden'); setTimeout(() => { const data = slidesData[currentSlide]; slideElement.querySelector('.icon').textContent = data.icon; slideElement.querySelector('.title').textContent = data.title; slideElement.querySelector('.description').innerHTML = data.description; slideElement.classList.remove('hidden'); slideElement.classList.add('visible'); }, 500); } function nextSlide() { currentSlide = (currentSlide + 1) % slidesData.length; updateSlide(); } function prevSlide() { currentSlide = (currentSlide - 1 + slidesData.length) % slidesData.length; updateSlide(); } updateSlide(); </script>

Печатающий текст

Анімація1-20250402-211231.gif

Демо: просмотр

Описание: Этот код создает анимированный текстовый блок с эффектом "печати", который плавно выводит заголовок и описание.

Анимация начинается автоматически при загрузке страницы, создавая эффект постепенного раскрытия контента.

Вставте код в поле “Пользовательский HTML-блок“:

<style> .container { position: relative; width: 385px; margin: 0 auto; } .step { background: white; padding: 20px; text-align: center; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); } .icon { font-size: 40px; margin-bottom: 10px; } .title { font-size: 18px; font-weight: bold; color: #2c3e50; margin-bottom: 10px; } .description { font-size: 14px; color: #7f8c8d; min-height: 80px; } </style> <div class="container"> <div class="step" id="slide"> <div class="icon">📲</div> <div class="title" id="title"></div> <div class="description" id="description"></div> </div> </div> <script> const slideData = { icon: "📲", title: "Why Crypto Investments Are #1 Opportunity? 🚀", description: "🔹 Cryptocurrency is the financial future! Every day, thousands of people make profits through smart investments.\n\n🔹 Bitcoin, Ethereum, altcoins – learn how professionals make money from them.\n\n🔹 No experience? No problem! We’ll teach you from scratch, without complicated terms.\n\n📢 Don’t wait – the crypto market is growing right now!" }; document.querySelector(".icon").textContent = slideData.icon; function typeEffect(element, text, speed, callback) { let i = 0; function type() { if (i < text.length) { element.innerHTML += text.charAt(i); i++; setTimeout(type, speed); } else if (callback) { callback(); } } type(); } function startTyping() { document.getElementById("title").innerHTML = ""; document.getElementById("description").innerHTML = ""; typeEffect(document.getElementById("title"), slideData.title, 50, () => { typeEffect(document.getElementById("description"), slideData.description, 30); }); } startTyping(); </script>

Бегущая строка

Анімація1-20250402-211322.gif

Демо: просмотр

Описание: Этот код создает бегущую строку с анимацией, плавно перемещающей текст справа налево.

Вставте код в поле “Пользовательский HTML-блок“:

<style> .container { position: relative; width: 385px; margin: 0 auto; overflow: hidden; white-space: nowrap; } .marquee { display: inline-block; font-size: 18px; font-weight: bold; color: #2c3e50; animation: marquee 10s linear infinite; } @keyframes marquee { from { transform: translateX(100%); } to { transform: translateX(-100%); } } </style> <div class="container"> <div class="marquee">Why Crypto Investments Are #1 Opportunity? 🚀 Cryptocurrency is the financial future!</div> </div>

Таймер отсчета

Анімація1-20250402-211443.gif

Демо: просмотр

Описание: Этот код создает таймер, который отсчитывает время до определенной даты.

Таймер отображает количество оставшихся дней, часов, минут и секунд, обновляя информацию каждую секунду.

Вставте код в поле “Пользовательский HTML-блок“:

<style> /* Стили для таймера (інтегрованого в слайд) */ .timer { display: flex; justify-content: space-between; align-items: center; /* Вирівнює елементи по вертикалі */ margin: 20px auto; /* Центрує таймер по горизонталі */ padding: 10px; background: #f7f7f7; border-radius: 10px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); width: 350px; text-align: center; /* Центрує текст всередині */ } .timer .time-section { flex: 1; } .timer .time { font-size: 24px; font-weight: bold; color: #2c3e50; } .timer .label { display: block; font-size: 12px; color: #7f8c8d; } </style> <!-- Інтегрований таймер --> <div class="timer" id="timer"> <div class="time-section"> <span class="time" id="days">00</span> <span class="label">Дні</span> </div> <div class="time-section"> <span class="time" id="hours">00</span> <span class="label">Години</span> </div> <div class="time-section"> <span class="time" id="minutes">00</span> <span class="label">Хвилини</span> </div> <div class="time-section"> <span class="time" id="seconds">00</span> <span class="label">Секунди</span> </div> </div> </div> </div> <script> // Таймер відліку до цільової дати (25 лютого 2025) const targetDate = new Date("2025-02-25T00:00:00"); function updateTimer() { const now = new Date(); const diff = targetDate - now; if (diff <= 0) { document.getElementById('days').textContent = "00"; document.getElementById('hours').textContent = "00"; document.getElementById('minutes').textContent = "00"; document.getElementById('seconds').textContent = "00"; return; } const days = Math.floor(diff / (1000 * 60 * 60 * 24)); const hours = Math.floor((diff / (1000 * 60 * 60)) % 24); const minutes = Math.floor((diff / (1000 * 60)) % 60); const seconds = Math.floor((diff / 1000) % 60); document.getElementById('days').textContent = days < 10 ? "0" + days : days; document.getElementById('hours').textContent = hours < 10 ? "0" + hours : hours; document.getElementById('minutes').textContent = minutes < 10 ? "0" + minutes : minutes; document.getElementById('seconds').textContent = seconds < 10 ? "0" + seconds : seconds; } updateTimer(); setInterval(updateTimer, 1000); </script>

Вертикальная карусель

Анімація1-20250402-211551.gif

Демо: просмотр

Описание: Этот код создает вертикальный карусельный слайдер, который автоматически прокручивает текстовые элементы. Каждое сообщение появляется с анимацией, создавая динамичное и плавное отображение.

Вставте код в поле “Пользовательский HTML-блок“:

<style> *, *::before, *::after { box-sizing: border-box; } .font { color: #fff; } .wrapper { background: #1C1C1C; height: 600px; width: 450px; display: flex; justify-content: center; align-items: center; border-radius: 20px; } .carousel { position: relative; width: 100%; max-width: 500px; display: flex; justify-content: center; flex-direction: column; } .carousel__item { display: flex; align-items: center; position: absolute; width: 100%; padding: 0 12px; opacity: 0; filter: drop-shadow(0 2px 2px #555); will-change: transform, opacity; animation: carousel-animate-vertical 27s linear infinite; color:rgb(0, 0, 0); } .carousel__item:nth-child(n) { animation-delay: calc(3s * (var(--index) - 1)); } .carousel__item-head { border-radius: 50%; background-color: #d7f7fc; width: 90px; height: 90px; padding: 14px; display: flex; align-items: center; justify-content: center; font-size: 50px; } .carousel__item-body { width: 100%; background-color: #fff; border-radius: 20px; padding: 16px 20px 16px 20px; color:rgb(0, 0, 0); } .title { text-transform: uppercase; font-size: 20px; margin-top: 10px; } @keyframes carousel-animate-vertical { 0% { transform: translateY(-100%) scale(0.5); opacity: 0; visibility: hidden; } 3%, 11.11% { transform: translateY(-100%) scale(0.7); opacity: 0.4; visibility: visible; } 14.11%, 22.22% { transform: translateY(0) scale(1); opacity: 1; visibility: visible; } 25.22%, 33.33% { transform: translateY(100%) scale(0.7); opacity: 0.4; visibility: visible; } 36.33% { transform: translateY(100%) scale(0.5); opacity: 0; visibility: visible; } 100% { transform: translateY(100%) scale(0.5); opacity: 0; visibility: hidden; } } </style> <div class='wrapper'> <div class='carousel'> <div class='carousel__item' style='--index:1'><div class='carousel__item-body'><p>Cryptocurrency is a digital asset that uses cryptography for secure transactions and to control the creation of new units. It operates in a decentralized manner, without control from banks or governments.</p></div></div> <div class='carousel__item' style='--index:2'><div class='carousel__item-body'><p>Blockchain is a technology that ensures transparency and security in cryptocurrency transactions. It consists of sequential blocks of information that cannot be altered.</p></div></div> <div class='carousel__item' style='--index:3'><div class='carousel__item-body'><p>Mining is the process of verifying transactions on the blockchain and creating new blocks. Miners solve complex problems to receive cryptocurrency rewards.</p></div></div> <div class='carousel__item' style='--index:4'><div class='carousel__item-body'><p>DeFi (decentralized finance) allows users to perform financial operations without banks. It opens opportunities for lending, trading, and passive income.</p></div></div> <div class='carousel__item' style='--index:5'><div class='carousel__item-body'><p>NFTs are unique digital assets that verify ownership of digital content such as art, videos, or music.</p></div></div> <div class='carousel__item' style='--index:6'><div class='carousel__item-body'><p>The metaverse is a virtual space where people interact through avatars. Cryptocurrencies play a key role in enabling the purchase of digital assets within it.</p></div></div> <div class='carousel__item' style='--index:7'><div class='carousel__item-body'><p>Crypto trends for 2025 include the widespread adoption of stablecoins, the development of Layer-2 solutions, the growth of DeFi, and the integration of cryptocurrencies into traditional finance.</p></div></div> </div> </div>

Кнопка копирования

image-20250402-201942.png

Демо: просмотр

Описание: Этот код создает стильную кнопку по нажатию на которую копируеться текст

Вставте код в поле “Пользовательский HTML-блок“:

<style> .button-container { position: relative; display: flex; flex-direction: column; align-items: center; } .copy-button { display: flex; align-items: center; justify-content: center; background-color: #0c0c0c; color: white; font-size: 18px; font-weight: bold; padding: 15px 25px; border: none; border-radius: 10px; cursor: pointer; text-decoration: none; width: 350px; position: relative; z-index: 1; box-shadow: 0 10px 20px rgba(39, 39, 39, 0.9); /* Розмита тінь */ transition: transform 0.2s ease-in-out; } .copy-button:hover { background-color: #020202; } .copy-button img { width: 24px; height: 24px; margin-right: 10px; } .notification { display: none; margin-top: 10px; font-size: 16px; color: green; } </style> <div class="button-container"> <button class="copy-button" id="copyButton"> <img src="https://img.icons8.com/ios-filled/50/ffffff/telegram.png" alt="Telegram"> Copy Referral Link 📋 </button> <div id="notification" class="notification">Link copied! ✅</div> </div> <script> document.getElementById('copyButton').addEventListener('click', function() { const referralLink = 'https://t.me/your_channel?ref=your_referral_code'; // Заміни на своє посилання navigator.clipboard.writeText(referralLink).then(function() { const notification = document.getElementById('notification'); notification.style.display = 'block'; setTimeout(function() { notification.style.display = 'none'; }, 2000); }).catch(function(err) { console.error('Не вдалося скопіювати посилання: ', err); }); }); </script>

Раскрывающийся текст

Анімація1-20250403-135833.gif

Демо: просмотр

Описание: Этот код создает веб-страницу с несколькими стильными кнопками, каждая из которых при нажатии открывает скрытый контент с текстом. Когда пользователь кликает по заголовку, соответствующий блок с контентом плавно раскрывается, благодаря чему текст становится видимым.

Вставте код в поле “Пользовательский HTML-блок“:

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Programming Texts</title> <style> .adaptive-container { top: -90px; } :root { --color-bg: #34304c; --color-bg2: #534d7a; --color-highlight: #fff; --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; } body { padding: 7.5vh 10px 0 10px; font-family: var(--font); background: var(--color-bg); color: var(--color-highlight); } .title { cursor: pointer; color: var(--color-highlight); font-weight: bold; font-size: 1.5rem; background: var(--color-bg2); padding: 0.5rem 1rem; border-radius: 8px; margin: 2px 0; /* Reduced the margin */ display: block; text-align: center; max-width: 400px; margin-left: auto; margin-right: auto; transition: background 0.3s ease-in-out; } .title:hover { background: #675c99; } .content { display: block; margin: 10px 2px; padding: 0 10px; background: var(--color-bg2); border-left: 4px solid #2b293d; border-radius: 8px; opacity: 0; max-height: 0; overflow: hidden; transition: max-height 0.5s ease-in-out, opacity 0.5s ease-in-out, padding 0.5s ease-in-out; } .content.active { opacity: 1; max-height: 500px; /* You can adjust this value depending on your content size */ padding: 10px; } .title::before, .title::after { content: '↓'; /* Стрілка вниз з обох боків */ margin-right: 10px; font-size: 1.2rem; } .title::after { margin-left: 10px; /* Стрілка з правого боку */ } </style> </head> <body> <h2 class="title">Code is Magic! 🧙‍♂️</h2> <div class="content"> <p>Programming is an art ✨ where lines of code turn into powerful apps 🚀.</p> <p>Bugs? 🐞 No worries! Debugging is our best friend 🔍.</p> <p>Create, experiment, and change the world with every commit! 💡💾</p> <p>Keep coding, keep innovating! 🚀👨‍💻</p> </div> <h2 class="title">From Idea to Reality 🚀</h2> <div class="content"> <p>Coding transforms ideas into reality 🎨💡.</p> <p>A few lines of logic and—boom!—a new feature is born 💥.</p> <p>Errors? 🤔 Just stepping stones to mastery 🏆.</p> <p>Keep learning, keep growing, and build the future, one line at a time! 🔥👨‍💻</p> </div> <h2 class="title">0s and 1s Rule the World 🌍</h2> <div class="content"> <p>Behind every app, game, and website lies the power of binary 🖥️⚡.</p> <p>Programming is the secret language of innovation 💡.</p> <p>A single bug 🐞 can break things, but a great coder always finds a way! 💪</p> <p>Debug, optimize, and make tech magic happen! ✨</p> </div> <h2 class="title">Code, Coffee, Repeat ☕</h2> <div class="content"> <p>Late nights, countless lines of code, and endless cups of coffee ☕—that's the coder's life! 🔥</p> <p>A single semicolon can make or break your day 😅.</p> <p>But when your code runs perfectly, it's pure joy! 🎉</p> <p>Keep pushing, keep coding, and never stop learning! 💡</p> </div> <h2 class="title">Change the World with Code 💻</h2> <div class="content"> <p>Every great invention starts with a single line of code 📜.</p> <p>Whether you're making apps 📱, AI 🤖, or websites 🌐, your work shapes the future! 💡</p> <p>Keep coding, keep dreaming, and build something amazing! 🚀</p> </div> <h2 class="title">Think. Code. Innovate. 🚀</h2> <div class="content"> <p>Coding is not just about writing syntax—it’s about solving problems 🧩.</p> <p>With logic, creativity, and persistence, you can build anything 💡.</p> <p>The best part? The only limit is your imagination! 🌟</p> <p>So start coding and bring your ideas to life! ⚡</p> </div> <h2 class="title">The Power of Programming 🖥️</h2> <div class="content"> <p>Code runs the world 🌍—from smartphones 📱 to AI 🤖.</p> <p>One algorithm can change everything! 💡</p> <p>Learning to code is like learning a superpower 🦸‍♂️.</p> <p>So keep typing, keep debugging, and keep building amazing things! 🔥</p> </div> <script> document.querySelectorAll('.title').forEach(title => { title.addEventListener('click', () => { const content = title.nextElementSibling; content.classList.toggle('active'); }); }); </script> </body> </html>

 

Блоки для текста

Анімація1-20250403-140202.gif

Демо: просмотр

Описание: Этот код создает веб-страницу с несколькими блоками текста.

Вставте код в поле “Пользовательский HTML-блок“:

<div class="container"> <div class="card" data-label="Java Course 🚀"> <div class="card__container"> <h1 class="card__header"> Learn Java Programming ☕ </h1> <p class="card__body"> Master the fundamentals of Java, one of the most popular programming languages. 💻 This course covers object-oriented programming, data structures, and real-world applications to help you become a proficient Java developer. 🔥 </p> </div> </div> <div class="card" data-label="Web Development 🌍"> <div class="card__container"> <h1 class="card__header"> Web Development with JavaScript </h1> <p class="card__body"> Dive into front-end and back-end development with JavaScript. 🌐 Learn frameworks like React and Node.js to build dynamic and interactive web applications. 🚀 </p> </div> </div> <div class="card" data-label="Mobile Development 📱"> <div class="card__container"> <h1 class="card__header"> Android Development with Java </h1> <p class="card__body"> Learn how to create native Android applications using Java. 📲 Explore Android Studio, UI/UX design, and best practices for building high-performance apps. 🔧 </p> </div> </div> </div> <style> @import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Roboto&display=swap'); *, *::before, *::after{ padding: 0; margin: 0; box-sizing: border-box; } .container{ margin: 10px; display: flex; justify-content: center; align-items:center; background: #f3f3f3; flex-wrap: wrap; gap: 20px; } .card{ width: 25rem; border-radius: 1rem; background: white; box-shadow: 4px 4px 15px rgba(#000, 0.15); position : relative; color: #434343; } .card .card__container{ padding : 2rem; width: 100%; height: 100%; background: white; border-radius: 1rem; position: relative; } .card .card__header{ margin-bottom: 1rem; font-family: 'Playfair Display', serif; } .card .card__body{ font-family: 'Roboto', sans-serif; } .card::before{ position: absolute; top:2rem; right:-0.5rem; content: ''; background: #283593; height: 28px; width: 28px; transform : rotate(45deg); } .card::after{ position: absolute; content: attr(data-label); top: 11px; right: -14px; padding: 0.5rem; width: 10rem; background: #3949ab; color: white; text-align: center; font-family: 'Roboto', sans-serif; box-shadow: 4px 4px 15px rgba(26, 35, 126, 0.2); } </style>

Related content