SaizX theme — Lite blue

This is a theme for agenda.sime.md with an anime background image and light blue colors.

当前为 2022-10-27 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name SaizX theme — Lite blue
  3. // @namespace https://bitbucket.org/
  4. // @version 0.1
  5. // @description This is a theme for agenda.sime.md with an anime background image and light blue colors.
  6. // @author ezX && Sairos
  7. // @match https://agenda.sime.md/ords/f?p=*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=sime.md
  9. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. function average(elmt) {
  17. var sum = 0;
  18. for( var i = 0; i < elmt.length; i++ ){
  19. sum += parseInt( elmt[i], 10 );
  20. }
  21.  
  22. var avg = sum/elmt.length;
  23. return avg;
  24. }
  25.  
  26. function addGlobalStyle(css) {
  27. var head, style;
  28. head = document.getElementsByTagName('head')[0];
  29. if (!head) { return; }
  30. style = document.createElement('style');
  31. style.type = 'text/css';
  32. style.innerHTML = css;
  33. head.appendChild(style);
  34. }
  35.  
  36. document.body.style.cssText +=
  37. `background-image: url('https://catherineasquithgallery.com/uploads/posts/2021-12/1639711912_214-catherineasquithgallery-com-p-fon-anime-dlya-intro-rozovii-290.jpg');
  38. backdrop-filter: blur(5px);
  39. background-size: 100% 100%`;
  40. addGlobalStyle('#outer {background: none !important;} .a-Menu-labelContainer, .a-Menu-label {color: black !important} a, button, td, strong, h3, .t-Login-title, .apex-item-display-only { color: white !important;} .a-TreeView-label { font-size: 13px !important;} .a-TreeView-content {margin-top: 10px !important;} .t-Region-headerItems, .t-Report-colHead {color: #00c4ff !important; text-shadow: -0 -1px 0 #000000,0 -1px 0 #000000,-0 1px 0 #000000,0 1px 0 #000000,-1px -0 0 #000000,1px -0 0 #000000,-1px 0 0 #000000,1px 0 0 #000000,-1px -1px 0 #000000,1px -1px 0 #000000,-1px 1px 0 #000000,1px 1px 0 #000000,-1px -1px 0 #000000,1px -1px 0 #000000,-1px 1px 0 #000000,1px 1px 0 #000000;}');
  41.  
  42. let avg_i = document.createElement('th');
  43. avg_i.className = 't-Report-colHead';
  44. avg_i.align = 'left';
  45. avg_i.innerHTML = 'Average';
  46.  
  47. let avg = document.querySelectorAll('tr')[48];
  48. $(avg).append(avg_i);
  49.  
  50. let lessons = document.querySelectorAll('tbody')[20].childNodes;
  51. console.log(lessons);
  52. for (let lesson of lessons) {
  53. if (lesson.nodeName == 'TR') {
  54. let note = document.createElement('td');
  55. note.className = 't-Report-cell';
  56. note.style.cssText = 'color: red !important; text-shadow: 1px 1px 1px #000';
  57. note.innerHTML = parseInt(average($(lesson).children()[1].innerHTML.split(', ')) * 100) / 100;
  58.  
  59. $(lesson).append(note);
  60. }
  61. }
  62. })();