Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix long schedule #150

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 27 additions & 12 deletions pages/api/schedule-artwork.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ async function handle(request: Request) {
});

const longSchedule = todaysSchedule.length > 10;
const extraLongSchedule = todaysSchedule.length > 11;

const fontLight = await fetch(
new URL("../../assets/VisueltLight.otf", import.meta.url)
Expand All @@ -79,11 +80,7 @@ async function handle(request: Request) {

return new ImageResponse(
(
<div
tw={`flex flex-col w-full h-full px-[15px] pb-[20px] text-white bg-opacity-0 ${
longSchedule ? "pt-[73.5px]" : "pt-[147px]"
}`}
>
<div tw="flex flex-col w-full h-full px-[15px] pb-[20px] text-white bg-opacity-0 pt-[147px]">
<div
tw="flex justify-center items-center mt-4"
style={{
Expand Down Expand Up @@ -138,23 +135,33 @@ async function handle(request: Request) {
</div>
</div>
<div
tw="flex flex-col grow w-full grow pt-[78.5px]"
tw={`flex flex-col grow w-full grow ${
longSchedule ? "justify-center" : "pt-[78.5px]"
}`}
style={{
gap: 30,
gap: extraLongSchedule ? 24 : 30,
}}
>
{todaysSchedule.map((item, index) => (
<div tw="flex pl-[27px]" key={item.date}>
<div
tw="text-[50px] font-bold flex w-[266px]"
tw={`font-bold flex ${
extraLongSchedule
? "w-[200px] text-[45px]"
: "w-[266px] text-[50px]"
}`}
style={{ fontFamily: '"VisueltMedium"', lineHeight: "100%" }}
>
{dayjs(item.date.slice(0, -1))
.add(cetAdjustment, "minutes")
.format("HH:mm")}
</div>
<div
tw="text-[50px] font-bold flex w-[615px]"
tw={` font-bold flex ${
extraLongSchedule
? "w-[750px] text-[45px]"
: "w-[615px] text-[50px]"
}`}
style={{ fontFamily: '"VisueltMedium"', lineHeight: "100%" }}
>
{item.title}
Expand All @@ -163,7 +170,11 @@ async function handle(request: Request) {
))}
<div tw="flex pl-[27px]">
<div
tw="text-[50px] font-bold flex w-[266px]"
tw={`font-bold flex ${
extraLongSchedule
? "w-[200px] text-[45px]"
: "w-[266px] text-[50px]"
}`}
style={{ fontFamily: '"VisueltMedium"', lineHeight: "100%" }}
>
{dayjs(
Expand All @@ -173,7 +184,11 @@ async function handle(request: Request) {
.format("HH:mm")}
</div>
<div
tw="text-[50px] font-bold flex w-[615px]"
tw={` font-bold flex ${
extraLongSchedule
? "w-[750px] text-[45px]"
: "w-[615px] text-[50px]"
}`}
style={{ fontFamily: '"VisueltMedium"', lineHeight: "100%" }}
>
Repeats Playlist
Expand All @@ -182,7 +197,7 @@ async function handle(request: Request) {
</div>
<div tw={`flex justify-center`}>
<div
tw={`flex text-[46px] pb-3 px-4 pt-2 border-white border`}
tw={`flex text-[45px] pb-3 px-4 pt-2 border-white border`}
style={{ fontFamily: '"fontArizona"', lineHeight: "90%" }}
>
refugeworldwide.com
Expand Down
Loading