Update styles for live room

This commit is contained in:
the1812 2018-12-09 23:38:28 +08:00
parent a41c8a2c53
commit 680cf14c34
8 changed files with 49 additions and 16 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
.bili-header-m .nav-menu .nav-con .nav-item:hover,.right-part>.shortcuts-ctnr .shortcut-item:hover,#link-navbar-vm>.link-navbar .nav-item:hover,.z_top .z_top_nav ul li:hover,.uns_box ul.menu li:not(.b-post):hover{background-color:#222;}.bili-header-m .nav-menu .nav-mask,#link-navbar-vm>.link-navbar,#navbar-vm>.link-navbar,#app>.link-navbar,#app>.nav-header-wrapper,.b-header-mask-wrp .b-header-mask{background-color:#444;}.z_top .i-link:hover,.z_top .z_top_nav ul li.home:hover{background-color:transparent;}#app>.nav-header-wrapper>.nav-header{background:transparent;}.bili-header-m .nav-menu .nav-con .nav-item .t,#link-navbar-vm>.link-navbar .main-ctnr .nav-logo,.right-part>.shortcuts-ctnr,.right-part>.shortcuts-ctnr .shortcut-item,.right-part>.shortcuts-ctnr .shortcut-item:hover,#link-navbar-vm>.link-navbar .nav-item:hover,.my-link-btn .label,#app>.link-navbar .main-ctnr .nav-logo,#app>.link-navbar .nav-item.selected .label,#app>.link-navbar .nav-item:hover .icon-font,#app>.nav-header-wrapper>.nav-header .nav-header-mainsite,#app>.nav-header-wrapper>.nav-header .order-center,.z_top.b-header-blur .z_top_nav li a.i-link,.z_top.b-header-blur .uns_box li.u-i a.i-link,.z_top a,.uns_box li.u-i a.i-link{color:#eee;}.uns_box li.u-i:hover a.i-link,.z_top .i-link:hover{color:$customStyleColor;}#link-navbar-vm>.link-navbar-ctnr,#app>.link-navbar{box-shadow:none;}#link-navbar-vm>.link-navbar .main-ctnr .nav-logo::before,#app>.link-navbar .main-ctnr .nav-logo::before{filter:$blueImageFileter!important;}#app>.nav-header-wrapper .nav-header .order-icon{filter:brightness(0) invert(1)!important;} .bili-header-m .nav-menu .nav-con .nav-item:hover,.right-part>.shortcuts-ctnr .shortcut-item:hover,#link-navbar-vm>.link-navbar .nav-item:hover,.z_top .z_top_nav ul li:hover,.uns_box ul.menu li:not(.b-post):hover{background-color:#222;}.bili-header-m .nav-menu .nav-mask,#link-navbar-vm>.link-navbar,#app>.link-navbar,#app>.nav-header-wrapper,.b-header-mask-wrp .b-header-mask{background-color:#444;}#navbar-vm>.link-navbar{background-color:#444!important;}.z_top .i-link:hover,.z_top .z_top_nav ul li.home:hover{background-color:transparent;}#app>.nav-header-wrapper>.nav-header{background:transparent;}.bili-header-m .nav-menu .nav-con .nav-item .t,#link-navbar-vm>.link-navbar .main-ctnr .nav-logo,.right-part>.shortcuts-ctnr,.right-part>.shortcuts-ctnr .shortcut-item:hover,#link-navbar-vm>.link-navbar .nav-item:hover,.my-link-btn .label,#app>.link-navbar .main-ctnr .nav-logo,#app>.link-navbar .nav-item.selected .label,#app>.link-navbar .nav-item:hover .icon-font,#app>.nav-header-wrapper>.nav-header .nav-header-mainsite,#app>.nav-header-wrapper>.nav-header .order-center,.z_top.b-header-blur .z_top_nav li a.i-link,.z_top.b-header-blur .uns_box li.u-i a.i-link,.z_top a,.uns_box li.u-i a.i-link{color:#eee;}.uns_box li.u-i:hover a.i-link,.z_top .i-link:hover{color:$customStyleColor;}#link-navbar-vm>.link-navbar-ctnr,#app>.link-navbar{box-shadow:none;}#link-navbar-vm>.link-navbar .main-ctnr .nav-logo::before,#app>.link-navbar .main-ctnr .nav-logo::before{filter:$blueImageFileter!important;}#app>.nav-header-wrapper .nav-header .order-icon{filter:brightness(0) invert(1)!important;}.shortcuts-ctnr .shortcut-item,.link-navbar .main-ctnr .custom-link>a{color:#eee!important;}.search-bar-ctnr .search-bar input{color:#eee!important;}.search-bar-ctnr .search-bar .placeholder,.search-bar-ctnr .search-bar .search-btn{color:#878787!important;}.search-bar-ctnr .search-bar{border:none!important;box-shadow:0px 2px 10px 1px #0002!important;}

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(()=>{return(e,t)=>{class n{constructor(e){this.url=e;if($(".image-viewer").length===0){this.createDom()}this.viewer=$(".image-viewer-container");this.downloadImage()}createDom(){$("body").append(t.data.imageViewerDom.text);$(".image-viewer-container .close").on("click",()=>this.hide());t.applyStyle("imageViewerStyle")}downloadImage(){const e=new XMLHttpRequest;e.open("GET",this.url.replace("http:","https:"),true);e.responseType="blob";e.onload=(()=>{const t=document.title.replace("_哔哩哔哩 (゜-゜)つロ 干杯~-bilibili","");const n=URL.createObjectURL(e.response);this.imageData=n;this.viewer.find(".download").attr("href",n).attr("download",t);this.viewer.find(".image").prop("src",n)});e.send()}show(){this.viewer.addClass("opened")}hide(){this.viewer.removeClass("opened")}}if($("meta[itemprop='image'],meta[property='og:image']").length>0){return{widget:{content:`\n <button\n class="gui-settings-flat-button"\n id="view-cover">\n <i class="icon-view"></i>\n <span>查看封面</span>\n </button>`,condition:async()=>{const e=await SpinQuery.condition(()=>$("meta[itemprop='image'],meta[property='og:image']"),e=>e.length>0&&e.prop("content"));return typeof e!=="undefined"},success:async()=>{const e=$("meta[itemprop='image'],meta[property='og:image']");const t=new n(e.prop("content"));$("#view-cover").on("click",()=>{t.show()})}}}}else{return{widget:{content:`\n <button\n class="gui-settings-flat-button"\n id="view-cover">\n <i class="icon-view"></i>\n <span>查看封面</span>\n </button>`,condition:async()=>{const e=await SpinQuery.any(()=>$(".header-info-ctnr .room-cover"));return typeof e!=="undefined"},success:async()=>{const e=$(".header-info-ctnr .room-cover");const t=e.attr("href").match(/space\.bilibili\.com\/([\d]+)/);if(t&&t[1]){const e=t[1];const o=`http://api.live.bilibili.com/room/v1/Room/getRoomInfoOld?mid=${e}`;const i=await downloadText(o);const a=JSON.parse(i).data.cover;const s=new n(a);$("#view-cover").on("click",()=>{s.show()})}}}}}}})(); (()=>{return(e,t)=>{class n{constructor(e){this.url=e;if($(".image-viewer").length===0){this.createDom()}this.viewer=$(".image-viewer-container");this.downloadImage()}createDom(){$("body").append(t.data.imageViewerDom.text);$(".image-viewer-container .close").on("click",()=>this.hide());t.applyStyle("imageViewerStyle")}downloadImage(){const e=new XMLHttpRequest;e.open("GET",this.url.replace("http:","https:"),true);e.responseType="blob";e.onload=(()=>{const t=document.title.replace("_哔哩哔哩 (゜-゜)つロ 干杯~-bilibili","");const n=URL.createObjectURL(e.response);this.imageData=n;this.viewer.find(".download").attr("href",n).attr("download",t);this.viewer.find(".image").prop("src",n)});e.send()}show(){this.viewer.addClass("opened")}hide(){this.viewer.removeClass("opened")}}if($("meta[itemprop='image'],meta[property='og:image']").length>0){return{widget:{content:`\n <button\n class="gui-settings-flat-button"\n id="view-cover">\n <i class="icon-view"></i>\n <span>查看封面</span>\n </button>`,condition:async()=>{const e=await SpinQuery.condition(()=>$("meta[itemprop='image'],meta[property='og:image']"),e=>e.length>0&&e.prop("content"));return typeof e!=="undefined"},success:async()=>{const e=$("meta[itemprop='image'],meta[property='og:image']");const t=new n(e.prop("content"));$("#view-cover").on("click",()=>{t.show()})}}}}else{return{widget:{content:`\n <button\n class="gui-settings-flat-button"\n id="view-cover">\n <i class="icon-view"></i>\n <span>查看封面</span>\n </button>`,condition:async()=>{const e=await SpinQuery.any(()=>$(".header-info-ctnr .room-cover"));return typeof e!=="undefined"},success:async()=>{const e=$(".header-info-ctnr .room-cover");const t=e.attr("href").match(/space\.bilibili\.com\/([\d]+)/);if(t&&t[1]){const e=t[1];const o=`https://api.live.bilibili.com/room/v1/Room/getRoomInfoOld?mid=${e}`;const i=await downloadText(o);const a=JSON.parse(i).data.cover;const s=new n(a);$("#view-cover").on("click",()=>{s.show()})}}}}}}})();

