Udemy Notifications Enhanced

Enhances the Udemy notification area to show more and make the buttons more accessible at the top.

目前为 2024-02-08 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Udemy Notifications Enhanced
  3. // @namespace https://github.com/lundeen-bryan
  4. // @author lundeen-bryan
  5. // @version 1.0.0
  6. // @description Enhances the Udemy notification area to show more and make the buttons more accessible at the top.
  7. // @match https://www.udemy.com/user/view-notifications/
  8. // @grant None
  9. // @icon tbd
  10. // @homepage tbd
  11. // @license MIT
  12. // @run-at document-end
  13. // @noframes n/a
  14. // @unwrap n/a
  15. // ==/UserScript==
  16.  
  17. (function() {
  18. 'use strict';
  19.  
  20. var css = `
  21. /* Your CSS goes here */
  22. /* Make main container flexible and stack children vertically */
  23. [data-testid="notification-tab-pane-student"] {
  24. display: flex;
  25. flex-direction: column;
  26. }
  27. /* Move notification list to end
  28. * Make text wide enough to fill
  29. * the width of the screen. */
  30. .activity-notifications-module--notification-list--3I_hF {
  31. order: 3;
  32. width: 220%;
  33. margin: 0 auto;
  34. max-width: 1500px;
  35. }
  36. /* Move 'load more' and 'mark all as read' to start */
  37. .activity-notifications-module--load-more-row--3_jVO, .activity-notifications-module--footer--3bQw7 {
  38. order: 1;
  39. }
  40. /* Align 'load more' contents to left */
  41. .activity-notifications-module--load-more-row--3_jVO {
  42. justify-content: left;
  43. }
  44. .activity-notification-module--notification-info--3Yr2y {
  45. height: 170px;
  46. }
  47. /* create CRLF after title then, normal font for the body text */
  48. span[data-purpose="safely-set-inner-html:activity-notification:notification-template"] span.subject::before {
  49. content: "\\A";
  50. white-space: pre;
  51. }
  52. .subject {
  53. font-weight: normal;
  54. }
  55. /* Text area for message body */
  56. .item-card-module--item-card-title--S729p{
  57. height: 250px;
  58. }
  59. /* move the msg body down a little to reveal the time posted */
  60. .item-card-module--item-card-title--S729p{
  61. padding-top: 5px;
  62. }
  63. /* increase msg vertical scroll area */
  64. .activity-notifications-module--notification-list--3I_hF{
  65. max-height:300rem
  66. }
  67. /* size of the card area where messages are shown */
  68. .activity-notification-module--card-container--3C8QZ {
  69. height: 300px
  70. }
  71. `;
  72.  
  73. var style = document.createElement('style');
  74. style.type = 'text/css';
  75. style.innerHTML = css;
  76. document.head.appendChild(style);
  77. })();