code đăng bài tự đóng khung

1. Mã CSS Thu Gọn và Xóa Dấu Chấm

Dán đoạn này vào trên thẻ ]]></b:skin>:

CSS
/* TỰ ĐỘNG ĐÓNG KHUNG THU GỌN - TRUYENAUDIOLHC */
.post-body ul {
    list-style: none !important;
    list-style-type: none !important;
    padding: 0 !important;
    margin: 15px 0 !important;
    text-indent: 0 !important;
}

/* Xóa bỏ hoàn toàn dấu chấm tròn hoặc icon đầu dòng của Template */
.post-body ul li::before, 
.post-body ul li::marker {
    content: none !important;
    display: none !important;
}

.post-body ul li {
    background: #fffdf0 !important;
    border: 1px solid #ffba80 !important;
    margin-bottom: 6px !important; /* Giảm khoảng cách giữa các khung */
    border-radius: 6px !important;
    transition: all 0.3s ease;
    display: block !important;
    position: relative !important;
    padding: 0 !important; /* Xóa padding ở li để dùng padding ở thẻ a */
}

/* Chỉnh chiều cao nhỏ hơn tại đây */
.post-body ul li a {
    display: block !important;
    padding: 8px 35px 8px 12px !important; /* Giảm padding từ 12px xuống 8px để khung mỏng hơn */
    color: #333 !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 15px !important; /* Chỉnh cỡ chữ vừa phải */
}

/* Hiệu ứng Đã Nghe (Xám lại) */
.post-body ul li.has-listened {
    background: #f2f2f2 !important;
    border-color: #ddd !important;
    opacity: 0.7;
}

/* Hiệu ứng Hover */
.post-body ul li:hover {
    background: #fff !important;
    border-color: #ff0000 !important;
    transform: translateX(4px);
}

/* Icon Play nhỏ gọn bên phải */
.post-body ul li::after {
    content: '\f144';
    font-family: 'FontAwesome';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #cc0000;
    font-size: 16px;
    pointer-events: none;
}


Bước 2: Script "Tự động mở tab mới & Ghi nhớ"

Bạn dán đoạn này vào ngay trên thẻ đóng </body>. Nó sẽ lo việc mở link ra cửa sổ mới và đổi màu xám khi khách click.

HTML
<script type='text/javascript'>
//<![CDATA[
document.addEventListener('DOMContentLoaded', function() {
    function autoProcessList() {
        var items = document.querySelectorAll('.post-body ul li');
        items.forEach(function(item) {
            var link = item.querySelector('a');
            if (!link) return;

            // 1. Tự động ép mở tab mới khi click
            link.setAttribute('target', '_blank');
            link.setAttribute('rel', 'noopener noreferrer');

            // 2. Xử lý đổi màu và ghi nhớ
            link.onclick = function() {
                item.classList.add('has-listened');
                localStorage.setItem('listened_' + link.href, 'true');
            };

            // 3. Kiểm tra trạng thái đã nghe từ trước
            if (localStorage.getItem('listened_' + link.href)) {
                item.classList.add('has-listened');
            }
        });
    }

    // Chạy ngay khi load và quét lại sau mỗi 3 giây (đề phòng link load chậm)
    autoProcessList();
    setInterval(autoProcessList, 3000);
});
//]]>
</script>

Bước 3: Cách đăng bài "Lười nhất"

Bây giờ, bạn không cần quan tâm đến code phức tạp nữa. Trong bài đăng:

  1. Viết tiêu đề tập và chèn link Drive như bình thường.

  2. Bôi đen danh sách đó.

  3. Nhấn vào nút "Danh sách có dấu đầu dòng" (Bullet List) trên thanh công cụ Blogger.

  4. Nhấn Cập nhật/Xuất bản.

Next Post Previous Post
No Comment
Add Comment
comment url