Skip to content

Commit

Permalink
修复去污粉样式问题和领瓜子性能问题
Browse files Browse the repository at this point in the history
  • Loading branch information
jjj201200 committed Oct 21, 2019
1 parent f14ea29 commit d86eaa8
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 97 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bilibili-helper-master",
"version": "1.2.2-beta.11",
"version": "1.2.2-beta.12",
"description": "bilibili-helper",
"main": "index.js",
"dependencies": {
Expand Down Expand Up @@ -95,4 +95,4 @@
"license": "MIT",
"repository": "https://github.com/zacyu/bilibili-helper",
"readme": "/source/README.md"
}
}
4 changes: 4 additions & 0 deletions src/js/modules/chatFilter/UI/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export class ChatFilterUI extends UI {
chatFilter.setAttribute('id', 'bilibili-helper-chat-filter');
chatFilter.setAttribute('style', 'position: relative;');

const iconBar = document.querySelector('.control-panel-icon-row');
iconBar.style.overflow = 'unset';
iconBar.style.height = '24px';

document.querySelector('.icon-left-part').appendChild(chatFilter);
ReactDOM.render(<ChatFilter settings={settings}/>, chatFilter, resolve);
}
Expand Down
10 changes: 5 additions & 5 deletions src/js/modules/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ import {NotAutoPlay, NotAutoPlayUI} from 'Modules/notAutoPlay';
import {LiveUpCheck, LiveUpCheckUI} from 'Modules/liveUpCheck';
//import {ShowDisabledVideo, ShowDisabledVideoUI} from 'Modules/ShowDisabledVideo';

let VideoUnblock;
try {
VideoUnblock = require('./videoUnblock').VideoUnblock;
} catch (e) {``;}
//let VideoUnblock;
//try {
// VideoUnblock = require('./videoUnblock').VideoUnblock;
//} catch (e) {``;}

