mirror of
https://github.com/skoelle/28k8-moonweb-org.git
synced 2026-09-18 02:40:24 +00:00
initial commit
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -0,0 +1,22 @@
|
||||
export type KeymapEntry = { key: string; href: string; label: string };
|
||||
export const GLOBAL_NAV_KEYS: KeymapEntry[] = [
|
||||
{ key: 'B', href: 'back', label: 'Back' },
|
||||
{ key: 'Q', href: 'disconnect', label: 'Disconnect' },
|
||||
{ key: 'I', href: '/bbs/legal-notice', label: 'Legal Notice' },
|
||||
];
|
||||
export const MENU_KEYS: KeymapEntry[] = [
|
||||
{ key: 'P', href: '/bbs/pc/phobia', label: 'PHOB!A' },
|
||||
{ key: 'T', href: '/bbs/pc/trancemission', label: 'Tr@nceMISSION' },
|
||||
{ key: 'S', href: '/bbs/pc/skyline', label: 'SkyLINE Productions' },
|
||||
{ key: 'K', href: '/bbs/pc/kosmos-design', label: 'Kosmos Design [KDS]' },
|
||||
{ key: 'D', href: '/bbs/atari/tropic-dreams', label: 'Tropic DREAMs' },
|
||||
{ key: 'E', href: '/bbs/amiga/esprit', label: 'ESPRIT Releases' },
|
||||
{ key: 'M', href: '/bbs/amiga/mods', label: 'MOD Files' },
|
||||
{ key: 'A', href: '/bbs/fido/ansi-art', label: 'BBS ANSI Art' },
|
||||
{ key: 'F', href: '/bbs/fido/nodelist', label: 'Fidonets and Nodelists' },
|
||||
];
|
||||
export const ALL_KEYS: KeymapEntry[] = [...GLOBAL_NAV_KEYS, ...MENU_KEYS];
|
||||
export function findKeyEntry(pressedKey: string): KeymapEntry | undefined {
|
||||
const upper = pressedKey.toUpperCase();
|
||||
return ALL_KEYS.find((entry) => entry.key === upper);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
export async function playLine1Sequence(onComplete: () => void) {
|
||||
const steps = ['/audio/dial-tone.mp3', '/audio/dtmf-beeps.mp3', '/audio/modem-handshake.mp3'];
|
||||
for (const src of steps) { await playClip(src); }
|
||||
onComplete();
|
||||
}
|
||||
function playClip(src: string): Promise<void> {
|
||||
return new Promise((resolve) => {
|
||||
const audio = new Audio(src);
|
||||
audio.addEventListener('ended', () => resolve());
|
||||
audio.addEventListener('error', () => resolve());
|
||||
audio.play().catch(() => resolve());
|
||||
});
|
||||
}
|
||||
const STORAGE_KEY = 'hasConnected';
|
||||
export function hasConnectedBefore(): boolean {
|
||||
if (typeof localStorage === 'undefined') return false;
|
||||
return localStorage.getItem(STORAGE_KEY) === 'true';
|
||||
}
|
||||
export function markConnected() { localStorage.setItem(STORAGE_KEY, 'true'); }
|
||||
export function resetConnected() { localStorage.removeItem(STORAGE_KEY); }
|
||||
Reference in New Issue
Block a user