diff --git a/src/app/(pages)/players/players.module.scss b/src/app/(pages)/players/players.module.scss index 48aa685..37d4902 100644 --- a/src/app/(pages)/players/players.module.scss +++ b/src/app/(pages)/players/players.module.scss @@ -14,9 +14,6 @@ .audio_player { padding: 2rem 2rem; - display: flex; - flex-direction: column; - align-items: center; height: 100%; } @@ -41,7 +38,10 @@ position: relative; background: transparent; width: 100%; - max-height: 10rem; + height: 75%; + max-height: 20rem; + min-height: 5rem; + aspect-ratio: 1.5; } diff --git a/src/app/(pages)/schedule.module.scss b/src/app/(pages)/schedule.module.scss index 47d5081..cc1b78a 100644 --- a/src/app/(pages)/schedule.module.scss +++ b/src/app/(pages)/schedule.module.scss @@ -18,12 +18,15 @@ @media (max-width: 1000px) { .container { - max-height: 10em; + max-height: 20em; border: unset; border-top: 0.25rem solid var(--accent-color); border-bottom: 0.25rem solid var(--accent-color); font-size: 1.25rem; } + .hide_on_mobile { + display: none; + } } .table { diff --git a/src/app/(pages)/schedule.tsx b/src/app/(pages)/schedule.tsx index 725cccf..664d4c0 100644 --- a/src/app/(pages)/schedule.tsx +++ b/src/app/(pages)/schedule.tsx @@ -5,6 +5,7 @@ import { DayOfWeek, formatDay, formatTimes, getNYCTime, getNYCWeekday, getNYCWee import styles from "./schedule.module.scss"; import useSWR from "swr"; import { jsonFetcher } from "../utils/fetchers"; +import { usePathname } from "next/navigation"; type Show = {name: string, desc: string, hosts: string, poster: string, start_time: number, end_time: number, is_running: number}; type DaySchedule = {day: DayOfWeek, shows: Array}; @@ -28,6 +29,9 @@ export default function Schedule() { if(!data || error) { continue; } + if(d < 0) { + continue; // weekend + } if(i == 0) { data = structuredClone(data); data.shows = data.shows.filter((show) => show.end_time > time); @@ -89,8 +93,11 @@ export default function Schedule() { } }); + const path = usePathname(); + let hide_on_mobile = !["/", "/shows/"].includes(path); + return ( -
+
{computed}
diff --git a/src/app/utils/delay_correction.ts b/src/app/utils/delay_correction.ts index aba89e6..e68bd21 100644 --- a/src/app/utils/delay_correction.ts +++ b/src/app/utils/delay_correction.ts @@ -9,7 +9,7 @@ // happy_delay_seconds should be < unhappy_delay_seconds const happy_delay_seconds = 10.0; const unhappy_delay_seconds = 20.0; -const correction_speed = 1.025; +const correction_speed = 1.05; export const delay_correction_interval = 1000; // in ms // global state is fine here since we will only ever have one stream active. @@ -29,16 +29,16 @@ export function applyDelayCorrection(media: HTMLMediaElement | null) { media.playbackRate = 1.0; return; } - if(current_delay < happy_delay_seconds) { + if(happy || current_delay < happy_delay_seconds) { happy = true; media.playbackRate = 1.0; return; } - happy = false; - if(current_delay < happy_delay_seconds) { - happy = true; + if(current_delay > unhappy_delay_seconds) { + happy = false; } media.playbackRate = correction_speed; + console.log(media.playbackRate); } export function teleportDelayCorrection(media: HTMLMediaElement | null) { @@ -49,7 +49,7 @@ export function teleportDelayCorrection(media: HTMLMediaElement | null) { if(timeRanges.length == 0) { return; } - const desired = timeRanges.end(timeRanges.length-1) - happy_delay_seconds; + const desired = timeRanges.end(timeRanges.length-1) - unhappy_delay_seconds; if(desired == null || Number.isNaN(desired) || !Number.isFinite(desired)) { return; } diff --git a/src/app/utils/time.ts b/src/app/utils/time.ts index 2fe6517..39a5bd2 100644 --- a/src/app/utils/time.ts +++ b/src/app/utils/time.ts @@ -47,7 +47,7 @@ export function getNYCWeekday() { } export function getWeekdayString(day: number): DayOfWeek { - return ["monday", "tuesday", "wednesday", "thursday", "friday"][day] as DayOfWeek; + return ["monday", "tuesday", "wednesday", "thursday", "friday"][Math.abs(day % 5)] as DayOfWeek; } export function getNYCWeekdayString(): DayOfWeek {