同传弹幕

B站同传弹幕高亮显示

// ==UserScript==
// @name         同传弹幕
// @namespace    http://tampermonkey.net/
// @version 1.0.
// @license MIT
// @description  B站同传弹幕高亮显示
// @author       wo
// @compatible   Chrome(80.0)
// @compatible   Firefox(74.0)
// @compatible   Edge(80.0)
// @include      /https?:\/\/live\.bilibili\.com\/(blanc\/)?\d+\??.*/
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
// ==/UserScript==

setInterval(danmu, 50)
function danmu(){
    $(".bilibili-danmaku").each(function(){
        let top = 83
        let str = $(this).text()
        if(str.indexOf('【')!= -1 || str.indexOf('〖')!= -1 ){
          $(this).css({
              "color":'white',
              "text-shadow":'0px 0px 5px #E58750,0px 0px 5px #E58750,0px 0px 5px #E58750',
              "font-family":'楷体',
              "font-weight":'bold',
             // "font-size": '50px',
              "z-index": '9999',
             // "margin-top": '-10px',
             // "top": (top) + '%'
          })
          $(this).text(str.substring(1, str.length - 1))
        //  $(this).attr({'class':'mode-bottomMiddleFLoat bilibili-danmaku'})
        }
        // mode-bottomMiddleFLoat
    })
}