Skip to content

Commit

Permalink
Fix BILIBILI API.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidDengHui committed Oct 7, 2024
1 parent a2f5361 commit 486768f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
7 changes: 4 additions & 3 deletions source/_data/widget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ home_widget:
icon: fa-brands fa-bilibili fa-shake fa-xl
icon_color: '#056DE8'
url: https://www.bilibili.com/v/popular/rank/all
background: '#fff'
background: '#fff'
html: '
<div id="mySwiper" @mouseenter="stopAutoPlay()" @mouseleave="startAutoPlay()">
<swiper class="myswiper" ref="myswiper" style="height:350px;" :options="swiperOption">
<swiper class="myswiper" ref="myswiper" style="height:150px;" :options="swiperOption">
<swiper-slide v-for="(item, index) in listData" :key="index">
<a :href="`https://player.bilibili.com/player.html?bvid=BV` + item.url.slice(-10)" :title="item.desc" class="toPath" target="_blank" data-fancybox data-type="iframe" data-preload="false">
<span data-fancybox="gallery" :data-src="item.pic"><img class="no-lazy" :src="item.pic" style="width:100%;height:100%;object-fit: cover;"></span>
<!-- span data-fancybox="gallery" :data-src="item.pic"><img class="no-lazy" :src="item.pic" style="width:100%;height:100%;object-fit: cover;"></span -->
<!-- span data-fancybox="gallery" :data-src="item.pic"><img class="no-lazy" src="https://s1.hdslb.com/bfs/static/blive/blfe-message-web/static/img/light_bg.8e46311e.png" style="width:100%;height:100%;object-fit: cover;"></span -->
<div class="mySwiper-text">
<h1 class="ani" swiper-animate-effect="fadeInDown" swiper-animate-duration="0.5s" swiper-animate-delay="0.3s">
<strong style="color: #FF0000CC; font-size: 1.5em; font-style: italic; text-shadow: 2px 2px 4px black;">TOP{{index+1}}</strong>&nbsp;<i class="fa-brands fa-hotjar fa-beat fa-lg" style="color: #c82828;"></i>&nbsp;<span style="border-radius: 500px; border-color: #ff000088; border-style: outset; background: #FF000088;"> &nbsp;{{item.hot}}&nbsp;</span>
Expand Down
9 changes: 8 additions & 1 deletion source/css/mySwiper.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,16 @@
}
.myswiper .swiper-slide h2 {
z-index: 9999;
color: #fff;
color: #222222;
font-size: 24px;
}

.darkModel .myswiper .swiper-slide h2 {
z-index: 9999;
color: #c9d1d9;
font-size: 24px;
}

.myswiper .swiper-slide img {
filter: brightness(0.7); /* 图片变暗 ,字体看得清 */
}
Expand Down
3 changes: 2 additions & 1 deletion source/js/mySwiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ new Vue({
},
// 请求开源api
getList() {
fetch("https://api.vvhan.com/api/hotlist?type=bili", {
fetch("https://api.vvhan.com/api/hotlist/bili", {
// fetch("https://tenapi.cn/v2/weekly", {
// fetch("https://api.bilibili.com/x/web-interface/popular?ps=20&pn=1", {
// fetch("https://qqlykm.cn/api/hotlist/get?key=XWM0J8FEYVbwggCgV1PuJqLj5s&type=bilibili", {
Expand All @@ -69,6 +69,7 @@ new Vue({
})
.then((data) => {
this.listData = data.data;
console.log(this.listData);
})
.catch((err) => {
console.log("err", err);
Expand Down

0 comments on commit 486768f

Please sign in to comment.