yaya影院

✦ yaya影院
🎬 yaya影院 · 海量高清影视免费在线观看 · 电影 · 电视剧 · 综艺 · 动漫 · 短剧 · 每日更新 · 无广告干扰 · 支持收藏追更

'+escapeHtml(m.title+'高清完整版在线观看 - '+m.category+'全集免费看')+'

'+escapeHtml((m.desc||'').slice(0,120))+'

关键词:'+escapeHtml([m.title,m.category+'在线观看','免费观看','高清完整版','全集','无广告播放'].join('、'))+''+ ''; } function renderDetailRecommend(bookId){var c=document.getElementById('recommendGrid-'+bookId);if(!c)return;var cur=findMovieById(bookId);if(!cur)return;var can=ALL_MOVIES.filter(function(b){return b.id!==bookId;});var sc=can.filter(function(b){return b.category===cur.category;});var ss=sc.slice().sort(function(){return Math.random()-0.5;});var sel=ss.slice(0,6);if(sel.length<6){var ot=can.filter(function(b){return b.category!==cur.category;});var so=ot.slice().sort(function(){return Math.random()-0.5;});while(sel.length<6&&so.length>0){sel.push(so.pop());}}var h='';for(var i=0;i
'+escapeHtml(b.category)+''+escapeHtml(b.title)+''+b.rating+'
'+escapeHtml(b.title)+'
'+stars+'
';}c.innerHTML=h;} function findMovieById(id){for(var i=0;i'+emojis[cat]+' '+cat+' ('+items.length+'部)
'+desc[cat]+'
'+gh+'
'); } function showAll(){document.getElementById('page-home').style.display='none';document.getElementById('detail-container').style.display='block';var car=document.getElementById('carousel-wrapper');if(car)car.style.display='none';var c=document.getElementById('all-container');c.className='visible';c.style.display='block';document.getElementById('category-container').className='';document.getElementById('category-container').style.display='none';document.getElementById('sitemap-container').className='';document.getElementById('sitemap-container').style.display='none';var ds=document.querySelectorAll('#detail-container .detail-page');for(var i=0;i📚 全部影视 ('+ALL_MOVIES.length+'部)
'+gh+'
'); } function showSitemap(){document.getElementById('page-home').style.display='none';document.getElementById('detail-container').style.display='block';var car=document.getElementById('carousel-wrapper');if(car)car.style.display='none';var c=document.getElementById('sitemap-container');c.className='visible';c.style.display='block';document.getElementById('category-container').className='';document.getElementById('category-container').style.display='none';document.getElementById('all-container').className='';document.getElementById('all-container').style.display='none';var ds=document.querySelectorAll('#detail-container .detail-page');for(var i=0;i

'+emojis[cat]+' '+cat+'('+items.length+'部)