export const Features = {
Background,
Expand All @@ -57,7 +57,7 @@ export const Features = {
QuickSearch,
VideoHideDanmu,
LiveChatMode,
VideoUnblock,
//VideoUnblock,
VideoDarkMode,
ProxyForWebsite,
CvImages,
Expand Down
1 change: 1 addition & 0 deletions src/js/modules/liveChatMode/UI/LiveChatMode.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export default () => {
.hide-aside-area .live-room-app .app-content .app-body .player-and-aside-area .aside-area {
background-color: transparent;
pointer-events: none;
z-index: 1001!important;
}
.hide-aside-area .live-room-app .app-content .app-body .player-and-aside-area .aside-area .chat-history-panel {
position: fixed;
Expand Down
9 changes: 4 additions & 5 deletions src/js/modules/treasure/UI/Treasure.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,13 @@ export default () => {
};

getGrayScaleMap = (context, rate = 235, width = 120, height = 40) => {
const getGrayscale = (x, y) => {
const pixel = context.getImageData(x, y, 1, 1).data;
return pixel ? (77 * pixel[0] + 150 * pixel[1] + 29 * pixel[2] + 128) >> 8 : 0;
};
const pixelMap = context.getImageData(0, 0, width, height).data;
const map = [];
for (let y = 0; y < height; y++) { // line y
for (let x = 0; x < width; x++) { // column x
const gray = getGrayscale(x, y);
const index = (y * width + x) * 4;
const pixel = pixelMap.slice(index, index + 4);
const gray = pixel ? (77 * pixel[0] + 150 * pixel[1] + 29 * pixel[2] + 128) >> 8 : 0;
map.push(gray > rate ? gray : 0);
}
}
Expand Down
44 changes: 37 additions & 7 deletions src/js/modules/videoDarkMode/UI/VideoDarkMode.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ export default () => {

const VideoDarkModeStyle = createGlobalStyle`
html {
--dark-1: #0c0c0c;
--dark-0: #101010;
--dark-1: #141414;
--dark-2: #131313;
--dark-3: #1f1f1f;
--dark-4: #2b2b2b;
Expand All @@ -47,12 +48,26 @@ export default () => {
#bofqi.mini-player:before {
box-shadow: #000000 0 0 8px;
}
// profile window
.profile-m.dd-bubble {
background-color: var(--dark-1);
border: 1px solid var(--dark-0);
border-top: none;
.member-menu {
border-top: 1px solid var(--dark-0);
}
.member-bottom {
background-color: var(--dark-0);
}
}
// nav 搜索框
.bili-header-m .nav-menu .showSearch.nav-search #nav_searchform {
border-color: var(--dark-3);
background-color: var(--dark-2);
.bili-header-m .nav-search #nav_searchform {
border-color: var(--dark-3)!important;
background-color: var(--dark-2)!important;
input {
color: var(--dark-font-0);
color: var(--dark-font-0)!important;
}
}
.bili-header-m .nav-menu .bilibili-suggest {
Expand All @@ -64,6 +79,9 @@ export default () => {
background-color: var(--dark-2);
}
}
li.suggest-item a {
color: #616161!important;
}
li.suggest-item:hover {
background-color: var(--dark-3);
}
Expand All @@ -76,7 +94,7 @@ export default () => {
}
// 创作团队
.members-info .members-info__header {
background-color: #131313;
background-color: var(--dark-1);
.title {
color: #99a2aa;
}
Expand Down Expand Up @@ -135,10 +153,22 @@ export default () => {
background-color: black !important;
}
.danmaku-info-row {
.danmaku-info-danmaku,span {
.danmaku-info-danmaku, span {
color: var(--dark-font-1)!important;
}
&.danmaku-info-row-block {
opacity: 0.3!important;
}
}
// 弹幕列表管理菜单
.danmaku-wrap .player-auxiliary-area .player-auxiliary-danmaku-management {
background-color: var(--dark-3)!important;
& > * {
border-color: var(--dark-1)!important;
}
}
.v-wrap .danmaku-wrap {
background-color: var(--dark-2)!important;
}
Expand Down
78 changes: 1 addition & 77 deletions src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,77 +1 @@
{
"version": "1.2.2.11",
"update_url": "https://clients2.google.com/service/update2/crx",
"manifest_version": 2,
"minimum_chrome_version": "56.0.0",
"name": "__MSG_extensionName__",
"short_name": "__MSG_extensionShortName__",
"default_locale": "zh_CN",
"description": "__MSG_extensionDescription__",
"options_ui": {"page": "config.html", "open_in_tab": true},
"options_page": "config.html",
"background": {"scripts": ["vendors.bundle.js", "features.bundle.js", "background.js"], "persistent": true},
"browser_action": {
"default_icon": {"19": "statics/imgs/icon-19.png", "38": "statics/imgs/icon-38.png"},
"default_popup": "popup.html",
"default_title": "__MSG_extensionShortName__"
},
"content_scripts": [
{
"all_frames": false,
"js": ["video.js", "vendors.bundle.js", "features.bundle.js"],
"css": ["styles/vendors.css", "styles/features.css"],
"matches": [
"*://*.bilibili.com/bangumi/play/ss*",
"*://*.bilibili.com/bangumi/play/ep*",
"*://*.bilibili.com/video/av*",
"*://www.bilibili.com/watchlater/*"
],
"run_at": "document_end"
},
{
"all_frames": true,
"js": ["vendors.bundle.js", "live.js", "statics/js/ocrad.min.js", "features.bundle.js"],
"matches": ["*://live.bilibili.com/*"],
"run_at": "document_end"
},
{
"all_frames": false,
"js": ["vendors.bundle.js", "website.js", "features.bundle.js"],
"matches": ["*://localhost/*", "*://helper.drowsyflesh.com/*", "*://bilibili-helper.github.io/*"],
"run_at": "document_start"
},
{
"all_frames": false,
"js": ["vendors.bundle.js", "cv.js", "features.bundle.js"],
"css": ["styles/vendors.css", "styles/features.css"],
"matches": ["*://www.bilibili.com/read/cv*"],
"run_at": "document_end"
},
{
"all_frames": false,
"js": ["vendors.bundle.js", "tbilibili.js", "features.bundle.js"],
"css": ["styles/vendors.css", "styles/features.css"],
"matches": ["*://t.bilibili.com/?tab=*"],
"run_at": "document_end"
}
],
"externally_connectable": {"matches": ["*://*/*"]},
"icons": {"16": "statics/imgs/icon-16.png", "32": "statics/imgs/icon-32.png", "128": "statics/imgs/icon-128.png"},
"key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXGarzPXVb5UpkDTsw4cdApsrQvPTNTMXdz/7j9QVuQZoPm5R9l3o9ppfGYeae7sZRaJiueBEO/LA8s7KCuE9icPl72xSqdei3Jo0PTTUlmNQIysl9PZy6Xd520sS5wNFhPaxOy1ApHZ6+o+yMEXWmjx2fX0tHJd7dKTii47MTnQIDAQAB",
"permissions": [
"downloads",
"alarms",
"contextMenus",
"cookies",
"notifications",
"storage",
"tabs",
"webRequest",
"webRequestBlocking",
"http://*/",
"https://*/"
],
"web_accessible_resources": ["statics/*", "bilibili-helper.woff", "at.alicdn.com/t/*", "libs/*", "js/*"],
"content_security_policy": "script-src 'self' https://www.google-analytics.com/analytics.js https://www.google-analytics.com/analytics_debug.js; object-src 'self';",
"incognito": "split"
}
{"version":"1.2.2.12","update_url":"https://clients2.google.com/service/update2/crx","manifest_version":2,"minimum_chrome_version":"56.0.0","name":"__MSG_extensionName__","short_name":"__MSG_extensionShortName__","default_locale":"zh_CN","description":"__MSG_extensionDescription__","options_ui":{"page":"config.html","open_in_tab":true},"options_page":"config.html","background":{"scripts":["vendors.bundle.js","features.bundle.js","background.js"],"persistent":true},"browser_action":{"default_icon":{"19":"statics/imgs/icon-19.png","38":"statics/imgs/icon-38.png"},"default_popup":"popup.html","default_title":"__MSG_extensionShortName__"},"content_scripts":[{"all_frames":false,"js":["video.js","vendors.bundle.js","features.bundle.js"],"css":["styles/vendors.css","styles/features.css"],"matches":["*://*.bilibili.com/bangumi/play/ss*","*://*.bilibili.com/bangumi/play/ep*","*://*.bilibili.com/video/av*","*://www.bilibili.com/watchlater/*"],"run_at":"document_end"},{"all_frames":true,"js":["vendors.bundle.js","live.js","statics/js/ocrad.min.js","features.bundle.js"],"matches":["*://live.bilibili.com/*"],"run_at":"document_end"},{"all_frames":false,"js":["vendors.bundle.js","website.js","features.bundle.js"],"matches":["*://localhost/*","*://helper.drowsyflesh.com/*","*://bilibili-helper.github.io/*"],"run_at":"document_start"},{"all_frames":false,"js":["vendors.bundle.js","cv.js","features.bundle.js"],"css":["styles/vendors.css","styles/features.css"],"matches":["*://www.bilibili.com/read/cv*"],"run_at":"document_end"},{"all_frames":false,"js":["vendors.bundle.js","tbilibili.js","features.bundle.js"],"css":["styles/vendors.css","styles/features.css"],"matches":["*://t.bilibili.com/?tab=*"],"run_at":"document_end"}],"externally_connectable":{"matches":["*://*/*"]},"icons":{"16":"statics/imgs/icon-16.png","32":"statics/imgs/icon-32.png","128":"statics/imgs/icon-128.png"},"key":"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXGarzPXVb5UpkDTsw4cdApsrQvPTNTMXdz/7j9QVuQZoPm5R9l3o9ppfGYeae7sZRaJiueBEO/LA8s7KCuE9icPl72xSqdei3Jo0PTTUlmNQIysl9PZy6Xd520sS5wNFhPaxOy1ApHZ6+o+yMEXWmjx2fX0tHJd7dKTii47MTnQIDAQAB","permissions":["downloads","alarms","contextMenus","cookies","notifications","storage","tabs","webRequest","webRequestBlocking","http://*/","https://*/"],"web_accessible_resources":["statics/*","bilibili-helper.woff","at.alicdn.com/t/*","libs/*","js/*"],"content_security_policy":"script-src 'self' https://www.google-analytics.com/analytics.js https://www.google-analytics.com/analytics_debug.js; object-src 'self';","incognito":"split"}
2 changes: 1 addition & 1 deletion src/styles/scss/video.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ body {
}
.bilibili-helper {
position: fixed;
bottom: 412px;
bottom: 420px;
right: 6px;
z-index: 1000;
& > span {
Expand Down

0 comments on commit d86eaa8

Please sign in to comment.