mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-17 03:29:31 -07:00
feat(stage.ts): implement stage navigation functionality feat(stageNav.ts): implement stage navigation overlay functionality feat(state.ts): implement state management for index and threshold feat(utils.ts): add utility functions for increment and decrement
16 lines
387 B
TypeScript
16 lines
387 B
TypeScript
export function increment(num: number, length: number): number {
|
|
return (num + 1) % length
|
|
}
|
|
|
|
export function decrement(num: number, length: number): number {
|
|
return (num + length - 1) % length
|
|
}
|
|
|
|
export function expand(num: number): string {
|
|
return ('0000' + num.toString()).slice(-4)
|
|
}
|
|
|
|
export function isMobile(): boolean {
|
|
return window.matchMedia('(hover: none)').matches
|
|
}
|