网页样式格式化

一些网页的样式格式化

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