网页样式格式化

一些网页的样式格式化

Versione datata 12/12/2023. Vedi la nuova versione l'ultima versione.

  1. // ==UserScript==
  2. // @name 网页样式格式化
  3. // @namespace xywc-s
  4. // @author xywc-s
  5. // @version 1.0.7
  6. // @description 一些网页的样式格式化
  7. // @match https://*.2biqu.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=spankbang.com
  9. // @grant GM_getResourceText
  10. // @grant GM_addStyle
  11. // @grant GM_setValue
  12. // @grant GM_getValue
  13. // @require https://unpkg.com/notyf@3.10.0/notyf.min.js
  14. // @resource NotifyCSS https://unpkg.com/notyf@3.10.0/notyf.min.css
  15. // @license MIT
  16. // ==/UserScript==
  17. /*jshint esversion: 6 */
  18.  
  19. const {host} = location
  20. switch(host){
  21. case 'www.2biqu.com':
  22. biquFormat();
  23. break;
  24. }
  25.  
  26. function biquFormat(){
  27. console.log('biqu')
  28. document.querySelector('.layout').style.border = 'none'
  29. const readerFun = document.querySelector('.reader-fun')
  30. readerFun.style.margin = '0 12px'
  31. readerFun.style.float = 'none'
  32. const searchForm = document.querySelector('.search-form')
  33. searchForm.style.margin = 0
  34. searchForm.style.float = 'none'
  35. searchForm.style.width = 'auto'
  36. const searchInput = document.querySelector('#keyWord')
  37. searchInput.style = {
  38. width: 'auto',
  39. backgroundColor: 'transparent',
  40. borderBottom: '1px solid #aaa',
  41. borderWidth: '0 0 1px 0'
  42. }
  43. searchInput.placeholder = '作者、书名'
  44. const searchBtn = document.querySelector('.btn-tosearch')
  45. searchBtn.style = {
  46. width: 'auto',
  47. backgroundColor: 'transparent'
  48. }
  49. const layoutTit = document.querySelector('.layout-tit')
  50. layoutTit.style.backgroundColor = 'transparent'
  51. layoutTit.style.border = 'none'
  52. layoutTit.append(searchForm)
  53. layoutTit.style.display = 'flex'
  54. layoutTit.style.justifyContent = 'center'
  55. const header = document.querySelector('.header')
  56. header.append(layoutTit)
  57. header.style.width = 'auto'
  58.  
  59. }