';for(var j=0;j🎬 '+escapeHtml(items[j].title)+'';}gh+='';}var seo=c.querySelector('.seo-hidden');c.innerHTML='';if(seo)c.appendChild(seo);c.insertAdjacentHTML('beforeend','
📌 本站共收录 '+ALL_MOVIES.length+' 部影视,点击剧名即可进入详情页。无广告干扰 · 支持收藏 · 追更提醒
'+gh+'
📄 共 '+ALL_MOVIES.length+' 部影视 · 全部静态化 · 蜘蛛可抓取
'); } function getStorage(k,d){try{var v=localStorage.getItem('xy_'+k);return v?JSON.parse(v):d;}catch(e){return d;}} function setStorage(k,v){localStorage.setItem('xy_'+k,JSON.stringify(v));} function toggleLike(id,btn){var liked=btn.classList.toggle('liked');var likes=getStorage('likes',{});likes[id]=liked;setStorage('likes',likes);var count=btn.querySelector('.count');if(count){var cur=parseInt(count.textContent);count.textContent=liked?cur+1:cur-1;}} function toggleFav(id,btn){var faved=btn.classList.toggle('collected');var favs=getStorage('favs',{});favs[id]=faved;setStorage('favs',favs);var count=btn.querySelector('.count');if(count){var cur=parseInt(count.textContent);count.textContent=faved?cur+1:cur-1;}} function shareMovie(title){if(navigator.share){navigator.share({title:title+' - yaya影院',text:'我在看《'+title+'》,推荐给你!🎬',url:window.location.href}).catch(function(){});}else if(navigator.clipboard){navigator.clipboard.writeText(window.location.href).then(function(){alert('📤 链接已复制,分享给好友吧!');}).catch(function(){prompt('📤 复制链接:',window.location.href);});}else{prompt('📤 复制链接:',window.location.href);}} function getComments(id){var all=getStorage('comments',{});return all[id]||[];} function setComments(id,comments){var all=getStorage('comments',{});all[id]=comments;setStorage('comments',all);} function addComment(id,text){var cs=getComments(id);var names=['影迷小A','追剧达人','剧荒患者','细节控','催泪党','推理迷','治愈系','二刷选手','8090粉丝','影视爱好者'];var colors=['#FF8A5C','#1A2A4A','#FFD700','#2A4A7A','#4DD4A0','#FF6B4A','#3B82F6','#EC4899'];cs.unshift({id:Date.now(),name:names[Math.floor(Math.random()*names.length)]+'·'+String(Math.floor(Math.random()*100)).padStart(2,'0'),text:text,time:'刚刚',avatarBg:colors[Math.floor(Math.random()*colors.length)],likes:0});setComments(id,cs);return cs;} function submitComment(id){var input=document.getElementById('input-'+id);if(!input)return;var text=input.value.trim();if(!text){alert('💬 请输入影评内容');return;}var cs=addComment(id,text);var list=document.getElementById('list-'+id);if(!list)return;var h=cs.map(function(c){return '
'+c.name.charAt(0)+'
'+escapeHtml(c.name)+''+c.time+'
'+escapeHtml(c.text)+'
';}).join('');list.innerHTML=h;input.value='';var count=document.querySelector('#body-'+id+' .count');if(count)count.textContent=cs.length;var body=document.getElementById('body-'+id);var arrow=document.getElementById('arrow-'+id);if(body)body.classList.add('open');if(arrow)arrow.classList.add('open');} function toggleComments(id){var body=document.getElementById('body-'+id);var arrow=document.getElementById('arrow-'+id);if(!body)return;body.classList.toggle('open');if(arrow)arrow.classList.toggle('open');var exp=getStorage('commentExpanded',{});exp[id]=body.classList.contains('open');setStorage('commentExpanded',exp);} function bindCommentEvents(id){var exp=getStorage('commentExpanded',{});if(exp[id]){var body=document.getElementById('body-'+id);var arrow=document.getElementById('arrow-'+id);if(body)body.classList.add('open');if(arrow)arrow.classList.add('open');}} function filterMovies(val){var cards=document.querySelectorAll('.movie-card');var sv=val.trim().toLowerCase();var found=false;cards.forEach(function(card){var title=card.querySelector('.title')?card.querySelector('.title').textContent.toLowerCase():'';if(sv===''||title.includes(sv)){card.style.display='';found=true;}else{card.style.display='none';}});var nr=document.querySelector('.no-results');if(!found&&sv!==''){if(!nr){var c=document.getElementById('mainContent');var d=document.createElement('div');d.className='no-results';d.innerHTML='🔍没有找到与「'+escapeHtml(sv)+'」相关的影视';c.insertBefore(d,c.firstChild);}else{nr.style.display='block';}}else if(nr){nr.style.display='none';}var si=document.getElementById('searchInput');if(si)si.value=val;} function goToSlide(index){var slides=document.querySelectorAll('.carousel-slide');var dots=document.querySelectorAll('.carousel-dots .dot');if(!slides.length)return;for(var i=0;i=slides.length)index=0;if(index<0)index=slides.length-1;slides[index].classList.add('active');if(dots[index])dots[index].classList.add('active');carouselIndex=index;} function carouselNext(e){if(e)e.stopPropagation();resetCarouselTimer();goToSlide(carouselIndex+1);} function carouselPrev(e){if(e)e.stopPropagation();resetCarouselTimer();goToSlide(carouselIndex-1);} function carouselGoTo(index){resetCarouselTimer();goToSlide(index);} function startCarousel(){stopCarousel();carouselTimer=setInterval(function(){goToSlide(carouselIndex+1);},5000);} function stopCarousel(){if(carouselTimer){clearInterval(carouselTimer);carouselTimer=null;}} function resetCarouselTimer(){stopCarousel();startCarousel();} function toggleTheme(){var html=document.documentElement;var current=html.getAttribute('data-theme');var next=current==='dark'?'light':'dark';html.setAttribute('data-theme',next);setStorage('theme',next);var btn=document.querySelector('.theme-toggle');if(btn)btn.textContent=next==='dark'?'☀️':'🌙';} function initTheme(){var saved=getStorage('theme',null);var prefers=window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light';var theme=saved||prefers;document.documentElement.setAttribute('data-theme',theme);var btn=document.querySelector('.theme-toggle');if(btn)btn.textContent=theme==='dark'?'☀️':'🌙';} window.addEventListener('scroll',function(){var nav=document.getElementById('navbar');if(nav)nav.classList.toggle('scrolled',window.scrollY>20);}); document.addEventListener('DOMContentLoaded',function(){initTheme();renderHomePage();generateAllDetailPages();route(window.location.pathname);var si=document.getElementById('searchInput');if(si){si.addEventListener('input',function(e){filterMovies(this.value);});si.addEventListener('keydown',function(e){if(e.key==='Enter'){filterMovies(this.value);}});}}); window.navigate=navigate;window.filterMovies=filterMovies;window.toggleTheme=toggleTheme;window.carouselNext=carouselNext;window.carouselPrev=carouselPrev;window.carouselGoTo=carouselGoTo;window.toggleLike=toggleLike;window.toggleFav=toggleFav;window.shareMovie=shareMovie;window.submitComment=submitComment;window.toggleComments=toggleComments;