I've made the tough decision to disable the BG animation by default. It's just to heavy on performance and is somewhat distracting for some people. I'm planning on making a toggle on it, but I'm not sure that will be done by the next release.
28 lines
656 B
TypeScript
28 lines
656 B
TypeScript
// The magic cookie system is so stupid
|
|
|
|
export function setCookie(
|
|
cname: string,
|
|
cvalue: string,
|
|
sameSite: string = "Lax",
|
|
) {
|
|
document.cookie =
|
|
cname + "=" + cvalue + ";" + "SameSite" + "=" + sameSite + ";";
|
|
}
|
|
|
|
// Credit: https://www.w3schools.com/js/js_cookies.asp
|
|
export function getCookie(cname: string): string {
|
|
let name = cname + "=";
|
|
let decodedCookie = decodeURIComponent(document.cookie);
|
|
let ca = decodedCookie.split(";");
|
|
for (let i = 0; i < ca.length; i++) {
|
|
let c = ca[i];
|
|
while (c.charAt(0) == " ") {
|
|
c = c.substring(1);
|
|
}
|
|
if (c.indexOf(name) == 0) {
|
|
return c.substring(name.length, c.length);
|
|
}
|
|
}
|
|
return "";
|
|
}
|