mirror of
https://github.com/NotXia/notxia.github.io.git
synced 2026-08-05 21:32:23 +00:00
Add cookie banner
This commit is contained in:
@@ -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");
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
Reference in New Issue
Block a user