-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Adds day/night cycle - Adds bus stops - Adds custom DBfH shift banner posts - Various code cleanup and restructuring - Adds timezone setting to the testing preview
- Loading branch information
Showing
61 changed files
with
524 additions
and
119 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { DateTime } from 'luxon'; | ||
|
||
const timezone = nodecg.Replicant<string>('timezone', { | ||
defaultValue: 'America/New_York', | ||
}); | ||
|
||
/** | ||
* These times are based on Pittsburgh, January 14th 2024. | ||
* Change times to reflect event location and time before event. | ||
*/ | ||
|
||
const Times: [number, 'night' | 'dawn' | 'day' | 'dusk'][] = [ | ||
[(17 * 60 + 46) * 60, 'night'], // 5:46pm | ||
[(17 * 60 + 16) * 60, 'dusk'], // 5:16pm | ||
[(7 * 60 + 41) * 60, 'day'], // 7:41am | ||
[(7 * 60 + 11) * 60, 'dawn'], // 7:11am | ||
[0, 'night'], // Midnight | ||
]; | ||
|
||
/** | ||
* This time is based on the scheduled time for Day 7 recap. | ||
* i.e. The Checkpoint. | ||
* Change time to reflect event schedule before event. | ||
*/ | ||
const OmegaShift = [2024, 1, 20, 21, 7, 0] as const; | ||
|
||
export function dayTime() { | ||
const datetime = DateTime.local({ zone: timezone.value }); | ||
const seconds = datetime.toSeconds() - datetime.startOf('day').toSeconds(); | ||
|
||
for (const Time of Times) { | ||
if (seconds > Time[0]) return Time[1]; | ||
} | ||
|
||
return Times[0][1]; | ||
} | ||
|
||
export function shiftTime(): 'zeta' | 'dawn' | 'alpha' | 'night' | 'omega' { | ||
const omegaShiftStart = DateTime.local(...OmegaShift, { zone: timezone.value }); | ||
const datetime = DateTime.local({ zone: timezone.value }); | ||
|
||
if (datetime.toSeconds() > omegaShiftStart.toSeconds()) return 'omega'; | ||
|
||
const hour = datetime.hour; | ||
|
||
if (hour > 18) return 'night'; | ||
if (hour > 12) return 'alpha'; | ||
if (hour > 6) return 'dawn'; | ||
return 'zeta'; | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Oops, something went wrong.