ساخت نوار خبری متحرک برای المنتور

ساخت نوار خبری متحرک برای المنتور

در عصر محتوایی کنونی، ابزارهایی مانند نوار های خبری متحرک (نیوز تیکر متحرک) ابزاری غیر قابل جایگزین برای جذب توجه کاربران به اخبار فوری، اطلاعات مهم یا پیشنهادهای ویژه می‌باشند. این قالب کامل با استایل جذاب، ریسپانسیو شده برای موبایل و تبلت  ، امکان تنظیم سرعت، ابزار مناسبی برای هر وبلاگ یا سایت است که به انتقال محتوا با استانداردهای حرفه‌ای می‌پردازد.این نیوز تیکر متحرک نه تنها ابزاری است که بازدیدکنندگان را به محتواهای مهم شما جلب میکند، بلکه به سایت شما اعتبار و حرفه‌ای بخشیده و با بهره‌برداری صحیح از ویژگی‌های سئو، ترافیک مطلوب و کاربران فعال را به سایت جذب میکند. همین حالا آن را در وبلاگ یا سایت خود امتحان کنید . در ادامه به نحوه راه اندازی این کد زیبا در المنتور میپردازیم.

مزیت‌های کد نوار خبری متحرک

  • طراحی استایلیز و جذاب:
    با استفاده از گرادیان رنگی و انیمیشن‌های جذاب توجه کاربران را به محتوا جلب میکند.
  • ریسپانسیو شده برای موبایل:
    کد طراحی شده طیف وسیعی از دستگاه های دیجیتالی از جمله موبایل و تبلت ها را پشتیبانی میکند.
  • قابلیت تنظیم سرعت:
    سرعت انتقال محتوا میتواند با تغییر پارامترهای CSS یا JavaScript تنظیم شود.
  • پشتیبانی از لینک‌های خارجی/داخلی:
    هر مورد از اطلاعات به صورت مجزا قابلیت لینک دهی را دارا می باشند.
  • قابلیت افزودن/حذف محتوا:
    میتوانید مطالب خود را در بخش ticker-content کد وارد یا حذف کنید.

روش استفاده :

المان کد کوتاه المنتور

برای استفاده از کد های زیر کافیست از قسمت المان های المنتور گزینه ” کد کوتاه ” را سرچ کرده و بعد از اجرای آن کدهای مربوطه را در قسمت مشخص شده قرار دهید تا کد بصورت خودکار اجرا شود.

