Skip to content

Commit

Permalink
Merge pull request #6 from the1812/preview
Browse files Browse the repository at this point in the history
Update to 1.5.2
  • Loading branch information
the1812 authored Oct 11, 2018
2 parents d42d294 + 6bdefba commit a8f626c
Show file tree
Hide file tree
Showing 33 changed files with 810 additions and 188 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,14 @@
![绿色](images/new-navbar-teal.png)
![暗蓝色](images/new-navbar-blueGrey.png)
### 样式调整
改变顶栏的样式, 并有一些其他地方的界面微调.
**主要**会改变顶栏的样式, 并有一些其他地方的界面微调:
- 为播放器增加主题色投影
- 可控制顶栏对横幅的透明度
- 使播放器按钮垂直对齐
- 使部分搜索栏的提示文字的颜色更清晰
- 启用迷你播放器时, 防止下方内容(评论区, 相关推荐等)突然向上收拢影响阅读
- 隐藏播放页面的"返回旧版"侧栏
- 修复直播间一些文字初始状态不正确
#### 顶栏效果
![主站](images/new-navbar.png)
![播放](images/new-navbar-stardust.png)
Expand Down
89 changes: 64 additions & 25 deletions bilibili-evolved.offline.user.js

Large diffs are not rendered by default.

89 changes: 64 additions & 25 deletions bilibili-evolved.preview-offline.user.js

Large diffs are not rendered by default.

