SaizX theme — Lite blue

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

  1. // ==UserScript==
  2. // @name SaizX theme — Lite blue
  3. // @namespace https://bitbucket.org/
  4. // @version 0.2
  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.  
  37. $(document).keypress(function(e){
  38. if (e.which == 13){
  39. $("#B46325816630545644").click();
  40. }
  41. });
  42.  
  43. try {
  44. $('button#t_Button_navControl').remove();
  45. $('a.t-Header-logo-link')[0].style.cssText = 'padding: 0px 0px';
  46. $('a.t-Header-logo-link')[0].href='#';
  47. $('div.t-Header-logo')[0].style.cssText = 'padding: 2px 4px';
  48.  
  49. let avatar = $('div#dosarContent').children()[0];
  50. $(avatar).children()[0].src = 'https://avatars.mds.yandex.net/get-images-cbir/7638013/0Dk1XLzWDa3P47p1Q-GigQ2171/ocr';
  51. $(avatar).children()[0].style.cssText += 'filter: brightness(85%);'
  52. } catch {}
  53.  
  54. document.body.style.cssText +=
  55. `background-image: url('https://catherineasquithgallery.com/uploads/posts/2021-12/1639711912_214-catherineasquithgallery-com-p-fon-anime-dlya-intro-rozovii-290.jpg');
  56. backdrop-filter: blur(5px);
  57. background-size: 100% 100%`;
  58. 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;}');
  59.  
  60. try {
  61. let avg_i = document.createElement('th');
  62. avg_i.className = 't-Report-colHead';
  63. avg_i.align = 'left';
  64. avg_i.innerHTML = 'Average';
  65.  
  66. let avg = document.querySelectorAll('tr')[48];
  67. $(avg).append(avg_i);
  68.  
  69. let lessons = document.querySelectorAll('tbody')[20].childNodes;
  70. for (let lesson of lessons) {
  71. if (lesson.nodeName == 'TR') {
  72. let note = document.createElement('td');
  73. note.className = 't-Report-cell';
  74. note.style.cssText = 'color: red !important; text-shadow: 1px 1px 1px #000';
  75. note.innerHTML = parseInt(average($(lesson).children()[1].innerHTML.split(', ')) * 100) / 100;
  76.  
  77. $(lesson).append(note);
  78. }
  79. }
  80. } catch {}
  81. })();