Skip to content

Commit

Permalink
feat(desert-bus): various updates
Browse files Browse the repository at this point in the history
- 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
VodBox committed Jan 11, 2024
1 parent b94f25d commit 95f7f7b
Show file tree
Hide file tree
Showing 61 changed files with 524 additions and 119 deletions.
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
"@emotion/styled": "^11.3.0",
"@mui/material": "^5.11.4",
"@pixi/filter-bevel": "^4.2.0",
"@pixi/filter-crt": "^4.2.0",
"@pixi/filter-drop-shadow": "^4.2.0",
"@pixi/filter-outline": "^4.2.0",
"@pixi/filter-crt": "^4.2.0",
"clone": "^2.1.2",
"currency-to-abbreviation": "^2.0.1",
"events": "^3.3.0",
"gsap": "^3.11.4",
"lodash": "^4.17.21",
"luxon": "^3.4.4",
"object-path": "^0.11.8",
"pixi-projection": "^0.4.4",
"pixi.js": "^6.5.9",
Expand All @@ -49,6 +50,7 @@
"@types/clone": "^2.1.1",
"@types/events": "^3.0.0",
"@types/lodash": "^4.14.191",
"@types/luxon": "^3.3.4",
"@types/object-path": "^0.11.1",
"@types/obs-studio": "^2.17.0",
"@types/react": "^17.0.21",
Expand Down
50 changes: 50 additions & 0 deletions src/channels/desert-bus/daytime.ts
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 removed src/channels/desert-bus/images/bus.png
Binary file not shown.
Binary file added src/channels/desert-bus/images/dawn/bus-stop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/channels/desert-bus/images/dawn/bus.png
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.
Binary file added src/channels/desert-bus/images/dawn/wheel1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/channels/desert-bus/images/dawn/wheel2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/channels/desert-bus/images/dawn/wheel3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/channels/desert-bus/images/dawn/wheel4.png
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.
Binary file added src/channels/desert-bus/images/day/bus-stop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/channels/desert-bus/images/day/bus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/channels/desert-bus/images/day/dawn-guard.png
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.
Binary file added src/channels/desert-bus/images/day/wheel1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/channels/desert-bus/images/day/wheel2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/channels/desert-bus/images/day/wheel3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/channels/desert-bus/images/day/wheel4.png
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.
Binary file added src/channels/desert-bus/images/dusk/bus-stop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/channels/desert-bus/images/dusk/bus.png
Diff not rendered.
Binary file modified src/channels/desert-bus/images/line1.png
Binary file modified src/channels/desert-bus/images/line2.png
Binary file modified src/channels/desert-bus/images/line3.png
Binary file modified src/channels/desert-bus/images/line4.png
Binary file modified src/channels/desert-bus/images/line5.png
Binary file modified src/channels/desert-bus/images/line6.png
Binary file modified src/channels/desert-bus/images/line7.png
Binary file added src/channels/desert-bus/images/night/bus-stop.png
Binary file added src/channels/desert-bus/images/night/bus.png
Binary file added src/channels/desert-bus/images/night/headlights.png
Binary file added src/channels/desert-bus/images/night/wheel1.png
Binary file added src/channels/desert-bus/images/night/wheel2.png
Binary file added src/channels/desert-bus/images/night/wheel3.png
Binary file added src/channels/desert-bus/images/night/wheel4.png
Binary file removed src/channels/desert-bus/images/numbers_white.png
Diff not rendered.
Binary file removed src/channels/desert-bus/images/sand_texture.png
Diff not rendered.
Binary file removed src/channels/desert-bus/images/wheel1.png
Diff not rendered.
Binary file removed src/channels/desert-bus/images/wheel2.png
Diff not rendered.
Binary file removed src/channels/desert-bus/images/wheel3.png
Diff not rendered.
Binary file removed src/channels/desert-bus/images/wheel4.png
Diff not rendered.
Loading

0 comments on commit 95f7f7b

Please sign in to comment.