SaizX theme — Lite blue

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

目前為 2022-10-27 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         SaizX theme — Lite blue
// @namespace    https://bitbucket.org/
// @version      0.1
// @description  This is a theme for agenda.sime.md with an anime background image and light blue colors.
// @author       ezX && Sairos
// @match        https://agenda.sime.md/ords/f?p=*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=sime.md
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function average(elmt) {
        var sum = 0;
        for( var i = 0; i < elmt.length; i++ ){
            sum += parseInt( elmt[i], 10 );
        }

        var avg = sum/elmt.length;
        return avg;
    }

    function addGlobalStyle(css) {
        var head, style;
        head = document.getElementsByTagName('head')[0];
        if (!head) { return; }
        style = document.createElement('style');
        style.type = 'text/css';
        style.innerHTML = css;
        head.appendChild(style);
    }

    document.body.style.cssText +=
        `background-image: url('https://catherineasquithgallery.com/uploads/posts/2021-12/1639711912_214-catherineasquithgallery-com-p-fon-anime-dlya-intro-rozovii-290.jpg');
        backdrop-filter: blur(5px);
        background-size: 100% 100%`;
    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;}');

    let avg_i = document.createElement('th');
    avg_i.className = 't-Report-colHead';
    avg_i.align = 'left';
    avg_i.innerHTML = 'Average';

    let avg = document.querySelectorAll('tr')[48];
    $(avg).append(avg_i);

    let lessons = document.querySelectorAll('tbody')[20].childNodes;
    console.log(lessons);
    for (let lesson of lessons) {
        if (lesson.nodeName == 'TR') {
            let note = document.createElement('td');
            note.className = 't-Report-cell';
            note.style.cssText = 'color: red !important; text-shadow: 1px 1px 1px #000';
            note.innerHTML = parseInt(average($(lesson).children()[1].innerHTML.split(', ')) * 100) / 100;

            $(lesson).append(note);
        }
    }
})();