Files
BetterSEQTA-Plus/src/SEQTA.js
T
RandomTechChannel d325a9f506 Release notes
2023-07-25 17:49:03 +08:00

3234 lines
175 KiB
JavaScript

var isChrome = window.chrome;
var SettingsClicked = false
var MenuOptionsOpen = false;
var UserInitalCode = '';
var currentSelectedDate = new Date();
var WhatsNewOpen = false;
var LessonInterval;
var stringToHTML = function (str, styles=false) {
var parser = new DOMParser();
var str = DOMPurify.sanitize(str, { ADD_ATTR: ['onclick']});
var doc = parser.parseFromString(str, "text/html");
if(styles){doc.body.style.cssText = "height: auto; overflow: scroll; margin: 0px; background: var(--background-primary);"}
return doc.body;
};
const ShortcutLinks = {
YouTube: {
link: "https://www.youtube.com/",
viewBox: "0 0 24 24",
icon: "M10,15L15.19,12L10,9V15M21.56,7.17C21.69,7.64 21.78,8.27 21.84,9.07C21.91,9.87 21.94,10.56 21.94,11.16L22,12C22,14.19 21.84,15.8 21.56,16.83C21.31,17.73 20.73,18.31 19.83,18.56C19.36,18.69 18.5,18.78 17.18,18.84C15.88,18.91 14.69,18.94 13.59,18.94L12,19C7.81,19 5.2,18.84 4.17,18.56C3.27,18.31 2.69,17.73 2.44,16.83C2.31,16.36 2.22,15.73 2.16,14.93C2.09,14.13 2.06,13.44 2.06,12.84L2,12C2,9.81 2.16,8.2 2.44,7.17C2.69,6.27 3.27,5.69 4.17,5.44C4.64,5.31 5.5,5.22 6.82,5.16C8.12,5.09 9.31,5.06 10.41,5.06L12,5C16.19,5 18.8,5.16 19.83,5.44C20.73,5.69 21.31,6.27 21.56,7.17Z"
},
Outlook: {
link: "https://outlook.office365.com/mail/inbox",
viewBox: "0 0 24 24",
icon: "M8.56 12.03Q8.56 12.41 8.5 12.76 8.39 13.1 8.2 13.38 8 13.65 7.71 13.81 7.41 13.97 7 13.97 6.58 13.97 6.29 13.8 6 13.63 5.81 13.35 5.62 13.07 5.54 12.72 5.45 12.37 5.45 12 5.45 11.64 5.54 11.28 5.62 10.93 5.81 10.65 6 10.37 6.31 10.2 6.61 10.03 7.03 10.03 7.46 10.03 7.75 10.2 8.05 10.38 8.23 10.66 8.41 10.95 8.5 11.3 8.56 11.66 8.56 12.03M22 12V19.81Q22 20.2 21.73 20.5 21.45 20.75 21.06 20.75H7.94Q7.55 20.75 7.27 20.5 7 20.2 7 19.81V17H2.83Q2.5 17 2.24 16.76 2 16.5 2 16.17V7.83Q2 7.5 2.24 7.24 2.5 7 2.83 7H8.25V4.13Q8.25 3.76 8.5 3.5 8.76 3.25 9.13 3.25H19.87Q20.24 3.25 20.5 3.5 20.75 3.76 20.75 4.13V11.04L21.79 11.64H21.8Q21.88 11.7 21.94 11.8 22 11.89 22 12M17 5.13V7.63H19.5V5.13M17 8.88V11.38H19.5V8.88M17 12.63V14.15L19.54 12.63M12.63 5.13V7.63H15.75V5.13M12.63 8.88V11.38H15.75V8.88M12.63 12.63V14.32L14.64 15.56L15.75 14.9V12.63M9.5 5.13V7H11.27Q11.33 7 11.38 7.04V5.12M7 15.32Q7.73 15.32 8.32 15.06 8.9 14.8 9.31 14.35 9.71 13.9 9.91 13.28 10.12 12.66 10.13 11.94 10.13 11.25 9.92 10.65 9.72 10.06 9.32 9.62 8.93 9.18 8.37 8.93 7.8 8.68 7.08 8.68 6.31 8.68 5.71 8.93 5.12 9.18 4.71 9.63 4.3 10.09 4.09 10.71 3.88 11.34 3.88 12.08 3.88 12.78 4.09 13.38 4.31 13.97 4.71 14.4 5.11 14.83 5.68 15.08 6.26 15.32 7 15.32M8.25 19.5H18.57L12 15.4V16.17Q12 16.5 11.76 16.76 11.5 17 11.17 17H8.25M20.75 19.39V13.36L15.83 16.31Z",
},
Office: {
link: "http://office.com",
viewBox: "0 0 24 24",
icon: "M19.94 5.59V18.39Q19.94 19.06 19.55 19.59 19.16 20.11 18.5 20.29L12.77 21.94Q12.65 21.97 12.5 22H12.28Q11.95 22 11.68 21.91 11.41 21.82 11.13 21.67L7.38 19.55Q7.17 19.43 7.05 19.24 6.93 19.05 6.93 18.81 6.93 18.45 7.19 18.2 7.44 17.95 7.8 17.95H12.66V6.14L9 7.44Q8.57 7.6 8.3 8 8.03 8.38 8.03 8.85V15.58Q8.03 16 7.82 16.34 7.62 16.68 7.25 16.88L5.53 17.82Q5.29 17.95 5.05 17.95 4.64 17.95 4.35 17.66 4.06 17.37 4.06 16.95V7.47Q4.06 6.95 4.33 6.5 4.61 6 5.06 5.74L11.22 2.24Q11.43 2.12 11.67 2.06 11.91 2 12.15 2 12.32 2 12.46 2.03 12.6 2.05 12.77 2.1L18.5 3.69Q18.83 3.78 19.09 3.96 19.35 4.14 19.54 4.39 19.74 4.65 19.84 4.95 19.94 5.26 19.94 5.59M18.62 18.39V5.59Q18.62 5.36 18.5 5.19 18.35 5 18.13 4.96L15.31 4.18Q15 4.09 14.65 4 14.32 3.89 14 3.81V20.21L18.13 19Q18.35 18.96 18.5 18.79 18.62 18.62 18.62 18.39Z"
},
Spotify: {
link: "https://accounts.spotify.com/en/login",
viewBox: "0 0 24 24",
icon: "M17.9,10.9C14.7,9 9.35,8.8 6.3,9.75C5.8,9.9 5.3,9.6 5.15,9.15C5,8.65 5.3,8.15 5.75,8C9.3,6.95 15.15,7.15 18.85,9.35C19.3,9.6 19.45,10.2 19.2,10.65C18.95,11 18.35,11.15 17.9,10.9M17.8,13.7C17.55,14.05 17.1,14.2 16.75,13.95C14.05,12.3 9.95,11.8 6.8,12.8C6.4,12.9 5.95,12.7 5.85,12.3C5.75,11.9 5.95,11.45 6.35,11.35C10,10.25 14.5,10.8 17.6,12.7C17.9,12.85 18.05,13.35 17.8,13.7M16.6,16.45C16.4,16.75 16.05,16.85 15.75,16.65C13.4,15.2 10.45,14.9 6.95,15.7C6.6,15.8 6.3,15.55 6.2,15.25C6.1,14.9 6.35,14.6 6.65,14.5C10.45,13.65 13.75,14 16.35,15.6C16.7,15.75 16.75,16.15 16.6,16.45M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"
},
Google: {
link: "https://google.com",
viewBox: "0 0 24 24",
icon: "M12,20L15.46,14H15.45C15.79,13.4 16,12.73 16,12C16,10.8 15.46,9.73 14.62,9H19.41C19.79,9.93 20,10.94 20,12A8,8 0 0,1 12,20M4,12C4,10.54 4.39,9.18 5.07,8L8.54,14H8.55C9.24,15.19 10.5,16 12,16C12.45,16 12.88,15.91 13.29,15.77L10.89,19.91C7,19.37 4,16.04 4,12M15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9A3,3 0 0,1 15,12M12,4C14.96,4 17.54,5.61 18.92,8H12C10.06,8 8.45,9.38 8.08,11.21L5.7,7.08C7.16,5.21 9.44,4 12,4M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"
},
DuckDuckGo: {
link: "https://duckduckgo.com/",
viewBox: "0 0 32 32",
icon: "M16 0c-8.839 0-16 7.161-16 16s7.161 16 16 16c8.839 0 16-7.161 16-16s-7.161-16-16-16zM16 30.667c-8.099 0-14.667-6.568-14.667-14.667s6.568-14.667 14.667-14.667c8.099 0 14.667 6.568 14.667 14.667s-6.568 14.667-14.667 14.667zM29.625 16c0 6.406-4.422 11.776-10.38 13.234-0.359-0.698-0.708-1.359-1-1.917 0.859 0.328 2.573 0.953 2.943 0.818 0.505-0.193 0.38-4.198-0.182-4.328-0.453-0.099-2.177 1.12-2.859 1.615l0.047 0.208c0.104 0.526 0.193 1.323 0.042 1.661 0 0.005-0.005 0.016-0.005 0.016-0.021 0.047-0.052 0.089-0.094 0.12-0.375 0.25-1.438 0.38-2 0.25-0.031-0.005-0.057-0.016-0.089-0.026-0.922 0.526-2.677 1.479-3 1.297-0.438-0.255-0.5-3.573-0.438-4.385 0.047-0.615 2.203 0.38 3.255 0.906 0.234-0.219 0.802-0.365 1.307-0.417-0.76-1.849-1.318-3.969-0.979-5.474 0 0.005 0.005 0.005 0.005 0.005 0.474 0.328 3.641 1.401 5.214 1.37s4.151-0.99 3.87-1.766c-0.281-0.771-2.849 0.682-5.521 0.432-1.984-0.182-2.333-1.073-1.896-1.719 0.552-0.818 1.557 0.151 3.214-0.344 1.661-0.495 3.984-1.38 4.844-1.859 1.995-1.115-0.833-1.573-1.5-1.266-0.63 0.297-2.828 0.849-3.849 1.094 0.568-2.021-0.807-5.531-2.344-7.068-0.5-0.5-1.271-0.813-2.141-0.979-0.333-0.458-0.87-0.896-1.63-1.302-1.474-0.771-3.156-1.047-4.797-0.781l-0.031 0.005-0.042 0.005 0.005 0.005c-0.198 0.036-0.318 0.104-0.479 0.13 0.198 0.021 0.943 0.37 1.411 0.557-0.234 0.089-0.552 0.146-0.797 0.245-0.094 0.016-0.182 0.036-0.271 0.073-0.229 0.109-0.406 0.5-0.401 0.688 1.12-0.115 2.776-0.031 3.99 0.328-0.859 0.12-1.646 0.344-2.214 0.646-0.021 0.010-0.042 0.021-0.068 0.036-0.068 0.026-0.141 0.057-0.198 0.089-1.823 0.958-2.63 3.203-2.151 5.896 0.432 2.432 2.219 10.786 3.052 14.755-5.297-1.87-9.094-6.917-9.094-12.854 0-7.526 6.099-13.625 13.625-13.625s13.625 6.099 13.625 13.625zM12.125 12.776c-0.557 0-1.010 0.453-1.010 1.010s0.453 1.010 1.010 1.010c1.349 0 1.349-2.021 0-2.021zM12.578 13.708c-0.146 0-0.26-0.115-0.26-0.26 0-0.141 0.115-0.26 0.26-0.26 0.349 0 0.349 0.521 0 0.521zM18.875 12.318c-0.49-0.016-0.901 0.375-0.901 0.87 0 0.49 0.411 0.885 0.901 0.865 1.156 0 1.156-1.734 0-1.734zM19.26 13.12c-0.12 0-0.224-0.099-0.224-0.224 0-0.12 0.104-0.224 0.224-0.224 0.302 0 0.302 0.448 0 0.448zM12.417 10.859c0 0-0.76-0.344-1.5 0.12-0.74 0.469-0.714 0.943-0.714 0.943s-0.391-0.875 0.656-1.307c1.047-0.427 1.557 0.245 1.557 0.245zM19.401 10.792c0 0-0.547-0.313-0.974-0.307-0.875 0.010-1.109 0.396-1.109 0.396s0.146-0.917 1.26-0.734c0.365 0.068 0.672 0.307 0.823 0.646z"
},
CoolMathGames: {
link: "https://coolmathgames.com/",
viewBox: "0 0 24 24",
icon: "M16.5,9L13.5,12L16.5,15H22V9M9,16.5V22H15V16.5L12,13.5M7.5,9H2V15H7.5L10.5,12M15,7.5V2H9V7.5L12,10.5L15,7.5Z"
},
SACE: {
link: "https://apps.sace.sa.edu.au/students-online/login.do",
viewBox: "0 0 125.2 125",
icon: "M103,40.1H84.8v-18C84.8,9.9,74.8,0,62.6,0C50.4,0,40.3,9.9,40.3,22.1c0,12.2,10,22.1,22.2,22.1h18.1v36H44.5v-18c0-12.2-10-22.1-22.2-22.1S0,50,0,62.2s10,22.1,22.2,22.1h18.1v18c0,12.2,10,22.1,22.2,22.1s22.2-9.9,22.2-22.1v-18h18.1c12.4,0,22.4-9.9,22.4-22.1S115.2,40.1,103,40.1z M40.3,80.2H22.2c-10,0-18.1-8.1-18.1-18s8.1-18,18.1-18s18.1,8.1,18.1,18V80.2zM80.7,102.3c0,9.9-8.1,18-18.1,18s-18.1-8.1-18.1-18v-18h36.2V102.3z M80.7,40.1H62.6c-10,0-18.1-8.1-18.1-18c0-9.9,8.1-18,18.1-18s18.1,8.1,18.1,18V40.1z M102.9,80.2H84.8v-36h18.1c10,0,18.1,8.1,18.1,18S112.9,80.2,102.9,80.2z"
},
GoogleScholar: {
link: "https://scholar.google.com",
viewBox: "0 0 24 24",
icon: "M21.35,11.1H12.18V13.83H18.69C18.36,17.64 15.19,19.27 12.19,19.27C8.36,19.27 5,16.25 5,12C5,7.9 8.2,4.73 12.2,4.73C15.29,4.73 17.1,6.7 17.1,6.7L19,4.72C19,4.72 16.56,2 12.1,2C6.42,2 2.03,6.8 2.03,12C2.03,17.05 6.16,22 12.25,22C17.6,22 21.5,18.33 21.5,12.91C21.5,11.76 21.35,11.1 21.35,11.1V11.1Z"
},
Gmail: {
link: "https://mail.google.com",
viewBox: "0 0 24 24",
icon: "M20,18H18V9.25L12,13L6,9.25V18H4V6H5.2L12,10.25L18.8,6H20M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6C22,4.89 21.1,4 20,4Z"
},
Netflix: {
link: "https://netflix.com",
viewBox: "0 0 24 24",
icon: "M6.5,2H10.5L13.44,10.83L13.5,2H17.5V22C16.25,21.78 14.87,21.64 13.41,21.58L10.5,13L10.43,21.59C9.03,21.65 7.7,21.79 6.5,22V2Z"
}
}
var MenuitemSVGKey = {
"welcome": `<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M7.03 4.95L3.5 8.5C.17 11.81 .17 17.19 3.5 20.5S12.19 23.83 15.5 20.5L21.5 14.5C22.5 13.53 22.5 11.94 21.5 10.96C21.4 10.84 21.27 10.73 21.13 10.64L21.5 10.25C22.5 9.28 22.5 7.69 21.5 6.71C21.36 6.55 21.17 6.41 21 6.3C21.38 5.38 21.21 4.28 20.46 3.53C19.59 2.66 18.24 2.57 17.26 3.25C17.16 3.1 17.05 2.96 16.92 2.83C15.95 1.86 14.36 1.86 13.38 2.83L10.87 5.34C10.78 5.2 10.67 5.07 10.55 4.95C9.58 4 8 4 7.03 4.95M8.44 6.37C8.64 6.17 8.95 6.17 9.15 6.37S9.35 6.88 9.15 7.08L5.97 10.26C7.14 11.43 7.14 13.33 5.97 14.5L7.38 15.91C8.83 14.46 9.2 12.34 8.5 10.55L14.8 4.25C15 4.05 15.31 4.05 15.5 4.25S15.71 4.76 15.5 4.96L10.91 9.56L12.32 10.97L18.33 4.96C18.53 4.76 18.84 4.76 19.04 4.96C19.24 5.16 19.24 5.47 19.04 5.67L13.03 11.68L14.44 13.09L19.39 8.14C19.59 7.94 19.9 7.94 20.1 8.14C20.3 8.34 20.3 8.65 20.1 8.85L14.44 14.5L15.85 15.92L19.39 12.38C19.59 12.18 19.9 12.18 20.1 12.38C20.3 12.58 20.3 12.89 20.1 13.09L14.1 19.1C11.56 21.64 7.45 21.64 4.91 19.1S2.37 12.45 4.91 9.91L8.44 6.37M23 17C23 20.31 20.31 23 17 23V21.5C19.5 21.5 21.5 19.5 21.5 17H23M1 7C1 3.69 3.69 1 7 1V2.5C4.5 2.5 2.5 4.5 2.5 7H1Z" />
</svg>`,
"assessments": `<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M6 20H13V22H6C4.89 22 4 21.11 4 20V4C4 2.9 4.89 2 6 2H18C19.11 2 20 2.9 20 4V12.54L18.5 11.72L18 12V4H13V12L10.5 9.75L8 12V4H6V20M24 17L18.5 14L13 17L18.5 20L24 17M15 19.09V21.09L18.5 23L22 21.09V19.09L18.5 21L15 19.09Z" />
</svg>`,
"courses": `<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M19 1L14 6V17L19 12.5V1M21 5V18.5C19.9 18.15 18.7 18 17.5 18C15.8 18 13.35 18.65 12 19.5V6C10.55 4.9 8.45 4.5 6.5 4.5C4.55 4.5 2.45 4.9 1 6V20.65C1 20.9 1.25 21.15 1.5 21.15C1.6 21.15 1.65 21.1 1.75 21.1C3.1 20.45 5.05 20 6.5 20C8.45 20 10.55 20.4 12 21.5C13.35 20.65 15.8 20 17.5 20C19.15 20 20.85 20.3 22.25 21.05C22.35 21.1 22.4 21.1 22.5 21.1C22.75 21.1 23 20.85 23 20.6V6C22.4 5.55 21.75 5.25 21 5M10 18.41C8.75 18.09 7.5 18 6.5 18C5.44 18 4.18 18.19 3 18.5V7.13C3.91 6.73 5.14 6.5 6.5 6.5C7.86 6.5 9.09 6.73 10 7.13V18.41Z" />
</svg>`,
"dashboard": `<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M13,3V9H21V3M13,21H21V11H13M3,21H11V15H3M3,13H11V3H3V13Z" />
</svg>`,
"messages": `<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M20,2H4A2,2 0 0,0 2,4V22L6,18H20A2,2 0 0,0 22,16V4A2,2 0 0,0 20,2M8,14H6V12H8V14M8,11H6V9H8V11M8,8H6V6H8V8M15,14H10V12H15V14M18,11H10V9H18V11M18,8H10V6H18V8Z" />
</svg>`,
"notices": `<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M12,15H10V13H12V15M18,15H14V13H18V15M8,11H6V9H8V11M18,11H10V9H18V11M20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4H20A2,2 0 0,1 22,6V18A2,2 0 0,1 20,20M4,6V18H20V6H4Z" />
</svg>`,
"portals": `<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M15,4A8,8 0 0,1 23,12A8,8 0 0,1 15,20A8,8 0 0,1 7,12A8,8 0 0,1 15,4M15,18A6,6 0 0,0 21,12A6,6 0 0,0 15,6A6,6 0 0,0 9,12A6,6 0 0,0 15,18M3,12C3,14.61 4.67,16.83 7,17.65V19.74C3.55,18.85 1,15.73 1,12C1,8.27 3.55,5.15 7,4.26V6.35C4.67,7.17 3,9.39 3,12Z" />
</svg>`,
"reports": `<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M18 2H12V9L9.5 7.5L7 9V2H6A2 2 0 0 0 4 4V20A2 2 0 0 0 6 22H18A2 2 0 0 0 20 20V4A2 2 0 0 0 18 2M14 12A2 2 0 1 1 12 14A2 2 0 0 1 14 12M18 20H10V19C10 17.67 12.67 17 14 17S18 17.67 18 19Z" />
</svg>`,
"settings": `<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z" />
</svg>`,
"timetable": `<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M9,10V12H7V10H9M13,10V12H11V10H13M17,10V12H15V10H17M19,3A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5C3.89,21 3,20.1 3,19V5A2,2 0 0,1 5,3H6V1H8V3H16V1H18V3H19M19,19V8H5V19H19M9,14V16H7V14H9M13,14V16H11V14H13M17,14V16H15V14H17Z" />
</svg>`
}
function loading() {
loadinghtml = stringToHTML(
`<div class="bkloading" id="loading" style="background-color: #1a1a1a;width: 100%;overflow: hidden;opacity: 1;transition: 0.5s;height: 100%;top: 0;position: absolute;left: 0;z-index: 10000;">
<style>
.svg {
transform-origin: center;
position: absolute;
top: 50%;
left: 50%;
}
.logo {
transform: translate(-50%, -50%);
}
.big-circle {
margin: -88px;
animation-timing-function: ease;
animation: spin 3s linear infinite;
-moz-animation: spin 3s linear infinite;
}
.small-circle {
margin: -66px;
animation-timing-function: ease;
animation: spin 3s linear infinite;
-moz-animation: spin 3s linear infinite;
}
.outer-circle {
margin: -108px;
animation-direction: alternate-reverse;
animation: spinback 1s linear infinite;
-moz-animation: spinback 1s linear infinite;
}
@-moz-keyframes spin {
100% {
-moz-transform: rotate(360deg);
}
}
@-webkit-keyframes spin {
100% {
-webkit-transform: rotate(360deg);
}
}
@keyframes spin {
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes spinback {
100% {
-webkit-transform: rotate(-360deg);
transform: rotate(-360deg);
}
}
</style>
<svg height="120" width="120" viewBox="0 0 400 400" class="logo svg"><path xmlns="http://www.w3.org/2000/svg" id="path0" style="fill:#ededed; stroke:none;" d="M186.505 87.037 C 182.415 87.344,173.998 88.440,173.252 88.762 C 172.985 88.877,172.274 89.020,171.672 89.079 C 170.442 89.200,168.636 89.622,167.903 89.959 C 167.635 90.082,167.033 90.234,166.565 90.296 C 165.612 90.422,163.779 90.882,163.040 91.179 C 162.772 91.287,162.061 91.507,161.459 91.668 C 160.857 91.829,160.036 92.098,159.635 92.265 C 159.234 92.432,158.249 92.769,157.447 93.014 C 156.644 93.259,155.884 93.550,155.757 93.660 C 155.630 93.770,155.327 93.860,155.085 93.860 C 154.842 93.860,154.454 93.965,154.222 94.093 C 153.400 94.545,150.479 95.805,150.253 95.805 C 150.016 95.805,149.771 95.915,148.328 96.665 C 147.860 96.908,147.313 97.182,147.112 97.273 C 146.912 97.364,146.365 97.637,145.897 97.881 C 145.429 98.124,144.881 98.397,144.681 98.488 C 144.480 98.579,143.933 98.853,143.465 99.096 C 142.997 99.340,142.395 99.646,142.128 99.777 C 141.860 99.908,141.477 100.108,141.277 100.222 C 141.076 100.336,140.748 100.499,140.547 100.585 C 140.347 100.670,139.854 100.978,139.453 101.269 C 139.052 101.560,138.213 102.041,137.590 102.338 C 136.967 102.636,136.396 103.039,136.321 103.233 C 136.247 103.428,136.030 103.587,135.841 103.587 C 135.550 103.587,132.653 105.358,132.280 105.764 C 132.213 105.837,131.983 106.006,131.768 106.140 C 130.923 106.668,127.533 109.285,127.457 109.470 C 127.412 109.577,127.268 109.666,127.135 109.666 C 126.540 109.666,121.820 113.892,117.087 118.663 C 112.078 123.712,111.261 124.586,110.692 125.504 C 110.412 125.954,109.794 126.699,109.317 127.160 C 108.840 127.621,108.450 128.132,108.450 128.295 C 108.450 128.458,108.365 128.628,108.262 128.673 C 107.951 128.807,105.015 132.816,104.785 133.420 C 104.667 133.729,104.457 133.982,104.317 133.982 C 104.177 133.982,103.932 134.283,103.773 134.650 C 103.614 135.018,103.234 135.628,102.927 136.006 C 102.621 136.385,102.371 136.812,102.371 136.956 C 102.371 137.100,102.086 137.592,101.737 138.049 C 101.389 138.506,100.664 139.720,100.128 140.747 C 99.591 141.774,98.966 142.888,98.738 143.222 C 98.356 143.783,96.170 148.220,95.444 149.909 C 95.271 150.310,94.844 151.251,94.495 152.000 C 94.146 152.749,93.860 153.542,93.860 153.763 C 93.860 153.984,93.764 154.164,93.645 154.164 C 93.527 154.164,93.374 154.410,93.305 154.711 C 93.161 155.340,92.710 156.616,92.240 157.727 C 92.061 158.148,91.915 158.661,91.915 158.867 C 91.915 159.073,91.805 159.309,91.672 159.392 C 91.538 159.475,91.429 159.797,91.429 160.108 C 91.429 160.419,91.265 160.987,91.065 161.370 C 90.866 161.753,90.701 162.252,90.701 162.478 C 90.700 162.704,90.590 162.957,90.456 163.040 C 90.322 163.122,90.213 163.493,90.213 163.864 C 90.213 164.235,90.138 164.614,90.046 164.706 C 89.824 164.927,89.029 167.996,89.011 168.696 C 89.003 168.999,88.893 169.437,88.765 169.669 C 88.508 170.137,88.048 172.415,87.871 174.103 C 87.808 174.705,87.662 175.416,87.548 175.684 C 87.266 176.343,86.617 181.044,86.457 183.587 C 86.385 184.723,86.222 186.529,86.094 187.599 C 85.788 190.163,85.798 198.120,86.112 201.337 C 86.249 202.742,86.453 205.040,86.565 206.444 C 86.838 209.853,87.280 212.835,87.557 213.119 C 87.680 213.246,87.781 213.924,87.781 214.627 C 87.781 215.329,87.883 216.156,88.007 216.463 C 88.131 216.770,88.415 217.897,88.639 218.967 C 89.146 221.396,89.699 223.457,89.990 224.009 C 90.112 224.241,90.213 224.584,90.213 224.771 C 90.213 225.098,90.801 227.195,91.176 228.207 C 91.698 229.617,91.977 230.450,92.089 230.942 C 92.158 231.243,92.311 231.489,92.430 231.489 C 92.548 231.489,92.648 231.681,92.652 231.915 C 92.663 232.514,93.402 234.579,94.046 235.813 C 94.345 236.385,94.590 236.997,94.590 237.173 C 94.590 237.553,99.750 247.882,100.233 248.468 C 100.417 248.692,100.726 249.204,100.919 249.605 C 101.375 250.552,103.155 253.229,103.398 253.333 C 103.502 253.378,103.587 253.532,103.587 253.675 C 103.587 253.819,103.860 254.295,104.195 254.733 C 104.529 255.171,104.802 255.620,104.802 255.731 C 104.802 255.842,105.076 256.227,105.410 256.588 C 105.745 256.948,106.018 257.310,106.018 257.393 C 106.018 257.475,106.443 258.054,106.961 258.680 C 107.480 259.306,107.945 259.938,107.995 260.085 C 108.100 260.395,109.505 262.079,112.158 265.073 C 113.195 266.243,114.043 267.295,114.043 267.411 C 114.043 267.745,120.539 273.957,123.266 276.231 C 124.629 277.368,126.093 278.604,126.519 278.979 C 126.946 279.354,127.842 280.020,128.511 280.459 C 129.179 280.898,129.877 281.439,130.060 281.662 C 130.244 281.885,130.495 282.067,130.618 282.067 C 130.741 282.067,131.137 282.340,131.497 282.675 C 131.858 283.009,132.244 283.283,132.354 283.283 C 132.465 283.283,132.914 283.556,133.352 283.891 C 133.791 284.225,134.226 284.498,134.319 284.498 C 134.413 284.498,134.784 284.772,135.145 285.106 C 135.505 285.441,135.930 285.714,136.088 285.714 C 136.247 285.714,136.685 285.967,137.063 286.275 C 137.441 286.584,138.407 287.157,139.210 287.549 C 140.012 287.942,140.731 288.348,140.807 288.452 C 140.956 288.655,143.088 289.799,145.653 291.053 C 146.523 291.477,147.753 292.091,148.387 292.417 C 149.022 292.743,149.689 293.009,149.871 293.009 C 150.052 293.009,150.716 293.283,151.344 293.617 C 151.973 293.951,152.637 294.225,152.820 294.225 C 153.002 294.225,153.696 294.498,154.362 294.833 C 155.028 295.167,155.775 295.444,156.023 295.448 C 156.271 295.453,156.687 295.617,156.946 295.813 C 157.206 296.010,157.664 296.170,157.965 296.170 C 158.266 296.170,158.580 296.280,158.663 296.413 C 158.745 296.547,159.071 296.657,159.387 296.657 C 159.702 296.657,160.270 296.812,160.649 297.003 C 161.028 297.193,161.830 297.478,162.432 297.635 C 163.033 297.791,163.701 298.009,163.916 298.119 C 164.130 298.229,164.815 298.395,165.438 298.488 C 166.062 298.581,166.631 298.755,166.704 298.873 C 166.777 298.991,167.247 299.088,167.747 299.088 C 168.247 299.088,168.760 299.188,168.888 299.310 C 169.134 299.547,171.496 300.017,173.495 300.226 C 174.164 300.297,174.824 300.446,174.962 300.558 C 175.276 300.813,179.239 301.297,182.614 301.493 C 184.018 301.575,185.314 301.736,185.493 301.851 C 185.918 302.126,319.779 302.047,320.112 301.772 C 320.251 301.657,320.693 301.526,321.094 301.480 C 322.760 301.292,322.787 301.067,322.873 286.565 C 322.964 271.258,322.943 270.923,321.795 269.775 L 320.956 268.936 296.233 268.936 L 271.510 268.936 272.533 267.894 C 273.096 267.320,273.556 266.764,273.556 266.659 C 273.556 266.553,273.967 266.041,274.468 265.521 C 276.001 263.931,276.569 263.271,277.490 262.006 C 277.977 261.337,278.659 260.525,279.005 260.201 C 279.352 259.877,279.635 259.516,279.635 259.400 C 279.635 259.284,279.743 259.057,279.874 258.896 C 280.892 257.645,282.796 254.907,282.796 254.694 C 282.796 254.550,283.070 254.174,283.404 253.860 C 283.739 253.546,284.012 253.157,284.012 252.997 C 284.012 252.836,284.174 252.570,284.371 252.406 C 284.568 252.242,285.001 251.535,285.332 250.835 C 285.663 250.135,286.092 249.431,286.284 249.272 C 286.701 248.925,292.175 237.982,292.411 237.021 C 292.502 236.653,292.673 236.353,292.792 236.353 C 292.912 236.353,293.009 236.163,293.009 235.931 C 293.009 235.698,293.268 234.960,293.584 234.289 C 293.901 233.619,294.348 232.468,294.578 231.733 C 294.808 230.997,295.081 230.176,295.185 229.909 C 295.289 229.641,295.563 228.821,295.793 228.085 C 296.023 227.350,296.300 226.529,296.408 226.261 C 296.792 225.308,297.386 223.159,297.386 222.722 C 297.386 222.478,297.495 222.210,297.629 222.128 C 297.763 222.045,297.872 221.614,297.872 221.170 C 297.872 220.727,298.036 219.971,298.237 219.490 C 298.438 219.010,298.602 218.183,298.602 217.651 C 298.602 217.120,298.711 216.618,298.845 216.535 C 298.979 216.452,299.088 215.892,299.088 215.289 C 299.088 214.686,299.214 213.957,299.369 213.668 C 299.640 213.162,299.843 211.804,300.306 207.416 C 300.425 206.280,300.632 204.584,300.766 203.647 C 301.081 201.438,301.071 187.027,300.754 185.289 C 300.619 184.553,300.424 182.967,300.320 181.763 C 300.025 178.368,299.580 175.255,299.349 174.970 C 299.233 174.828,299.081 174.164,299.011 173.495 C 298.801 171.496,298.331 169.134,298.094 168.888 C 297.972 168.760,297.872 168.419,297.872 168.128 C 297.872 167.838,297.613 166.793,297.296 165.806 C 296.980 164.819,296.530 163.218,296.297 162.247 C 296.064 161.276,295.776 160.422,295.657 160.348 C 295.538 160.275,295.441 159.998,295.441 159.734 C 295.441 159.470,295.167 158.715,294.833 158.055 C 294.498 157.395,294.225 156.639,294.225 156.375 C 294.225 156.111,294.116 155.827,293.982 155.745 C 293.848 155.662,293.739 155.426,293.739 155.220 C 293.739 154.869,293.251 153.605,292.746 152.648 C 292.623 152.415,292.523 152.095,292.523 151.936 C 292.523 151.552,288.208 142.818,287.558 141.888 C 287.016 141.111,286.718 140.587,285.811 138.817 C 285.494 138.200,285.070 137.557,284.867 137.389 C 284.664 137.221,284.498 136.970,284.498 136.832 C 284.498 136.694,284.225 136.222,283.891 135.784 C 283.556 135.346,283.283 134.896,283.283 134.786 C 283.283 134.675,283.009 134.290,282.675 133.929 C 282.340 133.569,282.067 133.173,282.067 133.050 C 282.067 132.926,281.884 132.675,281.661 132.492 C 281.437 132.308,280.949 131.679,280.576 131.092 C 280.203 130.506,279.565 129.661,279.159 129.214 C 278.752 128.768,278.419 128.332,278.419 128.246 C 278.419 128.160,277.872 127.459,277.204 126.687 C 276.535 125.915,275.988 125.162,275.988 125.013 C 275.988 124.639,262.904 111.611,262.528 111.611 C 262.361 111.611,261.628 111.087,260.900 110.448 C 258.576 108.407,255.317 106.018,254.859 106.018 C 254.733 106.018,254.594 105.933,254.549 105.830 C 254.432 105.557,251.480 103.587,251.188 103.587 C 251.053 103.587,250.942 103.487,250.942 103.365 C 250.942 103.243,250.473 102.917,249.900 102.639 C 249.327 102.362,248.505 101.874,248.073 101.556 C 247.642 101.238,244.911 99.807,242.003 98.377 C 239.096 96.947,236.408 95.619,236.029 95.426 C 235.650 95.234,235.189 95.076,235.004 95.076 C 234.819 95.076,234.178 94.802,233.579 94.468 C 232.980 94.134,232.287 93.860,232.038 93.860 C 231.790 93.860,231.483 93.773,231.356 93.667 C 231.229 93.561,230.468 93.274,229.666 93.031 C 228.863 92.787,227.988 92.500,227.720 92.394 C 227.453 92.287,226.632 92.011,225.897 91.781 C 225.161 91.551,224.340 91.274,224.073 91.166 C 223.551 90.956,221.617 90.497,220.426 90.300 C 220.024 90.234,219.477 90.084,219.210 89.967 C 218.504 89.659,216.463 89.208,215.198 89.081 C 214.596 89.021,213.884 88.875,213.617 88.757 C 212.989 88.480,210.310 88.051,207.538 87.784 C 206.334 87.667,204.474 87.457,203.404 87.315 C 200.840 86.976,189.743 86.793,186.505 87.037 M203.283 121.454 C 204.152 121.535,205.082 121.695,205.350 121.810 C 205.951 122.069,209.848 122.796,210.633 122.796 C 210.950 122.796,211.314 122.901,211.442 123.029 C 211.570 123.157,212.550 123.477,213.619 123.741 C 215.627 124.236,216.955 124.652,217.687 125.017 C 217.919 125.133,218.316 125.228,218.569 125.228 C 218.822 125.228,219.165 125.392,219.331 125.593 C 219.498 125.793,219.782 125.957,219.962 125.957 C 220.142 125.957,220.888 126.231,221.619 126.565 C 222.350 126.900,223.036 127.173,223.145 127.173 C 223.475 127.173,229.398 130.188,229.777 130.549 C 229.971 130.734,230.409 131.009,230.749 131.159 C 231.715 131.584,236.907 135.082,237.424 135.656 C 237.678 135.939,237.990 136.170,238.116 136.170 C 239.130 136.170,251.915 148.904,251.915 149.914 C 251.915 150.010,252.216 150.449,252.584 150.890 C 253.713 152.245,254.881 153.896,255.381 154.843 C 255.642 155.339,256.038 155.964,256.259 156.231 C 256.481 156.498,256.875 157.155,257.135 157.690 C 257.396 158.225,257.832 158.990,258.105 159.391 C 258.834 160.459,260.426 163.663,260.426 164.061 C 260.426 164.250,260.681 164.864,260.992 165.424 C 261.304 165.985,261.753 166.991,261.991 167.660 C 262.228 168.328,262.504 169.094,262.603 169.362 C 263.033 170.514,263.394 171.584,263.506 172.036 C 263.573 172.304,263.716 172.742,263.824 173.009 C 264.194 173.927,264.802 176.105,264.802 176.514 C 264.802 176.740,264.901 177.028,265.021 177.155 C 265.141 177.282,265.296 177.824,265.365 178.359 C 265.434 178.894,265.666 180.152,265.881 181.155 C 266.999 186.375,267.264 203.766,266.260 206.079 C 266.060 206.539,265.767 207.957,265.304 210.699 C 265.191 211.368,264.867 212.595,264.586 213.427 C 264.304 214.259,264.073 215.253,264.073 215.636 C 264.073 216.019,263.995 216.410,263.900 216.506 C 263.631 216.774,262.858 218.916,262.857 219.392 C 262.857 219.626,262.748 219.818,262.614 219.818 C 262.480 219.818,262.371 219.982,262.371 220.184 C 262.371 220.385,262.097 221.117,261.763 221.810 C 261.429 222.503,261.155 223.174,261.155 223.301 C 261.155 223.732,257.357 231.118,256.396 232.553 C 255.871 233.339,255.331 234.162,255.198 234.382 C 255.064 234.602,254.708 235.125,254.407 235.544 C 254.106 235.963,253.860 236.407,253.860 236.530 C 253.860 236.653,253.587 237.011,253.252 237.325 C 252.918 237.639,252.644 238.022,252.644 238.175 C 252.644 238.329,252.179 238.951,251.611 239.558 C 251.043 240.165,250.110 241.261,249.539 241.994 C 248.101 243.838,241.409 250.383,239.635 251.679 C 238.833 252.265,238.067 252.838,237.933 252.952 C 237.126 253.642,233.739 256.107,233.435 256.226 C 233.234 256.305,232.563 256.734,231.943 257.181 C 231.323 257.628,230.653 257.994,230.453 257.994 C 230.253 257.994,229.954 258.158,229.787 258.359 C 229.621 258.559,229.391 258.723,229.276 258.723 C 229.161 258.723,228.469 259.106,227.737 259.574 C 227.005 260.043,226.349 260.426,226.280 260.426 C 226.119 260.426,223.719 261.487,222.124 262.263 C 221.453 262.590,220.753 262.857,220.567 262.857 C 220.382 262.857,219.673 263.114,218.991 263.428 C 218.309 263.742,217.149 264.189,216.413 264.421 C 215.678 264.654,214.857 264.936,214.590 265.050 C 214.322 265.163,213.775 265.303,213.374 265.360 C 212.510 265.484,210.415 266.006,209.726 266.269 C 209.459 266.371,208.091 266.642,206.687 266.870 C 205.283 267.099,203.830 267.379,203.459 267.492 C 201.164 268.196,185.674 267.937,181.641 267.127 C 180.638 266.925,179.325 266.694,178.723 266.613 C 178.122 266.532,177.410 266.380,177.143 266.274 C 176.369 265.970,174.544 265.502,173.617 265.371 C 173.149 265.305,172.421 265.095,172.000 264.905 C 171.578 264.715,171.065 264.559,170.859 264.559 C 170.653 264.559,170.417 264.450,170.334 264.316 C 170.252 264.182,169.921 264.073,169.599 264.073 C 169.277 264.073,168.524 263.799,167.925 263.465 C 167.326 263.131,166.675 262.857,166.477 262.857 C 166.279 262.857,165.316 262.467,164.335 261.990 C 163.355 261.513,162.225 260.981,161.824 260.808 C 160.175 260.098,159.608 259.810,159.075 259.414 C 158.766 259.184,158.000 258.752,157.372 258.453 C 156.745 258.154,155.922 257.655,155.544 257.344 C 155.166 257.033,154.743 256.778,154.604 256.778 C 154.465 256.778,153.829 256.395,153.191 255.927 C 152.554 255.459,151.944 255.076,151.837 255.076 C 151.730 255.076,151.123 254.638,150.489 254.103 C 149.854 253.568,149.266 253.131,149.182 253.131 C 149.098 253.131,148.544 252.676,147.951 252.120 C 147.357 251.564,146.516 250.896,146.080 250.635 C 145.056 250.023,137.387 242.318,137.384 241.899 C 137.383 241.724,136.840 241.033,136.178 240.365 C 135.516 239.696,134.970 239.026,134.965 238.875 C 134.959 238.724,134.781 238.456,134.568 238.280 C 134.130 237.917,130.091 231.892,130.091 231.602 C 130.091 231.499,129.841 231.075,129.534 230.661 C 129.042 229.996,126.689 225.365,126.187 224.073 C 126.083 223.805,125.726 222.985,125.394 222.249 C 125.063 221.514,124.601 220.310,124.368 219.574 C 124.136 218.839,123.861 218.018,123.756 217.751 C 123.652 217.483,123.380 216.663,123.152 215.927 C 122.924 215.191,122.641 214.400,122.524 214.167 C 122.406 213.935,122.309 213.443,122.309 213.073 C 122.308 212.704,122.144 212.088,121.944 211.705 C 121.744 211.322,121.581 210.644,121.581 210.199 C 121.581 209.754,121.471 209.323,121.337 209.240 C 121.204 209.157,121.094 208.553,121.094 207.897 C 121.094 207.241,120.940 206.235,120.752 205.662 C 120.045 203.509,119.764 190.970,120.321 186.383 C 120.756 182.794,121.125 180.573,121.359 180.125 C 121.481 179.893,121.581 179.325,121.581 178.863 C 121.581 178.401,121.680 177.961,121.803 177.885 C 121.925 177.810,122.100 177.284,122.193 176.716 C 122.482 174.942,123.519 171.354,123.834 171.039 C 123.932 170.941,124.012 170.622,124.012 170.330 C 124.012 170.038,124.286 169.284,124.620 168.656 C 124.954 168.027,125.228 167.364,125.228 167.182 C 125.228 166.823,130.078 157.037,130.355 156.839 C 130.448 156.772,130.759 156.265,131.047 155.713 C 131.334 155.161,131.783 154.515,132.046 154.277 C 132.308 154.040,132.523 153.722,132.523 153.571 C 132.523 153.420,132.735 153.027,132.995 152.697 C 133.998 151.422,135.579 149.323,135.927 148.803 C 136.929 147.306,144.689 139.351,146.353 138.116 C 146.803 137.781,147.346 137.316,147.561 137.082 C 147.775 136.848,148.068 136.657,148.213 136.657 C 148.358 136.657,148.847 136.274,149.301 135.805 C 149.755 135.337,150.241 134.954,150.382 134.954 C 150.523 134.954,150.967 134.683,151.368 134.351 C 152.561 133.365,153.270 132.890,154.066 132.543 C 154.346 132.420,154.729 132.170,154.917 131.987 C 155.105 131.803,155.970 131.286,156.839 130.839 C 157.708 130.391,158.474 129.958,158.541 129.876 C 158.724 129.651,159.533 129.179,160.486 128.740 C 160.954 128.525,161.502 128.251,161.702 128.132 C 162.374 127.734,163.515 127.236,164.742 126.806 C 165.410 126.572,166.061 126.285,166.188 126.169 C 166.316 126.052,166.589 125.957,166.796 125.956 C 167.004 125.956,167.712 125.682,168.369 125.349 C 169.027 125.015,169.793 124.738,170.072 124.734 C 170.350 124.730,170.790 124.566,171.050 124.369 C 171.309 124.173,171.916 124.012,172.399 124.012 C 172.882 124.012,173.381 123.925,173.508 123.819 C 173.916 123.477,176.349 122.825,178.723 122.420 C 179.994 122.203,181.285 121.926,181.592 121.803 C 181.899 121.681,182.720 121.570,183.416 121.556 C 184.112 121.543,184.954 121.442,185.289 121.331 C 185.947 121.114,200.695 121.215,203.283 121.454 " stroke="none" fill="#040404" fill-rule="evenodd"/></svg>
<svg height="135" width="135" viewBox="0 0 1000 1000" class="small-circle svg"><path xmlns="http://www.w3.org/2000/svg" style="fill:#ededed; stroke:none;" d="M456 954L455.999 938C455.986 936.008 456.301 933.282 454.972 931.603C453.594 929.862 450.977 930.062 448.999 929.835C443.991 929.258 438.987 928.463 434 927.728C414.788 924.898 395.564 920.733 377 915.025C300.826 891.602 231.835 849.314 178.17 790C106.263 710.526 63.7248 603.522 65.0039 496C65.7806 430.71 81.6532 365.691 110.259 307C130.156 266.177 157.727 228.746 189.039 196C222.33 161.185 262.986 132.26 306 110.753C345.737 90.8846 389.756 75.6209 434 70L434 48C417.656 48.1353 400.764 53.1855 385 57.1265C338.501 68.7513 294.622 88.2739 254 113.576C215.656 137.46 181.298 167.82 151.87 202C33.2034 339.827 7.62905 544.971 91.2585 707C112.853 748.839 140.699 787.699 174 821C210.688 857.688 253.047 888.542 300 910.781C332.493 926.171 365.923 937.713 401 945.65C418.745 949.666 437.768 953.624 456 954z"/></svg>
<svg height="180" width="180" viewBox="0 0 1000 1000" class="big-circle svg"><path xmlns="http://www.w3.org/2000/svg" style="fill:#ededed; stroke:none;" d="M454 952L454 887C441.324 886.456 428.346 883.444 416 880.65C389.799 874.722 364.497 866.349 340 855.306C205.92 794.861 116.45 660.408 110.039 514C108.593 480.976 112.302 447.246 119.424 415C144.931 299.518 226.1 198.275 333 147.781C389.157 121.255 450.99 108.496 513 110.015C612.241 112.446 711.495 157.399 779.961 229C839.544 291.312 879.215 372.892 887.831 459C893.323 513.894 887.624 569.466 870.329 622C836.537 724.647 758.42 810.937 660 855.306C635.503 866.349 610.201 874.722 584 880.65C571.383 883.505 557.974 886.732 545 887L545 952C562.916 951.63 581.566 947.595 599 943.65C637.149 935.018 673.043 921.725 708 904.247C753.184 881.655 792.42 850.594 828 815C859.416 783.572 885.414 745.666 905.247 706C933.723 649.048 949.566 588.445 953.911 525C963.014 392.066 906.622 254.399 808 165.17C769.47 130.31 725.8 101.975 678 81.5787C629.733 60.9833 575.64 47.3041 523 46.0146C469.032 44.6927 415.748 49.9443 364 66.0255C223.375 109.726 109.726 223.376 66.0255 364C14.4181 530.066 63.7205 715.347 191 833.911C229.196 869.491 274.051 897.962 322 918.421C362.806 935.833 409.371 950.084 454 952z"/></svg>
<svg height="220" width="220" viewBox="0 0 1000 1000" class="outer-circle svg"><path xmlns="http://www.w3.org/2000/svg" style="fill:#ededed; stroke:none;" d="M456 954L456 946C438.715 945.258 420.843 941.462 404 937.65C369.403 929.822 335.739 918.116 304 902.247C255.981 878.237 211.768 846.374 175.09 807C62.5744 686.214 23.1598 509.033 78.6921 353C96.4653 303.062 122.84 256.974 156.424 216C207.709 153.43 278.099 103.658 355 78C372.453 72.1767 389.992 67.0399 408 63.2107C413.31 62.0816 418.647 60.9853 424 60.0811C426.508 59.6575 430.352 59.6852 432.397 57.9869C434.897 55.9098 434 50.8766 434 48C417.656 48.1353 400.764 53.1855 385 57.1265C338.517 68.7473 294.608 88.2827 254 113.576C215.673 137.45 181.285 167.835 151.87 202C33.9725 338.933 8.37009 541.243 89.2485 703C110.949 746.4 139.693 786.693 174 821C210.688 857.688 253.047 888.542 300 910.781C332.484 926.167 365.934 937.716 401 945.65C418.745 949.666 437.768 953.624 456 954z"/></svg>
<div style="position: absolute;bottom: 0;right: 0;padding: 10px;color: #4f4f4f;text-anchor: middle;font-size: 20px;">v${chrome.runtime.getManifest().version}</div></div>`
);
var html = document.getElementsByTagName("html")[0];
html.append(loadinghtml.firstChild);
}
function AppendLoadingSymbol(givenID, position) {
loadingsymbol = stringToHTML(`
<div id="${givenID}">
<svg height="120" width="120" viewBox="0 0 400 400" class="logo svg"><path xmlns="http://www.w3.org/2000/svg" id="path0" style="fill:var(--text-primary); stroke:none;" d="M186.505 87.037 C 182.415 87.344,173.998 88.440,173.252 88.762 C 172.985 88.877,172.274 89.020,171.672 89.079 C 170.442 89.200,168.636 89.622,167.903 89.959 C 167.635 90.082,167.033 90.234,166.565 90.296 C 165.612 90.422,163.779 90.882,163.040 91.179 C 162.772 91.287,162.061 91.507,161.459 91.668 C 160.857 91.829,160.036 92.098,159.635 92.265 C 159.234 92.432,158.249 92.769,157.447 93.014 C 156.644 93.259,155.884 93.550,155.757 93.660 C 155.630 93.770,155.327 93.860,155.085 93.860 C 154.842 93.860,154.454 93.965,154.222 94.093 C 153.400 94.545,150.479 95.805,150.253 95.805 C 150.016 95.805,149.771 95.915,148.328 96.665 C 147.860 96.908,147.313 97.182,147.112 97.273 C 146.912 97.364,146.365 97.637,145.897 97.881 C 145.429 98.124,144.881 98.397,144.681 98.488 C 144.480 98.579,143.933 98.853,143.465 99.096 C 142.997 99.340,142.395 99.646,142.128 99.777 C 141.860 99.908,141.477 100.108,141.277 100.222 C 141.076 100.336,140.748 100.499,140.547 100.585 C 140.347 100.670,139.854 100.978,139.453 101.269 C 139.052 101.560,138.213 102.041,137.590 102.338 C 136.967 102.636,136.396 103.039,136.321 103.233 C 136.247 103.428,136.030 103.587,135.841 103.587 C 135.550 103.587,132.653 105.358,132.280 105.764 C 132.213 105.837,131.983 106.006,131.768 106.140 C 130.923 106.668,127.533 109.285,127.457 109.470 C 127.412 109.577,127.268 109.666,127.135 109.666 C 126.540 109.666,121.820 113.892,117.087 118.663 C 112.078 123.712,111.261 124.586,110.692 125.504 C 110.412 125.954,109.794 126.699,109.317 127.160 C 108.840 127.621,108.450 128.132,108.450 128.295 C 108.450 128.458,108.365 128.628,108.262 128.673 C 107.951 128.807,105.015 132.816,104.785 133.420 C 104.667 133.729,104.457 133.982,104.317 133.982 C 104.177 133.982,103.932 134.283,103.773 134.650 C 103.614 135.018,103.234 135.628,102.927 136.006 C 102.621 136.385,102.371 136.812,102.371 136.956 C 102.371 137.100,102.086 137.592,101.737 138.049 C 101.389 138.506,100.664 139.720,100.128 140.747 C 99.591 141.774,98.966 142.888,98.738 143.222 C 98.356 143.783,96.170 148.220,95.444 149.909 C 95.271 150.310,94.844 151.251,94.495 152.000 C 94.146 152.749,93.860 153.542,93.860 153.763 C 93.860 153.984,93.764 154.164,93.645 154.164 C 93.527 154.164,93.374 154.410,93.305 154.711 C 93.161 155.340,92.710 156.616,92.240 157.727 C 92.061 158.148,91.915 158.661,91.915 158.867 C 91.915 159.073,91.805 159.309,91.672 159.392 C 91.538 159.475,91.429 159.797,91.429 160.108 C 91.429 160.419,91.265 160.987,91.065 161.370 C 90.866 161.753,90.701 162.252,90.701 162.478 C 90.700 162.704,90.590 162.957,90.456 163.040 C 90.322 163.122,90.213 163.493,90.213 163.864 C 90.213 164.235,90.138 164.614,90.046 164.706 C 89.824 164.927,89.029 167.996,89.011 168.696 C 89.003 168.999,88.893 169.437,88.765 169.669 C 88.508 170.137,88.048 172.415,87.871 174.103 C 87.808 174.705,87.662 175.416,87.548 175.684 C 87.266 176.343,86.617 181.044,86.457 183.587 C 86.385 184.723,86.222 186.529,86.094 187.599 C 85.788 190.163,85.798 198.120,86.112 201.337 C 86.249 202.742,86.453 205.040,86.565 206.444 C 86.838 209.853,87.280 212.835,87.557 213.119 C 87.680 213.246,87.781 213.924,87.781 214.627 C 87.781 215.329,87.883 216.156,88.007 216.463 C 88.131 216.770,88.415 217.897,88.639 218.967 C 89.146 221.396,89.699 223.457,89.990 224.009 C 90.112 224.241,90.213 224.584,90.213 224.771 C 90.213 225.098,90.801 227.195,91.176 228.207 C 91.698 229.617,91.977 230.450,92.089 230.942 C 92.158 231.243,92.311 231.489,92.430 231.489 C 92.548 231.489,92.648 231.681,92.652 231.915 C 92.663 232.514,93.402 234.579,94.046 235.813 C 94.345 236.385,94.590 236.997,94.590 237.173 C 94.590 237.553,99.750 247.882,100.233 248.468 C 100.417 248.692,100.726 249.204,100.919 249.605 C 101.375 250.552,103.155 253.229,103.398 253.333 C 103.502 253.378,103.587 253.532,103.587 253.675 C 103.587 253.819,103.860 254.295,104.195 254.733 C 104.529 255.171,104.802 255.620,104.802 255.731 C 104.802 255.842,105.076 256.227,105.410 256.588 C 105.745 256.948,106.018 257.310,106.018 257.393 C 106.018 257.475,106.443 258.054,106.961 258.680 C 107.480 259.306,107.945 259.938,107.995 260.085 C 108.100 260.395,109.505 262.079,112.158 265.073 C 113.195 266.243,114.043 267.295,114.043 267.411 C 114.043 267.745,120.539 273.957,123.266 276.231 C 124.629 277.368,126.093 278.604,126.519 278.979 C 126.946 279.354,127.842 280.020,128.511 280.459 C 129.179 280.898,129.877 281.439,130.060 281.662 C 130.244 281.885,130.495 282.067,130.618 282.067 C 130.741 282.067,131.137 282.340,131.497 282.675 C 131.858 283.009,132.244 283.283,132.354 283.283 C 132.465 283.283,132.914 283.556,133.352 283.891 C 133.791 284.225,134.226 284.498,134.319 284.498 C 134.413 284.498,134.784 284.772,135.145 285.106 C 135.505 285.441,135.930 285.714,136.088 285.714 C 136.247 285.714,136.685 285.967,137.063 286.275 C 137.441 286.584,138.407 287.157,139.210 287.549 C 140.012 287.942,140.731 288.348,140.807 288.452 C 140.956 288.655,143.088 289.799,145.653 291.053 C 146.523 291.477,147.753 292.091,148.387 292.417 C 149.022 292.743,149.689 293.009,149.871 293.009 C 150.052 293.009,150.716 293.283,151.344 293.617 C 151.973 293.951,152.637 294.225,152.820 294.225 C 153.002 294.225,153.696 294.498,154.362 294.833 C 155.028 295.167,155.775 295.444,156.023 295.448 C 156.271 295.453,156.687 295.617,156.946 295.813 C 157.206 296.010,157.664 296.170,157.965 296.170 C 158.266 296.170,158.580 296.280,158.663 296.413 C 158.745 296.547,159.071 296.657,159.387 296.657 C 159.702 296.657,160.270 296.812,160.649 297.003 C 161.028 297.193,161.830 297.478,162.432 297.635 C 163.033 297.791,163.701 298.009,163.916 298.119 C 164.130 298.229,164.815 298.395,165.438 298.488 C 166.062 298.581,166.631 298.755,166.704 298.873 C 166.777 298.991,167.247 299.088,167.747 299.088 C 168.247 299.088,168.760 299.188,168.888 299.310 C 169.134 299.547,171.496 300.017,173.495 300.226 C 174.164 300.297,174.824 300.446,174.962 300.558 C 175.276 300.813,179.239 301.297,182.614 301.493 C 184.018 301.575,185.314 301.736,185.493 301.851 C 185.918 302.126,319.779 302.047,320.112 301.772 C 320.251 301.657,320.693 301.526,321.094 301.480 C 322.760 301.292,322.787 301.067,322.873 286.565 C 322.964 271.258,322.943 270.923,321.795 269.775 L 320.956 268.936 296.233 268.936 L 271.510 268.936 272.533 267.894 C 273.096 267.320,273.556 266.764,273.556 266.659 C 273.556 266.553,273.967 266.041,274.468 265.521 C 276.001 263.931,276.569 263.271,277.490 262.006 C 277.977 261.337,278.659 260.525,279.005 260.201 C 279.352 259.877,279.635 259.516,279.635 259.400 C 279.635 259.284,279.743 259.057,279.874 258.896 C 280.892 257.645,282.796 254.907,282.796 254.694 C 282.796 254.550,283.070 254.174,283.404 253.860 C 283.739 253.546,284.012 253.157,284.012 252.997 C 284.012 252.836,284.174 252.570,284.371 252.406 C 284.568 252.242,285.001 251.535,285.332 250.835 C 285.663 250.135,286.092 249.431,286.284 249.272 C 286.701 248.925,292.175 237.982,292.411 237.021 C 292.502 236.653,292.673 236.353,292.792 236.353 C 292.912 236.353,293.009 236.163,293.009 235.931 C 293.009 235.698,293.268 234.960,293.584 234.289 C 293.901 233.619,294.348 232.468,294.578 231.733 C 294.808 230.997,295.081 230.176,295.185 229.909 C 295.289 229.641,295.563 228.821,295.793 228.085 C 296.023 227.350,296.300 226.529,296.408 226.261 C 296.792 225.308,297.386 223.159,297.386 222.722 C 297.386 222.478,297.495 222.210,297.629 222.128 C 297.763 222.045,297.872 221.614,297.872 221.170 C 297.872 220.727,298.036 219.971,298.237 219.490 C 298.438 219.010,298.602 218.183,298.602 217.651 C 298.602 217.120,298.711 216.618,298.845 216.535 C 298.979 216.452,299.088 215.892,299.088 215.289 C 299.088 214.686,299.214 213.957,299.369 213.668 C 299.640 213.162,299.843 211.804,300.306 207.416 C 300.425 206.280,300.632 204.584,300.766 203.647 C 301.081 201.438,301.071 187.027,300.754 185.289 C 300.619 184.553,300.424 182.967,300.320 181.763 C 300.025 178.368,299.580 175.255,299.349 174.970 C 299.233 174.828,299.081 174.164,299.011 173.495 C 298.801 171.496,298.331 169.134,298.094 168.888 C 297.972 168.760,297.872 168.419,297.872 168.128 C 297.872 167.838,297.613 166.793,297.296 165.806 C 296.980 164.819,296.530 163.218,296.297 162.247 C 296.064 161.276,295.776 160.422,295.657 160.348 C 295.538 160.275,295.441 159.998,295.441 159.734 C 295.441 159.470,295.167 158.715,294.833 158.055 C 294.498 157.395,294.225 156.639,294.225 156.375 C 294.225 156.111,294.116 155.827,293.982 155.745 C 293.848 155.662,293.739 155.426,293.739 155.220 C 293.739 154.869,293.251 153.605,292.746 152.648 C 292.623 152.415,292.523 152.095,292.523 151.936 C 292.523 151.552,288.208 142.818,287.558 141.888 C 287.016 141.111,286.718 140.587,285.811 138.817 C 285.494 138.200,285.070 137.557,284.867 137.389 C 284.664 137.221,284.498 136.970,284.498 136.832 C 284.498 136.694,284.225 136.222,283.891 135.784 C 283.556 135.346,283.283 134.896,283.283 134.786 C 283.283 134.675,283.009 134.290,282.675 133.929 C 282.340 133.569,282.067 133.173,282.067 133.050 C 282.067 132.926,281.884 132.675,281.661 132.492 C 281.437 132.308,280.949 131.679,280.576 131.092 C 280.203 130.506,279.565 129.661,279.159 129.214 C 278.752 128.768,278.419 128.332,278.419 128.246 C 278.419 128.160,277.872 127.459,277.204 126.687 C 276.535 125.915,275.988 125.162,275.988 125.013 C 275.988 124.639,262.904 111.611,262.528 111.611 C 262.361 111.611,261.628 111.087,260.900 110.448 C 258.576 108.407,255.317 106.018,254.859 106.018 C 254.733 106.018,254.594 105.933,254.549 105.830 C 254.432 105.557,251.480 103.587,251.188 103.587 C 251.053 103.587,250.942 103.487,250.942 103.365 C 250.942 103.243,250.473 102.917,249.900 102.639 C 249.327 102.362,248.505 101.874,248.073 101.556 C 247.642 101.238,244.911 99.807,242.003 98.377 C 239.096 96.947,236.408 95.619,236.029 95.426 C 235.650 95.234,235.189 95.076,235.004 95.076 C 234.819 95.076,234.178 94.802,233.579 94.468 C 232.980 94.134,232.287 93.860,232.038 93.860 C 231.790 93.860,231.483 93.773,231.356 93.667 C 231.229 93.561,230.468 93.274,229.666 93.031 C 228.863 92.787,227.988 92.500,227.720 92.394 C 227.453 92.287,226.632 92.011,225.897 91.781 C 225.161 91.551,224.340 91.274,224.073 91.166 C 223.551 90.956,221.617 90.497,220.426 90.300 C 220.024 90.234,219.477 90.084,219.210 89.967 C 218.504 89.659,216.463 89.208,215.198 89.081 C 214.596 89.021,213.884 88.875,213.617 88.757 C 212.989 88.480,210.310 88.051,207.538 87.784 C 206.334 87.667,204.474 87.457,203.404 87.315 C 200.840 86.976,189.743 86.793,186.505 87.037 M203.283 121.454 C 204.152 121.535,205.082 121.695,205.350 121.810 C 205.951 122.069,209.848 122.796,210.633 122.796 C 210.950 122.796,211.314 122.901,211.442 123.029 C 211.570 123.157,212.550 123.477,213.619 123.741 C 215.627 124.236,216.955 124.652,217.687 125.017 C 217.919 125.133,218.316 125.228,218.569 125.228 C 218.822 125.228,219.165 125.392,219.331 125.593 C 219.498 125.793,219.782 125.957,219.962 125.957 C 220.142 125.957,220.888 126.231,221.619 126.565 C 222.350 126.900,223.036 127.173,223.145 127.173 C 223.475 127.173,229.398 130.188,229.777 130.549 C 229.971 130.734,230.409 131.009,230.749 131.159 C 231.715 131.584,236.907 135.082,237.424 135.656 C 237.678 135.939,237.990 136.170,238.116 136.170 C 239.130 136.170,251.915 148.904,251.915 149.914 C 251.915 150.010,252.216 150.449,252.584 150.890 C 253.713 152.245,254.881 153.896,255.381 154.843 C 255.642 155.339,256.038 155.964,256.259 156.231 C 256.481 156.498,256.875 157.155,257.135 157.690 C 257.396 158.225,257.832 158.990,258.105 159.391 C 258.834 160.459,260.426 163.663,260.426 164.061 C 260.426 164.250,260.681 164.864,260.992 165.424 C 261.304 165.985,261.753 166.991,261.991 167.660 C 262.228 168.328,262.504 169.094,262.603 169.362 C 263.033 170.514,263.394 171.584,263.506 172.036 C 263.573 172.304,263.716 172.742,263.824 173.009 C 264.194 173.927,264.802 176.105,264.802 176.514 C 264.802 176.740,264.901 177.028,265.021 177.155 C 265.141 177.282,265.296 177.824,265.365 178.359 C 265.434 178.894,265.666 180.152,265.881 181.155 C 266.999 186.375,267.264 203.766,266.260 206.079 C 266.060 206.539,265.767 207.957,265.304 210.699 C 265.191 211.368,264.867 212.595,264.586 213.427 C 264.304 214.259,264.073 215.253,264.073 215.636 C 264.073 216.019,263.995 216.410,263.900 216.506 C 263.631 216.774,262.858 218.916,262.857 219.392 C 262.857 219.626,262.748 219.818,262.614 219.818 C 262.480 219.818,262.371 219.982,262.371 220.184 C 262.371 220.385,262.097 221.117,261.763 221.810 C 261.429 222.503,261.155 223.174,261.155 223.301 C 261.155 223.732,257.357 231.118,256.396 232.553 C 255.871 233.339,255.331 234.162,255.198 234.382 C 255.064 234.602,254.708 235.125,254.407 235.544 C 254.106 235.963,253.860 236.407,253.860 236.530 C 253.860 236.653,253.587 237.011,253.252 237.325 C 252.918 237.639,252.644 238.022,252.644 238.175 C 252.644 238.329,252.179 238.951,251.611 239.558 C 251.043 240.165,250.110 241.261,249.539 241.994 C 248.101 243.838,241.409 250.383,239.635 251.679 C 238.833 252.265,238.067 252.838,237.933 252.952 C 237.126 253.642,233.739 256.107,233.435 256.226 C 233.234 256.305,232.563 256.734,231.943 257.181 C 231.323 257.628,230.653 257.994,230.453 257.994 C 230.253 257.994,229.954 258.158,229.787 258.359 C 229.621 258.559,229.391 258.723,229.276 258.723 C 229.161 258.723,228.469 259.106,227.737 259.574 C 227.005 260.043,226.349 260.426,226.280 260.426 C 226.119 260.426,223.719 261.487,222.124 262.263 C 221.453 262.590,220.753 262.857,220.567 262.857 C 220.382 262.857,219.673 263.114,218.991 263.428 C 218.309 263.742,217.149 264.189,216.413 264.421 C 215.678 264.654,214.857 264.936,214.590 265.050 C 214.322 265.163,213.775 265.303,213.374 265.360 C 212.510 265.484,210.415 266.006,209.726 266.269 C 209.459 266.371,208.091 266.642,206.687 266.870 C 205.283 267.099,203.830 267.379,203.459 267.492 C 201.164 268.196,185.674 267.937,181.641 267.127 C 180.638 266.925,179.325 266.694,178.723 266.613 C 178.122 266.532,177.410 266.380,177.143 266.274 C 176.369 265.970,174.544 265.502,173.617 265.371 C 173.149 265.305,172.421 265.095,172.000 264.905 C 171.578 264.715,171.065 264.559,170.859 264.559 C 170.653 264.559,170.417 264.450,170.334 264.316 C 170.252 264.182,169.921 264.073,169.599 264.073 C 169.277 264.073,168.524 263.799,167.925 263.465 C 167.326 263.131,166.675 262.857,166.477 262.857 C 166.279 262.857,165.316 262.467,164.335 261.990 C 163.355 261.513,162.225 260.981,161.824 260.808 C 160.175 260.098,159.608 259.810,159.075 259.414 C 158.766 259.184,158.000 258.752,157.372 258.453 C 156.745 258.154,155.922 257.655,155.544 257.344 C 155.166 257.033,154.743 256.778,154.604 256.778 C 154.465 256.778,153.829 256.395,153.191 255.927 C 152.554 255.459,151.944 255.076,151.837 255.076 C 151.730 255.076,151.123 254.638,150.489 254.103 C 149.854 253.568,149.266 253.131,149.182 253.131 C 149.098 253.131,148.544 252.676,147.951 252.120 C 147.357 251.564,146.516 250.896,146.080 250.635 C 145.056 250.023,137.387 242.318,137.384 241.899 C 137.383 241.724,136.840 241.033,136.178 240.365 C 135.516 239.696,134.970 239.026,134.965 238.875 C 134.959 238.724,134.781 238.456,134.568 238.280 C 134.130 237.917,130.091 231.892,130.091 231.602 C 130.091 231.499,129.841 231.075,129.534 230.661 C 129.042 229.996,126.689 225.365,126.187 224.073 C 126.083 223.805,125.726 222.985,125.394 222.249 C 125.063 221.514,124.601 220.310,124.368 219.574 C 124.136 218.839,123.861 218.018,123.756 217.751 C 123.652 217.483,123.380 216.663,123.152 215.927 C 122.924 215.191,122.641 214.400,122.524 214.167 C 122.406 213.935,122.309 213.443,122.309 213.073 C 122.308 212.704,122.144 212.088,121.944 211.705 C 121.744 211.322,121.581 210.644,121.581 210.199 C 121.581 209.754,121.471 209.323,121.337 209.240 C 121.204 209.157,121.094 208.553,121.094 207.897 C 121.094 207.241,120.940 206.235,120.752 205.662 C 120.045 203.509,119.764 190.970,120.321 186.383 C 120.756 182.794,121.125 180.573,121.359 180.125 C 121.481 179.893,121.581 179.325,121.581 178.863 C 121.581 178.401,121.680 177.961,121.803 177.885 C 121.925 177.810,122.100 177.284,122.193 176.716 C 122.482 174.942,123.519 171.354,123.834 171.039 C 123.932 170.941,124.012 170.622,124.012 170.330 C 124.012 170.038,124.286 169.284,124.620 168.656 C 124.954 168.027,125.228 167.364,125.228 167.182 C 125.228 166.823,130.078 157.037,130.355 156.839 C 130.448 156.772,130.759 156.265,131.047 155.713 C 131.334 155.161,131.783 154.515,132.046 154.277 C 132.308 154.040,132.523 153.722,132.523 153.571 C 132.523 153.420,132.735 153.027,132.995 152.697 C 133.998 151.422,135.579 149.323,135.927 148.803 C 136.929 147.306,144.689 139.351,146.353 138.116 C 146.803 137.781,147.346 137.316,147.561 137.082 C 147.775 136.848,148.068 136.657,148.213 136.657 C 148.358 136.657,148.847 136.274,149.301 135.805 C 149.755 135.337,150.241 134.954,150.382 134.954 C 150.523 134.954,150.967 134.683,151.368 134.351 C 152.561 133.365,153.270 132.890,154.066 132.543 C 154.346 132.420,154.729 132.170,154.917 131.987 C 155.105 131.803,155.970 131.286,156.839 130.839 C 157.708 130.391,158.474 129.958,158.541 129.876 C 158.724 129.651,159.533 129.179,160.486 128.740 C 160.954 128.525,161.502 128.251,161.702 128.132 C 162.374 127.734,163.515 127.236,164.742 126.806 C 165.410 126.572,166.061 126.285,166.188 126.169 C 166.316 126.052,166.589 125.957,166.796 125.956 C 167.004 125.956,167.712 125.682,168.369 125.349 C 169.027 125.015,169.793 124.738,170.072 124.734 C 170.350 124.730,170.790 124.566,171.050 124.369 C 171.309 124.173,171.916 124.012,172.399 124.012 C 172.882 124.012,173.381 123.925,173.508 123.819 C 173.916 123.477,176.349 122.825,178.723 122.420 C 179.994 122.203,181.285 121.926,181.592 121.803 C 181.899 121.681,182.720 121.570,183.416 121.556 C 184.112 121.543,184.954 121.442,185.289 121.331 C 185.947 121.114,200.695 121.215,203.283 121.454 " stroke="none" fill="#040404" fill-rule="evenodd"/></svg>
<svg height="135" width="135" viewBox="0 0 1000 1000" class="small-circle svg"><path xmlns="http://www.w3.org/2000/svg" style="fill:var(--text-primary); stroke:none;" d="M456 954L455.999 938C455.986 936.008 456.301 933.282 454.972 931.603C453.594 929.862 450.977 930.062 448.999 929.835C443.991 929.258 438.987 928.463 434 927.728C414.788 924.898 395.564 920.733 377 915.025C300.826 891.602 231.835 849.314 178.17 790C106.263 710.526 63.7248 603.522 65.0039 496C65.7806 430.71 81.6532 365.691 110.259 307C130.156 266.177 157.727 228.746 189.039 196C222.33 161.185 262.986 132.26 306 110.753C345.737 90.8846 389.756 75.6209 434 70L434 48C417.656 48.1353 400.764 53.1855 385 57.1265C338.501 68.7513 294.622 88.2739 254 113.576C215.656 137.46 181.298 167.82 151.87 202C33.2034 339.827 7.62905 544.971 91.2585 707C112.853 748.839 140.699 787.699 174 821C210.688 857.688 253.047 888.542 300 910.781C332.493 926.171 365.923 937.713 401 945.65C418.745 949.666 437.768 953.624 456 954z"/></svg>
<svg height="180" width="180" viewBox="0 0 1000 1000" class="big-circle svg"><path xmlns="http://www.w3.org/2000/svg" style="fill:var(--text-primary); stroke:none;" d="M454 952L454 887C441.324 886.456 428.346 883.444 416 880.65C389.799 874.722 364.497 866.349 340 855.306C205.92 794.861 116.45 660.408 110.039 514C108.593 480.976 112.302 447.246 119.424 415C144.931 299.518 226.1 198.275 333 147.781C389.157 121.255 450.99 108.496 513 110.015C612.241 112.446 711.495 157.399 779.961 229C839.544 291.312 879.215 372.892 887.831 459C893.323 513.894 887.624 569.466 870.329 622C836.537 724.647 758.42 810.937 660 855.306C635.503 866.349 610.201 874.722 584 880.65C571.383 883.505 557.974 886.732 545 887L545 952C562.916 951.63 581.566 947.595 599 943.65C637.149 935.018 673.043 921.725 708 904.247C753.184 881.655 792.42 850.594 828 815C859.416 783.572 885.414 745.666 905.247 706C933.723 649.048 949.566 588.445 953.911 525C963.014 392.066 906.622 254.399 808 165.17C769.47 130.31 725.8 101.975 678 81.5787C629.733 60.9833 575.64 47.3041 523 46.0146C469.032 44.6927 415.748 49.9443 364 66.0255C223.375 109.726 109.726 223.376 66.0255 364C14.4181 530.066 63.7205 715.347 191 833.911C229.196 869.491 274.051 897.962 322 918.421C362.806 935.833 409.371 950.084 454 952z"/></svg>
<svg height="220" width="220" viewBox="0 0 1000 1000" class="outer-circle svg"><path xmlns="http://www.w3.org/2000/svg" style="fill:var(--text-primary); stroke:none;" d="M456 954L456 946C438.715 945.258 420.843 941.462 404 937.65C369.403 929.822 335.739 918.116 304 902.247C255.981 878.237 211.768 846.374 175.09 807C62.5744 686.214 23.1598 509.033 78.6921 353C96.4653 303.062 122.84 256.974 156.424 216C207.709 153.43 278.099 103.658 355 78C372.453 72.1767 389.992 67.0399 408 63.2107C413.31 62.0816 418.647 60.9853 424 60.0811C426.508 59.6575 430.352 59.6852 432.397 57.9869C434.897 55.9098 434 50.8766 434 48C417.656 48.1353 400.764 53.1855 385 57.1265C338.517 68.7473 294.608 88.2827 254 113.576C215.673 137.45 181.285 167.835 151.87 202C33.9725 338.933 8.37009 541.243 89.2485 703C110.949 746.4 139.693 786.693 174 821C210.688 857.688 253.047 888.542 300 910.781C332.484 926.167 365.934 937.716 401 945.65C418.745 949.666 437.768 953.624 456 954z"/></svg>
</div>`).firstChild
document.querySelector(position).appendChild(loadingsymbol)
}
function delay(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
function SetDisplayNone(ElementName) {
return `li[data-key=${ElementName}]{display:var(--menuHidden) !important; transition: 1s;}`;
}
function ApplyCSSToHiddenMenuItems() {
var stylesheetInnerText = "";
chrome.storage.local.get(null, function (result) {
for (let i = 0; i < Object.keys(result.menuitems).length; i++) {
if (!Object.values(result.menuitems)[i].toggle) {
stylesheetInnerText += SetDisplayNone(Object.keys(result.menuitems)[i]);
console.log(
`[BestSEQTA] Hiding ${Object.keys(result.menuitems)[i]} menu item`
);
}
}
MenuItemStyle = document.createElement("style");
MenuItemStyle.innerText = stylesheetInnerText;
document.head.appendChild(MenuItemStyle);
});
}
function OpenWhatsNewPopup() {
const background = document.createElement('div');
background.id = "whatsnewbk";
background.classList.add('whatsnewBackground');
const container = document.createElement('div');
container.classList.add('whatsnewContainer');
var header = stringToHTML(`<div class="whatsnewHeader">
<h1>What's New</h1>
<p>BestSEQTA V${chrome.runtime.getManifest().version}</p>
</div>`).firstChild;
imagecont = document.createElement('div');
imagecont.classList.add('whatsnewImgContainer');
var image = document.createElement('img');
image.src = chrome.runtime.getURL('icons/betterseqta-dark-icon.png');
image.classList.add('whatsnewImg')
imagecont.append(image);
textcontainer = document.createElement('div');
textcontainer.classList.add('whatsnewTextContainer');
textheader = stringToHTML('<h1 class="whatsnewTextHeader">DESIGN OVERHAUL</h1>').firstChild;
textcontainer.append(textheader);
text = stringToHTML(
`
<div class="whatsnewTextContainer" style="height: 50%;overflow-y: scroll;">
<h1>3.1.0 - Complete overhaul</h1><li>Upgraded Manifest to V3</li><li>Fixed transitional glitches</li><li>News feature wouldn't refresh until cookies were cleared</li>
<h1>3.0.1 - Bug fixes and working on manifest V3</h1>
<h1>3.0.0 - Started BestSEQTA</h1>
<h1>2.0.7 - Added support to other domains + Minor bug fixes</h1><li>Fixed BestSEQTA not loading on some pages</li><li>Fixed text colour of notices being unreadable</li><li>Fixed pages not reloading when saving changes</li>
<h1>2.0.2 - Minor bug fixes</h1><li>Fixed indicator for current lesson</li><li>Fixed text colour for DM messages list in Light mode</li><li>Fixed user info text colour</li>
<h1>Sleek New Layout</h1><li>Updated with a new font and presentation, BestSEQTA has never looked better.</li>
<h1>New Updated Sidebar</h1><li>Condensed appearance with new updated icons.</li>
<h1>Independent Light Mode and Dark Mode</h1><li>Dark mode and Light mode are now available to pick alongside your chosen Theme Colour. Your Theme Colour will now become an accent colour for the page.
Light/Dark mode can be toggled with the new button, found in the top-right of the menu bar.
</li>
<img style="width:150px;margin-bottom:5px" src="${chrome.runtime.getURL('inject/preview/lightdarkmode.png')}">
<h1>Create Custom Shortcuts</h1><li>Found in the BestSEQTA Settings menu, custom shortcuts can now be created with a name and URL of your choice.</li>
<img style="width:150px;" src="${chrome.runtime.getURL('inject/preview/customshortcut.png')}">
</div>
`
).firstChild;
footer = stringToHTML(`
<div class="whatsnewFooter">
<div>
Report bugs and feedback:
<a href="https://github.com/Nulkem/betterseqta" target="_blank" style="background: none !important; margin: 0 5px; padding:0;"><img style="filter: invert(99%) sepia(0%) saturate(627%) hue-rotate(255deg) brightness(122%) contrast(100%);" height="23" src="${chrome.runtime.getURL('/popup/github.svg')}" alt=""></a>
<a href="https://chrome.google.com/webstore/detail/betterseqta/boikofabjaholheekefimfojfncpjfib" target="_blank" style="background: none !important; margin: 0 5px; padding:0;">
<svg style="width:25px;height:25px" viewBox="0 0 24 24">
<path fill="white" d="M12,20L15.46,14H15.45C15.79,13.4 16,12.73 16,12C16,10.8 15.46,9.73 14.62,9H19.41C19.79,9.93 20,10.94 20,12A8,8 0 0,1 12,20M4,12C4,10.54 4.39,9.18 5.07,8L8.54,14H8.55C9.24,15.19 10.5,16 12,16C12.45,16 12.88,15.91 13.29,15.77L10.89,19.91C7,19.37 4,16.04 4,12M15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9A3,3 0 0,1 15,12M12,4C14.96,4 17.54,5.61 18.92,8H12C10.06,8 8.45,9.38 8.08,11.21L5.7,7.08C7.16,5.21 9.44,4 12,4M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z" />
</svg>
</a>
</div>
</div>
`).firstChild
exitbutton = document.createElement('div')
exitbutton.innerText = 'x';
exitbutton.id = 'whatsnewclosebutton';
container.append(header);
container.append(imagecont);
container.append(textcontainer);
container.append(text);
container.append(footer);
container.append(exitbutton);
document.getElementById('container').append(background);
document.getElementById('container').append(container);
chrome.storage.local.remove(["justupdated"]);
var bkelement = document.getElementById('whatsnewbk');
bkelement.addEventListener('click', function () {
DeleteWhatsNew();
WhatsNewOpen = false;
})
var closeelement = document.getElementById('whatsnewclosebutton');
closeelement.addEventListener('click', function (e) {
DeleteWhatsNew();
WhatsNewOpen = false;
})
}
async function finishLoad() {
var loadingbk = document.getElementById("loading");
loadingbk.style.opacity = "0";
await delay(501);
loadingbk.remove();
chrome.storage.local.get(["justupdated"], function (result) {
if (result.justupdated) {
WhatsNewOpen = true;
OpenWhatsNewPopup();
}
})
}
async function DeleteWhatsNew() {
var bkelement = document.getElementById('whatsnewbk');
var popup = document.getElementsByClassName("whatsnewContainer")[0];
bkelement.classList.add('whatsnewfadeout');
popup.classList.add('whatsnewzoomout');
await delay(500);
bkelement.remove();
popup.remove();
}
function CreateBackground() {
// Creating and inserting 3 divs containing the background applied to the pages
var bklocation = document.getElementById("container");
var menu = document.getElementById("menu");
var bk = document.createElement("div");
bk.classList.add("bg");
bklocation.insertBefore(bk, menu);
var bk2 = document.createElement("div");
bk2.classList.add("bg");
bk2.classList.add("bg2");
bklocation.insertBefore(bk2, menu);
var bk3 = document.createElement("div");
bk3.classList.add("bg");
bk3.classList.add("bg3");
bklocation.insertBefore(bk3, menu);
}
function waitForElm(selector) {
return new Promise((resolve) => {
if (document.querySelector(selector)) {
return resolve(document.querySelector(selector));
}
const observer = new MutationObserver((mutations) => {
if (document.querySelector(selector)) {
resolve(document.querySelector(selector));
observer.disconnect();
}
});
observer.observe(document.body, {
childList: true,
subtree: true,
});
});
}
var LoadingDone = false;
async function RunColourCheck(element) {
if (typeof element.contentDocument.documentElement.childNodes[1] == 'undefined') {
await delay(1000);
RunColourCheck(element);
}
else {
element.contentDocument.documentElement.childNodes[1].style.color = "white";
}
}
function GetiFrameCSSElement() {
var cssFile = chrome.runtime.getURL("inject/iframe.css");
var fileref = document.createElement("link");
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", cssFile);
return fileref;
}
function CheckiFrameItems() {
// Injecting CSS File to the webpage to overwrite iFrame default CSS
fileref = GetiFrameCSSElement();
const observer = new MutationObserver(function (mutations_list) {
mutations_list.forEach(function (mutation) {
mutation.addedNodes.forEach(function (added_node) {
if (added_node.tagName == "IFRAME") {
chrome.storage.local.get(["DarkMode"], function (result) {
DarkModeResult = result.DarkMode
if (DarkModeResult) {
RunColourCheck(added_node);
if (added_node.contentDocument.documentElement.childNodes[1].style.color != "white") {
added_node.contentDocument.documentElement.childNodes[1].style.color = "white";
}
if (
!added_node.contentDocument.documentElement.firstChild.innerHTML.includes(
"iframe.css"
)
) {
added_node.contentDocument.documentElement.firstChild.appendChild(
fileref
);
}
added_node.addEventListener("load", function () {
if (added_node.contentDocument.documentElement.childNodes[1].style.color != "white") {
added_node.contentDocument.documentElement.childNodes[1].style.color = "white";
}
if (
!added_node.contentDocument.documentElement.firstChild.innerHTML.includes(
"iframe.css"
)
) {
added_node.contentDocument.documentElement.firstChild.appendChild(
fileref
);
}
});
}
});
}
});
});
});
observer.observe(document.body, {
subtree: true,
childList: true,
});
}
function SortMessagePageItems(messagesParentElement) {
filterbutton = document.createElement('div');
filterbutton.classList.add("messages-filterbutton");
filterbutton.innerText = "Filter";
header = document.getElementsByClassName('MessageList__MessageList___3DxoC')[0].firstChild;
header.append(filterbutton);
const observer = new MutationObserver(function (mutations_list) {
mutations_list.forEach(function (mutation) {
mutation.addedNodes.forEach(function (added_node) {
if (added_node.dataset.message) {
// Check if added_node.firstChild.title is in block list
}
});
});
});
observer.observe(messagesParentElement, {
subtree: true,
childList: true,
});
}
function LoadPageElements() {
AddBetterSEQTAElements(true);
var sublink = window.location.href.split("/")[4];
switch (sublink) {
case "news":
console.log("[BestSEQTA] Started Init");
chrome.storage.local.get(null, function (result) {
if (result.onoff) {
SendNewsPage();
// Sends similar HTTP Post Request for the notices
chrome.storage.local.get(null, function (result) {
if (result.notificationcollector) {
var xhr3 = new XMLHttpRequest();
xhr3.open(
"POST",
`${location.origin}/seqta/student/heartbeat?`,
true
);
xhr3.setRequestHeader(
"Content-Type",
"application/json; charset=utf-8"
);
xhr3.onreadystatechange = function () {
if (xhr3.readyState === 4) {
var Notifications = JSON.parse(xhr3.response);
var alertdiv = document.getElementsByClassName(
"notifications__bubble___1EkSQ"
)[0];
if (typeof alertdiv == 'undefined') {
console.log("[BestSEQTA] No notifications currently")
}
else {
alertdiv.textContent = Notifications.payload.notifications.length;
}
}
};
xhr3.send(
JSON.stringify({
timestamp: "1970-01-01 00:00:00.0",
hash: "#?page=/home",
})
);
}
});
finishLoad();
}
});
break;
case "home":
window.location.replace(`${location.origin}/#?page=/home`);
LoadInit();
break;
case undefined:
window.location.replace(`${location.origin}/#?page=/home`);
LoadInit();
break;
default:
finishLoad();
// Sends similar HTTP Post Request for the notices
chrome.storage.local.get(null, function (result) {
if (result.notificationcollector) {
var xhr3 = new XMLHttpRequest();
xhr3.open(
"POST",
`${location.origin}/seqta/student/heartbeat?`,
true
);
xhr3.setRequestHeader(
"Content-Type",
"application/json; charset=utf-8"
);
xhr3.onreadystatechange = function () {
if (xhr3.readyState === 4) {
var Notifications = JSON.parse(xhr3.response);
var alertdiv = document.getElementsByClassName(
"notifications__bubble___1EkSQ"
)[0];
if (typeof alertdiv == 'undefined') {
console.log("[BestSEQTA] No notifications currently")
}
else {
alertdiv.textContent = Notifications.payload.notifications.length;
}
}
};
xhr3.send(
JSON.stringify({
timestamp: "1970-01-01 00:00:00.0",
hash: "#?page=/home",
})
);
}
});
break;
}
const observer = new MutationObserver(function (mutations_list) {
mutations_list.forEach(function (mutation) {
mutation.addedNodes.forEach(function (added_node) {
if (added_node.classList.contains('messages')) {
element = document.getElementById('title').firstChild;
element.innerText = "Direct Messages";
document.title = "Direct Messages ― SEQTA Learn";
SortMessagePageItems(added_node);
}
else if (added_node.classList.contains('notices')) {
CheckNoticeTextColour(added_node);
}
});
});
});
observer.observe(document.querySelector('#main'), {
subtree: false,
childList: true,
});
}
function CheckNoticeTextColour(notice) {
const observer = new MutationObserver(function (mutations_list) {
mutations_list.forEach(function (mutation) {
mutation.addedNodes.forEach(function (added_node) {
chrome.storage.local.get(['DarkMode'], function (result) {
Darkmode = result.DarkMode;
if (added_node.classList.contains('notice')) {
var hex = added_node.style.cssText.split(' ')[1];
var threshold = GetThresholdofHex(hex);
if (Darkmode && threshold < 100) {
added_node.style.cssText = "--color: undefined;";
}
}
})
});
});
});
observer.observe(notice, {
subtree: true,
childList: true,
});
}
function tryLoad() {
waitForElm(".login").then((elm) => {
LoadingDone = true;
finishLoad();
});
waitForElm(".day-container").then((elm) => {
LoadingDone = true;
finishLoad();
});
waitForElm("[data-key=welcome]").then((elm) => {
elm.classList.remove('active')
});
waitForElm(".code").then((elm) => {
if (!elm.innerText.includes("BestSEQTA"))
LoadPageElements();
});
// Waits for page to call on load, run scripts
document.addEventListener(
"load",
function () {
CheckiFrameItems();
},
true
);
}
function ChangeMenuItemPositions(storage) {
menuorder = storage;
var menuList = document.querySelector('#menu').firstChild.childNodes;
listorder = []
for (let i = 0; i < menuList.length; i++) {
namevalue = menuList[i].dataset.key
a = menuorder.indexOf(menuList[i].dataset.key)
listorder.push(a)
}
var newArr = []
for (var i = 0; i < listorder.length; i++) {
newArr[listorder[i]] = menuList[i]
}
listItemsDOM = document.getElementById('menu').firstChild
for (let i = 0; i < newArr.length; i++) {
const element = newArr[i];
if (element) {
element.setAttribute('data-checked', 'true')
listItemsDOM.appendChild(element);
}
}
}
async function ObserveMenuItemPosition() {
chrome.storage.local.get(null, function (result) {
menuorder = result.menuorder
if (menuorder && result.onoff) {
const observer = new MutationObserver(function (mutations_list) {
mutations_list.forEach(function (mutation) {
mutation.addedNodes.forEach(function (added_node) {
if (!added_node.dataset.checked && !MenuOptionsOpen) {
if (MenuitemSVGKey[added_node.dataset.key]) {
ReplaceMenuSVG(added_node, MenuitemSVGKey[added_node.dataset.key])
}
ChangeMenuItemPositions(menuorder);
}
});
});
});
observer.observe(document.querySelector('#menu').firstChild, {
subtree: true,
childList: true,
});
}
})
}
function AppendElementsToDisabledPage() {
AddBetterSEQTAElements(false);
settingsStyle = document.createElement('style')
settingsStyle.innerText = `
.addedButton {
position: absolute !important;
right: 50px;
width: 35px;
height: 35px;
padding: 6px !important;
overflow: unset !important;
border-radius: 50%;
margin: 7px !important;
cursor: pointer;
color: white !important;
}
.addedButton svg {
margin: 6px;
}
.outside-container {
top: 48px !important;
}
`
document.head.append(settingsStyle)
}
function ColorLuminance(hex, lum) {
// validate hex string
hex = String(hex).replace(/[^0-9a-f]/gi, '');
if (hex.length < 6) {
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
}
lum = lum || 0;
// convert to decimal and change luminosity
var rgb = "#", c, i;
for (i = 0; i < 3; i++) {
c = parseInt(hex.substr(i * 2, 2), 16);
c = Math.round(Math.min(Math.max(0, c + (c * lum)), 255)).toString(16);
rgb += ("00" + c).substring(c.length);
}
return rgb;
}
chrome.storage.onChanged.addListener(function (changes) {
if (changes.selectedColor) {
rbg = GetThresholdofHex(changes.selectedColor.newValue)
if (rbg > 210) {
document.documentElement.style.setProperty('--text-color', 'black');
document.documentElement.style.setProperty('--betterseqta-logo', `url(${chrome.runtime.getURL('icons/betterseqta-dark-full.png')})`);
}
else {
document.documentElement.style.setProperty('--text-color', 'white');
document.documentElement.style.setProperty('--betterseqta-logo', `url(${chrome.runtime.getURL('icons/betterseqta-light-full.png')})`);
}
document.documentElement.style.setProperty('--better-main', changes.selectedColor.newValue);
// document.documentElement.style.setProperty('--better-sub', ColorLuminance(changes.selectedColor.newValue, -0.15));
if (changes.selectedColor.newValue == '#ffffff') {
document.documentElement.style.setProperty('--better-light', '#b7b7b7');
} else {
document.documentElement.style.setProperty('--better-light', ColorLuminance(changes.selectedColor.newValue, 0.99));
}
}
if (changes.customshortcuts.newValue) {
if (changes.customshortcuts.oldValue.length > 0) {
CreateCustomShortcutDiv(changes.customshortcuts.newValue[(changes.customshortcuts.oldValue.length)]);
} else {
CreateCustomShortcutDiv(changes.customshortcuts.newValue[0]);
}
}
})
var PageLoaded = false;
async function CheckLoadOnPeriods() {
if (!PageLoaded) {
await delay(1000);
var code = document.getElementsByClassName('code')[0];
if (code && !UserInitalCode) {
LoadPageElements();
finishLoad();
PageLoaded = true;
}
if (!code) {
CheckLoadOnPeriods();
}
}
}
function RunFunctionOnTrue(storedSetting) {
// If the option is 'on', open BetterSEQTA
if (typeof storedSetting.onoff == 'undefined') {
chrome.runtime.sendMessage({ type: "setDefaultStorage" });
}
if (storedSetting.onoff) {
console.log("[BestSEQTA] Enabled");
// Injecting CSS File to the webpage to overwrite SEQTA's default CSS
var cssFile = chrome.runtime.getURL("inject/injected.css");
var fileref = document.createElement("link");
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", cssFile);
document.head.appendChild(fileref);
document.getElementsByTagName("html")[0].appendChild(fileref);
document.documentElement.style.setProperty('--better-sub', "#161616");
document.documentElement.style.setProperty('--better-alert-highlight', "#c61851");
if (storedSetting.DarkMode) {
document.documentElement.style.setProperty('--background-primary', "#232323");
document.documentElement.style.setProperty('--background-secondary', "#1a1a1a");
document.documentElement.style.setProperty('--text-primary', "white");
}
else {
document.documentElement.style.setProperty('--background-primary', "#ffffff");
document.documentElement.style.setProperty('--background-secondary', "#e5e7eb");
document.documentElement.style.setProperty('--text-primary', "black");
}
document.querySelector('link[rel*="icon"]').href = chrome.runtime.getURL("icons/icon-48.png");
rbg = GetThresholdofHex(storedSetting.selectedColor);
if (rbg > 210) {
document.documentElement.style.setProperty('--text-color', 'black');
document.documentElement.style.setProperty('--betterseqta-logo', `url(${chrome.runtime.getURL('icons/betterseqta-dark-full.png')})`);
}
else {
document.documentElement.style.setProperty('--text-color', 'white');
document.documentElement.style.setProperty('--betterseqta-logo', `url(${chrome.runtime.getURL('icons/betterseqta-light-full.png')})`);
}
document.documentElement.style.setProperty('--better-main', storedSetting.selectedColor);
// document.documentElement.style.setProperty('--better-sub', ColorLuminance(storedSetting.selectedColor, -0.15));
if (storedSetting.selectedColor == '#ffffff') {
document.documentElement.style.setProperty('--better-light', '#b7b7b7');
} else {
document.documentElement.style.setProperty('--better-light', ColorLuminance(storedSetting.selectedColor, 0.95));
}
ApplyCSSToHiddenMenuItems();
loading();
CheckLoadOnPeriods();
if (!isChrome || isChrome == "undefined") {
tryLoad();
}
window.addEventListener("load", function () {
tryLoad();
});
}
else {
if (!isChrome || isChrome == "undefined") {
waitForElm(".code").then((elm) => {
AppendElementsToDisabledPage();
});
}
window.addEventListener("load", function () {
waitForElm(".code").then((elm) => {
AppendElementsToDisabledPage();
});
});
};
}
async function CheckForMenuList() {
if (!MenuItemMutation) {
try {
if (document.getElementById('menu').firstChild) {
ObserveMenuItemPosition();
MenuItemMutation = true;
}
}
catch (error) {
return;
}
}
}
var MenuItemMutation = false;
var NonSEQTAPage = false;
var IsSEQTAPage = false;
document.addEventListener(
"load",
function () {
CheckForMenuList();
var weblink = window.location.origin
if (document.childNodes[1].textContent?.includes("Copyright (c) SEQTA Software") && document.title.includes("SEQTA Learn") && !IsSEQTAPage) {
IsSEQTAPage = true;
console.log("[BestSEQTA] Verified SEQTA Page");
var link = document.createElement("link");
link.href = chrome.runtime.getURL("inject/documentload.css");
link.type = "text/css";
link.rel = "stylesheet";
document.getElementsByTagName("html")[0].appendChild(link);
chrome.storage.local.get(null, function (items) {
RunFunctionOnTrue(items);
});
}
if (
!document.childNodes[1].textContent?.includes("SEQTA") &&
!NonSEQTAPage
) {
NonSEQTAPage = true;
}
},
true
);
function RunExtensionSettingsJS() {
const whatsnewsettings = document.getElementById('whatsnewsettings');
whatsnewsettings.addEventListener('click', function () {
if (!WhatsNewOpen) {
WhatsNewOpen = true;
OpenWhatsNewPopup();
}
});
const onoffselection = document.querySelector("#onoff");
const notificationcollector = document.querySelector("#notification");
const lessonalert = document.querySelector("#lessonalert");
const aboutsection = document.querySelector("#aboutsection");
const shortcutsection = document.querySelector("#shortcutsection");
const miscsection = document.querySelector('#miscsection');
const mainpage = document.querySelector("#mainpage");
const colorpicker = document.querySelector("#colorpicker");
const animatedbk = document.querySelector('#animatedbk');
const customshortcutbutton = document.getElementsByClassName('custom-shortcuts-button')[0];
const customshortcutdiv = document.getElementsByClassName('custom-shortcuts-container')[0];
const customshortcutsubmit = document.getElementsByClassName('custom-shortcuts-submit')[0];
const customshortcutinputname = document.querySelector('#shortcutname');
const customshortcutinputurl = document.querySelector('#shortcuturl');
const shortcutmenuitemselection = document.getElementsByClassName('menushortcut')[0];
const applybutton = document.querySelector('#applychanges')
const navbuttons = document.getElementsByClassName("navitem");
const menupages = document.getElementsByClassName("menu-page")
const allinputs = document.getElementsByTagName('input');
const menupage = document.querySelector("#menupage");
const shortcutpage = document.querySelector("#shortcutpage");
const miscpage = document.querySelector('#miscpage');
var shortcutbuttons = document.getElementsByClassName("shortcutitem");
var validURL = false;
var validName = false;
const github = document.getElementById("github");
function openGithub() {
chrome.runtime.sendMessage({ type: "githubTab" });
}
function resetActive() {
for (let i = 0; i < navbuttons.length; i++) {
navbuttons[i].classList.remove('activenav');
}
for (let i = 0; i < menupages.length; i++) {
menupages[i].classList.add('hiddenmenu');
}
}
function FindSEQTATab() {
chrome.runtime.sendMessage({ type: "reloadTabs", });
}
/*
Store the currently selected settings using chrome.storage.local.
*/
function storeSettings() {
chrome.storage.local.set({ onoff: onoffselection.checked }, function () {
FindSEQTATab();
});
}
function storeNotificationSettings() {
chrome.storage.local.set(
{ notificationcollector: notificationcollector.checked });
chrome.storage.local.set({ lessonalert: lessonalert.checked });
chrome.storage.local.set({ animatedbk: animatedbk.checked });
}
function StoreAllSettings() {
chrome.storage.local.get(["shortcuts"], function (result) {
var shortcuts = Object.values(result)[0];
for (var i = 0; i < shortcutbuttons.length; i++) {
shortcuts[i].enabled = shortcutbuttons[i].checked;
}
chrome.storage.local.set({ shortcuts: shortcuts });
});
FindSEQTATab();
}
/*
Update the options UI with the settings values retrieved from storage,
or the default settings if the stored settings are empty.
*/
function updateUI(restoredSettings) {
if (typeof restoredSettings.onoff == 'undefined') {
chrome.runtime.sendMessage({ type: "setDefaultStorage" });
chrome.storage.local.get(null, function (result) {
updateUI(result);
});
} else {
onoffselection.checked = restoredSettings.onoff;
notificationcollector.checked = restoredSettings.notificationcollector;
lessonalert.checked = restoredSettings.lessonalert;
animatedbk.checked = restoredSettings.animatedbk;
chrome.storage.local.get(["shortcuts"], function (result) {
var shortcuts = Object.values(result)[0];
for (var i = 0; i < shortcutbuttons.length; i++) {
shortcutbuttons[i].checked = shortcuts[i].enabled;
}
chrome.storage.local.set({ shortcuts: shortcuts });
});
}
}
function CreateShortcutDiv(name) {
div = stringtoHTML(`
<div class="item-container menushortcuts" data-customshortcut="${name}">
<div class="text-container">
<h1 class="addonitem" style="font-size: 8px !important;font-weight: 300;">Custom</h1>
<h1 class="addonitem">${name}</h1>
</div>
<svg id="delete-${name}" style="width:24px;height:24px;margin: 9px;cursor:pointer;" viewBox="0 0 24 24">
<path fill="#ffffff" d="M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2C6.47,2 2,6.47 2,12C2,17.53 6.47,22 12,22C17.53,22 22,17.53 22,12C22,6.47 17.53,2 12,2M14.59,8L12,10.59L9.41,8L8,9.41L10.59,12L8,14.59L9.41,16L12,13.41L14.59,16L16,14.59L13.41,12L16,9.41L14.59,8Z"></path></svg>
</div>`).firstChild;
shortcutmenuitemselection.append(div);
const deletebutton = document.getElementById(`delete-${name}`);
deletebutton.addEventListener('click', function () {
DeleteCustomShortcut(name);
applybutton.style.left = "4px";
});
}
function AddCustomShortcuts() {
chrome.storage.local.get(["customshortcuts"], function (result) {
var customshortcuts = Object.values(result)[0];
for (let i = 0; i < customshortcuts.length; i++) {
const element = customshortcuts[i];
CreateShortcutDiv(
element.name,
)
}
});
}
function DeleteCustomShortcut(name) {
item = document.querySelector(`[data-customshortcut="${name}"]`);
item.remove();
chrome.storage.local.get(["customshortcuts"], function (result) {
var customshortcuts = Object.values(result)[0];
for (let i = 0; i < customshortcuts.length; i++) {
if (customshortcuts[i].name == name) {
customshortcuts.splice(i, 1);
}
}
chrome.storage.local.set({ customshortcuts: customshortcuts });
});
}
function CustomShortcutMenu() {
customshortcutinputname.value = '';
customshortcutinputurl.value = '';
validURL = false;
validName = false;
customshortcutsubmit.classList.remove("customshortcut-submit-valid");
if (customshortcutdiv.classList.contains('custom-shortcuts-container-shown')) {
customshortcutdiv.classList.remove('custom-shortcuts-container-shown')
} else {
customshortcutdiv.classList.add('custom-shortcuts-container-shown')
};
}
function CreateCustomShortcut() {
const shortcutname = customshortcutinputname.value;
var shortcuturl = customshortcutinputurl.value;
if (!(shortcuturl.includes('http'))) {
shortcuturl = "https://" + shortcuturl;
}
chrome.storage.local.get(["customshortcuts"], function (result) {
var customshortcuts = Object.values(result)[0];
customshortcuts.push({ name: shortcutname, url: shortcuturl, icon: (shortcutname[0]).toUpperCase() });
chrome.storage.local.set({ customshortcuts: customshortcuts });
});
CreateShortcutDiv(
shortcutname
);
document.getElementsByClassName("shortcut-container")[0].style.display = "block";
}
function onError(e) {
console.error(e);
}
chrome.storage.local.get(null, function (result) {
document.getElementsByClassName('clr-field')[0].style.color = result.selectedColor;
colorpicker.value = result.selectedColor;
updateUI(result);
});
github.addEventListener("click", openGithub);
aboutsection.addEventListener("click", () => { resetActive(); aboutsection.classList.add('activenav'); menupage.classList.remove('hiddenmenu') });
shortcutsection.addEventListener("click", () => { resetActive(); shortcutsection.classList.add('activenav'); shortcutpage.classList.remove('hiddenmenu') });
miscsection.addEventListener("click", () => { resetActive(); miscsection.classList.add('activenav'); miscpage.classList.remove('hiddenmenu') });
customshortcutbutton.addEventListener("click", () => { CustomShortcutMenu(); })
customshortcutsubmit.addEventListener("click", () => { if (validName && validURL) { CreateCustomShortcut(); CustomShortcutMenu() } });
var sameName = false;
customshortcutinputname.addEventListener("input", function () {
sameName = false;
chrome.storage.local.get(["customshortcuts"], function (result) {
var customshortcuts = Object.values(result)[0];
for (let i = 0; i < customshortcuts.length; i++) {
if (customshortcuts[i].name == customshortcutinputname.value) {
sameName = true;
}
}
if (customshortcutinputname.value.length > 0 && customshortcutinputname.value.length < 22 && !sameName) {
validName = true;
} else {
validName = false;
}
if (validName && validURL) {
customshortcutsubmit.classList.add("customshortcut-submit-valid");
}
else {
customshortcutsubmit.classList.remove("customshortcut-submit-valid");
}
});
});
customshortcutinputurl.addEventListener("input", function () {
if (customshortcutinputurl.value.length > 0 && customshortcutinputurl.value.includes('.')) {
validURL = true;
} else {
validURL = false;
}
if (validName && validURL) {
customshortcutsubmit.classList.add("customshortcut-submit-valid");
}
else {
customshortcutsubmit.classList.remove("customshortcut-submit-valid");
}
})
AddCustomShortcuts();
onoffselection.addEventListener("change", storeSettings);
notificationcollector.addEventListener(
"change",
storeNotificationSettings
);
lessonalert.addEventListener("change", storeNotificationSettings)
animatedbk.addEventListener("change", storeNotificationSettings)
for (let i = 0; i < allinputs.length; i++) {
if (allinputs[i].id != 'colorpicker' && allinputs[i].id != "shortcuturl" && allinputs[i].id != "shortcutname") {
allinputs[i].addEventListener("change", () => { applybutton.style.left = "4px" })
}
}
applybutton.addEventListener('click', () => { StoreAllSettings(); applybutton.style.left = "-150px" })
colorpicker.addEventListener("input", function () {
var colorPreview = document.querySelector('#clr-color-preview')
if (colorPreview.style.color) {
var hex = colorPreview.style.color.split("(")[1].split(")")[0];
hex = hex.split(",");
var b = hex.map(function (x) { //For each array element
x = parseInt(x).toString(16); //Convert to a base16 string
return (x.length == 1) ? "0" + x : x; //Add zero if we get only one character
})
b = "#" + b.join("");
chrome.storage.local.set({ selectedColor: b })
}
})
}
function CallExtensionSettings() {
// Injecting CSS File to the webpage to overwrite iFrame default CSS
var cssFile = chrome.runtime.getURL("popup/info.css");
var fileref = document.createElement("link");
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", cssFile);
document.head.append(fileref);
var jsFile = chrome.runtime.getURL("popup/coloris.js");
var fileref = document.createElement("script");
fileref.setAttribute("src", jsFile);
document.head.append(fileref);
var cssFile = chrome.runtime.getURL("popup/coloris.css");
var fileref = document.createElement("link");
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", cssFile);
document.head.append(fileref);
NextPageImage = chrome.runtime.getURL('popup/page.png')
Settings = stringToHTML(`<div class="outside-container hidden" id="ExtensionPopup"><div class="logo-container"><img src=${chrome.runtime.getURL('icons/betterseqta-light-full.png')}></div>
<div class="main-page" id="mainpage">
<div class="topmenu">
<div class="navitem activenav" id="miscsection">Settings</div>
<div class="navitem" id="shortcutsection">Shortcuts</div>
<div class="navitem" id="aboutsection">About</div>
</div>
</div>
<div class="menu-page hiddenmenu" id="menupage">
<div class="selector-container" style="margin-bottom: 0;">
<div class="menu-item-selection">
<div class="aboutcontainer">
<div>
<h1 class="addonitem">About</h1>
<p class="item subitem">Created and developed and maintained by Nulkem</p>
<p class="item subitem">BestSEQTA is a fork of the project BetterSEQTA, BetterSEQTA is no longer supported so we are here to fill that gap!</p>
</div>
</div>
<div class="aboutcontainer">
<div>
<a class="aboutlinks" href="https://chrome.google.com/webstore/detail/betterseqta/boikofabjaholheekefimfojfncpjfib" target="_blank">
<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M12,20L15.46,14H15.45C15.79,13.4 16,12.73 16,12C16,10.8 15.46,9.73 14.62,9H19.41C19.79,9.93 20,10.94 20,12A8,8 0 0,1 12,20M4,12C4,10.54 4.39,9.18 5.07,8L8.54,14H8.55C9.24,15.19 10.5,16 12,16C12.45,16 12.88,15.91 13.29,15.77L10.89,19.91C7,19.37 4,16.04 4,12M15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9A3,3 0 0,1 15,12M12,4C14.96,4 17.54,5.61 18.92,8H12C10.06,8 8.45,9.38 8.08,11.21L5.7,7.08C7.16,5.21 9.44,4 12,4M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z" />
</svg>
Chrome Webstore
</a>
<a class="aboutlinks" href="https://addons.mozilla.org/en-US/firefox/addon/betterseqta/" target="_blank">
<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M9.27 7.94C9.27 7.94 9.27 7.94 9.27 7.94M6.85 6.74C6.86 6.74 6.86 6.74 6.85 6.74M21.28 8.6C20.85 7.55 19.96 6.42 19.27 6.06C19.83 7.17 20.16 8.28 20.29 9.1L20.29 9.12C19.16 6.3 17.24 5.16 15.67 2.68C15.59 2.56 15.5 2.43 15.43 2.3C15.39 2.23 15.36 2.16 15.32 2.09C15.26 1.96 15.2 1.83 15.17 1.69C15.17 1.68 15.16 1.67 15.15 1.67H15.13L15.12 1.67L15.12 1.67L15.12 1.67C12.9 2.97 11.97 5.26 11.74 6.71C11.05 6.75 10.37 6.92 9.75 7.22C9.63 7.27 9.58 7.41 9.62 7.53C9.67 7.67 9.83 7.74 9.96 7.68C10.5 7.42 11.1 7.27 11.7 7.23L11.75 7.23C11.83 7.22 11.92 7.22 12 7.22C12.5 7.21 12.97 7.28 13.44 7.42L13.5 7.44C13.6 7.46 13.67 7.5 13.75 7.5C13.8 7.54 13.86 7.56 13.91 7.58L14.05 7.64C14.12 7.67 14.19 7.7 14.25 7.73C14.28 7.75 14.31 7.76 14.34 7.78C14.41 7.82 14.5 7.85 14.54 7.89C14.58 7.91 14.62 7.94 14.66 7.96C15.39 8.41 16 9.03 16.41 9.77C15.88 9.4 14.92 9.03 14 9.19C17.6 11 16.63 17.19 11.64 16.95C11.2 16.94 10.76 16.85 10.34 16.7C10.24 16.67 10.14 16.63 10.05 16.58C10 16.56 9.93 16.53 9.88 16.5C8.65 15.87 7.64 14.68 7.5 13.23C7.5 13.23 8 11.5 10.83 11.5C11.14 11.5 12 10.64 12.03 10.4C12.03 10.31 10.29 9.62 9.61 8.95C9.24 8.59 9.07 8.42 8.92 8.29C8.84 8.22 8.75 8.16 8.66 8.1C8.43 7.3 8.42 6.45 8.63 5.65C7.6 6.12 6.8 6.86 6.22 7.5H6.22C5.82 7 5.85 5.35 5.87 5C5.86 5 5.57 5.16 5.54 5.18C5.19 5.43 4.86 5.71 4.56 6C4.21 6.37 3.9 6.74 3.62 7.14C3 8.05 2.5 9.09 2.28 10.18C2.28 10.19 2.18 10.59 2.11 11.1L2.08 11.33C2.06 11.5 2.04 11.65 2 11.91L2 11.94L2 12.27L2 12.32C2 17.85 6.5 22.33 12 22.33C16.97 22.33 21.08 18.74 21.88 14C21.9 13.89 21.91 13.76 21.93 13.63C22.13 11.91 21.91 10.11 21.28 8.6Z" />
</svg>
Firefox Add-ons
</a>
<a class="aboutlinks" href="https://betterseqta.com" target="_blank">
<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M10.59,13.41C11,13.8 11,14.44 10.59,14.83C10.2,15.22 9.56,15.22 9.17,14.83C7.22,12.88 7.22,9.71 9.17,7.76V7.76L12.71,4.22C14.66,2.27 17.83,2.27 19.78,4.22C21.73,6.17 21.73,9.34 19.78,11.29L18.29,12.78C18.3,11.96 18.17,11.14 17.89,10.36L18.36,9.88C19.54,8.71 19.54,6.81 18.36,5.64C17.19,4.46 15.29,4.46 14.12,5.64L10.59,9.17C9.41,10.34 9.41,12.24 10.59,13.41M13.41,9.17C13.8,8.78 14.44,8.78 14.83,9.17C16.78,11.12 16.78,14.29 14.83,16.24V16.24L11.29,19.78C9.34,21.73 6.17,21.73 4.22,19.78C2.27,17.83 2.27,14.66 4.22,12.71L5.71,11.22C5.7,12.04 5.83,12.86 6.11,13.65L5.64,14.12C4.46,15.29 4.46,17.19 5.64,18.36C6.81,19.54 8.71,19.54 9.88,18.36L13.41,14.83C14.59,13.66 14.59,11.76 13.41,10.59C13,10.2 13,9.56 13.41,9.17Z" />
</svg>
betterseqta.com
</a>
</div>
</div>
<div class="aboutcontainer">
<div>
</div>
</div>
<div class="aboutcontainer" style="color: rgb(155, 155, 155); font-size: 14px; margin-top: 7px;">
<p>Contact: [email protected]</p>
</div>
</div>
</div>
</div>
<div class="menu-page hiddenmenu" id="shortcutpage">
<div class="selector-container" style="margin-bottom: 0; max-height: 17em; overflow-y:hidden;">
<div>
<div class="custom-shortcuts-button custom-shortcuts-buttons">Create Custom Shortcut</div>
<div class="custom-shortcuts-container">
<label for="shortcutname" class="custom-shortcuts-label">Shortcut Name:</label>
<input type="text" id="shortcutname" name="shortcutname" class="custom-shortcuts-field" placeholder="e.g. Google" maxlength="20">
<label for="shortcuturl" class="custom-shortcuts-label">URL:</label>
<input type="text" id="shortcuturl" name="shortcuturl" class="custom-shortcuts-field" placeholder="e.g. https://www.google.com">
<div class="custom-shortcuts-submit custom-shortcuts-buttons">Create</div>
</div>
</div>
<div class="menu-item-selection menushortcut">
<div class="item-container menushortcuts">
<div class="text-container">
<h1 class="addonitem">YouTube</h1>
</div>
<div class="onoffswitch"><input class="onoffswitch-checkbox notification shortcutitem" type="checkbox" id="youtube">
<label for="youtube" class="onoffswitch-label"></label>
</div>
</div>
<div class="item-container menushortcuts">
<div class="text-container">
<h1 class="addonitem">Outlook</h1>
</div>
<div class="onoffswitch"><input class="onoffswitch-checkbox notification shortcutitem" type="checkbox" id="outlook">
<label for="outlook" class="onoffswitch-label"></label>
</div>
</div>
<div class="item-container menushortcuts">
<div class="text-container">
<h1 class="addonitem">Office</h1>
</div>
<div class="onoffswitch"><input class="onoffswitch-checkbox notification shortcutitem" type="checkbox" id="office">
<label for="office" class="onoffswitch-label"></label>
</div>
</div>
<div class="item-container menushortcuts">
<div class="text-container">
<h1 class="addonitem">Spotify</h1>
</div>
<div class="onoffswitch"><input class="onoffswitch-checkbox notification shortcutitem" type="checkbox" id="spotify">
<label for="spotify" class="onoffswitch-label"></label>
</div>
</div>
<div class="item-container menushortcuts">
<div class="text-container">
<h1 class="addonitem">Google</h1>
</div>
<div class="onoffswitch"><input class="onoffswitch-checkbox notification shortcutitem" type="checkbox" id="google">
<label for="google" class="onoffswitch-label"></label>
</div>
</div>
<div class="item-container menushortcuts">
<div class="text-container">
<h1 class="addonitem">DuckDuckGo</h1>
</div>
<div class="onoffswitch"><input class="onoffswitch-checkbox notification shortcutitem" type="checkbox"
id="duckduckgo">
<label for="duckduckgo" class="onoffswitch-label"></label>
</div>
</div>
<div class="item-container menushortcuts">
<div class="text-container">
<h1 class="addonitem">Cool Math Games</h1>
</div>
<div class="onoffswitch"><input class="onoffswitch-checkbox notification shortcutitem" type="checkbox"
id="coolmathgames">
<label for="coolmathgames" class="onoffswitch-label"></label>
</div>
</div>
<div class="item-container menushortcuts">
<div class="text-container">
<h1 class="addonitem">SACE</h1>
</div>
<div class="onoffswitch"><input class="onoffswitch-checkbox notification shortcutitem" type="checkbox" id="sace">
<label for="sace" class="onoffswitch-label"></label>
</div>
</div>
<div class="item-container menushortcuts">
<div class="text-container">
<h1 class="addonitem">Google Scholar</h1>
</div>
<div class="onoffswitch"><input class="onoffswitch-checkbox notification shortcutitem" type="checkbox"
id="googlescholar">
<label for="googlescholar" class="onoffswitch-label"></label>
</div>
</div>
<div class="item-container menushortcuts">
<div class="text-container">
<h1 class="addonitem">Gmail</h1>
</div>
<div class="onoffswitch"><input class="onoffswitch-checkbox notification shortcutitem" type="checkbox" id="gmail">
<label for="gmail" class="onoffswitch-label"></label>
</div>
</div>
<div class="item-container menushortcuts">
<div class="text-container">
<h1 class="addonitem">Netflix</h1>
</div>
<div class="onoffswitch"><input class="onoffswitch-checkbox notification shortcutitem" type="checkbox" id="netflix">
<label for="netflix" class="onoffswitch-label"></label>
</div>
</div>
</div>
</div>
</div>
<div class="menu-page" id="miscpage">
<div class="selector-container" style="margin-bottom: 0;">
<div class="menu-item-selection">
<div class="item-container">
<div class="text-container">
<h1 class="addonitem">Notification Collector</h1>
<p class="item subitem">Uncaps the 9+ limit for notifications, showing the real number.</p>
</div>
<div class="onoffswitch"><input class="onoffswitch-checkbox notification" type="checkbox" id="notification">
<label for="notification" class="onoffswitch-label"></label>
</div>
</div>
<div class="item-container">
<div class="text-container">
<h1 class="addonitem">Lesson Alerts</h1>
<p class="item subitem">Sends a native browser notification ~5 minutes prior to lessons.</p>
</div>
<div class="onoffswitch"><input class="onoffswitch-checkbox notification" type="checkbox" id="lessonalert">
<label for="lessonalert" class="onoffswitch-label"></label>
</div>
</div>
<div class="item-container">
<div class="text-container">
<h1 class="addonitem">Animated Background</h1>
<p class="item subitem">Adds an animated background to BestSEQTA. (May impact battery life)</p>
</div>
<div class="onoffswitch"><input class="onoffswitch-checkbox notification" type="checkbox" id="animatedbk">
<label for="animatedbk" class="onoffswitch-label"></label>
</div>
</div>
<div class="item-container">
<div class="text-container">
<h1 class="addonitem">Custom Theme Colour</h1>
<p class="item subitem">Customise the overall theme colour of SEQTA Learn.</p>
</div>
<div class="clr-field" style="justify-content: end; display: flex; margin: 5px;">
<button aria-labelledby="clr-open-label" style="width: 51px; right: 0px; border: 1px solid white;"></button>
<input type="text" id="colorpicker" class="coloris" style="width: 42px; border-radius: 3px;" />
</div>
</div>
<div class="item-container" style="height: 2em; margin-top: 0px;">
<div class="text-container">
<h1 class="addonitem">BestSEQTA</h1>
</div>
<div class="onoffswitch" style="margin-bottom: 0px;"><input class="onoffswitch-checkbox notification" type="checkbox" id="onoff">
<label for="onoff" class="onoffswitch-label"></label>
</div>
</div>
</div>
</div>
</div>
<div class="bottom-container">
<div class="applychanges" id="applychanges" style="height: 25px;">
<div style="margin-top:0px;">
<h5>Unsaved Changes</h5>
<h6>Click to apply.</h6>
</div>
</div>
<div></div>
<div style="position: absolute; bottom: 15px; right: 50px; color: rgb(177, 177, 177); display: flex; align-items:center;">
<p style="margin: 0; margin-right: 5px; color: white;">Created by Nulkem </p>
<p style="margin: 0; cursor:pointer; padding: 4px 5px; background: #ff5f5f; color:#1a1a1a;font-weight: 500; border-radius: 10px;" id="whatsnewsettings">What's new in v${chrome.runtime.getManifest().version}</p></div>
<img src=${chrome.runtime.getURL('/popup/github.svg')} alt="" id="github">
</div></div>`)
document.body.append(Settings.firstChild)
var container = document.getElementById('container');
var extensionsettings = document.getElementById('ExtensionPopup');
container.onclick = function () {
if (!SettingsClicked) {
extensionsettings.classList.add('hidden');
}
SettingsClicked = false
}
}
function ApplyDraggableFunctions() {
var listItens = document.querySelectorAll('.draggable');
[].forEach.call(listItens, function (item) {
addEventsDragAndDrop(item);
});
}
// Code By Webdevtrick ( https://webdevtrick.com )
var remove = document.querySelector('.draggable');
function dragStart(e) {
this.style.opacity = '0.4';
dragSrcEl = this;
e.dataTransfer.effectAllowed = 'move';
e.dataTransfer.setData('text/html', this.innerHTML);
};
function dragEnter(e) {
this.classList.add('over');
}
function dragLeave(e) {
e.stopPropagation();
this.classList.remove('over');
}
function dragOver(e) {
e.preventDefault();
e.dataTransfer.dropEffect = 'move';
return false;
}
function dragDrop(e) {
if (dragSrcEl != this) {
const parentA = this.parentNode;
const siblingA = this.nextSibling === dragSrcEl ? this : this.nextSibling;
// Move `this` to before the `dragSrcEl`
dragSrcEl.parentNode.insertBefore(this, dragSrcEl);
// Move `dragSrcEl` to before the sibling of `this`
parentA.insertBefore(dragSrcEl, siblingA);
// Save position of all menu items
children = parentA.childNodes;
// console.log(children)
listorder = []
for (let i = 0; i < children.length; i++) {
const elm = children[i]
listorder.push(elm.dataset.key)
}
chrome.storage.local.set({ menuorder: listorder })
}
return false;
}
function dragEnd(e) {
var listItens = document.querySelectorAll('.draggable');
[].forEach.call(listItens, function (item) {
item.classList.remove('over');
});
this.style.opacity = '1';
}
function addEventsDragAndDrop(el) {
el.addEventListener('dragstart', dragStart, false);
el.addEventListener('dragenter', dragEnter, false);
el.addEventListener('dragover', dragOver, false);
el.addEventListener('dragleave', dragLeave, false);
el.addEventListener('drop', dragDrop, false);
el.addEventListener('dragend', dragEnd, false);
}
function cloneAttributes(target, source) {
[...source.attributes].forEach(attr => { target.setAttribute(attr.nodeName, attr.nodeValue) })
}
function OpenMenuOptions() {
chrome.storage.local.get(null, function (result) {
var container = document.getElementById('container');
var menu = document.getElementById('menu');
if (result.defaultmenuorder.length == '0') {
childnodes = menu.firstChild.childNodes;
newdefaultmenuorder = [];
for (let i = 0; i < childnodes.length; i++) {
const element = childnodes[i];
newdefaultmenuorder.push(element.dataset.key)
chrome.storage.local.set({ defaultmenuorder: newdefaultmenuorder })
}
}
childnodes = menu.firstChild.childNodes;
if (result.defaultmenuorder.length != childnodes.length) {
for (let i = 0; i < childnodes.length; i++) {
const element = childnodes[i];
if (!result.defaultmenuorder.indexOf(element.dataset.key)) {
newdefaultmenuorder = result.defaultmenuorder;
newdefaultmenuorder.push(element.dataset.key);
chrome.storage.local.set({ defaultmenuorder: newdefaultmenuorder })
}
}
}
MenuOptionsOpen = true;
cover = document.createElement('div');
cover.classList.add('notMenuCover');
menu.style.zIndex = '20';
menu.style.setProperty('--menuHidden', 'flex');
container.append(cover);
menusettings = document.createElement('div');
menusettings.classList.add('editmenuoption-container');
defaultbutton = document.createElement('div');
defaultbutton.classList.add('editmenuoption');
defaultbutton.innerText = 'Restore Default';
defaultbutton.id = 'restoredefaultoption';
savebutton = document.createElement('div');
savebutton.classList.add('editmenuoption');
savebutton.innerText = 'Save';
savebutton.id = 'restoredefaultoption';
menusettings.appendChild(defaultbutton);
menusettings.appendChild(savebutton);
menu.appendChild(menusettings);
ListItems = menu.firstChild.childNodes;
for (let i = 0; i < ListItems.length; i++) {
const element = ListItems[i];
element.classList.add('draggable');
element.setAttribute('draggable', true)
if (element.classList.contains('hasChildren')) {
element.classList.remove('active');
menu.firstChild.classList.remove('noscroll');
}
MenuItemToggle = stringToHTML(`<div class="onoffswitch" style="margin: auto 0;"><input class="onoffswitch-checkbox notification menuitem" type="checkbox" id="${element.dataset.key}"><label for="${element.dataset.key}" class="onoffswitch-label"></label>`).firstChild
element.append(MenuItemToggle);
if (!element.dataset.betterseqta) {
var a = document.createElement('section');
a.innerHTML = element.innerHTML;
cloneAttributes(a, element);
menu.firstChild.insertBefore(a, element);
element.remove();
}
}
if (Object.keys(result.menuitems).length == 0) {
menubuttons = menu.firstChild.childNodes;
var menuItems = {};
for (var i = 0; i < menubuttons.length; i++) {
var id = menubuttons[i].dataset.key;
const element = {}
element.toggle = true;
menuItems[id] = element;
}
chrome.storage.local.set({ menuitems: menuItems });
}
var menubuttons = document.getElementsByClassName('menuitem');
chrome.storage.local.get(["menuitems"], function (result) {
var menuItems = result.menuitems;
buttons = document.getElementsByClassName('menuitem');
for (var i = 0; i < buttons.length; i++) {
var id = buttons[i].id;
if (menuItems[id]) {
buttons[i].checked = menuItems[id].toggle;
}
if (!menuItems[id]) {
buttons[i].checked = true;
}
}
});
ApplyDraggableFunctions();
function StoreMenuSettings() {
chrome.storage.local.get(["menuitems"], function (result) {
var menuItems = {};
menubuttons = menu.firstChild.childNodes;
button = document.getElementsByClassName('menuitem');
for (var i = 0; i < menubuttons.length; i++) {
var id = menubuttons[i].dataset.key;
const element = {}
element.toggle = button[i].checked;
menuItems[id] = element;
}
chrome.storage.local.set({ menuitems: menuItems });
});
}
function changeDisplayProperty(element) {
if (!element.checked) {
element.parentNode.parentNode.style.display = 'var(--menuHidden)';
}
if (element.checked) {
element.parentNode.parentNode.style.setProperty('display', 'flex', 'important');
}
}
for (let i = 0; i < menubuttons.length; i++) {
const element = menubuttons[i];
element.addEventListener('change', () => { StoreMenuSettings(); changeDisplayProperty(element); })
}
function closeAll() {
ListItems = menu.firstChild.childNodes;
menusettings.remove();
cover.remove();
MenuOptionsOpen = false;
menu.style.setProperty('--menuHidden', 'none');
for (let i = 0; i < ListItems.length; i++) {
const element = ListItems[i];
element.classList.remove('draggable');
element.setAttribute('draggable', false)
if (!element.dataset.betterseqta) {
var a = document.createElement('li');
a.innerHTML = element.innerHTML;
cloneAttributes(a, element);
menu.firstChild.insertBefore(a, element);
element.remove();
}
}
switches = menu.querySelectorAll('.onoffswitch')
for (let i = 0; i < switches.length; i++) {
switches[i].remove()
}
StoreMenuSettings();
}
cover.addEventListener('click', closeAll)
savebutton.addEventListener('click', closeAll)
defaultbutton.addEventListener('click', function () {
chrome.storage.local.get(null, function (response) {
const options = response.defaultmenuorder
chrome.storage.local.set({ menuorder: options })
ChangeMenuItemPositions(options);
for (let i = 0; i < menubuttons.length; i++) {
const element = menubuttons[i];
element.checked = true;
element.parentNode.parentNode.style.setProperty('display', 'flex', 'important');
}
StoreMenuSettings();
})
})
})
}
function ReplaceMenuSVG(element, svg) {
item = element.firstChild;
item.firstChild.remove();
if (element.dataset.key == "messages") {
element.firstChild.innerText = "Direct Messages";
}
newsvg = stringToHTML(svg).firstChild;
item.insertBefore(newsvg, item.firstChild);
}
function AddBetterSEQTAElements(toggle) {
var code = document.getElementsByClassName("code")[0];
// Replaces students code with the version of BetterSEQTA
if (code != null) {
if (!code.innerHTML.includes("BestSEQTA")) {
UserInitalCode = code.innerText;
code.innerText = `BestSEQTA v${chrome.runtime.getManifest().version}`;
code.setAttribute('data-hover', 'Click for user code');
code.addEventListener('click', function () {
var code = document.getElementsByClassName("code")[0];
if (code.innerText.includes('BestSEQTA')) {
code.innerText = UserInitalCode;
code.setAttribute('data-hover', 'Click for BestSEQTA version')
}
else {
code.innerText = `BestSEQTA v${chrome.runtime.getManifest().version}`
code.setAttribute('data-hover', 'Click for user code');
}
})
if (toggle) {
// Creates Home menu button and appends it as the first child of the list
chrome.storage.local.get(['animatedbk'], function (result) {
if (result.animatedbk) {
CreateBackground();
}
else {
document.getElementById('container').style.background = "var(--background-secondary)";
}
})
var titlebar = document.createElement('div');
titlebar.classList.add("titlebar");
container = document.getElementById('content');
container.append(titlebar);
var NewButtonStr = `<li class="item" data-key="home" id="homebutton" data-path="/home" data-betterseqta="true"><label><svg style="width:24px;height:24px" viewBox="0 0 24 24"><path fill="currentColor" d="M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z" /></svg>Home</label></li>`;
var NewButton = stringToHTML(NewButtonStr);
var menu = document.getElementById("menu");
var List = menu.firstChild;
List.insertBefore(NewButton.firstChild, List.firstChild);
fetch(`${location.origin}/seqta/student/login`, {
method: "POST",
headers: {
"Content-Type": "application/json; charset=utf-8",
},
body: JSON.stringify({ "mode": "normal", "query": null, "redirect_url": location.origin })
})
.then((result) => result.json())
.then((response) => {
info = response.payload;
var titlebar = document.getElementsByClassName('titlebar')[0];
titlebar.append(stringToHTML(`<div class="userInfosvgdiv tooltip"><svg class="userInfosvg" viewBox="0 0 24 24"><path fill="var(--text-primary)" d="M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"></path></svg><div class="tooltiptext topmenutooltip" id="logouttooltip"></div></div>`).firstChild)
var userinfostr = `<div class="userInfo"><div class="userInfoText"><div style="display: flex; align-items: center;"><p class="userInfohouse userInfoCode"></p><p class="userInfoName">${info.userDesc}</p></div><p class="userInfoCode">${UserInitalCode}</p></div></div>`
var userinfo = stringToHTML(userinfostr).firstChild
titlebar.append(userinfo)
var logoutbutton = document.getElementsByClassName('logout')[0];
var userInfosvgdiv = document.getElementById('logouttooltip');
userInfosvgdiv.appendChild(logoutbutton);
fetch(`${location.origin}/seqta/student/load/message/people`, {
method: "POST",
headers: {
"Content-Type": "application/json; charset=utf-8",
},
body: JSON.stringify({ "mode": "student" })
})
.then((result) => result.json())
.then((response) => {
students = response.payload;
var index = students.findIndex(function (person) {
return person.firstname == (info.userDesc.split(' ')[0]) && person.surname == (info.userDesc.split(' ')[1])
});
houseelement = document.getElementsByClassName("userInfohouse")[0];
if (students[index].house) {
houseelement.style.background = students[index].house_colour;
colorresult = GetThresholdofHex(students[index].house_colour);
if (colorresult > 300) {
houseelement.style.color = "black";
}
else {
houseelement.style.color = "white";
}
houseelement.innerText = students[index].year + students[index].house;
}
else {
houseelement.innerText = students[index].year;
}
})
})
var NewsButtonStr = `<li class="item" data-key="news" id="newsbutton" data-path="/news" data-betterseqta="true"><label><svg style="width:24px;height:24px" viewBox="0 0 24 24"><path fill="currentColor" d="M20 3H4C2.89 3 2 3.89 2 5V19C2 20.11 2.89 21 4 21H20C21.11 21 22 20.11 22 19V5C22 3.89 21.11 3 20 3M5 7H10V13H5V7M19 17H5V15H19V17M19 13H12V11H19V13M19 9H12V7H19V9Z" /></svg>News</label></li>`;
var NewsButton = stringToHTML(NewsButtonStr);
List.appendChild(NewsButton.firstChild)
editmenu = document.createElement('div');
editmenu.classList.add('editmenu');
svg = stringToHTML('<svg style="width:24px;height:24px;padding:5px;" id="editmenu" viewBox="0 0 24 24"><path fill="currentColor" d="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z" /></svg>')
editmenu.append(svg.firstChild)
menu.appendChild(editmenu);
a = document.createElement('div');
a.classList.add('icon-cover');
a.id = 'icon-cover';
menu.appendChild(a);
var editmenu = document.querySelector("#editmenu");
editmenu.addEventListener("click", function () {
if (!MenuOptionsOpen) {
OpenMenuOptions();
}
})
var menuCover = document.querySelector("#icon-cover");
menuCover.addEventListener("click", function () {
location.href = '../#?page=/home'
SendHomePage();
document.getElementById('menu').firstChild.classList.remove('noscroll');
})
// Creates the home container when the menu button is pressed
var homebutton = document.getElementById("homebutton");
homebutton.addEventListener("click", function () {
if (!MenuOptionsOpen) {
SendHomePage();
}
});
// Creates the news container when the menu button is pressed
var newsbutton = document.getElementById("newsbutton");
newsbutton.addEventListener("click", function () {
if (!MenuOptionsOpen) {
SendNewsPage();
}
});
}
CallExtensionSettings();
RunExtensionSettingsJS();
if (toggle) {
// Creates settings and dashboard buttons next to alerts
var SettingsButton = stringToHTML(
`<button class="addedButton tooltip" id="AddedSettings""><svg width="24" height="24" viewBox="0 0 24 24"><g><g><path d="M23.182,6.923c-.29,0-3.662,2.122-4.142,2.4l-2.8-1.555V4.511l4.257-2.456a.518.518,0,0,0,.233-.408.479.479,0,0,0-.233-.407,6.511,6.511,0,1,0-3.327,12.107,6.582,6.582,0,0,0,6.148-4.374,5.228,5.228,0,0,0,.333-1.542A.461.461,0,0,0,23.182,6.923Z"></path><path d="M9.73,10.418,7.376,12.883c-.01.01-.021.016-.03.025L1.158,19.1a2.682,2.682,0,1,0,3.793,3.793l4.583-4.582,0,0,4.1-4.005-.037-.037A9.094,9.094,0,0,1,9.73,10.418ZM3.053,21.888A.894.894,0,1,1,3.946,21,.893.893,0,0,1,3.053,21.888Z"></path></g></g></svg><div class="tooltiptext topmenutooltip">BestSEQTA Settings</div></button>`
);
var ContentDiv = document.getElementById("content");
ContentDiv.append(SettingsButton.firstChild);
chrome.storage.local.get(['DarkMode'], function (result) {
Darkmode = result.DarkMode;
tooltipstring = GetLightDarkModeString(Darkmode);
var LightDarkModeButton = stringToHTML(`<button class="addedButton DarkLightButton tooltip" id="LightDarkModeButton"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" style="width: 100%; height: 100%; transform: translate3d(0px, 0px, 0px);" preserveAspectRatio="xMidYMid meet"></svg><div class="tooltiptext topmenutooltip" id="darklighttooliptext">${tooltipstring}</div></button>`);
ContentDiv.append(LightDarkModeButton.firstChild);
LightDarkModeElement = document.getElementById('LightDarkModeButton');
if (Darkmode) {
LightDarkModeElement.firstChild.innerHTML = `<defs><clipPath id="__lottie_element_80"><rect width="24" height="24" x="0" y="0"></rect></clipPath></defs><g clip-path="url(#__lottie_element_80)"><g style="display: block;" transform="matrix(1,0,0,1,12,12)" opacity="1"><g opacity="1" transform="matrix(1,0,0,1,0,0)"><path fill-opacity="1" d=" M0,-4 C-2.2100000381469727,-4 -4,-2.2100000381469727 -4,0 C-4,2.2100000381469727 -2.2100000381469727,4 0,4 C2.2100000381469727,4 4,2.2100000381469727 4,0 C4,-2.2100000381469727 2.2100000381469727,-4 0,-4z"></path></g></g><g style="display: block;" transform="matrix(1,0,0,1,12,12)" opacity="1"><g opacity="1" transform="matrix(1,0,0,1,0,0)"><path fill-opacity="1" d=" M0,6 C-3.309999942779541,6 -6,3.309999942779541 -6,0 C-6,-3.309999942779541 -3.309999942779541,-6 0,-6 C3.309999942779541,-6 6,-3.309999942779541 6,0 C6,3.309999942779541 3.309999942779541,6 0,6z M8,-3.309999942779541 C8,-3.309999942779541 8,-8 8,-8 C8,-8 3.309999942779541,-8 3.309999942779541,-8 C3.309999942779541,-8 0,-11.3100004196167 0,-11.3100004196167 C0,-11.3100004196167 -3.309999942779541,-8 -3.309999942779541,-8 C-3.309999942779541,-8 -8,-8 -8,-8 C-8,-8 -8,-3.309999942779541 -8,-3.309999942779541 C-8,-3.309999942779541 -11.3100004196167,0 -11.3100004196167,0 C-11.3100004196167,0 -8,3.309999942779541 -8,3.309999942779541 C-8,3.309999942779541 -8,8 -8,8 C-8,8 -3.309999942779541,8 -3.309999942779541,8 C-3.309999942779541,8 0,11.3100004196167 0,11.3100004196167 C0,11.3100004196167 3.309999942779541,8 3.309999942779541,8 C3.309999942779541,8 8,8 8,8 C8,8 8,3.309999942779541 8,3.309999942779541 C8,3.309999942779541 11.3100004196167,0 11.3100004196167,0 C11.3100004196167,0 8,-3.309999942779541 8,-3.309999942779541z"></path></g></g></g>`
} else {
LightDarkModeElement.firstChild.innerHTML = `<defs><clipPath id="__lottie_element_263"><rect width="24" height="24" x="0" y="0"></rect></clipPath></defs><g clip-path="url(#__lottie_element_263)"><g style="display: block;" transform="matrix(1.5,0,0,1.5,7,12)" opacity="1"><g opacity="1" transform="matrix(1,0,0,1,0,0)"><path fill-opacity="1" d=" M0,-4 C-2.2100000381469727,-4 -1.2920000553131104,-2.2100000381469727 -1.2920000553131104,0 C-1.2920000553131104,2.2100000381469727 -2.2100000381469727,4 0,4 C2.2100000381469727,4 4,2.2100000381469727 4,0 C4,-2.2100000381469727 2.2100000381469727,-4 0,-4z"></path></g></g><g style="display: block;" transform="matrix(-1,0,0,-1,12,12)" opacity="1"><g opacity="1" transform="matrix(1,0,0,1,0,0)"><path fill-opacity="1" d=" M0,6 C-3.309999942779541,6 -6,3.309999942779541 -6,0 C-6,-3.309999942779541 -3.309999942779541,-6 0,-6 C3.309999942779541,-6 6,-3.309999942779541 6,0 C6,3.309999942779541 3.309999942779541,6 0,6z M8,-3.309999942779541 C8,-3.309999942779541 8,-8 8,-8 C8,-8 3.309999942779541,-8 3.309999942779541,-8 C3.309999942779541,-8 0,-11.3100004196167 0,-11.3100004196167 C0,-11.3100004196167 -3.309999942779541,-8 -3.309999942779541,-8 C-3.309999942779541,-8 -8,-8 -8,-8 C-8,-8 -8,-3.309999942779541 -8,-3.309999942779541 C-8,-3.309999942779541 -11.3100004196167,0 -11.3100004196167,0 C-11.3100004196167,0 -8,3.309999942779541 -8,3.309999942779541 C-8,3.309999942779541 -8,8 -8,8 C-8,8 -3.309999942779541,8 -3.309999942779541,8 C-3.309999942779541,8 0,11.3100004196167 0,11.3100004196167 C0,11.3100004196167 3.309999942779541,8 3.309999942779541,8 C3.309999942779541,8 8,8 8,8 C8,8 8,3.309999942779541 8,3.309999942779541 C8,3.309999942779541 11.3100004196167,0 11.3100004196167,0 C11.3100004196167,0 8,-3.309999942779541 8,-3.309999942779541z"></path></g></g></g>`
}
darklightText = document.getElementById('darklighttooliptext');
LightDarkModeElement.addEventListener('click', function () {
chrome.storage.local.get(['DarkMode'], function (result) {
alliframes = document.getElementsByTagName('iframe');
fileref = GetiFrameCSSElement();
if (!result.DarkMode) {
document.documentElement.style.setProperty('--background-primary', "#232323");
document.documentElement.style.setProperty('--background-secondary', "#1a1a1a");
document.documentElement.style.setProperty('--text-primary', "white");
LightDarkModeElement.firstChild.innerHTML = `<defs><clipPath id="__lottie_element_80"><rect width="24" height="24" x="0" y="0"></rect></clipPath></defs><g clip-path="url(#__lottie_element_80)"><g style="display: block;" transform="matrix(1,0,0,1,12,12)" opacity="1"><g opacity="1" transform="matrix(1,0,0,1,0,0)"><path fill-opacity="1" d=" M0,-4 C-2.2100000381469727,-4 -4,-2.2100000381469727 -4,0 C-4,2.2100000381469727 -2.2100000381469727,4 0,4 C2.2100000381469727,4 4,2.2100000381469727 4,0 C4,-2.2100000381469727 2.2100000381469727,-4 0,-4z"></path></g></g><g style="display: block;" transform="matrix(1,0,0,1,12,12)" opacity="1"><g opacity="1" transform="matrix(1,0,0,1,0,0)"><path fill-opacity="1" d=" M0,6 C-3.309999942779541,6 -6,3.309999942779541 -6,0 C-6,-3.309999942779541 -3.309999942779541,-6 0,-6 C3.309999942779541,-6 6,-3.309999942779541 6,0 C6,3.309999942779541 3.309999942779541,6 0,6z M8,-3.309999942779541 C8,-3.309999942779541 8,-8 8,-8 C8,-8 3.309999942779541,-8 3.309999942779541,-8 C3.309999942779541,-8 0,-11.3100004196167 0,-11.3100004196167 C0,-11.3100004196167 -3.309999942779541,-8 -3.309999942779541,-8 C-3.309999942779541,-8 -8,-8 -8,-8 C-8,-8 -8,-3.309999942779541 -8,-3.309999942779541 C-8,-3.309999942779541 -11.3100004196167,0 -11.3100004196167,0 C-11.3100004196167,0 -8,3.309999942779541 -8,3.309999942779541 C-8,3.309999942779541 -8,8 -8,8 C-8,8 -3.309999942779541,8 -3.309999942779541,8 C-3.309999942779541,8 0,11.3100004196167 0,11.3100004196167 C0,11.3100004196167 3.309999942779541,8 3.309999942779541,8 C3.309999942779541,8 8,8 8,8 C8,8 8,3.309999942779541 8,3.309999942779541 C8,3.309999942779541 11.3100004196167,0 11.3100004196167,0 C11.3100004196167,0 8,-3.309999942779541 8,-3.309999942779541z"></path></g></g></g>`
for (let i = 0; i < alliframes.length; i++) {
const element = alliframes[i];
element.contentDocument.documentElement.childNodes[1].style.color = "white";
element.contentDocument.documentElement.firstChild.appendChild(fileref);
}
}
else {
document.documentElement.style.setProperty('--background-primary', "#ffffff");
document.documentElement.style.setProperty('--background-secondary', "#e5e7eb");
document.documentElement.style.setProperty('--text-primary', "black");
LightDarkModeElement.firstChild.innerHTML = `<defs><clipPath id="__lottie_element_263"><rect width="24" height="24" x="0" y="0"></rect></clipPath></defs><g clip-path="url(#__lottie_element_263)"><g style="display: block;" transform="matrix(1.5,0,0,1.5,7,12)" opacity="1"><g opacity="1" transform="matrix(1,0,0,1,0,0)"><path fill-opacity="1" d=" M0,-4 C-2.2100000381469727,-4 -1.2920000553131104,-2.2100000381469727 -1.2920000553131104,0 C-1.2920000553131104,2.2100000381469727 -2.2100000381469727,4 0,4 C2.2100000381469727,4 4,2.2100000381469727 4,0 C4,-2.2100000381469727 2.2100000381469727,-4 0,-4z"></path></g></g><g style="display: block;" transform="matrix(-1,0,0,-1,12,12)" opacity="1"><g opacity="1" transform="matrix(1,0,0,1,0,0)"><path fill-opacity="1" d=" M0,6 C-3.309999942779541,6 -6,3.309999942779541 -6,0 C-6,-3.309999942779541 -3.309999942779541,-6 0,-6 C3.309999942779541,-6 6,-3.309999942779541 6,0 C6,3.309999942779541 3.309999942779541,6 0,6z M8,-3.309999942779541 C8,-3.309999942779541 8,-8 8,-8 C8,-8 3.309999942779541,-8 3.309999942779541,-8 C3.309999942779541,-8 0,-11.3100004196167 0,-11.3100004196167 C0,-11.3100004196167 -3.309999942779541,-8 -3.309999942779541,-8 C-3.309999942779541,-8 -8,-8 -8,-8 C-8,-8 -8,-3.309999942779541 -8,-3.309999942779541 C-8,-3.309999942779541 -11.3100004196167,0 -11.3100004196167,0 C-11.3100004196167,0 -8,3.309999942779541 -8,3.309999942779541 C-8,3.309999942779541 -8,8 -8,8 C-8,8 -3.309999942779541,8 -3.309999942779541,8 C-3.309999942779541,8 0,11.3100004196167 0,11.3100004196167 C0,11.3100004196167 3.309999942779541,8 3.309999942779541,8 C3.309999942779541,8 8,8 8,8 C8,8 8,3.309999942779541 8,3.309999942779541 C8,3.309999942779541 11.3100004196167,0 11.3100004196167,0 C11.3100004196167,0 8,-3.309999942779541 8,-3.309999942779541z"></path></g></g></g>`
for (let i = 0; i < alliframes.length; i++) {
const element = alliframes[i];
element.contentDocument.documentElement.childNodes[1].style.color = "black";
element.contentDocument.documentElement.firstChild.lastChild.remove();
}
}
tooltipstring = GetLightDarkModeString(!result.DarkMode);
darklightText.innerText = tooltipstring;
chrome.storage.local.set({ DarkMode: !result.DarkMode });
});
});
});
} else {
// Creates settings and dashboard buttons next to alerts
var SettingsButton = stringToHTML(
`<button class="addedButton" id="AddedSettings""><svg width="24" height="24" viewBox="0 0 24 24"><g style="fill: var(--text-color);"><g><path d="M23.182,6.923c-.29,0-3.662,2.122-4.142,2.4l-2.8-1.555V4.511l4.257-2.456a.518.518,0,0,0,.233-.408.479.479,0,0,0-.233-.407,6.511,6.511,0,1,0-3.327,12.107,6.582,6.582,0,0,0,6.148-4.374,5.228,5.228,0,0,0,.333-1.542A.461.461,0,0,0,23.182,6.923Z"></path><path d="M9.73,10.418,7.376,12.883c-.01.01-.021.016-.03.025L1.158,19.1a2.682,2.682,0,1,0,3.793,3.793l4.583-4.582,0,0,4.1-4.005-.037-.037A9.094,9.094,0,0,1,9.73,10.418ZM3.053,21.888A.894.894,0,1,1,3.946,21,.893.893,0,0,1,3.053,21.888Z"></path></g></g></svg></button>`
);
var ContentDiv = document.getElementById("content");
ContentDiv.append(SettingsButton.firstChild);
}
var AddedSettings = document.getElementById("AddedSettings");
var extensionsettings = document.getElementById("ExtensionPopup")
AddedSettings.addEventListener("click", function () {
extensionsettings.classList.toggle('hidden');
SettingsClicked = true
});
}
}
}
function GetLightDarkModeString(darkmodetoggle) {
if (darkmodetoggle) {
tooltipstring = "Switch to light theme";
} else {
tooltipstring = "Switch to dark theme";
}
return tooltipstring;
}
function delay(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
function ChangeCurrentPage(newpage) {
window.location.replace(`${location.origin}"/#?page=/" + ${newpage}`);
}
function CheckCurrentLesson(lesson, num) {
var startTime = lesson.from;
var endTime = lesson.until;
// Gets current time
currentDate = new Date();
// Takes start time of current lesson and makes it into a Date function for comparison
startDate = new Date(currentDate.getTime());
startDate.setHours(startTime.split(":")[0]);
startDate.setMinutes(startTime.split(":")[1]);
startDate.setSeconds("00");
// Takes end time of current lesson and makes it into a Date function for comparison
endDate = new Date(currentDate.getTime());
endDate.setHours(endTime.split(":")[0]);
endDate.setMinutes(endTime.split(":")[1]);
endDate.setSeconds("00");
// Gets the difference between the start time and current time
var difference = startDate.getTime() - currentDate.getTime();
// Converts the difference into minutes
var minutes = Math.floor(difference / 1000 / 60);
// Checks if current time is between the start time and end time of current tested lesson
valid = startDate < currentDate && endDate > currentDate;
id = lesson.code + num
const date = new Date()
var elementA = document.getElementById(id);
if (!elementA) {
clearInterval(LessonInterval);
}
else {
if (currentSelectedDate.toLocaleDateString('en-au') == date.toLocaleDateString('en-au')) {
if (valid) {
// Apply the activelesson class to increase the box-shadow of current lesson
elementA.classList.add("activelesson");
} else {
// Removes the activelesson class to ensure only the active lesson have the class
if (elementA != null) {
elementA.classList.remove("activelesson");
}
}
}
}
// If 5 minutes before the start of another lesson:
if (minutes == 5) {
chrome.storage.local.get('lessonalert', function (result) {
if (result.lessonalert) {
// Checks if notifications are supported
if (!window.Notification) {
console.log("Browser does not support notifications.");
} else {
// check if permission is already granted
if (Notification.permission === "granted") {
// show notification here
} else {
// request permission from user
Notification.requestPermission()
.then(function (p) {
if (p === "granted") {
// show notification here
var notify = new Notification("Next Lesson in 5 Minutes:", {
body:
"Subject: " +
lesson.description +
" \nRoom: " +
lesson.room +
" \nTeacher: " +
lesson.staff,
});
} else {
console.log("User blocked notifications.");
}
})
.catch(function (err) {
console.error(err);
});
}
}
}
});
}
}
function hexToRGB(hex) {
var r = parseInt(hex.slice(1, 3), 16),
g = parseInt(hex.slice(3, 5), 16),
b = parseInt(hex.slice(5, 7), 16);
return { 'r': r, 'g': g, 'b': b }
}
function GetThresholdofHex(hex) {
var rgb = hexToRGB(hex)
return Math.sqrt(rgb.r ** 2 + rgb.g ** 2 + rgb.b ** 2)
}
function CheckCurrentLessonAll(lessons) {
// Checks each lesson and sets an interval to run every 60 seconds to continue updating
LessonInterval = setInterval(
function () {
for (i = 0; i < lessons.length; i++) {
CheckCurrentLesson(lessons[i], i + 1);
}
}.bind(lessons),
60000
);
}
function MakeLessonDiv(lesson, num) {
assessmentstring = ""
var lessonstring = `<div class="day" id=${lesson.code + num} style="${lesson.colour}"><h2>${lesson?.description ?? "Unknown"}</h2><h3>${lesson?.staff ?? "Unknown"}</h3><h3>${lesson?.room ?? "Unknown"}</h3><h4>${lesson?.from ?? "Unknown"} - ${lesson?.until ?? "Unknown"}</h4><h5>${lesson?.attendanceTitle ?? "Unknown"}</h5>`
if (lesson.programmeID != 0) {
lessonstring += `<div class="day-button clickable" style="right: 5px;" onclick="location.href='../#?page=/assessments/${lesson.programmeID}:${lesson.metaID}'">${assessmentsicon}</div><div class="day-button clickable" style="right: 35px;" onclick="location.href='../#?page=/courses/${lesson.programmeID}:${lesson.metaID}'">${coursesicon}</div>`
}
if (lesson.assessments.length > 0) {
for (let i = 0; i < lesson.assessments.length; i++) {
const element = lesson.assessments[i]
assessmentstring += `<p onclick="location.href = '../#?page=/assessments/${lesson.programmeID}:${lesson.metaID}&item=${element.id}';">${element.title}</p>`
}
lessonstring += `<div class="tooltip assessmenttooltip"><svg style="width:28px;height:28px;border-radius:0;" viewBox="0 0 24 24">
<path fill="#ed3939" d="M16 2H4C2.9 2 2 2.9 2 4V20C2 21.11 2.9 22 4 22H16C17.11 22 18 21.11 18 20V4C18 2.9 17.11 2 16 2M16 20H4V4H6V12L8.5 9.75L11 12V4H16V20M20 15H22V17H20V15M22 7V13H20V7H22Z" />
</svg><div class="tooltiptext">${assessmentstring}</div></div>`
}
lessonstring += '</div>';
var lessondiv = stringToHTML(lessonstring);
return lessondiv;
}
function CheckUnmarkedAttendance(lessonattendance) {
if (lessonattendance) {
var lesson = lessonattendance.label;
}
else {
var lesson = " ";
}
return lesson;
}
function callHomeTimetable(date, change) {
// Creates a HTTP Post Request to the SEQTA page for the students timetable
var xhr = new XMLHttpRequest();
xhr.open(
"POST",
`${location.origin}/seqta/student/load/timetable?`,
true
);
// Sets the response type to json
xhr.setRequestHeader("Content-Type", "application/json; charset=utf-8");
xhr.onreadystatechange = function () {
// Once the response is ready
if (xhr.readyState === 4) {
var serverResponse = JSON.parse(xhr.response);
lessonArray = [];
var DayContainer = document.getElementById("day-container")
// If items in response:
if (serverResponse.payload.items.length > 0) {
if (!DayContainer.innerText || change) {
// console.log(serverResponse.payload.items.length);
for (let i = 0; i < serverResponse.payload.items.length; i++) {
lessonArray.push(serverResponse.payload.items[i]);
}
lessonArray.sort(function (a, b) {
return a.from.localeCompare(b.from);
});
// If items in the response, set each corresponding value into divs
// lessonArray = lessonArray.splice(1)
GetLessonColours().then((colours) => {
subjects = colours;
for (let i = 0; i < lessonArray.length; i++) {
subjectname = `timetable.subject.colour.${lessonArray[i].code}`
subject = subjects.find(element => element.name === subjectname)
if (!subject) {
lessonArray[i].colour = `--item-colour: #8e8e8e;`
}
else {
lessonArray[i].colour = `--item-colour: ${subject.value};`
result = GetThresholdofHex(subject.value);
if (result > 300) {
lessonArray[i].invert = true;
}
}
// Removes seconds from the start and end times
lessonArray[i].from = lessonArray[i].from.substring(0, 5);
lessonArray[i].until = lessonArray[i].until.substring(0, 5);
// Checks if attendance is unmarked, and sets the string to " ".
lessonArray[i].attendanceTitle = CheckUnmarkedAttendance(
lessonArray[i].attendance)
}
// If on home page, apply each lesson to HTML with information in each div
DayContainer.innerText = '';
for (let i = 0; i < lessonArray.length; i++) {
var div = MakeLessonDiv(lessonArray[i], i + 1);
// Append each of the lessons into the day-container
if (lessonArray[i].invert) {
div.firstChild.classList.add('day-inverted');
}
DayContainer.append(div.firstChild);
}
const today = new Date();
if (currentSelectedDate.getDate() == today.getDate()) {
for (i = 0; i < lessonArray.length; i++) {
CheckCurrentLesson(lessonArray[i], i + 1);
}
// For each lesson, check the start and end times
CheckCurrentLessonAll(lessonArray);
}
})
}
}
else {
if (!DayContainer.innerText || change) {
DayContainer.innerText = '';
var dummyDay = document.createElement("div");
dummyDay.classList.add("day-empty");
img = document.createElement('img')
img.src = chrome.runtime.getURL('icons/betterseqta-light-icon.png')
text = document.createElement('p')
text.innerText = "No lessons available."
dummyDay.append(img);
dummyDay.append(text);
DayContainer.append(dummyDay);
}
}
}
};
xhr.send(
JSON.stringify({
// Information sent to SEQTA page as a request with the dates and student number
from: date,
until: date,
// Funny number
student: 69,
})
);
}
function GetUpcomingAssessments() {
func = fetch(`${location.origin}/seqta/student/assessment/list/upcoming?`, {
method: "POST",
headers: {
"Content-Type": "application/json; charset=utf-8",
},
body: JSON.stringify({ "student": 69 })
})
return func
.then((result) => result.json())
.then(response => (response.payload))
}
function GetActiveClasses() {
func = fetch(`${location.origin}/seqta/student/load/subjects?`, {
method: "POST",
headers: {
"Content-Type": "application/json; charset=utf-8",
},
body: JSON.stringify({})
})
return func
.then((result) => result.json())
.then(response => (response.payload))
}
function comparedate(obj1, obj2) {
if (obj1.date < obj2.date) {
return -1;
}
if (obj1.date > obj2.date) {
return 1;
}
return 0;
}
function CreateElement(type, class_, id, innerText, innerHTML, style) {
element = document.createElement(type);
if (class_ !== undefined) {
element.classList.add(class_);
}
if (id !== undefined) {
element.id = id;
}
if (innerText !== undefined) {
element.innerText = innerText;
}
if (innerHTML !== undefined) {
element.innerHTML = innerHTML;
}
if (style !== undefined) {
element.style = style;
}
return element
}
function createAssessmentDateDiv(date, value, datecase = undefined) {
var options = { weekday: 'long', month: 'long', day: 'numeric' };
const FormattedDate = new Date(date)
const assessments = value.assessments;
const container = value.div;
DateTitleDiv = document.createElement('div');
DateTitleDiv.classList.add('upcoming-date-title');
if (datecase) {
datetitle = document.createElement('h5');
datetitle.classList.add('upcoming-special-day')
datetitle.innerText = datecase;
DateTitleDiv.append(datetitle);
container.setAttribute('data-day', datecase);
}
DateTitle = document.createElement('h5')
DateTitle.innerText = FormattedDate.toLocaleDateString("en-AU", options);
DateTitleDiv.append(DateTitle);
container.append(DateTitleDiv);
assessmentContainer = document.createElement('div')
assessmentContainer.classList.add('upcoming-date-assessments');
for (let i = 0; i < assessments.length; i++) {
const element = assessments[i];
item = document.createElement('div')
item.classList.add('upcoming-assessment');
item.setAttribute('data-subject', element.code);
item.id = `assessment${element.id}`;
item.style = element.colour;
titlediv = document.createElement('div');
titlediv.classList.add('upcoming-subject-title');
titlesvg = stringToHTML(`<svg viewBox="0 0 24 24" style="width:35px;height:35px;fill:white;">
<path d="M6 20H13V22H6C4.89 22 4 21.11 4 20V4C4 2.9 4.89 2 6 2H18C19.11 2 20 2.9 20 4V12.54L18.5 11.72L18 12V4H13V12L10.5 9.75L8 12V4H6V20M24 17L18.5 14L13 17L18.5 20L24 17M15 19.09V21.09L18.5 23L22 21.09V19.09L18.5 21L15 19.09Z"></path>
</svg>`).firstChild
titlediv.append(titlesvg);
detailsdiv = document.createElement('div');
detailsdiv.classList.add('upcoming-details');
detailstitle = document.createElement('h5');
detailstitle.innerText = `${element.subject} assessment`;
subject = document.createElement('p');
subject.innerText = element.title;
subject.classList.add('upcoming-assessment-title');
subject.onclick = function () { location.href = `../#?page=/assessments/${element.programmeID}:${element.metaclassID}&item=${element.id}` };
detailsdiv.append(detailstitle);
detailsdiv.append(subject);
item.append(titlediv);
item.append(detailsdiv);
assessmentContainer.append(item);
fetch(`${location.origin}/seqta/student/assessment/submissions/get`, {
method: "POST",
headers: {
"Content-Type": "application/json; charset=utf-8",
},
body: JSON.stringify({ "assessment": element.id, "metaclass": element.metaclassID, "student": 69 })
})
.then((result) => result.json())
.then((response) => {
if (response.payload.length > 0) {
const assessment = document.querySelector(`#assessment${element.id}`);
// ticksvg = stringToHTML(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="var(--item-colour)" viewBox="0 0 24 24"><path d="M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z"/></svg>`).firstChild
// ticksvg.classList.add('upcoming-tick');
// assessment.append(ticksvg);
submittedtext = document.createElement('div')
submittedtext.classList.add('upcoming-submittedtext');
submittedtext.innerText = "Submitted";
assessment.append(submittedtext);
}
})
}
container.append(assessmentContainer);
return container;
}
function CheckSpecialDay(date1, date2) {
if (
date1.getFullYear() === date2.getFullYear() &&
date1.getMonth() === date2.getMonth() &&
(date1.getDate() - 1) === date2.getDate()
) {
return "Yesterday";
}
if (
date1.getFullYear() === date2.getFullYear() &&
date1.getMonth() === date2.getMonth() &&
date1.getDate() === date2.getDate()
) {
TodayinUpcoming = true;
return "Today";
}
if (
date1.getFullYear() === date2.getFullYear() &&
date1.getMonth() === date2.getMonth() &&
(date1.getDate() + 1) === date2.getDate()
) {
TomorrowinUpcoming = true;
return "Tomorrow";
}
}
function CreateDateCheckedDiv(text, date) {
upcomingitemcontainer = document.querySelector('#upcoming-items')
container = CreateElement(type = 'div', class_ = 'upcoming-date-container');
datecontainer = CreateElement(type = 'div', class_ = 'upcoming-date-title');
titletext = CreateElement(type = 'h5', class_ = 'upcoming-special-day', id = undefined, innerText = text);
titledate = CreateElement(type = 'h5', class_ = undefined, id = undefined, innerText = date);
textcontainer = CreateElement('div', 'upcoming-blank')
textblank = CreateElement('p');
textblank.innerText = 'No assessments due';
textcontainer.append(textblank)
datecontainer.append(titletext);
datecontainer.append(titledate);
container.append(datecontainer);
container.append(textcontainer)
upcomingitemcontainer.append(container);
}
function CreateSubjectFilter(subjectcode, itemcolour, checked) {
label = CreateElement('label', "upcoming-checkbox-container")
label.innerText = subjectcode;
input = CreateElement('input');
input.type = "checkbox";
input.checked = checked;
input.id = `filter-${subjectcode}`;
label.style = itemcolour;
span = CreateElement('span', 'upcoming-checkmark')
label.append(input);
label.append(span);
input.addEventListener('change', function (change) {
chrome.storage.local.get(null, function (storage) {
filters = storage.subjectfilters;
id = change.target.id.split('-')[1]
filters[id] = change.target.checked
chrome.storage.local.set({ subjectfilters: filters })
})
})
return label
}
function CreateFilters(subjects) {
chrome.storage.local.get(null, function (result) {
filteroptions = result.subjectfilters
filterdiv = document.querySelector('#upcoming-filters')
for (let i = 0; i < subjects.length; i++) {
const element = subjects[i];
if (!filteroptions.hasOwnProperty(element.code)) {
filteroptions[element.code] = true;
chrome.storage.local.set({ subjectfilters: filteroptions });
}
elementdiv = CreateSubjectFilter(element.code, element.colour, filteroptions[element.code])
filterdiv.append(elementdiv)
}
})
}
function CreateUpcomingSection(assessments) {
upcomingitemcontainer = document.querySelector('#upcoming-items')
homecontainer = document.querySelector('#home-container')
overdueDates = [];
upcomingDates = {};
TodayinUpcoming = false;
TomorrowinUpcoming = false;
// date = '2022/3/20';
// var Today = new Date(date);
var Today = new Date();
// Removes overdue assessments from the upcoming assessments array and pushes to overdue array
for (let i = 0; i < assessments.length; i++) {
const element = assessments[i];
assessmentdue = new Date(element.due);
CheckSpecialDay(Today, assessmentdue)
if (assessmentdue < Today) {
if (!CheckSpecialDay(Today, assessmentdue)) {
overdueDates.push(element);
assessments.splice(i, 1);
i--;
}
}
}
var options = { weekday: 'long', month: 'long', day: 'numeric' };
if (!TodayinUpcoming) {
text = Today.toLocaleDateString("en-AU", options);
CreateDateCheckedDiv("Today", text);
}
function addTomorrowinUpcoming() {
// var TomorrowDate = new Date(date);
var TomorrowDate = new Date();
TomorrowDate.setDate((TomorrowDate.getDate() + 1))
textDate = TomorrowDate.toLocaleDateString("en-AU", options);
CreateDateCheckedDiv("Tomorrow", textDate);
}
if (!TomorrowinUpcoming && !TodayinUpcoming) {
addTomorrowinUpcoming();
}
GetLessonColours().then((colours) => {
subjects = colours;
for (let i = 0; i < assessments.length; i++) {
subjectname = `timetable.subject.colour.${assessments[i].code}`
subject = subjects.find(element => element.name === subjectname)
if (!subject) {
assessments[i].colour = `--item-colour: #8e8e8e;`
}
else {
assessments[i].colour = `--item-colour: ${subject.value};`
result = GetThresholdofHex(subject.value);
}
}
for (let i = 0; i < activeSubjects.length; i++) {
const element = activeSubjects[i];
subjectname = `timetable.subject.colour.${element.code}`
colour = colours.find(element => element.name === subjectname);
if (!colour) {
element.colour = `--item-colour: #8e8e8e;`
}
else {
element.colour = `--item-colour: ${colour.value};`
result = GetThresholdofHex(colour.value);
if (result > 300) {
element.invert = true;
}
}
}
CreateFilters(activeSubjects);
for (let i = 0; i < assessments.length; i++) {
const element = assessments[i];
if (!upcomingDates[element.due]) {
dateObj = new Object();
dateObj.div = CreateElement(type = 'div', class_ = 'upcoming-date-container')
dateObj.assessments = [];
upcomingDates[element.due] = dateObj;
}
assessmentDateDiv = upcomingDates[element.due];
assessmentDateDiv.assessments.push(element);
}
for (var date in upcomingDates) {
assessmentdue = new Date(upcomingDates[date].assessments[0].due);
specialcase = CheckSpecialDay(Today, assessmentdue);
if (specialcase) {
assessmentDate = createAssessmentDateDiv(date, upcomingDates[date], datecase = specialcase);
} else {
assessmentDate = createAssessmentDateDiv(date, upcomingDates[date]);
}
if (specialcase === 'Yesterday') {
upcomingitemcontainer.insertBefore(assessmentDate, upcomingitemcontainer.firstChild);
} else {
upcomingitemcontainer.append(assessmentDate)
}
if (specialcase === 'Today' && !TomorrowinUpcoming) {
addTomorrowinUpcoming();
}
}
chrome.storage.local.get(null, function (result) {
FilterUpcomingAssessments(result.subjectfilters);
})
})
}
function AddPlaceHolderToParent(parent, numberofassessments) {
textcontainer = CreateElement('div', 'upcoming-blank')
textblank = CreateElement('p', 'upcoming-hiddenassessment');
s = "";
if (numberofassessments > 1) {
s = "s";
}
textblank.innerText = `${numberofassessments} hidden assessment${s} due`;
textcontainer.append(textblank);
textcontainer.setAttribute('data-hidden', true);
parent.append(textcontainer);
}
function FilterUpcomingAssessments(subjectoptions) {
for (var item in subjectoptions) {
subjectdivs = document.querySelectorAll(`[data-subject="${item}"]`);
for (let i = 0; i < subjectdivs.length; i++) {
const element = subjectdivs[i];
if (!subjectoptions[item]) {
element.classList.add('hidden');
}
if (subjectoptions[item]) {
element.classList.remove('hidden');
}
element.parentNode.classList.remove('hidden');
children = element.parentNode.parentNode.children
for (let i = 0; i < children.length; i++) {
const element = children[i];
if (element.hasAttribute('data-hidden')) {
element.remove();
}
}
if (element.parentNode.children.length == element.parentNode.querySelectorAll(".hidden").length) {
if (element.parentNode.querySelectorAll(".hidden").length > 0) {
if (!element.parentNode.parentNode.hasAttribute('data-day')) {
element.parentNode.parentNode.classList.add('hidden');
} else {
AddPlaceHolderToParent(element.parentNode.parentNode, element.parentNode.querySelectorAll(".hidden").length)
}
}
}
else {
element.parentNode.parentNode.classList.remove('hidden');
}
}
}
}
chrome.storage.onChanged.addListener(function (changes) {
if (changes.subjectfilters) {
FilterUpcomingAssessments(changes.subjectfilters.newValue);
}
})
function GetLessonColours() {
func = fetch(`${location.origin}/seqta/student/load/prefs?`, {
method: "POST",
headers: {
"Content-Type": "application/json; charset=utf-8",
},
body: JSON.stringify({ "request": "userPrefs", "asArray": true, "user": 69 })
})
return func
.then((result) => result.json())
.then(response => (response.payload))
}
function CreateCustomShortcutDiv(element) {
// Creates the stucture and element information for each seperate shortcut
var shortcut = document.createElement("a");
shortcut.setAttribute("href", element.url);
shortcut.setAttribute("target", "_blank");
var shortcutdiv = document.createElement("div");
shortcutdiv.classList.add("shortcut");
shortcutdiv.classList.add("customshortcut");
image = stringToHTML(`<svg viewBox="0 0 40 40" style="width:39px;height:39px"><text font-size="32" font-weight="bold" fill="var(--text-primary)" x="50%" y="50%" text-anchor="middle" dominant-baseline="central">${element.icon}</text></svg>`).firstChild
image.classList.add("shortcuticondiv");
var text = document.createElement("p");
text.textContent = element.name;
shortcutdiv.append(image);
shortcutdiv.append(text);
shortcut.append(shortcutdiv);
document.getElementById("shortcuts").append(shortcut);
}
function AddCustomShortcutsToPage() {
chrome.storage.local.get(["customshortcuts"], function (result) {
var customshortcuts = Object.values(result)[0];
if (customshortcuts.length > 0) {
document.getElementsByClassName("shortcut-container")[0].style.display = "block";
for (let i = 0; i < customshortcuts.length; i++) {
const element = customshortcuts[i];
CreateCustomShortcutDiv(element);
}
}
});
}
function SendHomePage() {
setTimeout(function () {
// Sends the html data for the home page
console.log("[BestSEQTA] Started Loading Home Page");
document.title = "Home ― SEQTA Learn";
var element = document.querySelector("[data-key=home]");
// Apply the active class to indicate clicked on home button
element.classList.add("active");
// Remove all current elements in the main div to add new elements
var main = document.getElementById("main");
main.innerHTML = "";
const titlediv = document.getElementById('title').firstChild;
titlediv.innerText = "Home";
document.querySelector('link[rel*="icon"]').href = chrome.runtime.getURL("icons/icon-48.png");
currentSelectedDate = new Date();
// Creates the root of the home page added to the main div
var htmlStr =
`<div class="home-root"><div class="home-container" id="home-container"></div></div>`;
var html = stringToHTML(htmlStr);
// Appends the html file to main div
// Note : firstChild of html is done due to needing to grab the body from the stringToHTML function
main.append(html.firstChild);
// Gets the current date
const date = new Date();
// Formats the current date used send a request for timetable and notices later
var TodayFormatted =
date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
// Replaces actual date with a selected date. Used for testing.
// TodayFormatted = "2020-08-31";
// Creates the shortcut container into the home container
var ShortcutStr = `<div class="shortcut-container border"><div class="shortcuts border" id="shortcuts"></div></div>`;
var Shortcut = stringToHTML(ShortcutStr);
// Appends the shortcut container into the home container
document.getElementById("home-container").append(Shortcut.firstChild);
// Creates the container div for the timetable portion of the home page
var TimetableStr = `<div class="timetable-container border"><div class="home-subtitle"><h2 id="home-lesson-subtitle">Today's Lessons</h2><div class="timetable-arrows"><svg width="24" height="24" viewBox="0 0 24 24" style="transform: scale(-1,1)" id="home-timetable-back"><g style="fill: currentcolor;"><path d="M8.578 16.359l4.594-4.594-4.594-4.594 1.406-1.406 6 6-6 6z"></path></g></svg><svg width="24" height="24" viewBox="0 0 24 24" id="home-timetable-forward"><g style="fill: currentcolor;"><path d="M8.578 16.359l4.594-4.594-4.594-4.594 1.406-1.406 6 6-6 6z"></path></g></svg></div></div><div class="day-container" id="day-container"></div></div>`;
var Timetable = stringToHTML(TimetableStr);
// Appends the timetable container into the home container
document.getElementById("home-container").append(Timetable.firstChild);
var timetablearrowback = document.getElementById('home-timetable-back')
var timetablearrowforward = document.getElementById('home-timetable-forward')
function SetTimetableSubtitle() {
var homelessonsubtitle = document.getElementById('home-lesson-subtitle');
const date = new Date();
if (date.getYear() == currentSelectedDate.getYear() && date.getMonth() == currentSelectedDate.getMonth()) {
if (date.getDate() == currentSelectedDate.getDate()) {
// Change text to Today's Lessons
homelessonsubtitle.innerText = "Today's Lessons";
}
else if ((date.getDate() - 1) == currentSelectedDate.getDate()) {
// Change text to Yesterday's Lessons
homelessonsubtitle.innerText = "Yesterday's Lessons";
}
else if ((date.getDate() + 1) == currentSelectedDate.getDate()) {
// Change text to Tomorrow's Lessons
homelessonsubtitle.innerText = "Tomorrow's Lessons";
}
else {
// Change text to date of the day
homelessonsubtitle.innerText = `${currentSelectedDate.toLocaleString('en-us', { weekday: 'short' })} ${currentSelectedDate.toLocaleDateString('en-au')}`;
}
}
else {
// Change text to date of the day
homelessonsubtitle.innerText = `${currentSelectedDate.toLocaleString('en-us', { weekday: 'short' })} ${currentSelectedDate.toLocaleDateString('en-au')}`;
}
}
function changeTimetable(value) {
currentSelectedDate.setDate(currentSelectedDate.getDate() + value);
FormattedDate = currentSelectedDate.getFullYear() + "-" + (currentSelectedDate.getMonth() + 1) + "-" + currentSelectedDate.getDate();
callHomeTimetable(FormattedDate, true);
SetTimetableSubtitle();
}
timetablearrowback.addEventListener('click', function () { changeTimetable(-1) })
timetablearrowforward.addEventListener('click', function () { changeTimetable(1) })
assessmentsicon = `<svg style="width:24px;height:24px;border-radius:0;" viewBox="0 0 24 24"><path fill="currentColor" d="M6 20H13V22H6C4.89 22 4 21.11 4 20V4C4 2.9 4.89 2 6 2H18C19.11 2 20 2.9 20 4V12.54L18.5 11.72L18 12V4H13V12L10.5 9.75L8 12V4H6V20M24 17L18.5 14L13 17L18.5 20L24 17M15 19.09V21.09L18.5 23L22 21.09V19.09L18.5 21L15 19.09Z"></path></svg>`
coursesicon = `<svg style="width:24px;height:24px;border-radius:0;" viewBox="0 0 24 24"><path fill="currentColor" d="M19 1L14 6V17L19 12.5V1M21 5V18.5C19.9 18.15 18.7 18 17.5 18C15.8 18 13.35 18.65 12 19.5V6C10.55 4.9 8.45 4.5 6.5 4.5C4.55 4.5 2.45 4.9 1 6V20.65C1 20.9 1.25 21.15 1.5 21.15C1.6 21.15 1.65 21.1 1.75 21.1C3.1 20.45 5.05 20 6.5 20C8.45 20 10.55 20.4 12 21.5C13.35 20.65 15.8 20 17.5 20C19.15 20 20.85 20.3 22.25 21.05C22.35 21.1 22.4 21.1 22.5 21.1C22.75 21.1 23 20.85 23 20.6V6C22.4 5.55 21.75 5.25 21 5M10 18.41C8.75 18.09 7.5 18 6.5 18C5.44 18 4.18 18.19 3 18.5V7.13C3.91 6.73 5.14 6.5 6.5 6.5C7.86 6.5 9.09 6.73 10 7.13V18.41Z"></path></svg>`
function createNewShortcut(link, icon, viewBox, title) {
// Creates the stucture and element information for each seperate shortcut
var shortcut = document.createElement("a");
shortcut.setAttribute("href", link);
shortcut.setAttribute("target", "_blank");
var shortcutdiv = document.createElement("div");
shortcutdiv.classList.add("shortcut");
image = stringToHTML(`<svg style="width:39px;height:39px" viewBox="${viewBox}"><path fill="currentColor" d="${icon}" /></svg>`).firstChild
image.classList.add("shortcuticondiv");
var text = document.createElement("p");
text.textContent = title;
shortcutdiv.append(image);
shortcutdiv.append(text);
shortcut.append(shortcutdiv);
document.getElementById("shortcuts").append(shortcut);
}
// Adds the shortcuts to the shortcut container
chrome.storage.local.get(["shortcuts"], function (result) {
var shortcuts = Object.values(result)[0];
for (let i = 0; i < shortcuts.length; i++) {
if (shortcuts[i].enabled) {
Itemname = (shortcuts[i].name).replace(/ /g, '')
createNewShortcut(
ShortcutLinks[Itemname].link,
ShortcutLinks[Itemname].icon,
ShortcutLinks[Itemname].viewBox,
shortcuts[i].name
);
}
}
AddCustomShortcutsToPage();
// Checks if shortcut container is empty
if (document.getElementById("shortcuts").childElementCount == 0) {
// If there are no shortcuts, hide the container
document.getElementsByClassName("shortcut-container")[0].style.display = "none";
}
});
// Creates the upcoming container and appends to the home container
var upcomingcontainer = document.createElement('div');
upcomingcontainer.classList.add('upcoming-container');
upcomingcontainer.classList.add('border');
upcomingtitlediv = CreateElement('div', 'upcoming-title');
upcomingtitle = document.createElement('h2');
upcomingtitle.classList.add('home-subtitle');
upcomingtitle.innerText = 'Upcoming Assessments';
upcomingtitlediv.append(upcomingtitle);
upcomingfilterdiv = CreateElement('div', 'upcoming-filters', 'upcoming-filters');
upcomingtitlediv.append(upcomingfilterdiv)
upcomingcontainer.append(upcomingtitlediv);
upcomingitems = document.createElement('div');
upcomingitems.id = 'upcoming-items';
upcomingitems.classList.add('upcoming-items');
upcomingcontainer.append(upcomingitems);
document.getElementById("home-container").append(upcomingcontainer);
// Creates the notices container into the home container
var NoticesStr = `<div class="notices-container border"><h2 class="home-subtitle">Notices</h2><div class="notice-container" id="notice-container"></div></div>`;
var Notices = stringToHTML(NoticesStr);
// Appends the shortcut container into the home container
document.getElementById("home-container").append(Notices.firstChild);
callHomeTimetable(TodayFormatted);
// Sends similar HTTP Post Request for the notices
var xhr2 = new XMLHttpRequest();
xhr2.open(
"POST",
`${location.origin}/seqta/student/load/notices?`,
true
);
xhr2.setRequestHeader("Content-Type", "application/json; charset=utf-8");
xhr2.onreadystatechange = function () {
if (xhr2.readyState === 4) {
var NoticesPayload = JSON.parse(xhr2.response);
var NoticeContainer = document.getElementById("notice-container");
if (NoticesPayload.payload.length == 0) {
if (!NoticeContainer.innerText) {
// If no notices: display no notices
var dummyNotice = document.createElement("div");
dummyNotice.textContent = "No notices for today.";
dummyNotice.classList.add("dummynotice");
NoticeContainer.append(dummyNotice);
}
} else {
if (!NoticeContainer.innerText) {
// For each element in the response json:
chrome.storage.local.get(["DarkMode"], function (result) {
for (let i = 0; i < NoticesPayload.payload.length; i++) {
// Create a div, and place information from json response
var NewNotice = document.createElement("div");
NewNotice.classList.add("notice");
var title = stringToHTML(
`<h3 style="color:var(--colour)">` + NoticesPayload.payload[i].title + `</h3>`
);
NewNotice.append(title.firstChild);
if (NoticesPayload.payload[i].label_title != undefined) {
var label = stringToHTML(
`<h5 style="color:var(--colour)">` + NoticesPayload.payload[i].label_title + `</h5>`
);
NewNotice.append(label.firstChild);
}
var staff = stringToHTML(
`<h6 style="color:var(--colour)">` + NoticesPayload.payload[i].staff + `</h6>`
);
NewNotice.append(staff.firstChild);
// Converts the string into HTML
var content = stringToHTML(NoticesPayload.payload[i].contents, styles=true);
for (let i = 0; i < content.childNodes.length; i++) {
NewNotice.append(content.childNodes[i]);
}
// Gets the colour for the top section of each notice
var colour = NoticesPayload.payload[i].colour;
if (typeof (colour) == "string") {
rgb = GetThresholdofHex(colour);
DarkModeResult = result.DarkMode
if (rgb < 100 && DarkModeResult) {
colour = undefined;
}
}
var colourbar = document.createElement("div");
colourbar.classList.add("colourbar");
colourbar.style.background = "var(--colour)";
NewNotice.style = `--colour: ${colour}`;
// Appends the colour bar to the new notice
NewNotice.append(colourbar);
// Appends the new notice into the notice container
NoticeContainer.append(NewNotice);
}
});
}
}
}
};
// Data sent as the POST request
xhr2.send(JSON.stringify({ date: TodayFormatted }));
// Sends similar HTTP Post Request for the notices
chrome.storage.local.get(null, function (result) {
if (result.notificationcollector) {
var xhr3 = new XMLHttpRequest();
xhr3.open(
"POST",
`${location.origin}/seqta/student/heartbeat?`,
true
);
xhr3.setRequestHeader(
"Content-Type",
"application/json; charset=utf-8"
);
xhr3.onreadystatechange = function () {
if (xhr3.readyState === 4) {
var Notifications = JSON.parse(xhr3.response);
var alertdiv = document.getElementsByClassName(
"notifications__bubble___1EkSQ"
)[0];
if (typeof alertdiv == 'undefined') {
console.log("[BestSEQTA] No notifications currently")
}
else {
alertdiv.textContent = Notifications.payload.notifications.length;
}
}
};
xhr3.send(
JSON.stringify({
timestamp: "1970-01-01 00:00:00.0",
hash: "#?page=/home",
})
);
}
});
GetUpcomingAssessments()
.then((assessments) => {
GetActiveClasses().then((classes) => {
// Gets all subjects for the student
for (let i = 0; i < classes.length; i++) {
const element = classes[i];
if (element.hasOwnProperty('active')) {
// Finds the active class list with the current subjects
activeClassList = classes[i]
}
}
activeSubjects = activeClassList.subjects
activeSubjectCodes = []
// Gets the code for each of the subjects and puts them in an array
for (let i = 0; i < activeSubjects.length; i++) {
const element = activeSubjects[i];
activeSubjectCodes.push(element.code)
}
CurrentAssessments = []
for (let i = 0; i < assessments.length; i++) {
const element = assessments[i];
if (activeSubjectCodes.includes(element.code)) {
CurrentAssessments.push(element)
}
}
CurrentAssessments.sort(comparedate);
CreateUpcomingSection(CurrentAssessments, activeSubjects);
// Run function to check if gap between assessments > 7 days?
})
});
}, 8);
}
function SendNewsPage() {
setTimeout(function () {
// Sends the html data for the home page
console.log("[BestSEQTA] Started Loading News Page");
document.title = "News ― SEQTA Learn";
var element = document.querySelector("[data-key=news]");
// Apply the active class to indicate clicked on home button
element.classList.add("active");
// Remove all current elements in the main div to add new elements
var main = document.getElementById("main");
main.innerHTML = "";
// Creates the root of the home page added to the main div
var htmlStr =
`<div class="home-root"><div class="home-container" id="news-container"><h1 class="border">Latest Headlines - ABC News</h1></div></div>`;
var html = stringToHTML(htmlStr);
// Appends the html file to main div
// Note : firstChild of html is done due to needing to grab the body from the stringToHTML function
main.append(html.firstChild);
const titlediv = document.getElementById('title').firstChild;
titlediv.innerText = "News";
AppendLoadingSymbol("newsloading", "#news-container");
chrome.runtime.sendMessage({ type: "sendNews" }, function (response) {
newsarticles = response.news.articles;
var newscontainer = document.querySelector('#news-container');
document.getElementById('newsloading').remove();
for (let i = 0; i < newsarticles.length; i++) {
newsarticle = document.createElement('a');
newsarticle.classList.add('NewsArticle');
newsarticle.href = newsarticles[i].url;
newsarticle.target = '_blank';
articleimage = document.createElement('div');
articleimage.classList.add('articleimage')
if (newsarticles[i].urlToImage == 'null') {
articleimage.style.backgroundImage = `url(${chrome.runtime.getURL("icons/betterseqta-light-outline.png")})`;
articleimage.style.width = '20%'
articleimage.style.margin = '0 7.5%';
}
else {
articleimage.style.backgroundImage = `url(${newsarticles[i].urlToImage})`;
}
articletext = document.createElement('div');
articletext.classList.add('ArticleText')
title = document.createElement('a');
title.innerText = newsarticles[i].title;
title.href = newsarticles[i].url;
title.target = '_blank';
description = document.createElement('p');
description.innerHTML = newsarticles[i].description;
articletext.append(title);
articletext.append(description);
newsarticle.append(articleimage);
newsarticle.append(articletext);
newscontainer.append(newsarticle);
}
});
}, 8);
}
function EnabledDisabledToBool(input) {
if (input == "enabled") {
return true;
}
if (input == "disabled") {
return false;
}
}
function LoadInit() {
console.log("[BestSEQTA] Started Init");
chrome.storage.local.get(null, function (result) {
if (result.onoff) {
SendHomePage();
}
});
}