Daymap Graphics

Some better graphics for QASMT Daymap. Allows for much more customisation.

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

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Daymap Graphics
// @namespace    mailto:[email protected]
// @version      6.1.1
// @description  Some better graphics for QASMT Daymap. Allows for much more customisation.
// @author       apate98
// @match        https://*.daymap.net/*
// @icon         https://www.google.com/s2/favicons?domain=daymap.net
// @grant        none
// @license      GNU GPLv3
// ==/UserScript==

// Changelog
// 6.0.0: Added changelog and introduced compatibility for Daymap's timetable view.
// 6.0.1: Fixed a problem where opacity is reversed in timetable view.
// 6.0.2: Changed the manual background change to apply to underlay rather than body. Increased speed of underlay rainbow.
// 6.0.3: Allowed manual changing of the attendance indicator colour to anything, replacing the old background-color with background.
// 6.1.0: Allows blurring behind the foreground cards, giving a glassy effect.
// 6.1.1: Made header also change opacity and made logo transparent.

// Compatibile pages:
// Feed View
// Timetable
// Mobile Daymap
// My Details

// Tips:
// Change the Daymap.Web_DaymapIdentityCookie cookie expiry date to 2038-01-18T18:14:07.000Z every time you log into Daymap. Daymap Graphics cannot do this automatically as the cookie is HTTP only.



// Local storage functions by DY
var storage;
(function() {
    storage = this.localStorage;
})();

function getItem(key) {
    if(storage != undefined) {
        return storage.getItem(key);
    }
    storage = this.localStorage;
    return null;
}

function setItem(key, value) {
    if(storage != undefined) {
        storage.setItem(key, value);
    } else {
        storage = this.localStorage;
    }
}

function rainbowMove(val1, val2, val3, val4, val5, speed) {
    speed = speed ? speed : 1;
    val1 += (Math.random() - val4) * speed;
    val2 += (Math.random() - val5) * speed;
    val1 = val1 < 0 ? 0 : val1 > 410 ? 410 : val1;
    val2 = val2 < 0 ? 0 : val2 > 410 ? 410 : val2;
    return [val1, val2, val3, val4, val5];
}

function constrain(num, min, max) {
    return num < min ? min : num > max ? max : num;
}

function timeOfDiaryEl(lessonEl) {
    let lessonStart;
    let lessonEnd;
    if(lessonEl.text().substr(1, 1) === ":" && lessonEl.text().substr(12, 1) !== ":") {
        lessonStart = lessonEl.text().substr(0, 1) + lessonEl.text().substr(2, 2);
        lessonEnd = lessonEl.text().substr(11, 2) + lessonEl.text().substr(14, 2);
        if(lessonEl.text().substr(5, 1) === "P") {
            lessonStart = Number(lessonStart) + 1200;
        }
    }
    if(lessonEl.text().substr(1, 1) === ":" && lessonEl.text().substr(12, 1) === ":") {
        lessonStart = lessonEl.text().substr(0, 1) + lessonEl.text().substr(2, 2);
        lessonEnd = lessonEl.text().substr(11, 1) + lessonEl.text().substr(13, 2);
        if(lessonEl.text().substr(5, 1) === "P") {
            lessonStart = Number(lessonStart) + 1200;
        }
        if(lessonEl.text().substr(16, 1) === "P") {
            lessonEnd = Number(lessonEnd) + 1200;
        }
    }
    if(lessonEl.text().substr(1, 1) !== ":" && lessonEl.text().substr(13, 1) !== ":") {
        lessonStart = lessonEl.text().substr(0, 2) + lessonEl.text().substr(3, 2);
        lessonEnd = lessonEl.text().substr(12, 2) + lessonEl.text().substr(15, 2);
    }
    if(lessonEl.text().substr(1, 1) !== ":" && lessonEl.text().substr(13, 1) === ":") {
        lessonStart = lessonEl.text().substr(0, 2) + lessonEl.text().substr(3, 2);
        lessonEnd = lessonEl.text().substr(12, 1) + lessonEl.text().substr(14, 2);
        if(lessonEl.text().substr(17, 1) === "P") {
            lessonEnd = Number(lessonEnd) + 1200;
        }
    }
    return [lessonStart, lessonEnd];
}

