Clean Code Daymap Graphics

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

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

  1. // ==UserScript==
  2. // @name Clean Code Daymap Graphics
  3. // @namespace mailto:apate98@eq.edu.au
  4. // @version 6.1.1
  5. // @description Some better graphics for QASMT Daymap. Allows for much more customisation.
  6. // @author apate98
  7. // @match https://*.daymap.net/*
  8. // @icon https://www.google.com/s2/favicons?domain=daymap.net
  9. // @grant none
  10. // @license GNU GPLv3
  11. // ==/UserScript==
  12.  
  13. // Changelog
  14. // 6.0.0: Added changelog and introduced compatibility for Daymap's timetable view.
  15. // 6.0.1: Fixed a problem where opacity is reversed in timetable view.
  16. // 6.0.2: Changed the manual background change to apply to underlay rather than body. Increased speed of underlay rainbow.
  17. // 6.0.3: Allowed manual changing of the attendance indicator colour to anything, replacing the old background-color with background.
  18. // 6.1.0: Allows blurring behind the foreground cards, giving a glassy effect.
  19. // 6.1.1: Made header also change opacity and made logo transparent.
  20.  
  21. // Compatibile pages:
  22. // Feed View
  23. // Timetable
  24. // Mobile Daymap
  25. // My Details
  26.  
  27. // Tips:
  28. // 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.
  29.  
  30.  
  31.  
  32. // Local storage functions by DY
  33. var storage;
  34. (function() {
  35. storage = this.localStorage;
  36. })();
  37.  
  38. function getItem(key) {
  39. if(storage != undefined) {
  40. return storage.getItem(key);
  41. }
  42. storage = this.localStorage;
  43. return null;
  44. }
  45.  
  46. function setItem(key, value) {
  47. if(storage != undefined) {
  48. storage.setItem(key, value);
  49. } else {
  50. storage = this.localStorage;
  51. }
  52. }
  53.  
  54. function rainbowMove(val1, val2, val3, val4, val5, speed) {
  55. speed = speed ? speed : 1;
  56. val1 += (Math.random() - val4) * speed;
  57. val2 += (Math.random() - val5) * speed;
  58. val1 = val1 < 0 ? 0 : val1 > 410 ? 410 : val1;
  59. val2 = val2 < 0 ? 0 : val2 > 410 ? 410 : val2;
  60. return [val1, val2, val3, val4, val5];
  61. }
  62.  
  63. function constrain(num, min, max) {
  64. return num < min ? min : num > max ? max : num;
  65. }
  66.  
  67. function timeOfDiaryEl(lessonEl) {
  68. let lessonStart;
  69. let lessonEnd;
  70. if(lessonEl.text().substr(1, 1) === ":" && lessonEl.text().substr(12, 1) !== ":") {
  71. lessonStart = lessonEl.text().substr(0, 1) + lessonEl.text().substr(2, 2);
  72. lessonEnd = lessonEl.text().substr(11, 2) + lessonEl.text().substr(14, 2);
  73. if(lessonEl.text().substr(5, 1) === "P") {
  74. lessonStart = Number(lessonStart) + 1200;
  75. }
  76. }
  77. if(lessonEl.text().substr(1, 1) === ":" && lessonEl.text().substr(12, 1) === ":") {
  78. lessonStart = lessonEl.text().substr(0, 1) + lessonEl.text().substr(2, 2);
  79. lessonEnd = lessonEl.text().substr(11, 1) + lessonEl.text().substr(13, 2);
  80. if(lessonEl.text().substr(5, 1) === "P") {
  81. lessonStart = Number(lessonStart) + 1200;
  82. }
  83. if(lessonEl.text().substr(16, 1) === "P") {
  84. lessonEnd = Number(lessonEnd) + 1200;
  85. }
  86. }
  87. if(lessonEl.text().substr(1, 1) !== ":" && lessonEl.text().substr(13, 1) !== ":") {
  88. lessonStart = lessonEl.text().substr(0, 2) + lessonEl.text().substr(3, 2);
  89. lessonEnd = lessonEl.text().substr(12, 2) + lessonEl.text().substr(15, 2);
  90. }
  91. if(lessonEl.text().substr(1, 1) !== ":" && lessonEl.text().substr(13, 1) === ":") {
  92. lessonStart = lessonEl.text().substr(0, 2) + lessonEl.text().substr(3, 2);
  93. lessonEnd = lessonEl.text().substr(12, 1) + lessonEl.text().substr(14, 2);
  94. if(lessonEl.text().substr(17, 1) === "P") {
  95. lessonEnd = Number(lessonEnd) + 1200;
  96. }
  97. }
  98. return [lessonStart, lessonEnd];
  99. }
  100.  
  101. // By joshuacockrell based on a post by Maxwell Collard and edited by Mahdi
  102. function randn_bm() {
  103. let u = 0, v = 0;
  104. while(u === 0) u = Math.random(); //Converting [0,1) to (0,1)
  105. while(v === 0) v = Math.random();
  106. let num = Math.sqrt( -2.0 * Math.log( u ) ) * Math.cos( 2.0 * Math.PI * v );
  107. num = num / 10.0 + 0.5; // Translate to 0 -> 1
  108. if (num > 1 || num < 0) return randn_bm() // resample between 0 and 1
  109. return num
  110. }
  111.  
  112. var attendanceColour = "#7FFFD4";
  113. var bodyColour = "#ABCDEF";
  114. var cardColour = "#E6E6E6";
  115. var date;
  116. var classEls = [];
  117. var i;
  118. var anything = [];
  119. var animatedPhotoLinks = [5097557231353856, 6056784221388800, 5537046336684032]; //4617381095718912 (khanemon), 5169842873122816 (were in a comic, not working yet)
  120. var r50d = [];
  121.  
  122.  
  123.  
  124. (function() {
  125. 'use strict';
  126. var bodyEl = $("#mainBody");
  127. //Reload icon from Khan Academy coding
  128. 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>');
  129. $(".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>");
  130. $("#mainBody").append("<style id='customStyles'></style>");
  131. 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);
  132. bodyEl.append("<div id='bodyUnderlay'></div><style>#bodyUnderlay {position: fixed; width: 100%; height: 100%; top: 0; z-index: -2147483647}</style>");
  133. $("#toolbox > button").prepend(reloadSVG);
  134. document.querySelector("#blurAmount").value = getItem("blurAmount");
  135. document.querySelector("#animatedProfileProjectId").value = getItem("animatedProfileProjectId");
  136. document.querySelector("#bodyBackground").value = getItem("bodyBackground");
  137. $("#translucent").attr("value", getItem("translucentMode"));
  138. $("#blur").attr("value", getItem("blurAmount"));
  139. if(getItem("autoAnimatedPhoto") != 0 && getItem("autoAnimatedPhoto")) {
  140. $("#autoAnimatedPhoto").attr("checked", 1);
  141. }
  142. if(getItem("autoAttendanceRainbow") != 0 && getItem("autoAttendanceRainbow")) {
  143. $("#autoAttendanceRainbow").attr("checked", 1);
  144. }
  145. if(getItem("autoBackground") != 0 && getItem("autoBackground")) {
  146. $("#autoBackground").attr("checked", 1);
  147. if(getItem("bodyBackground") != "" && getItem("bodyBackground") != undefined) {
  148. $("#bodyUnderlay").css("background", getItem("bodyBackground"));
  149. if(getItem("bodyBackground") === "linear-gradient(to bottom right, yellow, black, black, black)") {
  150. $("#bodyUnderlay").append("<style></style>");
  151. for(var i = 0; i < 500; i ++) {
  152. anything[0] = Math.random() * 7.5;
  153. anything[1] = randn_bm() * 255;
  154. anything[2] = Math.random() * 100;
  155. anything[3] = Math.random() * 100;
  156. anything[4] = Math.random() + 1;
  157. anything[5] = (Math.random() - 0.5) * 90;
  158. if(anything[2] < 37.5 && anything[3] < 37.5) {
  159. continue;
  160. }
  161. $("#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>");
  162. r50d.push("1," + Math.random() / 100 + "," + anything[5] + "," + (randn_bm() - 0.5) * 15);
  163. if(getItem("translucentMode") == 0) {
  164. $(".msg > table > tbody > tr > td[colspan='2']").css("color", "rgba(200, 200, 200, 0.5)");
  165. }
  166. }
  167. }
  168. if(getItem("bodyBackground") === "url('https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLB_p0PncTtkrhaNDZtntrE3gKkoYw')") {
  169. setItem("bodyBackground", "black url('https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLB_p0PncTtkrhaNDZtntrE3gKkoYw')");
  170. window.location.href = "https://www.youtube.com/watch?v=dQw4w9WgXcQ";
  171. }
  172. }
  173. }
  174. $("#customStyles").text(getItem("additionalCSS"));
  175. document.querySelector("#additionalCSS").value = getItem("additionalCSS");
  176. i = 0;
  177. 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);
  178. $("#closeToolbox").click(function() {
  179. $("#toolbox").css("display", "none");
  180. });
  181. $("#reloadBtn").click(function() {
  182. setItem("animatedProfileProjectId", document.querySelector("#animatedProfileProjectId").value);
  183. setItem("bodyBackground", document.querySelector("#bodyBackground").value);
  184. setItem("translucentMode", document.querySelector("#translucent").value);
  185. setItem("additionalCSS", document.querySelector("#additionalCSS").value);
  186. setItem("blurAmount", document.querySelector("#blur").value);
  187. });
  188. $("#autoAnimatedPhoto").click(function() {setItem("autoAnimatedPhoto", getItem("autoAnimatedPhoto") != 0 && getItem("autoAnimatedPhoto") ? 0 : 1);});
  189. $("#autoAttendanceRainbow").click(function() {setItem("autoAttendanceRainbow", getItem("autoAttendanceRainbow") != 0 ? 0 : 1);});
  190. $("#autoBackground").click(function() {setItem("autoBackground", getItem("autoBackground") != 0 && getItem("autoBackground") ? 0 : 1);});
  191. setInterval(function() {if($("#toolbox")[0].style.display === "block") {}}, 1000);
  192. if (!document.querySelector(".sdIndicator")) {
  193. $(".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>');
  194. $(".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>");
  195. }
  196. $(".itm .Error").text("Uh did you submit on Turnitin or something?");
  197. var attendanceEl = $(".sdIndicator");
  198. attendanceEl.addClass("attendance");
  199. var cardEl = $(".diaryDay");
  200. var attendanceRainbow = [0, 0, 0, 0.5, 0.5];
  201. var attendanceRainbow1 = [400, 5, 0, 0.5, 0.5];
  202. var attendanceRainbow2 = [210, 350, 0, 0.5, 0.5];
  203. var bodyRainbow = [200, 200, 0, 0.5, 0.5];
  204. var cardRainbow = [200, 200, 0, 0.5, 0.5];
  205. //Rainbow gradient by Weather at https://www.khanacademy.org/computer-programming/the-randomish-quiz/6515084802260992
  206. 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);
  207. 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);
  208. 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);
  209. setInterval(function(){bodyRainbow = rainbowMove(bodyRainbow[0], bodyRainbow[1], bodyRainbow[2], bodyRainbow[3], bodyRainbow[4] , 10);}, 10);
  210. setInterval(function(){if(bodyRainbow[2]) {$("#bodyUnderlay").css("background-color", "rgb(" + bodyRainbow[0] + "," + (400 - bodyRainbow[0] + bodyRainbow[1]) / 2.5 + "," + (400 - bodyRainbow[1]) + ")");}}, 10);
  211. setInterval(function(){bodyRainbow[3] = Math.random() / 2 + 0.25; bodyRainbow[4] = Math.random() / 2 + 0.25;}, 5000);
  212. setInterval(function(){cardRainbow = rainbowMove(cardRainbow[0], cardRainbow[1], cardRainbow[2], cardRainbow[3], cardRainbow[4] , 10);}, 10);
  213. setInterval(function(){if(cardRainbow[2]) {cardEl.css("background-color", "rgb(" + cardRainbow[0] + "," + (400 - cardRainbow[0] + cardRainbow[1]) / 2.5 + "," + (400 - cardRainbow[1]) + ")");}}, 10);
  214. setInterval(function(){cardRainbow[3] = Math.random() / 2 + 0.25; cardRainbow[4] = Math.random() / 2 + 0.25;}, 5000);
  215. attendanceRainbow[2] = getItem("autoAttendanceRainbow") != 0 && getItem("autoAttendanceRainbow") ? 1 : 0;
  216. attendanceEl.click(function() {
  217. attendanceColour = prompt("Please enter a colour", "#7FFFD4");
  218. if (attendanceColour && attendanceColour != "RAINBOW") {
  219. attendanceRainbow[2] = 0;
  220. attendanceEl.css("background-image", "");
  221. attendanceEl.css("background", attendanceColour);
  222. } else if (attendanceColour === "RAINBOW") {
  223. attendanceRainbow[2] = 1;
  224. }
  225. });
  226. cardEl.click(function() {
  227. cardColour = prompt("Please enter a colour", "#7FFFD4");
  228. if (cardColour && cardColour != "RAINBOW") {
  229. cardRainbow[2] = 0;
  230. cardEl.css("background-color", cardColour);
  231. } else if (cardColour === "RAINBOW") {
  232. cardRainbow[2] = 1;
  233. }
  234. });
  235. $(".diaryWeek").click(function() {
  236. alert("rgb(" + attendanceRainbow[0] + "," + (400 - attendanceRainbow[0] + attendanceRainbow[1]) / 2.5 + "," + (400 - attendanceRainbow[1]) + ")");
  237. });
  238. switch(Date().substr(4, 3)) {
  239. case "Jan":
  240. date = Date().substr(11, 4) + "-01-" + Date().substr(8, 2);
  241. break;
  242. case "Feb":
  243. date = Date().substr(11, 4) + "-02-" + Date().substr(8, 2);
  244. break;
  245. case "Mar":
  246. date = Date().substr(11, 4) + "-03-" + Date().substr(8, 2);
  247. break;
  248. case "Apr":
  249. date = Date().substr(11, 4) + "-04-" + Date().substr(8, 2);
  250. break;
  251. case "May":
  252. date = Date().substr(11, 4) + "-05-" + Date().substr(8, 2);
  253. break;
  254. case "Jun":
  255. date = Date().substr(11, 4) + "-06-" + Date().substr(8, 2);
  256. break;
  257. case "Jul":
  258. date = Date().substr(11, 4) + "-07-" + Date().substr(8, 2);
  259. break;
  260. case "Aug":
  261. date = Date().substr(11, 4) + "-08-" + Date().substr(8, 2);
  262. break;
  263. case "Sep":
  264. date = Date().substr(11, 4) + "-09-" + Date().substr(8, 2);
  265. break;
  266. case "Oct":
  267. date = Date().substr(11, 4) + "-10-" + Date().substr(8, 2);
  268. break;
  269. case "Nov":
  270. date = Date().substr(11, 4) + "-11-" + Date().substr(8, 2);
  271. break;
  272. case "Dec":
  273. date = Date().substr(11, 4) + "-12-" + Date().substr(8, 2);
  274. break;
  275. }
  276. var time = Number(Date().substr(16, 2) + Date().substr(19, 2));
  277. 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()];
  278. var lessonEl;
  279.  
  280. i = 0;
  281. while (!lessonEl && i < 10) {
  282. if (lessonEls[i]) {
  283. if (timeOfDiaryEl(lessonEls[i])[0] < time && timeOfDiaryEl(lessonEls[i])[1] >= time) {
  284. lessonEl = lessonEls[i];
  285. }
  286. }
  287. i ++;
  288. }
  289. var evilEl;
  290. // Click on the time thing of any English lesson in DayPlan.
  291. $(".L").each(function() {
  292. if($(this).children().children().text().substr(0, 3) === "ENG") {
  293. $(this).addClass("evil");
  294. }
  295. });
  296. if(lessonEl != undefined) {
  297. lessonEl.css("transform-origin", "50% 50%");
  298. if(lessonEl.children().children().text().substr(0, 3) != "JEX") {
  299. lessonEl.css("border-radius", "5px");
  300. } else {
  301. lessonEl.css("border-radius", "50%");
  302. }
  303. var lessonStyle = $("<style>@keyframes lessonAnimation {from, to {} 50% {}} .lessonEl {animation: lessonAnimation 15s infinite;}</style>");
  304. lessonEl.append(lessonStyle);
  305. lessonEl.addClass("lessonEl");
  306. var lessonOverlay = $(".lessonOverlay");
  307. lessonOverlay.css("top", "0px");
  308. lessonOverlay.css("left", "-5px");
  309. $("#lessonOverlay1").css("width", $(".lessonEl .c a").width() + 10 > 250 ? $(".lessonEl .c a").width() + 10 : "250px");
  310. $("#lessonOverlay1").css("height", lessonEl.height() + 10);
  311. lessonOverlay.css("position", "absolute");
  312. $("#lessonOverlay1").css("border", "10px dotted blue");
  313. $(".lessonEl .t").click(function() {
  314. lessonEl.css("border-radius", prompt("Enter the radius", "5px"));
  315. });
  316. }
  317. $(".evil .t").click(function() {
  318. if(confirm("Are you sure you would like to enable evil mode? You will need to refresh the page to revert this.")) {
  319. $(".header").css("background-color", "rgb(85, 2, 2)");
  320. $(".lpMenuTop tbody td").css("background-color", "rgb(85, 2, 2)");
  321. $(".logo").remove();
  322. $(".lpMenuTop tbody td").css("border-bottom", "rgb(0, 0, 0)");
  323. $("#mainBody").css("background-color", "rgb(85, 10, 10)");
  324. $("#mainBody").append("<div class='bodyOverlay'></div>");
  325. $(".bodyOverlay").append("<style>.bodyOverlay {background-color:rgba(113,13,13,0.5);width:100vw; height: 100vh; position:fixed;}</style>");
  326. $("hasDatepicker").css("background-color", "rgb(100, 20, 20)");
  327. $(".Toolbar").css("background", "rgb(100, 20, 20)");
  328. $(".post-ticker").css("background-color", "rgb(70, 0, 0)");
  329. $(".grid div").each(function() {
  330. $(this).css("background-color", "rgb(100, 20, 40)");
  331. });
  332. $(".msgHead .icon").next().each(function() {
  333. $(this).text("Mua ha ha ha!");
  334. });
  335. $(".msgHead .icon").next().next().each(function() {
  336. $(this).text("Always.");
  337. });
  338. $(".msg table tbody tr:nth-child(2) td").each(function() {
  339. $(this).text("Daymap bows down to my power.");
  340. });
  341. }
  342. });
  343. $(".MasterContent > table > tbody > tr > td > .Header").click(function() {
  344. bodyColour = prompt("Please enter a background", "#ABCDEF");
  345. if (bodyColour && bodyColour != "RAINBOW") {
  346. bodyRainbow[2] = 0;
  347. $("#bodyUnderlay").css("background", bodyColour);
  348. } else if (bodyColour === "RAINBOW") {
  349. bodyRainbow[2] = 1;
  350. }
  351. });
  352. if(getItem("autoBodyRainbow") && getItem("autoBodyRainbow")) {
  353. setTimeout(bodyRainbow[2]=1,1);
  354. }
  355. if(getItem("autoCardRainbow")) {
  356. setTimeout(cardRainbow[2]=1,1);
  357. }
  358. if(getItem("autoAnimatedPhoto") != 0 && getItem("autoAnimatedPhoto")) {
  359. if(getItem("animatedProfileProjectId") != 0 && getItem("animatedProfileProjectId") != "" && getItem("animatedProfileProjectId")) {
  360. $(".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>');
  361. } else {
  362. $(".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>');
  363. }
  364. }
  365. if(getItem("translucentMode") && getItem("translucentMode") < 1) {
  366. $(".card, .msg, .ditm, .Toolbar").css("background-color", "rgba(255, 255, 255, " + getItem("translucentMode") + ")");
  367. $(".ditm .t, .ditm .c").css("background-color", "rgba(0, 0, 0, 0)");
  368. $(".hasDatepicker").css("background-color", "rgba(255, 255, 255, " + getItem("translucentMode") * 0.7 + ")");
  369. $("#tblTt tbody tr td").css("opacity", constrain(getItem("translucentMode") * 1.62, 0, 1));
  370. $("#tblTt tbody tr td .ttCell").css("opacity", 1);
  371. $(".ditm, .Toolbar").css("outline", "3px solid rgba(250, 250, 250, " + getItem("translucentMode") * 0.45 + ")");
  372. $(".msg").css("border", "3px solid rgba(220, 220, 220, " + getItem("translucentMode") * 0.45 + ")");
  373. $("#bCalendar, #btnDiary").css("background-color", "rgba(31, 157, 217, " + getItem("translucentMode") * 1.6 + ")");
  374. $(".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)");
  375. window.setTimeout(function() {
  376. $(".logo").css("margin-top", "-1.5px");
  377. $(".logo").css("margin-left", "43px");
  378. $(".logo").css("width", "122px");
  379. }, 510);
  380. window.setTimeout(function() {
  381. $(".header").css("background-color","rgba(255, 255, 255, " + getItem("translucentMode") + ")");
  382. $(".header").css("backdrop-filter","blur(" + getItem("blurAmount") * 3 + "px)");
  383. $("#mnu > table > tbody > tr > td").css("background-color", "rgba(255, 255, 255, " + getItem("translucentMode") + ")");
  384. $(".logo").attr("src", "https://portal-beta.daymap.net/daymapidentity/logo.png");
  385. }, 500);
  386. }
  387. $("#customStyles").text(getItem("additionalCSS"));
  388. })();