A homescreen-style age gate shown before auth or any route: J621 brand mark, the explicit 18+ check, an Enter action remembered per browser in localStorage (j621.age-verified), and a blocked state if the visitor chooses Leave.
18 lines
370 B
TypeScript
18 lines
370 B
TypeScript
const AGE_KEY = "j621.age-verified";
|
|
|
|
export function isAgeVerified(): boolean {
|
|
try {
|
|
return window.localStorage.getItem(AGE_KEY) === "1";
|
|
} catch {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
export function markAgeVerified(): void {
|
|
try {
|
|
window.localStorage.setItem(AGE_KEY, "1");
|
|
} catch {
|
|
// Private mode with storage disabled: the gate simply shows again.
|
|
}
|
|
}
|