This commit is contained in:
tree🌴 2024-03-07 12:31:03 +01:00
parent e937a323c6
commit db10ab6b2d

View file

@ -47,6 +47,7 @@ let searchParams = null
//let eventSelected = core.events[0].id; //let eventSelected = core.events[0].id;
const eventSelected = writable(''); const eventSelected = writable('');
const speakerSelected = writable('alona-shevchenko'); const speakerSelected = writable('alona-shevchenko');
const imageSelected = writable('');
onMount(() => { onMount(() => {
searchParams = new URL(document.location).searchParams; searchParams = new URL(document.location).searchParams;
@ -59,6 +60,10 @@ onMount(() => {
if (speaker) { if (speaker) {
speakerSelected.set(speaker); speakerSelected.set(speaker);
} }
const img = searchParams.get('img');
if (img) {
imageSelected.set(img);
}
}); });
eventSelected.subscribe((id, next) => { eventSelected.subscribe((id, next) => {
@ -73,7 +78,7 @@ eventSelected.subscribe((id, next) => {
}) })
function getImage(eId) { function getImage(eId) {
return `/gen-img/events/${events[eId]?.image}.png` return `/gen-img/events/${$imageSelected ? $imageSelected : events[eId]?.image}.png`
} }
$: image = getImage($eventSelected); $: image = getImage($eventSelected);