Skip to content

Commit 2732280

Browse files
committed
introduced theming.headingSrcSet allowing to define multiple heading backgrounds based on device width/resolution
1 parent e9a2d30 commit 2732280

File tree

5 files changed

+12
-2
lines changed

5 files changed

+12
-2
lines changed

cloud/functions/src/crawlers/crawler-parsers.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ export const EVENT_THEME_PARSER = z.object({
6060
subTitle: z.string().nullable(),
6161
banner: z.string().nullable(),
6262
}).optional().nullable().default(null),
63+
headingSrcSet: z.array(z.object({
64+
url: z.string(),
65+
descriptor: z.string().regex(/\d(?:w|x)/)
66+
})).min(1).optional().nullable().default(null),
6367
customGoogleFontFamilies: z.array(z.string()).optional().nullable().default(null),
6468
})
6569

mobile/src/components/events/CurrentEventHeader.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
</div>
2121
</ion-toolbar>
2222
<img
23-
:src="confDescriptor.backgroundUrl"
23+
:src="!confDescriptor.theming.headingSrcSet?.length && confDescriptor.backgroundUrl ? confDescriptor.backgroundUrl : ''"
24+
:srcset="confDescriptor.theming.headingSrcSet?.length ? confDescriptor.theming.headingSrcSet.map(entry => `${entry.url} ${entry.descriptor}`).join(', ') : ''"
2425
:alt="LL.Banner_Event()"
2526
:style="confDescriptor.theming.headingCustomStyles?.banner || ''"
2627
/>

mobile/src/components/events/EventTalksGroup.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<template>
2-
<img :src="confDescriptor.backgroundUrl">
2+
<img
3+
:src="!confDescriptor.theming.headingSrcSet?.length && confDescriptor.backgroundUrl ? confDescriptor.backgroundUrl : ''"
4+
:srcset="confDescriptor.theming.headingSrcSet?.length ? confDescriptor.theming.headingSrcSet.map(entry => `${entry.url} ${entry.descriptor}`).join(', ') : ''"
5+
/>
36
<span class="schedule-talk-event-title">{{confDescriptor.headingTitle}}</span>
47

58
<schedule-talk v-for="(talk, index) in talks" :key="talk.id.value"

mobile/src/models/VoxxrinEvent.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ export function toVoxxrinEventTheme(firestoreTheme: EventTheme): VoxxrinEventThe
118118
tertiaryContrastRGB: hexToRGB(firestoreTheme.colors.tertiaryContrastHex),
119119
},
120120
headingCustomStyles: firestoreTheme.headingCustomStyles,
121+
headingSrcSet: firestoreTheme.headingSrcSet,
121122
customGoogleFontFamilies: firestoreTheme.customGoogleFontFamilies,
122123
}
123124
}

shared/event-list.firestore.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export type EventTheme = {
1414
subTitle: string|null,
1515
banner: string|null,
1616
}|null,
17+
headingSrcSet: Array<{ url: string, descriptor: string }>|null,
1718
customGoogleFontFamilies: string[]|null
1819
}
1920

0 commit comments

Comments
 (0)