bilibili直播精简

精简了bilibili的直播页面

目前为 2016-10-08 提交的版本,查看 最新版本

// ==UserScript==
// @name         bilibili直播精简
// @namespace    https://coding.net/u/BackRunner/p/GreaseMonkey-JS/git
// @version      1.1
// @description  精简了bilibili的直播页面
// @author       BackRunner
// @match        *://live.bilibili.com/*
// @license      MIT
// @grant        none
// ==/UserScript==

// ==   Tips   ==
// 使用时可以根据自己需要用双斜线注释掉部分代码开启你想要的功能(比如送礼)
// == 更新日志 ==
// 2016.10.8  -  1.1
// 屏蔽聊天框内各种公告
// 精简掉了聊天框下方三个按钮
// 更详细的注释
// 删除了一些无效忘记删除的代码
// 调整了顶部的css
// 2016.10.3  -  1.0
// 整合了 https://greasyfork.org/zh-CN/scripts/21416-bilibili直播净化 中的聊天室内容过滤
// ==============
// 2016.10.2  -  alpha 0.1
// 基本精简完成,直播基础功能经测试正常
// ==============

(function() {
    //变量定义
    var cssText = "";
    
    //去广告Banner
    $('div').remove('.live-ad-full');
    //去顶部下载
    $('div').remove('.download-link.p-relative.float-left');
    //去除排行榜
    $('div').remove('.rank-list-ctnr');
    //去除礼物连击
    $('div').remove('.super-gift-ctnr');
    //去除左边栏
    $('#room-left-sidebar').remove();
      
    //背景调整
    $('.bk-img').css({'transform':'translate(0,0)','-webkit-transform':'translate(0,0)'});
    //主体位置调整
    $('.room-main-ctnr').css({'transform':'translate(0,0)','-webkit-transform':'translate(0,0)'});
    //去除聊天框低于1000礼物提示
    $('div').remove('.gift-msg-1000.p-absolute');
    //去除礼物面板
    $('div').remove('.gift-panel.main-section');
    //聊天面板css调整
    $('#chat-ctrl-panel.chat-ctrl-panel').css('padding','20px 10px 23px 10px');
    //弹幕字数限制提示css调整
    $('.danmu-length-count').css('top','22px');
    //聊天发送框css调整
    $('.danmu-textbox.float-left').css('height','65px');
    $('.danmu-send-btn.float-right.live-btn.default').css('height','85px');
    //移除银瓜子宝箱
    $('div').remove('.treasure-box-ctnr.treasure');
    //移除我要直播
    $('div').remove('.live-action-btn-ctnr');
    //移除整个footer
    $('div').remove('.live-footer.p-relative');
    //移除播主信息中的礼物信息
    $('div').remove('.row-item');
    $('div').remove('.activity-top-panel.dp-inline-block');
    //聊天发送框下排3个按钮
    $('div').remove('.profile-ctrl');
    //去聊天框内用户等级信息、VIP标志、等级信息等等
    
    //红叶祭活动标志
    cssText += '#chat-msg-list a[href="/hd/aki2016"] {display: none !important;}';
    //用户vip标志
    cssText += '#chat-msg-list a[href="/i#to-vip"] {display: none !important;}';
    //奖牌标志
    cssText += '#chat-msg-list .medal-icon {display: none !important;}';
    //用户等级标志
    cssText += '#chat-msg-list .user-level-icon {display: none !important;}';
    //称号标志
    cssText += '#chat-msg-list a[href="/i/myTitle#list"] {display: none !important;}';
    //礼物信息
    cssText += '#chat-msg-list .gift-msg {display: none !important;} #chat-list-ctnr > .super-gift-ctnr, #gift-msg-1000 {display: none !important;} #chat-list-ctnr > #chat-msg-list {height: 100% !important;}';
    //聊天框内的各种公告(系统公告、小电视抽奖)
    cssText += '.announcement-container {display:none !important;}';
    //聊天框内的系统公告(xxx进入了直播间)
    cssText += '.system-msg {display:none !important;}';
    
    //顶部css调整(如果错位请注释掉下面这个部分)
    cssText += '.search-bar-ctnr {padding-right:80px; !important}';
    cssText += '.user-avatar {padding-right:40px; !important}';
    $('#top-nav-msg-hinter').css('right','60px');
    
    var modStyle = document.querySelector('#modCSS');
    if (modStyle === null)
    {
        modStyle = document.createElement('style');
        modStyle.id = 'modCSS';
        document.body.appendChild(modStyle);
    }   
    modStyle.innerHTML = cssText;
})();