// By joshuacockrell based on a post by Maxwell Collard and edited by Mahdi
function randn_bm() {
    let u = 0, v = 0;
    while(u === 0) u = Math.random(); //Converting [0,1) to (0,1)
    while(v === 0) v = Math.random();
    let num = Math.sqrt( -2.0 * Math.log( u ) ) * Math.cos( 2.0 * Math.PI * v );
    num = num / 10.0 + 0.5; // Translate to 0 -> 1
    if (num > 1 || num < 0) return randn_bm() // resample between 0 and 1
    return num
}

var attendanceColour = "#7FFFD4";
var bodyColour = "#ABCDEF";
var cardColour = "#E6E6E6";
var date;
var classEls = [];
var i;
var anything = [];
var animatedPhotoLinks = [5097557231353856, 6056784221388800, 5537046336684032]; //4617381095718912 (khanemon), 5169842873122816 (were in a comic, not working yet)
var r50d = [];



(function() {
    'use strict';
    var bodyEl = $("#mainBody");
    //Reload icon from Khan Academy coding
    var reloadSVG = $('<svg width="0.75vw" height="0.75vw" viewBox="0 0 24 24" class="_18zn2ntb"><path fill="currentColor" d="M18.071 18.644c-3.532 3.232-9.025 3.13-12.452-.297a9.014 9.014 0 0 1-2.636-6.866 1 1 0 0 1 1.997.105 7.014 7.014 0 0 0 2.053 5.346c2.642 2.642 6.856 2.747 9.606.31h-1.81a1 1 0 1 1 0-2h4.242a1 1 0 0 1 1 1v4.243a1 1 0 0 1-2 0v-1.84zM7.361 6.757h1.81a1 1 0 0 1 0 2H4.93a1 1 0 0 1-1-1V3.515a1 1 0 1 1 2 0v1.84c3.532-3.231 9.025-3.13 12.452.298a9.014 9.014 0 0 1 2.636 6.866 1 1 0 1 1-1.997-.105 7.014 7.014 0 0 0-2.053-5.346c-2.642-2.642-6.856-2.747-9.606-.31z"></path></svg>');
    $(".main").append("<div id='toolbox' style='display:none;'><div id='closeToolbox'>×</div><div><form oninput='blurAmount.value=parseFloat(blur.value)'>Opacity: <input id='translucent' type='range' min='0' max='1' step='0.001'></input><output><br/>Blur amount: <input id='blur' type='range' min='0' max='50' step='0.1' name='blur'></input><input id='blurAmount' name='blurAmount' readonly='true' style='background-color:light-gray;'></input><br/>Auto animated photo:<input id='autoAnimatedPhoto' type='checkbox'></input><br/>Auto attendance rainbow:<input id='autoAttendanceRainbow' type='checkbox'></input><br/>Animated profile project id:&nbsp;<input id='animatedProfileProjectId' type='number'></input><br/>Auto body background:<input id='autoBackground' type='checkbox'/><br/>Body background CSS property (value only):<input type='text' id='bodyBackground'/><br/>Additional CSS (CSS style declaration):<textarea id='additionalCSS' rows='3'></textarea></form></div><button id='reloadBtn'>&nbsp;Apply changes and reload page</button><style>#toolbox {top: 15vh; left: 20vw; background-color: rgba(229, 229, 229, 0.8); position: fixed; width: 60vw; height: 70vh; padding: 50px; border-width: 50px; border-image: linear-gradient(red, yellow);} #closeToolbox {float: right; color: rgb(200, 200, 200); font-size: 2.5vw; cursor: pointer; background-color: rgba(255, 255, 255, 0.6); border-radius: 50%; width: 2.5vw; height: 2.5vw; text-align: center; vertical-align: baseline; line-height: 2.3vw;} #reloadBtn {position: absolute; bottom: 2vw; background-image: radial-gradient(100% 100% at 100% 0, #5adaff 0, #5468ff 100%); border: 0; border-radius: 4.25%; width: 15vw; height: 4vh; color: white; cursor: pointer;}#bodyBackground, #additionalCSS{display:inline-block;width:100%;}</style>");
    $("#mainBody").append("<style id='customStyles'></style>");
    var tools = setInterval(function() {if($(".lpMenuTd3[menuid='60']")[0]) {$(".lpMenuTd3[menuid='60']").parent()[0].innerHTML = "<tr><div class='tools' style='border-left: 2px solid #a0d7f1; text-align: left; padding: 7px 11px;' onclick='document.getElementById(`toolbox`).style.display = `block`;'>Daymap Graphics Command Center</div></div></tr><style>.tools:hover{background-color:#e5e5e5}</style>"; clearInterval(tools);}}, 50);
    bodyEl.append("<div id='bodyUnderlay'></div><style>#bodyUnderlay {position: fixed; width: 100%; height: 100%; top: 0; z-index: -2147483647}</style>");
    $("#toolbox > button").prepend(reloadSVG);
    document.querySelector("#blurAmount").value = getItem("blurAmount");
    document.querySelector("#animatedProfileProjectId").value = getItem("animatedProfileProjectId");
    document.querySelector("#bodyBackground").value = getItem("bodyBackground");
    $("#translucent").attr("value", getItem("translucentMode"));
    $("#blur").attr("value", getItem("blurAmount"));
    if(getItem("autoAnimatedPhoto") != 0 && getItem("autoAnimatedPhoto")) {
        $("#autoAnimatedPhoto").attr("checked", 1);
    }
    if(getItem("autoAttendanceRainbow") != 0 && getItem("autoAttendanceRainbow")) {
        $("#autoAttendanceRainbow").attr("checked", 1);
    }
    if(getItem("autoBackground") != 0 && getItem("autoBackground")) {
        $("#autoBackground").attr("checked", 1);
        if(getItem("bodyBackground") != "" && getItem("bodyBackground") != undefined) {
            $("#bodyUnderlay").css("background", getItem("bodyBackground"));
            if(getItem("bodyBackground") === "linear-gradient(to bottom right, yellow, black, black, black)") {
                $("#bodyUnderlay").append("<style></style>");
                for(var i = 0; i < 500; i ++) {
                    anything[0] = Math.random() * 7.5;
                    anything[1] = randn_bm() * 255;
                    anything[2] = Math.random() * 100;
                    anything[3] = Math.random() * 100;
                    anything[4] = Math.random() + 1;
                    anything[5] = (Math.random() - 0.5) * 90;
                    if(anything[2] < 37.5 && anything[3] < 37.5) {
                        continue;
                    }
                    $("#bodyUnderlay").append("<div class='r50d' style='width:" + anything[0] + "px;height:" + anything[0] + "px;top:" + anything[2] + "vh;left:" + anything[3] + "vw;position:absolute;border-radius:" + constrain(randn_bm() * 50, 0, 50) + "%;background-color:rgba(" + constrain(anything[1] * anything[4], 0, 255) + ", " + constrain((anything[1] > 127.5 ? (127.5 - anything[1]) : anything[1]) * anything[4], 0, 255) + ", " + constrain((255 - anything[1]) * anything[4], 0, 255) + ", " + Math.random() / 1.5 +");transform:rotate("+ anything[5] + "deg);'></div>");
                    r50d.push("1," + Math.random() / 100 + "," + anything[5] + "," + (randn_bm() - 0.5) * 15);
                    if(getItem("translucentMode") == 0) {
                        $(".msg > table > tbody > tr > td[colspan='2']").css("color", "rgba(200, 200, 200, 0.5)");
                    }
                }
            }
            if(getItem("bodyBackground") === "url('https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLB_p0PncTtkrhaNDZtntrE3gKkoYw')") {
                setItem("bodyBackground", "black url('https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLB_p0PncTtkrhaNDZtntrE3gKkoYw')");
                window.location.href = "https://www.youtube.com/watch?v=dQw4w9WgXcQ";
            }
        }
    }
    $("#customStyles").text(getItem("additionalCSS"));
    document.querySelector("#additionalCSS").value = getItem("additionalCSS");
    i = 0;
    setInterval(function() {i = 0; $(".r50d").each(function() {$(this).css("transform", "scale(" + r50d[i].split(",")[0] + ", " + r50d[i].split(",")[0] + ") rotate(" + r50d[i].split(",")[2] + "deg)"); r50d[i] = (parseFloat(r50d[i].split(",")[0]) + parseFloat(r50d[i].split(",")[1])) + "," + (parseFloat(r50d[i].split(",")[0]) >= 1.1 ? Math.abs(parseFloat(r50d[i].split(",")[1])) * -1 : parseFloat(r50d[i].split(",")[0]) <= 0.9 ? Math.abs(r50d[i].split(",")[1]) : parseFloat(r50d[i].split(",")[1])) + "," + (parseFloat(r50d[i].split(",")[2]) + parseFloat(r50d[i].split(",")[3])) + "," + parseFloat(r50d[i].split(",")[3]); i = i >= r50d.length - 1 ? 0 : i + 1;});}, 30);
    $("#closeToolbox").click(function() {
        $("#toolbox").css("display", "none");
    });
    $("#reloadBtn").click(function() {
        setItem("animatedProfileProjectId", document.querySelector("#animatedProfileProjectId").value);
        setItem("bodyBackground", document.querySelector("#bodyBackground").value);
        setItem("translucentMode", document.querySelector("#translucent").value);
        setItem("additionalCSS", document.querySelector("#additionalCSS").value);
        setItem("blurAmount", document.querySelector("#blur").value);
    });
    $("#autoAnimatedPhoto").click(function() {setItem("autoAnimatedPhoto", getItem("autoAnimatedPhoto") != 0 && getItem("autoAnimatedPhoto") ? 0 : 1);});
    $("#autoAttendanceRainbow").click(function() {setItem("autoAttendanceRainbow", getItem("autoAttendanceRainbow") != 0 ? 0 : 1);});
    $("#autoBackground").click(function() {setItem("autoBackground", getItem("autoBackground") != 0 && getItem("autoBackground") ? 0 : 1);});
    setInterval(function() {if($("#toolbox")[0].style.display === "block") {}}, 1000);
    if (!document.querySelector(".sdIndicator")) {
        $(".StudentBox > table > tbody").append('<tr><td colspan="3"><div id="divIndicators"><div><div class="sdIndicator" title="Term" style="background-color:#65EC0B">100</div><div class="sdCap">Attendance Tracking</div></div></div></td></tr>');
        $(".sdIndicator").append("<style>.sdIndicator{color: #302F46;font-size: 16pt;width: 50px;height: 50px;border-radius: 25px;text-align: center;vertical-align: baseline;margin-left: auto;margin-right: auto;line-height: 50px;}</style>");
    }
    $(".itm .Error").text("Uh did you submit on Turnitin or something?");
    var attendanceEl = $(".sdIndicator");
    attendanceEl.addClass("attendance");
    var cardEl = $(".diaryDay");
    var attendanceRainbow = [0, 0, 0, 0.5, 0.5];
    var attendanceRainbow1 = [400, 5, 0, 0.5, 0.5];
    var attendanceRainbow2 = [210, 350, 0, 0.5, 0.5];
    var bodyRainbow = [200, 200, 0, 0.5, 0.5];
    var cardRainbow = [200, 200, 0, 0.5, 0.5];
    //Rainbow gradient by Weather at https://www.khanacademy.org/computer-programming/the-randomish-quiz/6515084802260992
    setInterval(function(){attendanceRainbow = rainbowMove(attendanceRainbow[0], attendanceRainbow[1], attendanceRainbow[2], attendanceRainbow[3], attendanceRainbow[4] , 15); attendanceRainbow1 = rainbowMove(attendanceRainbow1[0], attendanceRainbow1[1], attendanceRainbow1[2], attendanceRainbow1[3], attendanceRainbow1[4] , 15); attendanceRainbow2 = rainbowMove(attendanceRainbow2[0], attendanceRainbow2[1], attendanceRainbow2[2], attendanceRainbow2[3], attendanceRainbow2[4] , 15);}, 10);
    setInterval(function(){if(attendanceRainbow[2]) {$(".attendance").css("background-image", "linear-gradient(" + attendanceRainbow[0] + "deg, rgb(" + bodyRainbow[0] + "," + (400 - attendanceRainbow1[0] + attendanceRainbow1[1]) / 2.5 + "," + (400 - attendanceRainbow1[1]) + ") -75%, rgb(" + attendanceRainbow[0] + "," + (400 - attendanceRainbow[0] + attendanceRainbow[1]) / 2.5 + "," + (400 - attendanceRainbow[1]) + ") 50%, rgb(" + attendanceRainbow2[0] + "," + (400 - attendanceRainbow2[0] + attendanceRainbow2[1]) / 2.5 + "," + (400 - attendanceRainbow2[1]) + ") 175%)");}}, 10);
    setInterval(function(){attendanceRainbow[3] = Math.random() / 2 + 0.25; attendanceRainbow[4] = Math.random() / 2 + 0.25; attendanceRainbow1[3] = Math.random() / 2 + 0.25; attendanceRainbow1[4] = Math.random() / 2 + 0.25; attendanceRainbow2[3] = Math.random() / 2 + 0.25; attendanceRainbow2[4] = Math.random() / 2 + 0.25;}, 5000);
    setInterval(function(){bodyRainbow = rainbowMove(bodyRainbow[0], bodyRainbow[1], bodyRainbow[2], bodyRainbow[3], bodyRainbow[4] , 10);}, 10);
    setInterval(function(){if(bodyRainbow[2]) {$("#bodyUnderlay").css("background-color", "rgb(" + bodyRainbow[0] + "," + (400 - bodyRainbow[0] + bodyRainbow[1]) / 2.5 + "," + (400 - bodyRainbow[1]) + ")");}}, 10);
    setInterval(function(){bodyRainbow[3] = Math.random() / 2 + 0.25; bodyRainbow[4] = Math.random() / 2 + 0.25;}, 5000);
    setInterval(function(){cardRainbow = rainbowMove(cardRainbow[0], cardRainbow[1], cardRainbow[2], cardRainbow[3], cardRainbow[4] , 10);}, 10);
    setInterval(function(){if(cardRainbow[2]) {cardEl.css("background-color", "rgb(" + cardRainbow[0] + "," + (400 - cardRainbow[0] + cardRainbow[1]) / 2.5 + "," + (400 - cardRainbow[1]) + ")");}}, 10);
    setInterval(function(){cardRainbow[3] = Math.random() / 2 + 0.25; cardRainbow[4] = Math.random() / 2 + 0.25;}, 5000);
    attendanceRainbow[2] = getItem("autoAttendanceRainbow") != 0 && getItem("autoAttendanceRainbow") ? 1 : 0;
    attendanceEl.click(function() {
        attendanceColour = prompt("Please enter a colour", "#7FFFD4");
        if (attendanceColour && attendanceColour != "RAINBOW") {
            attendanceRainbow[2] = 0;
            attendanceEl.css("background-image", "");
            attendanceEl.css("background", attendanceColour);
        } else if (attendanceColour === "RAINBOW") {
            attendanceRainbow[2] = 1;
        }
    });
    cardEl.click(function() {
        cardColour = prompt("Please enter a colour", "#7FFFD4");
        if (cardColour && cardColour != "RAINBOW") {
            cardRainbow[2] = 0;
            cardEl.css("background-color", cardColour);
        } else if (cardColour === "RAINBOW") {
            cardRainbow[2] = 1;
        }
    });
    $(".diaryWeek").click(function() {
        alert("rgb(" + attendanceRainbow[0] + "," + (400 - attendanceRainbow[0] + attendanceRainbow[1]) / 2.5 + "," + (400 - attendanceRainbow[1]) + ")");
    });
    switch(Date().substr(4, 3)) {
        case "Jan":
            date = Date().substr(11, 4) + "-01-" + Date().substr(8, 2);
        break;
        case "Feb":
            date = Date().substr(11, 4) + "-02-" + Date().substr(8, 2);
        break;
        case "Mar":
            date = Date().substr(11, 4) + "-03-" + Date().substr(8, 2);
        break;
        case "Apr":
            date = Date().substr(11, 4) + "-04-" + Date().substr(8, 2);
        break;
        case "May":
            date = Date().substr(11, 4) + "-05-" + Date().substr(8, 2);
        break;
        case "Jun":
            date = Date().substr(11, 4) + "-06-" + Date().substr(8, 2);
        break;
        case "Jul":
            date = Date().substr(11, 4) + "-07-" + Date().substr(8, 2);
        break;
        case "Aug":
            date = Date().substr(11, 4) + "-08-" + Date().substr(8, 2);
        break;
        case "Sep":
            date = Date().substr(11, 4) + "-09-" + Date().substr(8, 2);
        break;
        case "Oct":
            date = Date().substr(11, 4) + "-10-" + Date().substr(8, 2);
        break;
        case "Nov":
            date = Date().substr(11, 4) + "-11-" + Date().substr(8, 2);
        break;
        case "Dec":
            date = Date().substr(11, 4) + "-12-" + Date().substr(8, 2);
        break;
    }
    var time = Number(Date().substr(16, 2) + Date().substr(19, 2));
    var lessonEls = [$(".diaryDay[data-date='"+date+"']").next(), $(".diaryDay[data-date='"+date+"']").next().next(), $(".diaryDay[data-date='"+date+"']").next().next().next(), $(".diaryDay[data-date='"+date+"']").next().next().next().next(), $(".diaryDay[data-date='"+date+"']").next().next().next().next().next(), $(".diaryDay[data-date='"+date+"']").next().next().next().next().next().next()];
    var lessonEl;

    i = 0;
    while (!lessonEl && i < 10) {
        if (lessonEls[i]) {
            if (timeOfDiaryEl(lessonEls[i])[0] < time && timeOfDiaryEl(lessonEls[i])[1] >= time) {
                lessonEl = lessonEls[i];
            }
        }
        i ++;
    }
    var evilEl;
    // Click on the time thing of any English lesson in DayPlan.
    $(".L").each(function() {
        if($(this).children().children().text().substr(0, 3) === "ENG") {
            $(this).addClass("evil");
        }
    });
    if(lessonEl != undefined) {
        lessonEl.css("transform-origin", "50% 50%");
        if(lessonEl.children().children().text().substr(0, 3) != "JEX") {
            lessonEl.css("border-radius", "5px");
        } else {
            lessonEl.css("border-radius", "50%");
        }
        var lessonStyle = $("<style>@keyframes lessonAnimation {from, to {} 50% {}} .lessonEl {animation: lessonAnimation 15s infinite;}</style>");
        lessonEl.append(lessonStyle);
        lessonEl.addClass("lessonEl");
        var lessonOverlay = $(".lessonOverlay");
        lessonOverlay.css("top", "0px");
        lessonOverlay.css("left", "-5px");
        $("#lessonOverlay1").css("width", $(".lessonEl .c a").width() + 10 > 250 ? $(".lessonEl .c a").width() + 10 : "250px");
        $("#lessonOverlay1").css("height", lessonEl.height() + 10);
        lessonOverlay.css("position", "absolute");
        $("#lessonOverlay1").css("border", "10px dotted blue");
        $(".lessonEl .t").click(function() {
            lessonEl.css("border-radius", prompt("Enter the radius", "5px"));
        });
    }
    $(".evil .t").click(function() {
        if(confirm("Are you sure you would like to enable evil mode? You will need to refresh the page to revert this.")) {
            $(".header").css("background-color", "rgb(85, 2, 2)");
            $(".lpMenuTop tbody td").css("background-color", "rgb(85, 2, 2)");
            $(".logo").remove();
            $(".lpMenuTop tbody td").css("border-bottom", "rgb(0, 0, 0)");
            $("#mainBody").css("background-color", "rgb(85, 10, 10)");
            $("#mainBody").append("<div class='bodyOverlay'></div>");
            $(".bodyOverlay").append("<style>.bodyOverlay {background-color:rgba(113,13,13,0.5);width:100vw; height: 100vh; position:fixed;}</style>");
            $("hasDatepicker").css("background-color", "rgb(100, 20, 20)");
            $(".Toolbar").css("background", "rgb(100, 20, 20)");
            $(".post-ticker").css("background-color", "rgb(70, 0, 0)");
            $(".grid div").each(function() {
                $(this).css("background-color", "rgb(100, 20, 40)");
            });
            $(".msgHead .icon").next().each(function() {
                $(this).text("Mua ha ha ha!");
            });
            $(".msgHead .icon").next().next().each(function() {
                $(this).text("Always.");
            });
            $(".msg table tbody tr:nth-child(2) td").each(function() {
                $(this).text("Daymap bows down to my power.");
            });
        }
    });
    $(".MasterContent > table > tbody > tr > td > .Header").click(function() {
        bodyColour = prompt("Please enter a background", "#ABCDEF");
        if (bodyColour && bodyColour != "RAINBOW") {
            bodyRainbow[2] = 0;
            $("#bodyUnderlay").css("background", bodyColour);
        } else if (bodyColour === "RAINBOW") {
            bodyRainbow[2] = 1;
        }
    });
    if(getItem("autoBodyRainbow") && getItem("autoBodyRainbow")) {
        setTimeout(bodyRainbow[2]=1,1);
    }
    if(getItem("autoCardRainbow")) {
        setTimeout(cardRainbow[2]=1,1);
    }
    if(getItem("autoAnimatedPhoto") != 0 && getItem("autoAnimatedPhoto")) {
        if(getItem("animatedProfileProjectId") != 0 && getItem("animatedProfileProjectId") != "" && getItem("animatedProfileProjectId")) {
            $(".photoThumb").replaceWith('<iframe id="programThumb"src="https://www.khanacademy.org/computer-programming/new-program/' + getItem("animatedProfileProjectId") + '/embedded?id=1631784173750-0.47024163734957236&origin=https%3A%2F%2Fqasmt.eq.daymap.net&buttons=no&embed=yes&editor=no&author=no" frameborder="0" scrolling="no" style="border: 0px; width: 120px; height: 120px;"></iframe>');
        } else {
            $(".photoThumb").replaceWith('<iframe id="programThumb"src="https://www.khanacademy.org/computer-programming/new-program/' + animatedPhotoLinks[Math.floor(Math.random() * animatedPhotoLinks.length)] + '/embedded?id=1631784173750-0.47024163734957236&origin=https%3A%2F%2Fqasmt.eq.daymap.net&buttons=no&embed=yes&editor=no&author=no" frameborder="0" scrolling="no" style="border: 0px; width: 120px; height: 120px;"></iframe>');
        }
    }
    if(getItem("translucentMode") && getItem("translucentMode") < 1) {
        $(".card, .msg, .ditm, .Toolbar").css("background-color", "rgba(255, 255, 255, " + getItem("translucentMode") + ")");
        $(".ditm .t, .ditm .c").css("background-color", "rgba(0, 0, 0, 0)");
        $(".hasDatepicker").css("background-color", "rgba(255, 255, 255, " + getItem("translucentMode") * 0.7 + ")");
        $("#tblTt tbody tr td").css("opacity", constrain(getItem("translucentMode") * 1.62, 0, 1));
        $("#tblTt tbody tr td .ttCell").css("opacity", 1);
        $(".ditm, .Toolbar").css("outline", "3px solid rgba(250, 250, 250, " + getItem("translucentMode") * 0.45 + ")");
        $(".msg").css("border", "3px solid rgba(220, 220, 220, " + getItem("translucentMode") * 0.45 + ")");
        $("#bCalendar, #btnDiary").css("background-color", "rgba(31, 157, 217, " + getItem("translucentMode") * 1.6 + ")");
        $(".card, .msg, .ditm, .Toolbar, .ditm .t, .ditm .c, .hasDatepicker, #tblTt tbody tr td, #tblTt tbody tr td .ttCell, .msg, #bCalendar, #btnDiary").css("backdrop-filter", "blur(" + getItem("blurAmount") + "px)");
        window.setTimeout(function() {
            $(".logo").css("margin-top", "-1.5px");
            $(".logo").css("margin-left", "43px");
            $(".logo").css("width", "122px");
        }, 510);
        window.setTimeout(function() {
            $(".header").css("background-color","rgba(255, 255, 255, " + getItem("translucentMode") + ")");
            $(".header").css("backdrop-filter","blur(" + getItem("blurAmount") * 3 + "px)");
            $("#mnu > table > tbody > tr > td").css("background-color", "rgba(255, 255, 255, " + getItem("translucentMode") + ")");
            $(".logo").attr("src", "https://portal-beta.daymap.net/daymapidentity/logo.png");
        }, 500);
    }
    $("#customStyles").text(getItem("additionalCSS"));
})();