mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
1 line
2.4 KiB
JavaScript
1 line
2.4 KiB
JavaScript
(()=>{return(i,e)=>{const a=`<div class=bangumi-category :class="{'rank-loading': rank.loading, 'timeline-loading': timeline.loading}"><bangumi-timeline class=timeline @load="timeline.loading = false"@error="timeline.error = true"></bangumi-timeline><rank-list :videos=rank.videos></rank-list><div class="timeline loading"></div><div class="rank loading"></div></div>`;e.applyStyleFromText(`.simple-home .bangumi-category{display:grid;grid-template:"timeline rank" 1fr/1fr calc(1.5 * var(--rank-width) + 10px);grid-row-gap:24px;row-gap:24px;grid-column-gap:32px;column-gap:32px;position:relative}.simple-home .bangumi-category,.simple-home .bangumi-category *,.simple-home .bangumi-category ::after,.simple-home .bangumi-category ::before{transition:.2s ease-out}.simple-home .bangumi-category .loading{opacity:0;pointer-events:none;border-radius:16px;position:absolute}.simple-home .bangumi-category .timeline{grid-area:timeline}.simple-home .bangumi-category.timeline-loading .timeline.loading{position:static;animation:.64s ease-in-out infinite alternate category-loading;opacity:1;pointer-events:initial;width:100%;height:100%}.simple-home .bangumi-category.timeline-loading .timeline:not(.loading){opacity:0;pointer-events:none}.simple-home .bangumi-category .rank{height:700px;grid-area:rank}.simple-home .bangumi-category.rank-loading .rank.loading{position:static;animation:.64s ease-in-out infinite alternate category-loading;opacity:1;pointer-events:initial;width:100%;height:100%}.simple-home .bangumi-category.rank-loading .rank:not(.loading){opacity:0;pointer-events:none}`,"simple-home-bangumi-category-style");return{export:Object.assign({template:a},{components:{BangumiTimeline:()=>e.importAsync("bangumi-timeline.vue"),RankList:()=>e.importAsync("rank-list.vue")},data(){return{timeline:{error:false,loading:true},rank:{error:false,loading:true,videos:[]}}},computed:{},methods:{async loadRankList(){const i=`https://api.bilibili.com/pgc/web/rank/list?season_type=1&day=3`;try{const e=await Ajax.getJson(i);if(e.code!==0){throw new Error(e.message)}const a=e.result.list.map(i=>{return{id:i.season_id,href:i.url,coverUrl:i.new_ep.cover.replace("http:","https:"),title:i.title,points:i.pts,epTitle:i.new_ep.index_show,playCount:i.stat.view,danmakuCount:i.stat.danmaku,watchlater:null}});this.rank.videos=a.slice(0,10)}catch(i){logError(i);this.rank.error=true}finally{this.rank.loading=false}}},mounted(){this.loadRankList()}})}}})(); |