View File

@ -8,13 +8,16 @@
} }
.bili-header-m .nav-menu .nav-mask, .bili-header-m .nav-menu .nav-mask,
#link-navbar-vm>.link-navbar, #link-navbar-vm>.link-navbar,
#navbar-vm>.link-navbar,
#app>.link-navbar, #app>.link-navbar,
#app>.nav-header-wrapper, #app>.nav-header-wrapper,
.b-header-mask-wrp .b-header-mask .b-header-mask-wrp .b-header-mask
{ {
background-color: #444; background-color: #444;
} }
#navbar-vm>.link-navbar
{
background-color: #444 !important;
}
.z_top .i-link:hover, .z_top .i-link:hover,
.z_top .z_top_nav ul li.home:hover .z_top .z_top_nav ul li.home:hover
{ {
@ -27,7 +30,6 @@
.bili-header-m .nav-menu .nav-con .nav-item .t, .bili-header-m .nav-menu .nav-con .nav-item .t,
#link-navbar-vm>.link-navbar .main-ctnr .nav-logo, #link-navbar-vm>.link-navbar .main-ctnr .nav-logo,
.right-part>.shortcuts-ctnr, .right-part>.shortcuts-ctnr,
.right-part>.shortcuts-ctnr .shortcut-item,
.right-part>.shortcuts-ctnr .shortcut-item:hover, .right-part>.shortcuts-ctnr .shortcut-item:hover,
#link-navbar-vm>.link-navbar .nav-item:hover, #link-navbar-vm>.link-navbar .nav-item:hover,
.my-link-btn .label, .my-link-btn .label,
@ -62,3 +64,22 @@
{ {
filter: brightness(0) invert(1) !important; filter: brightness(0) invert(1) !important;
} }
.shortcuts-ctnr .shortcut-item,
.link-navbar .main-ctnr .custom-link>a
{
color: #eee !important;
}
.search-bar-ctnr .search-bar input
{
color: #eee !important;
}
.search-bar-ctnr .search-bar .placeholder,
.search-bar-ctnr .search-bar .search-btn
{
color: #878787 !important;
}
.search-bar-ctnr .search-bar
{
border: none !important;
box-shadow: 0px 2px 10px 1px #0002 !important;
}

View File

@ -59,7 +59,8 @@ div.stardust-player
.link-navbar .nav-item.selected .label, .link-navbar .nav-item.selected .label,
.link-navbar .nav-item .icon-font, .link-navbar .nav-item .icon-font,
.nav-header-wrapper .nav-header .nav-header-mainsite, .nav-header-wrapper .nav-header .nav-header-mainsite,
.nav-header-wrapper .nav-header .order-center .nav-header-wrapper .nav-header .order-center,
.link-navbar .main-ctnr .custom-link>a
{ {
color: $foregroundd !important; color: $foregroundd !important;
} }
@ -154,10 +155,21 @@ div.up-load
{ {
border-radius: 0 !important; border-radius: 0 !important;
} }
.slot-ctnr a .slot-ctnr a,
.main-ctnr .search-bar-ctnr .search-bar input
{ {
color: #222 !important; color: #222 !important;
} }
.main-ctnr .search-bar-ctnr .search-bar .placeholder,
.main-ctnr .search-bar-ctnr .search-bar .search-btn
{
color: #878787 !important;
}
.main-ctnr .search-bar-ctnr .search-bar
{
border: none !important;
box-shadow: 0px 2px 10px 1px #0002 !important;
}
.u-link .u-link
{ {
background: transparent !important; background: transparent !important;

View File

@ -106,7 +106,7 @@
if (match && match[1]) if (match && match[1])
{ {
const uid = match[1]; const uid = match[1];
const url = `http://api.live.bilibili.com/room/v1/Room/getRoomInfoOld?mid=${uid}`; const url = `https://api.live.bilibili.com/room/v1/Room/getRoomInfoOld?mid=${uid}`;
const text = await downloadText(url); const text = await downloadText(url);
const coverUrl = JSON.parse(text).data.cover; const coverUrl = JSON.parse(text).data.cover;
const imageViewer = new ImageViewer(coverUrl); const imageViewer = new ImageViewer(coverUrl);