// ==UserScript== // @name Acfun直播宽屏和屏蔽 // @namespace http://tampermonkey.net/ // @require http://code.jquery.com/jquery-1.11.0.min.js // @version 0.1 // @description 增加宽屏按钮和礼物信息屏蔽按钮 // @author 星雨漂流 // @match http://live.acfun.cn/live/* // @grant GM_addStyle // @downloadURL none // ==/UserScript== GM_addStyle('.main{transiton: all 0.5s}.main_wide{width: 99.5%!important; margin-left: 0.5%;} .control-btn svg{width: 20px; height: auto;} .main_wide .live-info{display:none;} .wide_app #header{display: none!important} .notice_icon{position: absolute; width: 18px; heigth: auto; left: 35px; top: 0px; cursor: pointer;} .notice_icon svg{ width: 100%; height: auto}' + '.hide_popup{position: absolute; z-index: 100;display: none;} .ban_gift .gift{display:none;} .ban_user-enter .user-enter{display:none;} .ban_like .like{display:none;} .hide_popup{background-color:#fff; width: 94px; height: 140px; padding: 8px;border-radius: 4px;box-sizing:border-box;margin-top: -150px;margin-left:-15px;} .hide_popup li{height: 35px;display: flex; align-items: center;}' + '.hide_popup::before{content:""; display: block; position: absolute;top: 140px; left: 15px; width:0;height:0; border-top: 10px solid #fff; border-left: 5px solid transparent;border-right: 5px solid transparent;}' ) let isWideScreen = false function addElement() { let icon = '' let noticeIcon = '' $('.box-right').find('.danmaku-setting').after('
' + icon + '
'); $('.face-text').append(`${noticeIcon}`) $('.main').append('
') setTimeout(()=> { $('#toggleWide').click(() =>{ if (!isWideScreen) { $('.main').addClass('main_wide') $('#app').addClass('wide_app') $(window).scrollTop(0) isWideScreen = true } else { $('.main').removeClass('main_wide') $('#app').removeClass('wide_app') isWideScreen = false } }) $('#noticeBtn').click((e)=> { $('.hide_popup').css({left: e.pageX+'px', top: e.pageY + 'px'}).show() $('.hide_popup').bind('mouseenter', function(e){ $(this).bind('mouseleave', function(){ $(this).unbind('mouseleave').hide() }) }) }) $('.hide_popup').find('input').click(function(e){ let _type = $(this).attr('data-type') let isChecked = $(this).prop('checked') console.log(isChecked) if (isChecked) { $('.live-feed-messages').addClass('ban_' + _type) } else { $('.live-feed-messages').removeClass('ban_' + _type) } }) },0) } setTimeout(()=> { addElement() }, 3000)