<!doctype html>

<style>#story-list-RenamedBTV{display:flex;gap:20px;overflow-x:auto;padding:10px 0;scroll-snap-type:x mandatory;justify-content:flex-start;overflow-x:auto;-ms-overflow-style:none;scrollbar-width:none}#story-list-RenamedBTV::-webkit-scrollbar{display:none}#story-list-RenamedBTV{display:flex;gap:15px;overflow-x:auto;padding:10px 0;scroll-snap-type:x mandatory;justify-content:flex-start;-ms-overflow-style:none;scrollbar-width:none}.story-container-RenamedBTV{flex:0 0 calc(100px + 22px);width:100px;display:flex;flex-direction:column;align-items:center;justify-content:space-between;scroll-snap-align:start;opacity:0;transform:scale(.95);transition:opacity 0.3s ease,transform 0.3s ease;z-index:1}.story-container-RenamedBTV.visible{opacity:1;transform:scale(1)}.story-title-RenamedBTV{text-align:center;font-size:14px;font-weight:700;color:var(--bodyC);margin-top:8px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;width:100%;height:33px;line-height:1.2}.story-title-RenamedBTV:hover{color:var(--linkB)}.story-cover-RenamedBTV{position:relative;width:100%;overflow:hidden;border-radius:10px;z-index:0}.story-cover-RenamedBTV img{width:100%;aspect-ratio:2 / 3;object-fit:cover;border-radius:10px;transition:transform 0.3s ease;z-index:0}.story-cover-RenamedBTV img:hover{transform:scale(1.1)}.ribbon-RenamedBTV{position:absolute;top:0;right:0;background:linear-gradient(135deg,#FFA726,#FB8C00);color:#fff;font-size:5px;font-weight:700;text-transform:uppercase;padding:5.2px 8px 5.2px 8px;border-bottom-left-radius:8px;border-bottom-right-radius:8px;box-shadow:0 4px 6px rgb(0 0 0 / .3);z-index:1}.ribbon-RenamedBTV span{font-size:7px;margin-right:14px;display:block;font-weight:700}.circle-RenamedBTV{position:absolute;top:-3px;right:-5px;width:25px;height:25px;background-color:#000;background:linear-gradient(135deg,#121212,#333333,#880E4F);border-radius:50%;display:flex;align-items:center;justify-content:center;z-index:2}.circle-RenamedBTV svg{width:14px;height:14px;margin-top:4px;margin-left:-4px}#story-list-RenamedBTV{display:flex;gap:20px;overflow-x:auto;padding:10px 0;scroll-snap-type:x mandatory;justify-content:flex-start;-ms-overflow-style:none;scrollbar-width:none}#story-list-RenamedBTV::-webkit-scrollbar{display:none}.scroll-button-RenamedBTV{position:absolute;top:50%;transform:translateY(-50%);background:none;border:none;padding:0;cursor:pointer;z-index:10;display:none}.scroll-button-RenamedBTV.active{display:block}.scroll-button-RenamedBTV.left{left:10px}.scroll-button-RenamedBTV.right{right:10px}.scroll-button-RenamedBTV svg{width:24px;height:24px;fill:#fff}.scroll-button-RenamedBTV:hover svg{fill:#555}@media (max-width:1024px){.scroll-button-RenamedBTV.active{display:none}}.loader-RenamedBTV{display:none;border:4px solid rgb(0 0 0 / .1);border-left-color:var(--linkB);border-radius:50%;width:24px;height:24px;animation:loader 1s linear infinite;margin:0 auto}@keyframes loader{to{transform:rotate(360deg)}}</style>


<div style="position: relative; width: 100%; overflow: hidden;">
  <div class="loader-RenamedBTV"></div> <!-- Loader -->
  <div id="story-list-RenamedBTV"></div>
  <button class="scroll-button-RenamedBTV left" onclick="scrollStoryListRenamedBTV('left')">
