Fix remaining time for mobile + smaller heading sizes

This commit is contained in:
mrjvs 2023-11-29 17:51:22 +01:00
parent bc22c323a0
commit 761884ee01
3 changed files with 384 additions and 385 deletions

View File

@ -111,9 +111,10 @@
"short": "Back" "short": "Back"
}, },
"time": { "time": {
"short": "-{{timeLeft}}",
"regular": "{{timeWatched}} / {{duration}}", "regular": "{{timeWatched}} / {{duration}}",
"remaining": "{{timeLeft}} left • Finish at {{timeFinished, datetime}}" "shortRegular": "{{timeWatched}}",
"remaining": "{{timeLeft}} left • Finish at {{timeFinished, datetime}}",
"shortRemaining": "-{{timeLeft}}"
}, },
"nextEpisode": { "nextEpisode": {
"next": "Next episode", "next": "Next episode",
@ -203,15 +204,9 @@
"stopEditing": "Stop editing" "stopEditing": "Stop editing"
}, },
"titles": { "titles": {
"morning": [ "morning": ["Morning title"],
"Morning title" "day": ["Day title"],
], "night": ["Night title"]
"day": [
"Day title"
],
"night": [
"Night title"
]
}, },
"search": { "search": {
"loading": "Loading...", "loading": "Loading...",

View File

@ -40,10 +40,14 @@ export function Time(props: { short?: boolean }) {
const timeFinished = new Date(Date.now() + secondsRemaining * 1e3); const timeFinished = new Date(Date.now() + secondsRemaining * 1e3);
const duration = formatSeconds(timeDuration, hasHours); const duration = formatSeconds(timeDuration, hasHours);
let localizationKey = "regular"; let localizationKey =
if (props.short) localizationKey = "short"; timeFormat === VideoPlayerTimeFormat.REGULAR ? "regular" : "remaining";
else if (timeFormat === VideoPlayerTimeFormat.REMAINING) if (props.short) {
localizationKey = "remaining"; localizationKey =
timeFormat === VideoPlayerTimeFormat.REGULAR
? "shortRegular"
: "shortRemaining";
}
return ( return (
<VideoPlayerButton onClick={() => toggleMode()}> <VideoPlayerButton onClick={() => toggleMode()}>

View File

@ -24,7 +24,7 @@ export function Heading2(props: TextProps) {
return ( return (
<h2 <h2
className={[ className={[
"text-xl lg:text-3xl font-bold text-white mt-20 mb-9", "text-xl lg:text-2xl font-bold text-white mt-20 mb-9",
props.border ? borderClass : null, props.border ? borderClass : null,
props.className ?? "", props.className ?? "",
].join(" ")} ].join(" ")}