63 changes: 51 additions & 12 deletions bilibili-evolved.preview.user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name Bilibili Evolved (Preview)
// @version 1.5.1
// @version 1.5.2
// @description 增强哔哩哔哩Web端体验. (预览版分支)
// @author Grant Howard, Coulomb-G
// @match *://*.bilibili.com/*
Expand Down Expand Up @@ -54,7 +54,7 @@
notifyNewVersion: true,
fixFullscreen: false,
latestVersionLink: "https://github.com/the1812/Bilibili-Evolved/raw/preview/bilibili-evolved.preview.user.js",
currentVersion: "1.5.1"
currentVersion: "1.5.2"
};
function loadSettings()
{
Expand All @@ -81,15 +81,6 @@
GM_addValueChangeListener(key, change);
}
}
function runAndObserveDomMutation(selector, callback)
{
const element = document.querySelector(selector);
if (element)
{
const observer = new MutationObserver(callback);
observer.observe(element, { childList: true, subtree: true });
}
}
function loadResources()
{
Resource.root = "https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/";
Expand Down Expand Up @@ -220,6 +211,54 @@
static success() { }
static error() { }
}
class Observer
{
constructor(element, callback)
{
this.element = element;
this.callback = callback;
this.observer = null;
this.options = { childList: true, subtree: true };
}
start()
{
if (this.element)
{
this.observer = new MutationObserver(this.callback);
this.observer.observe(this.element, this.options);
}
return this;
}
stop()
{
this.observer && this.observer.disconnect();
return this;
}
static subtree(selector, callback)
{
callback();
return new Array(...document.querySelectorAll(selector))
.map(it =>
{
return new Observer(it, callback).start();
});
}
static attributes(selector, callback)
{
callback();
return new Array(...document.querySelectorAll(selector))
.map(it =>
{
const observer = new Observer(it, callback);
observer.options = {
childList: false,
subtree: false,
attributes: true
};
return observer.start();
});
}
}
class SpinQuery
{
constructor(query, condition, action, onFailed)
Expand Down Expand Up @@ -770,7 +809,7 @@
{
// execution error
console.error(`Failed to apply feature "${key}": ${error}`);
Toast.error(`加载组件<span>${Resource.all[key].displayName}</span>失败.`, "错误");
Toast.error(`加载组件<span>${Resource.all[key].displayName}</span>失败`, "错误");
}
}
}
Expand Down
63 changes: 51 additions & 12 deletions bilibili-evolved.user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name Bilibili Evolved
// @version 1.5.1
// @version 1.5.2
// @description 增强哔哩哔哩Web端体验.
// @author Grant Howard, Coulomb-G
// @match *://*.bilibili.com/*
Expand Down Expand Up @@ -54,7 +54,7 @@
notifyNewVersion: true,
fixFullscreen: false,
latestVersionLink: "https://github.com/the1812/Bilibili-Evolved/raw/master/bilibili-evolved.user.js",
currentVersion: "1.5.1"
currentVersion: "1.5.2"
};
function loadSettings()
{
Expand All @@ -81,15 +81,6 @@
GM_addValueChangeListener(key, change);
}
}
function runAndObserveDomMutation(selector, callback)
{
const element = document.querySelector(selector);
if (element)
{
const observer = new MutationObserver(callback);
observer.observe(element, { childList: true, subtree: true });
}
}
function loadResources()
{
Resource.root = "https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/";
Expand Down Expand Up @@ -220,6 +211,54 @@
static success() { }
static error() { }
}
class Observer
{
constructor(element, callback)
{
this.element = element;
this.callback = callback;
this.observer = null;
this.options = { childList: true, subtree: true };
}
start()
{
if (this.element)
{
this.observer = new MutationObserver(this.callback);
this.observer.observe(this.element, this.options);
}
return this;
}
stop()
{
this.observer && this.observer.disconnect();
return this;
}
static subtree(selector, callback)
{
callback();
return new Array(...document.querySelectorAll(selector))
.map(it =>
{
return new Observer(it, callback).start();
});
}
static attributes(selector, callback)
{
callback();
return new Array(...document.querySelectorAll(selector))
.map(it =>
{
const observer = new Observer(it, callback);
observer.options = {
childList: false,
subtree: false,
attributes: true
};
return observer.start();
});
}
}
class SpinQuery
{
constructor(query, condition, action, onFailed)
Expand Down Expand Up @@ -770,7 +809,7 @@
{
// execution error
console.error(`Failed to apply feature "${key}": ${error}`);
Toast.error(`加载组件<span>${Resource.all[key].displayName}</span>失败.`, "错误");
Toast.error(`加载组件<span>${Resource.all[key].displayName}</span>失败`, "错误");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion min/blur-video-control.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion min/dark-important.min.scss
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.link-footer{background-color:#222!important;}.wrapper .elec-btn.disabled,.f-list-hover:hover,.status_box .status_btn.disabled,.game-groom-m .num{background-color:#444!important;}blockquote,blockquote *,blockquote .color-blue-01,blockquote .color-blue-02,blockquote .color-blue-03,blockquote .color-blue-04,blockquote .color-gray-01,blockquote .color-gray-02,blockquote .color-gray-03,blockquote .color-green-01,blockquote .color-green-02,blockquote .color-green-03,blockquote .color-green-04,blockquote .color-lblue-01,blockquote .color-lblue-02,blockquote .color-lblue-03,blockquote .color-lblue-04,blockquote .color-pink-01,blockquote .color-pink-02,blockquote .color-pink-03,blockquote .color-pink-04,blockquote .color-purple-01,blockquote .color-purple-02,blockquote .color-purple-03,blockquote .color-purple-04,blockquote .color-yellow-01,blockquote .color-yellow-02,blockquote .color-yellow-03,blockquote .color-yellow-04,.status_box .status_btn.disabled{color:#aaa!important;}.home-page .sticky-bar .bar-content .message,.cover .disabled-cover,.el-input__inner,.commnent-screen-wrap .el-input__inner,.tag-list li.tag-item.on,.bp-popup-panel .title-ctnr .popup-title{color:#eee!important;}.link-footer,.el-input__inner,.commnent-screen-wrap .el-input__inner,.ui-input-textarea.focus,.user-setting-warp .el-radio-button__orig-radio:checked + .el-radio-button__inner{border-color:transparent!important;}.home-page .sticky-bar .bar-content .message:hover,.other a a:hover,.more-data a:hover,.rank-item .content .info .detail a a:hover,.rank-item .content .other a:hover,.rank-item .content .more-data:hover{color:$customStyleColor!important;}.season-timeline .season-group.today,.season-timeline .season-group.today .group-time::before,.aside-ctnr .author-info .communicate-btn,.tag-list li.tag-item.on{border-color:$customStyleColor!important;}.season-timeline .season-group.today.is-published .group-time::before,.bg-blue,.security-list .child-list li a.bg-blue:hover,.face-g-tab li.current,.el-date-table td.current:not(.disabled),.el-date-table td.end-date,.el-date-table td.start-date,.tag-list li.tag-item.on,.face-g-list#my-g-list .face-g-block .my-mp-block .mp-info .btn-white,.user-setting-warp .el-radio-button__orig-radio:checked + .el-radio-button__inner,.user-my-btn .el-button--primary{background-color:$customStyleColor!important;}.face-g-tab li.current,.current .tab-btn-link,.el-date-table td.current:not(.disabled),.el-date-table td.end-date,.el-date-table td.start-date{color:$foreground!important;}
.link-footer{background-color:#222!important;}.wrapper .elec-btn.disabled,.f-list-hover:hover,.status_box .status_btn.disabled,.game-groom-m .num,.container .pagination,.fjw-case-detail .ban-detail .content-box .video-model{background-color:#444!important;}blockquote,blockquote *,blockquote .color-blue-01,blockquote .color-blue-02,blockquote .color-blue-03,blockquote .color-blue-04,blockquote .color-gray-01,blockquote .color-gray-02,blockquote .color-gray-03,blockquote .color-green-01,blockquote .color-green-02,blockquote .color-green-03,blockquote .color-green-04,blockquote .color-lblue-01,blockquote .color-lblue-02,blockquote .color-lblue-03,blockquote .color-lblue-04,blockquote .color-pink-01,blockquote .color-pink-02,blockquote .color-pink-03,blockquote .color-pink-04,blockquote .color-purple-01,blockquote .color-purple-02,blockquote .color-purple-03,blockquote .color-purple-04,blockquote .color-yellow-01,blockquote .color-yellow-02,blockquote .color-yellow-03,blockquote .color-yellow-04,.status_box .status_btn.disabled{color:#aaa!important;}.home-page .sticky-bar .bar-content .message,.cover .disabled-cover,.el-input__inner,.commnent-screen-wrap .el-input__inner,.tag-list li.tag-item.on,.bp-popup-panel .title-ctnr .popup-title{color:#eee!important;}.link-footer,.el-input__inner,.commnent-screen-wrap .el-input__inner,.ui-input-textarea.focus,.user-setting-warp .el-radio-button__orig-radio:checked + .el-radio-button__inner{border-color:transparent!important;}.home-page .sticky-bar .bar-content .message:hover,.other a a:hover,.more-data a:hover,.rank-item .content .info .detail a a:hover,.rank-item .content .other a:hover,.rank-item .content .more-data:hover{color:$customStyleColor!important;}.season-timeline .season-group.today,.season-timeline .season-group.today .group-time::before,.aside-ctnr .author-info .communicate-btn,.tag-list li.tag-item.on,.tag-list li.tag-item:hover{border-color:$customStyleColor!important;}.season-timeline .season-group.today.is-published .group-time::before,.bg-blue,.security-list .child-list li a.bg-blue:hover,.face-g-tab li.current,.el-date-table td.current:not(.disabled),.el-date-table td.end-date,.el-date-table td.start-date,.tag-list li.tag-item.on,.face-g-list#my-g-list .face-g-block .my-mp-block .mp-info .btn-white,.user-setting-warp .el-radio-button__orig-radio:checked + .el-radio-button__inner,.user-my-btn .el-button--primary{background-color:$customStyleColor!important;}.face-g-tab li.current,.current .tab-btn-link,.el-date-table td.current:not(.disabled),.el-date-table td.end-date,.el-date-table td.start-date{color:$foreground!important;}
2 changes: 1 addition & 1 deletion min/dark-navbar.min.scss
Original file line number Diff line number Diff line change
@@ -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{background-color:#222;}.bili-header-m .nav-menu .nav-mask,#link-navbar-vm>.link-navbar,#navbar-vm>.link-navbar,#app>.link-navbar{background-color:#444;}.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{color:#eee;}#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;}
.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: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{color:#eee;}#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;}
2 changes: 1 addition & 1 deletion min/dark.min.scss

Large diffs are not rendered by default.

Loading

0 comments on commit a8f626c

Please sign in to comment.