North-Plus Notification Plus

发帖时自动勾选新回复通知按钮,增强通知显示效果

  1. // ==UserScript==
  2. // @name North-Plus Notification Plus
  3. // @namespace https://github.com/sssssssl/NP-scripts
  4. // @version 0.1.1
  5. // @description 发帖时自动勾选新回复通知按钮,增强通知显示效果
  6. // @author sl
  7. // @match https://*.summer-plus.net
  8. // @match https://*.summer-plus.net/index.php
  9. // @match https://*.level-plus.net/*
  10. // @match https://*.white-plus.net/*
  11. // @match https://*.south-plus.net/*
  12. // @match https://*.imoutolove.me/*
  13. // @grant none
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. 'use strict';
  18.  
  19. const url = window.location.href;
  20. const THREAD_PAT = /read\.php\?tid/;
  21. const POST_PAT = /post\.php\?fid-*/;
  22. const REPLY_PAT = /post\.php\?action-reply/;
  23.  
  24. const ID_NEW_RP = 'newrp';
  25. const CLS_BLINK = 'blink';
  26. const NEW_RP_STYLE = `
  27. .${CLS_BLINK} {
  28. display: inline-block; font-weight:bold;
  29. color:#FF0000;
  30. animation:blink 1s;
  31. animation-iteration-count:infinite;
  32. -webkit-animation: blink 1s;
  33. -webkit-animation-iteration-count: infinite;
  34. }
  35. @keyframes blink {
  36. 0% { transform: rotate(0deg) scale(1, 1); }
  37. 25% { transform: rotate(15deg) scale(1.2, 1.2); }
  38. 50% { transform: rotate(-15deg) scale(1.2, 1.2); }
  39. 100% { transform: rotate(0deg) scale(1, 1); }
  40. }
  41. @-webkit-keyframes blink {
  42. 0% { transform: rotate(0deg) scale(1, 1); }
  43. 25% { transform: rotate(15deg) scale(1.2, 1.2); }
  44. 50% { transform: rotate(-15deg) scale(1.2, 1.2); }
  45. 100% { transform: rotate(0deg) scale(1, 1); }
  46. }
  47. `;
  48.  
  49. let tagNewRP = document.getElementById(ID_NEW_RP);
  50. if(tagNewRP) {
  51. let styleTag = document.createElement('style');
  52. styleTag.textContent = NEW_RP_STYLE;
  53. document.head.appendChild(styleTag);
  54. tagNewRP.classList.add(CLS_BLINK);
  55. tagNewRP.addEventListener('click', (e) => {
  56. tagNewRP.classList.remove(CLS_BLINK);
  57. });
  58. }
  59.  
  60. if(POST_PAT.test(url) || REPLY_PAT.test(url)) {
  61. const postOptions = document.getElementById('post-option');
  62. if(postOptions) {
  63. const box = document.querySelector('input[name=atc_newrp]');
  64. box.setAttribute('checked', 'checked');
  65. }
  66. }
  67. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址