کد نوار خبری دارک ( مشکی )

				
					<div class="news-ticker-container">
    <style>
        .news-ticker {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            background: linear-gradient(270deg, #1a1a1a, #2d2d2d, #333);
            color: #ffffff;
            padding: 12px 20px;
            font-family: 'Segoe UI', Tahoma, sans-serif;
            overflow: hidden;
            white-space: nowrap;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
            z-index: 9999;
            direction: ltr;
            border-top: 1px solid #444;
            animation: gradient-animate 10s linear infinite;
        }

        @keyframes gradient-animate {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }

        .ticker-content {
            display: inline-block;
            animation: ticker-scroll linear infinite;
            padding-left: 100%;
            position: relative;
        }

        @keyframes ticker-scroll {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(0); }
        }

        .ticker-item {
            display: inline-block;
            font-size: 16px;
            padding: 10px 50px 10px 20px; /* فاصله سمت راست 50px */
            margin: 0 20px;
            border-radius: 6px;
            background: linear-gradient(180deg, #333, #444);
            transition: all 0.3s ease;
            cursor: pointer;
            text-decoration: none !important;
            color: #fff !important;
            position: relative;
        }

        .ticker-item::after {
            content: '';
            position: absolute;
            top: 50%;
            right: 30px; /* فاصله 30px از متن */
            transform: translateY(-50%);
            width: 14px;
            height: 14px;
            background: #ff4444;
            border-radius: 50%;
            animation: pulse 1.5s infinite;
            box-shadow: 0 0 15px #ff4444;
        }

        @keyframes pulse {
            0% { transform: translateY(-50%) scale(1); }
            50% { transform: translateY(-50%) scale(1.1); }
            100% { transform: translateY(-50%) scale(1); }
        }

        .ticker-content:hover {
            animation-play-state: paused;
        }

        .ticker-item:hover {
            transform: scale(1.03) translateY(-1px);
            box-shadow: 0 3px 10px rgba(255, 68, 68, 0.2);
            background: linear-gradient(180deg, #444, #555);
        }

        @media (max-width: 768px) {
            .ticker-item {
                font-size: 14px;
                padding: 8px 40px 8px 15px; /* تنظیم فاصله موبایل */
                margin: 0 15px;
            }
            
            .ticker-item::after {
                right: 25px;
                width: 12px;
                height: 12px;
            }
        }

        @media (max-width: 480px) {
            .ticker-item {
                font-size: 13px;
                padding: 6px 35px 6px 12px; /* تنظیم فاصله موبایل کوچک */
                margin: 0 10px;
            }
            
            .ticker-item::after {
                right: 20px;
                width: 10px;
                height: 10px;
            }
        }
    </style>

    <div class="news-ticker">
        <div class="ticker-content" id="tickerContent">
            <a href="https://example.com/news1" class="ticker-item" target="_blank" rel="noopener">خبر فوری: آغاز مذاکرات صلح بینالمللی در استانبول</a>
            <a href="https://example.com/news2" class="ticker-item" target="_blank" rel="noopener">اقتصاد: افزایش ۴٫۷ درصدی نرخ رشد اقتصادی در فصل اول</a>
            <a href="https://example.com/news3" class="ticker-item" target="_blank" rel="noopener">فناوری: معرفی پردازنده نسل پنجم از طرف شرکت سامسونگ</a>
            <a href="https://example.com/news4" class="ticker-item" target="_blank" rel="noopener">ورزش: قهرمانی ایران در مسابقات جودوی آسیا</a>
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            const ticker = document.getElementById('tickerContent');
            const originalContent = ticker.innerHTML.trim();
            
            ticker.innerHTML = originalContent + originalContent;
            
            const contentWidth = ticker.scrollWidth / 2;
            const duration = contentWidth / 40;
            
            ticker.style.animationDuration = `${duration}s`;
        });
    </script>
</div>
				
			

