Add cookie banner

This commit is contained in:
2023-01-29 17:36:36 +01:00
parent 3084b4a90d
commit 436307eb0d
7 changed files with 198 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
export function shouldShowCookie():boolean {
return localStorage.getItem("cookie") == undefined;
}
export function acceptCookie():void {
localStorage.setItem("cookie", "accept");
}
export function refuseCookie():void {
localStorage.setItem("cookie", "refuse");
}
+11
View File
@@ -0,0 +1,11 @@
export function randomOfArray<T>(array:T[]):T {
return array[Math.floor(Math.random() * array.length)];
}
export function random(min:number, max:number):number {
return Math.random() * (max - min) + min;
}
export function randomInt(min:number, max:number):number {
return Math.floor(random(min, max));
}