Greasy Fork is available in English.

Magister卐

Magister andere css!

// ==UserScript==
// @name         Magister卐
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Magister andere css!
// @author       Vic Peeters
// @match        https://merlet.magister.net/*
// @match        https://accounts.magister.net/*
// @match        https://merletcollege.magister.net/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=magister.net
// @grant        GM_addStyle
// @grant        GM_getResourceText
// @license nikker
// ==/UserScript==

(function() {
    'use strict';

    if (localStorage.getItem('disableScript')) {
        return;
    }
    // Function to disable the script and reload the page
    function panicButton() {
        // Disable the script
        localStorage.setItem('disableScript', true);
        // Reload the page
        location.reload();
    }

    // Function to handle keydown events
    function handleKeyDown(event) {
        // Check if the pressed key is "="
        if (event.key === "=") {
            // Trigger the panic button
            panicButton();
        }
    }

    // Add event listener for keydown events
    document.addEventListener('keydown', handleKeyDown);

    // Function to replace images
    function replaceImages() {
        var replacementImageURL = bg7;
        var images = document.getElementsByTagName('img');
        for (var i = 0; i < images.length; i++) {
            images[i].src = replacementImageURL;
        }
    }

    // Inject CSS styles
    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);
        GM_addStyle(GM_getResourceText("style"));
    }

    var erika = document.createElement("div");
    erika.innerHTML = "<audio autoplay='' loop=''> <source src='https://github.com/NietVic/magister69/raw/main/erika.mp3' type='audio/mpeg'></audio>";
    document.body.appendChild(erika);

    // URLs for background images
    var bg1 = 'https://raw.githubusercontent.com/NietVic/magister69/main/bg1.jpg';
    var bg2 = 'https://raw.githubusercontent.com/NietVic/magister69/main/bg2.jpg';
    var bg3 = 'https://raw.githubusercontent.com/NietVic/magister69/main/bg3.webp';
    var bg4 = 'https://raw.githubusercontent.com/NietVic/magister69/main/bg4.jpg';
    var bg5 = 'https://raw.githubusercontent.com/NietVic/magister69/main/bg5.jpg';
    var bg6 = 'https://raw.githubusercontent.com/NietVic/magister69/main/bg6.jpg';
    var bg7 = 'https://raw.githubusercontent.com/NietVic/magister69/main/bg7.jpg';

    // Define colors
    var AKleur = '#382c1e';
    var SKleur = '#1f97f9';
    var TKleur = '#ddd';
    var GRKleur = '#bbb';
    var HKleur = '#1f97f9';
    AKleur = '#000';

    // Add CSS styles
    addGlobalStyle('.bg1{background-image: url('+bg1+')} .bg1_webp{ background-image: url('+bg1+')} body{background-color: '+AKleur+'} .bg2{background-image: url('+bg2+')} .bg2_webp{ background-image: url('+bg2+')} .bg3{background-image: url('+bg3+')} .bg3_webp{ background-image: url('+bg3+')} .bg4{background-image: url('+bg4+')} .bg4_webp{ background-image: url('+bg4+')} .bg5{background-image: url('+bg5+')} .bg5_webp{ background-image: url('+bg5+')} .bg6{background-image: url('+bg6+')} .bg6_webp{ background-image: url('+bg6+')} .bg7{background-image: url('+bg7+')} .bg7_webp{ background-image: url('+bg7+')}')
    addGlobalStyle('body{background-color: '+AKleur+';} .k-scheduler{background-color: '+AKleur+'} .block .content form{background-color: '+AKleur+'} div.loading-overlay{background-color: '+AKleur+'} :root { --chrome-background: '+AKleur+'; --primary-background: '+AKleur+'; --secondary-background: '+AKleur+'; --background-1: '+AKleur+'; --background-2: '+AKleur+'; --background-3: '+AKleur+'; --background-4: '+AKleur+';--background-5: '+AKleur+'; --background-6: '+AKleur+'; --background-7: '+AKleur+'; --background-8: '+AKleur+'; --background-9: transparent; --background-10: '+AKleur+'; --background-11: '+AKleur+'; --primary-text-color: '+AKleur+'; --secondary-text-color: '+AKleur+';} .menu-footer{background: '+AKleur+';} .ngGrid{background-color: '+AKleur+'} .widget li{background-color: '+AKleur+'} .sm-grid.k-grid .k-grid-content tr{background: '+AKleur+'} .k-grid-content{background: '+AKleur+'} .cijfers-k-grid.k-grid .k-grid-content{background: '+AKleur+'} table.table-grid-layout tr{background: '+AKleur+'} .block .content{background-color: '+AKleur+'} table.table-grid-layout td{color: '+TKleur+' !important;} .widget .list li a{color: '+TKleur+'} #vandaag-container .grade-widget ul{background-color: '+AKleur+'} .block{background-color: '+AKleur+'} .endlink{background-color: '+AKleur+'f} .cijfers-k-grid.k-grid .k-grid-header th.k-header{background: '+AKleur+'} .ngTopPanel{background-color: '+AKleur+'}');
    addGlobalStyle('.sm-grid.k-grid .k-grid-content td{color: '+TKleur+'} form label{color: '+TKleur+'} table.table-grid-layout td a{color: '+TKleur+'} .k-header{color: '+TKleur+'} .k-grid-header .k-link:link, .k-grid-header .k-link:visited, .k-grid-header .k-nav-current.k-state-hover .k-link, .k-grouping-header .k-link{color: '+TKleur+'} table.table-grid-layout > tbody > tr.selected{background-color: '+SKleur+';} .k-scheduler-dayview .k-scheduler-times th, .k-scheduler-weekview .k-scheduler-times th, .k-scheduler-workWeekview .k-scheduler-times th{color: '+TKleur+'} .sm-grid.k-grid .k-grid-content tr.k-state-selected, .sm-grid.k-grid .k-grid-content tr.k-state-selected.k-state-focused, .sm-grid.k-grid .k-grid-content tr.k-state-selected .k-state-focused{background-color:'+SKleur+'} .alert a:hover{background-color:'+SKleur+' !important} .alert{background-color: #213740 !important;}');
    addGlobalStyle('.k-grouping-row td, td.k-group-cell, .k-resize-handle-inner{background-color:'+GRKleur+'} table.table-grid-layout tr:hover{background-color: '+HKleur+'}')
    addGlobalStyle('body{ background-image: url("https://github.com/NietVic/magisterU-5350/blob/main/hakenkruis.png?raw=true");}')

    // Add panic button event listener
    document.addEventListener('keydown', function(event) {
        if (event.key === "=") {
            panicButton();
        }
    });


    setInterval(replaceImages, 1000);

})();