کد نوار خبری سبز

				
					<div class="news-ticker-container">
    <style>
        .news-ticker {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            background: linear-gradient(270deg, #1a4c2d, #2d734d, #339966);
            color: #ffffff;
            padding: 12px 20px;
            font-family: 'Segoe UI', Tahoma, sans-serif;
            overflow: hidden;
            white-space: nowrap;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
            z-index: 9999;
            direction: ltr;
            border-top: 1px solid #4a8e6c;
            animation: gradient-animate 10s linear infinite;
        }
        @keyframes gradient-animate {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        .ticker-content {
            display: inline-block;
            animation: ticker-scroll linear infinite;
            padding-left: 100%;
            position: relative;
        }
        @keyframes ticker-scroll {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(0); }
        }
        .ticker-item {
            display: inline-block;
            font-size: 16px;
            padding: 10px 50px 10px 20px;
            margin: 0 20px;
            border-radius: 6px;
            background: linear-gradient(180deg, #2c5e34, #34653a);
            transition: all 0.3s ease;
            cursor: pointer;
            text-decoration: none !important;
            color: #fff !important;
            position: relative;
        }
        .ticker-item::after {
            content: '';
            position: absolute;
            top: 50%;
            right: 30px;
            transform: translateY(-50%);
            width: 14px;
            height: 14px;
            background: #58db34;
            border-radius: 50%;
            animation: pulse 1.5s infinite;
            box-shadow: 0 0 15px #58db34;
        }
        @keyframes pulse {
            0% { transform: translateY(-50%) scale(1); }
            50% { transform: translateY(-50%) scale(1.1); }
            100% { transform: translateY(-50%) scale(1); }
        }
        .ticker-content:hover {
            animation-play-state: paused;
        }
        .ticker-item:hover {
            transform: scale(1.03) translateY(-1px);
            box-shadow: 0 3px 10px rgba(85, 219, 52, 0.3);
            background: linear-gradient(180deg, #85e9c1, #ade2d5);
        }
        @media (max-width: 768px) {
            .ticker-item {
                font-size: 14px;
                padding: 8px 40px 8px 15px;
                margin: 0 15px;
            }
            .ticker-item::after {
                right: 25px;
                width: 12px;
                height: 12px;
            }
        }
        @media (max-width: 480px) {
            .ticker-item {
                font-size: 13px;
                padding: 6px 35px 6px 12px;
                margin: 0 10px;
            }
            .ticker-item::after {
                right: 20px;
                width: 10px;
                height: 10px;
            }
        }
    </style>
    <div class="news-ticker">
        <div class="ticker-content" id="tickerContent">
            <a href="https://example.com/news1" class="ticker-item" target="_blank" rel="noopener">خبر فوری: آغاز مذاکرات صلح بینالمللی در استانبول</a>
            <a href="https://example.com/news2" class="ticker-item" target="_blank" rel="noopener">اقتصاد: افزایش ۴٫۷ درصدی نرخ رشد اقتصادی در فصل اول</a>
            <a href="https://example.com/news3" class="ticker-item" target="_blank" rel="noopener">فناوری: معرفی پردازنده نسل پنجم از طرف شرکت سامسونگ</a>
            <a href="https://example.com/news4" class="ticker-item" target="_blank" rel="noopener">ورزش: قهرمانی ایران در مسابقات جودوی آسیا</a>
        </div>
    </div>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            const ticker = document.getElementById('tickerContent');
            const originalContent = ticker.innerHTML.trim();
            ticker.innerHTML = originalContent + originalContent;
            const contentWidth = ticker.scrollWidth / 2;
            const duration = contentWidth / 40;
            ticker.style.animationDuration = `${duration}s`;
        });
    </script>
</div>
				
			

کد نوار خبری قرمز

				
					<div class="news-ticker-container">
    <style>
        .news-ticker {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            background: linear-gradient(270deg, #4c1a1a, #732d2d, #993333);
            color: #ffffff;
            padding: 12px 20px;
            font-family: 'Segoe UI', Tahoma, sans-serif;
            overflow: hidden;
            white-space: nowrap;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
            z-index: 9999;
            direction: ltr;
            border-top: 1px solid #8e4a4a;
            animation: gradient-animate 10s linear infinite;
        }
        @keyframes gradient-animate {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        .ticker-content {
            display: inline-block;
            animation: ticker-scroll linear infinite;
            padding-left: 100%;
            position: relative;
        }
        @keyframes ticker-scroll {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(0); }
        }
        .ticker-item {
            display: inline-block;
            font-size: 16px;
            padding: 10px 50px 10px 20px;
            margin: 0 20px;
            border-radius: 6px;
            background: linear-gradient(180deg, #5e1a1a, #732d2d);
            transition: all 0.3s ease;
            cursor: pointer;
            text-decoration: none !important;
            color: #fff !important;
            position: relative;
        }
        .ticker-item::after {
            content: '';
            position: absolute;
            top: 50%;
            right: 30px;
            transform: translateY(-50%);
            width: 14px;
            height: 14px;
            background: #db3434;
            border-radius: 50%;
            animation: pulse 1.5s infinite;
            box-shadow: 0 0 15px #db3434;
        }
        @keyframes pulse {
            0% { transform: translateY(-50%) scale(1); }
            50% { transform: translateY(-50%) scale(1.1); }
            100% { transform: translateY(-50%) scale(1); }
        }
        .ticker-content:hover {
            animation-play-state: paused;
        }
        .ticker-item:hover {
            transform: scale(1.03) translateY(-1px);
            box-shadow: 0 3px 10px rgba(219, 52, 52, 0.3);
            background: linear-gradient(180deg, #e95d5d, #e98585);
        }
        @media (max-width: 768px) {
            .ticker-item {
                font-size: 14px;
                padding: 8px 40px 8px 15px;
                margin: 0 15px;
            }
            .ticker-item::after {
                right: 25px;
                width: 12px;
                height: 12px;
            }
        }
        @media (max-width: 480px) {
            .ticker-item {
                font-size: 13px;
                padding: 6px 35px 6px 12px;
                margin: 0 10px;
            }
            .ticker-item::after {
                right: 20px;
                width: 10px;
                height: 10px;
            }
        }
    </style>
    <div class="news-ticker">
        <div class="ticker-content" id="tickerContent">
            <a href="https://example.com/news1" class="ticker-item" target="_blank" rel="noopener">خبر فوری: آغاز مذاکرات صلح بینالمللی در استانبول</a>
            <a href="https://example.com/news2" class="ticker-item" target="_blank" rel="noopener">اقتصاد: افزایش ۴٫۷ درصدی نرخ رشد اقتصادی در فصل اول</a>
            <a href="https://example.com/news3" class="ticker-item" target="_blank" rel="noopener">فناوری: معرفی پردازنده نسل پنجم از طرف شرکت سامسونگ</a>
            <a href="https://example.com/news4" class="ticker-item" target="_blank" rel="noopener">ورزش: قهرمانی ایران در مسابقات جودوی آسیا</a>
        </div>
    </div>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            const ticker = document.getElementById('tickerContent');
            const originalContent = ticker.innerHTML.trim();
            ticker.innerHTML = originalContent + originalContent;
            const contentWidth = ticker.scrollWidth / 2;
            const duration = contentWidth / 40;
            ticker.style.animationDuration = `${duration}s`;
        });
    </script>
</div>
				
			

کد نوار خبری آبی

				
					<div class="news-ticker-container">
    <style>
        .news-ticker {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            background: linear-gradient(270deg, #010051, #00117A, #0022A3);
            color: #ffffff;
            padding: 12px 20px;
            font-family: 'Segoe UI', Tahoma, sans-serif;
            overflow: hidden;
            white-space: nowrap;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
            z-index: 9999;
            direction: ltr;
            border-top: 1px solid #000C80;
            animation: gradient-animate 10s linear infinite;
        }
        @keyframes gradient-animate {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        .ticker-content {
            display: inline-block;
            animation: ticker-scroll linear infinite;
            padding-left: 100%;
            position: relative;
        }
        @keyframes ticker-scroll {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(0); }
        }
        .ticker-item {
            display: inline-block;
            font-size: 16px;
            padding: 10px 50px 10px 20px;
            margin: 0 20px;
            border-radius: 6px;
            background: linear-gradient(180deg, #000A33, #000D5C);
            transition: all 0.3s ease;
            cursor: pointer;
            text-decoration: none !important;
            color: #fff !important;
            position: relative;
        }
        .ticker-item::after {
            content: '';
            position: absolute;
            top: 50%;
            right: 30px;
            transform: translateY(-50%);
            width: 14px;
            height: 14px;
            background: #0077FF;
            border-radius: 50%;
            animation: pulse 1.5s infinite;
            box-shadow: 0 0 15px #0077FF;
        }
        @keyframes pulse {
            0% { transform: translateY(-50%) scale(1); }
            50% { transform: translateY(-50%) scale(1.1); }
            100% { transform: translateY(-50%) scale(1); }
        }
        .ticker-content:hover {
            animation-play-state: paused;
        }
        .ticker-item:hover {
            transform: scale(1.03) translateY(-1px);
            box-shadow: 0 3px 10px rgba(0, 119, 255, 0.3);
            background: linear-gradient(180deg, #0066FF, #0099FF);
        }
        @media (max-width: 768px) {
            .ticker-item {
                font-size: 14px;
                padding: 8px 40px 8px 15px;
                margin: 0 15px;
            }
            .ticker-item::after {
                right: 25px;
                width: 12px;
                height: 12px;
            }
        }
        @media (max-width: 480px) {
            .ticker-item {
                font-size: 13px;
                padding: 6px 35px 6px 12px;
                margin: 0 10px;
            }
            .ticker-item::after {
                right: 20px;
                width: 10px;
                height: 10px;
            }
        }
    </style>
    <div class="news-ticker">
        <div class="ticker-content" id="tickerContent">
            <a href="https://example.com/news1" class="ticker-item" target="_blank" rel="noopener">خبر فوری: آغاز مذاکرات صلح بینالمللی در استانبول</a>
            <a href="https://example.com/news2" class="ticker-item" target="_blank" rel="noopener">اقتصاد: افزایش ۴٫۷ درصدی نرخ رشد اقتصادی در فصل اول</a>
            <a href="https://example.com/news3" class="ticker-item" target="_blank" rel="noopener">فناوری: معرفی پردازنده نسل پنجم از طرف شرکت سامسونگ</a>
            <a href="https://example.com/news4" class="ticker-item" target="_blank" rel="noopener">ورزش: قهرمانی ایران در مسابقات جودوی آسیا</a>
        </div>
    </div>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            const ticker = document.getElementById('tickerContent');
            const originalContent = ticker.innerHTML.trim();
            ticker.innerHTML = originalContent + originalContent;
            const contentWidth = ticker.scrollWidth / 2;
            const duration = contentWidth / 40;
            ticker.style.animationDuration = `${duration}s`;
        });
    </script>
</div>
				
			

کد نوار خبری زرد

				
					<div class="news-ticker-container">
    <style>
        .news-ticker {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            background: linear-gradient(270deg, #B38A00, #D4A300, #FFD700);
            color: #ffffff;
            padding: 12px 20px;
            font-family: 'Segoe UI', Tahoma, sans-serif;
            overflow: hidden;
            white-space: nowrap;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
            z-index: 9999;
            direction: ltr;
            border-top: 1px solid #E5C200;
            animation: gradient-animate 10s linear infinite;
        }
        @keyframes gradient-animate {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        .ticker-content {
            display: inline-block;
            animation: ticker-scroll linear infinite;
            padding-left: 100%;
            position: relative;
        }
        @keyframes ticker-scroll {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(0); }
        }
        .ticker-item {
            display: inline-block;
            font-size: 16px;
            padding: 10px 50px 10px 20px;
            margin: 0 20px;
            border-radius: 6px;
            background: linear-gradient(180deg, #8C6B00, #B38A00);
            transition: all 0.3s ease;
            cursor: pointer;
            text-decoration: none !important;
            color: #fff !important;
            position: relative;
        }
        .ticker-item::after {
            content: '';
            position: absolute;
            top: 50%;
            right: 30px;
            transform: translateY(-50%);
            width: 14px;
            height: 14px;
            background: #FFEA00;
            border-radius: 50%;
            animation: pulse 1.5s infinite;
            box-shadow: 0 0 15px #FFEA00;
        }
        @keyframes pulse {
            0% { transform: translateY(-50%) scale(1); }
            50% { transform: translateY(-50%) scale(1.1); }
            100% { transform: translateY(-50%) scale(1); }
        }
        .ticker-content:hover {
            animation-play-state: paused;
        }
        .ticker-item:hover {
            transform: scale(1.03) translateY(-1px);
            box-shadow: 0 3px 10px rgba(255, 234, 0, 0.3);
            background: linear-gradient(180deg, #FFED4D, #FFF385);
        }
        @media (max-width: 768px) {
            .ticker-item {
                font-size: 14px;
                padding: 8px 40px 8px 15px;
                margin: 0 15px;
            }
            .ticker-item::after {
                right: 25px;
                width: 12px;
                height: 12px;
            }
        }
        @media (max-width: 480px) {
            .ticker-item {
                font-size: 13px;
                padding: 6px 35px 6px 12px;
                margin: 0 10px;
            }
            .ticker-item::after {
                right: 20px;
                width: 10px;
                height: 10px;
            }
        }
    </style>
    <div class="news-ticker">
        <div class="ticker-content" id="tickerContent">
            <a href="https://example.com/news1" class="ticker-item" target="_blank" rel="noopener">خبر فوری: آغاز مذاکرات صلح بینالمللی در استانبول</a>
            <a href="https://example.com/news2" class="ticker-item" target="_blank" rel="noopener">اقتصاد: افزایش ۴٫۷ درصدی نرخ رشد اقتصادی در فصل اول</a>
            <a href="https://example.com/news3" class="ticker-item" target="_blank" rel="noopener">فناوری: معرفی پردازنده نسل پنجم از طرف شرکت سامسونگ</a>
            <a href="https://example.com/news4" class="ticker-item" target="_blank" rel="noopener">ورزش: قهرمانی ایران در مسابقات جودوی آسیا</a>
        </div>
    </div>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            const ticker = document.getElementById('tickerContent');
            const originalContent = ticker.innerHTML.trim();
            ticker.innerHTML = originalContent + originalContent;
            const contentWidth = ticker.scrollWidth / 2;
            const duration = contentWidth / 40;
            ticker.style.animationDuration = `${duration}s`;
        });
    </script>
</div>
				
			

کد نوار خبری المنتور ( کد رنگی المنتور )

				
					<div class="news-ticker-container">
    <style>
        .news-ticker {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            background: linear-gradient(270deg, #92003B, #B30044, #D4004E);
            color: #ffffff;
            padding: 12px 20px;
            font-family: 'Segoe UI', Tahoma, sans-serif;
            overflow: hidden;
            white-space: nowrap;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
            z-index: 9999;
            direction: ltr;
            border-top: 1px solid #9C003F;
            animation: gradient-animate 10s linear infinite;
        }
        @keyframes gradient-animate {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        .ticker-content {
            display: inline-block;
            animation: ticker-scroll linear infinite;
            padding-left: 100%;
            position: relative;
        }
        @keyframes ticker-scroll {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(0); }
        }
        .ticker-item {
            display: inline-block;
            font-size: 16px;
            padding: 10px 50px 10px 20px;
            margin: 0 20px;
            border-radius: 6px;
            background: linear-gradient(180deg, #6D002C, #92003B);
            transition: all 0.3s ease;
            cursor: pointer;
            text-decoration: none !important;
            color: #fff !important;
            position: relative;
        }
        .ticker-item::after {
            content: '';
            position: absolute;
            top: 50%;
            right: 30px;
            transform: translateY(-50%);
            width: 14px;
            height: 14px;
            background: #FF6B6B;
            border-radius: 50%;
            animation: pulse 1.5s infinite;
            box-shadow: 0 0 15px #FF6B6B;
        }
        @keyframes pulse {
            0% { transform: translateY(-50%) scale(1); }
            50% { transform: translateY(-50%) scale(1.1); }
            100% { transform: translateY(-50%) scale(1); }
        }
        .ticker-content:hover {
            animation-play-state: paused;
        }
        .ticker-item:hover {
            transform: scale(1.03) translateY(-1px);
            box-shadow: 0 3px 10px rgba(255, 107, 107, 0.3);
            background: linear-gradient(180deg, #FF9A9A, #FFB3B3);
        }
        @media (max-width: 768px) {
            .ticker-item {
                font-size: 14px;
                padding: 8px 40px 8px 15px;
                margin: 0 15px;
            }
            .ticker-item::after {
                right: 25px;
                width: 12px;
                height: 12px;
            }
        }
        @media (max-width: 480px) {
            .ticker-item {
                font-size: 13px;
                padding: 6px 35px 6px 12px;
                margin: 0 10px;
            }
            .ticker-item::after {
                right: 20px;
                width: 10px;
                height: 10px;
            }
        }
    </style>
    <div class="news-ticker">
        <div class="ticker-content" id="tickerContent">
            <a href="https://example.com/news1" class="ticker-item" target="_blank" rel="noopener">خبر فوری: آغاز مذاکرات صلح بینالمللی در استانبول</a>
            <a href="https://example.com/news2" class="ticker-item" target="_blank" rel="noopener">اقتصاد: افزایش ۴٫۷ درصدی نرخ رشد اقتصادی در فصل اول</a>
            <a href="https://example.com/news3" class="ticker-item" target="_blank" rel="noopener">فناوری: معرفی پردازنده نسل پنجم از طرف شرکت سامسونگ</a>
            <a href="https://example.com/news4" class="ticker-item" target="_blank" rel="noopener">ورزش: قهرمانی ایران در مسابقات جودوی آسیا</a>
        </div>
    </div>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            const ticker = document.getElementById('tickerContent');
            const originalContent = ticker.innerHTML.trim();
            ticker.innerHTML = originalContent + originalContent;
            const contentWidth = ticker.scrollWidth / 2;
            const duration = contentWidth / 40;
            ticker.style.animationDuration = `${duration}s`;
        });
    </script>
</div>
				
			

دیدگاهتان را بنویسید