diff --git a/tieba page.js b/tieba page.js index 0a1bec7..b305acc 100644 --- a/tieba page.js +++ b/tieba page.js @@ -1,7 +1,7 @@ // ==UserScript== // @name tieba page // @namespace https://github.com/fthvgb1/tampermonkey-script -// @version 0.985 +// @version 0.986 // @author fthvgb1 // @match https://tieba.baidu.com/* // @match https://tiebac.baidu.com/* @@ -569,6 +569,7 @@ } let book; + let svgss; function clickControl() { let el = ['list_item_top_name', 'j_new_header_reply', 'list_item_user_wrap', 'user_img', 'user_name', 'icon_tieba_edit', 'reply_num', 'for_app_label_text_tag']; @@ -581,6 +582,9 @@ } if (ev.target.tagName === 'svg') { + if ([...svgss].indexOf(ev.target.parentNode)) { + return; + } ev.stopPropagation(); ev.preventDefault(); if (ev.target.innerHTML.indexOf('remind_on') > -1) { @@ -726,16 +730,77 @@ }) } + function fnav() { + let d = document.createElement('div'); + d.style.cssText = `position: fixed;width: 45px;right: 10px;bottom: 50px;`; + d.innerHTML = ` + + + + + + + + + + + + + + `; + let svgs = svgss = d.querySelectorAll('svg'); + let f = 1; + + function dd() { + [svgs[0], svgs[1], svgs[2]].forEach(el => { + el.style.display = f === 1 ? 'block' : 'none' + }); + f = f === 1 ? 2 : 1; + } + + svgs.forEach((value, key) => { + + if (key !== 3) { + value.style.display = 'none'; + } + value.style.fill = 'rgba(77, 74, 210,.3)'; + value.addEventListener('click', ev => { + switch (key) { + case 0: + location.href = '/mo/q/searchpage'; + break; + case 1: + window.scrollTo({top: 0, left: 0, behavior: "smooth"}); + dd(); + break; + case 2: + window.scrollTo({top: document.documentElement.scrollHeight, left: 0, behavior: "smooth"}); + dd(); + break; + case 3: + dd(); + break; + + } + }); + }); + document.querySelector('body').appendChild(d); + } + try { if (!check()) { return; } + fnav(); clickControl(); let css = document.createElement('style'); css.textContent = ` .class_hide_flag{display:block!important;}.father-cut-pager-class-no-page>#list_pager{visibility: visible!important;height: 44px!important;}#glob,body{margin-top: 0px!important;}.father_cut_list_class{padding-bottom: 0px!important;}.father-cut-recommend-normal-box,.father-cut-daoliu-normal-box,.fixed_bar,.pb,.frs,.no_mean,.addbodybottom,.img_desc,.top-guide-wrap,.open-style,.index-feed-cards .hot-topic,.appPromote_wrapper,.ui_image_header_bottom,.videoFooter,#diversBanner,.tb-footer-wrap,.interest-bar,.footer-wrap,.client-btn,.daoliu{display:none!important;}.tl_shadow:not([data-tid]),#pblist>li:not([data-tid]){display:none!important;}.navbar-view{top:24px!important;}.navbar-box{top:44px!important;} - .footer_logo,.footer-version { display:none!important} + .footer_logo,.footer-version { display:none!important} + .fr_list .list_item_floor { padding-top:6px;} + .floor_footer_item .user_name { color:#125bc7; } + .floor_content a { color:#498bef; } `; document.querySelector('head').append(css);