<svg class='line' width="100%" height="100%" viewbox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
 <path class='c' d="M19 12H5M5 12L12 19M5 12L12 5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
 </path></svg>
  </button>
  <button class="scroll-button-RenamedBTV right" onclick="scrollStoryListRenamedBTV('right')">
<svg class='line' width="100%" height="100%" viewbox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
 <path class='c' d="M5 12H19M19 12L12 5M19 12L12 19" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
 </path></svg>
  </button>
</div>


  

<script>const apiUrlRenamedBTV="https://firestore.googleapis.com/v1/projects/kunsnovel-admin/databases/(default)/documents/the-loai/✪ Lựa chọn của BTV";function getRibbonRenamedBTV(){const background="linear-gradient(#880E4F, #AD1457, #C2185B, #F06292)";const svgPath=`
<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--emojione" preserveAspectRatio="xMidYMid meet" fill="#000000">
  <defs>
    <linearGradient id="beautifulGradient" x1="0" y1="0" x2="1" y2="1">
      <stop offset="0%" style="stop-color:#000000;stop-opacity:1" />
      <stop offset="40%" style="stop-color:#880E4F;stop-opacity:1" />
      <stop offset="80%" style="stop-color:#D32F2F;stop-opacity:1" />
      <stop offset="100%" style="stop-color:#F06292;stop-opacity:1" />
    </linearGradient>
  </defs>
  <g id="SVGRepo_bgCarrier" stroke-width="0"></g>
  <g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
  <g id="SVGRepo_iconCarrier">
    <path fill="url(#beautifulGradient)" d="M41 4H23L2 20.1L32 60l30-39.9z"></path>
    <g fill="#AD1457">
      <path d="M32 60l12.5-39.9H18.8z"></path>
      <path d="M9.5 9.5L2 20.1h16.8L23 4z"></path>
      <path d="M54.5 9.5L41 4l3.5 16.1H62z"></path>
    </g>
  </g>
</svg>

    `;const label="BTV lựa chọn";return `
      <div class="ribbon-RenamedBTV" style="background: ${background}">
        <span>${label}</span>
      </div>
      <div class="circle-RenamedBTV">
        ${svgPath}
      </div>
    `}
async function fetchBooksRenamedBTV(){const loader=document.querySelector(".loader-RenamedBTV");const scrollButtons=document.querySelectorAll(".scroll-button-RenamedBTV");try{loader.style.display="block";const response=await fetch(apiUrlRenamedBTV);const data=await response.json();const pages=data.fields;const books=Object.values(pages).map((page)=>{const fields=page.mapValue.fields;return{urlBia:fields["Url bìa"].stringValue,tacPham:fields["Tác phẩm"].stringValue,linkTacPham:fields["Link tác phẩm"].stringValue,}});const storyList=document.getElementById("story-list-RenamedBTV");storyList.innerHTML="";books.forEach((book)=>{const storyContainer=document.createElement("div");storyContainer.className="story-container-RenamedBTV visible";storyContainer.innerHTML=`
          <div class="story-cover-RenamedBTV">
            <a href="${book.linkTacPham}" target="_self">
              <img src="${book.urlBia}" alt="${book.tacPham}">
              ${getRibbonRenamedBTV()}
            </a>
          </div>
          <a href="${book.linkTacPham}" target="_self" class="story-title-RenamedBTV">${book.tacPham}</a>
        `;storyList.appendChild(storyContainer)});scrollButtons.forEach((button)=>button.classList.add("active"))}catch(error){console.error("Lỗi khi tải dữ liệu:",error)}finally{loader.style.display="none"}}
fetchBooksRenamedBTV();function scrollStoryListRenamedBTV(direction){const storyList=document.getElementById("story-list-RenamedBTV");const scrollAmount=300;if(direction==="left"){storyList.scrollBy({left:-scrollAmount,behavior:"smooth"})}else if(direction==="right"){storyList.scrollBy({left:scrollAmount,behavior:"smooth"})}}</script>

</!doctype>






