Skip to content

Commit

Permalink
start detail page webinars fdnd-agency#31
Browse files Browse the repository at this point in the history
  • Loading branch information
zoepje committed Nov 12, 2024
1 parent 2f84540 commit 4d21cf2
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/routes/webinars/[slug]/+page.server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import fetchJson from "$lib/fetch-json"

const baseURL = 'https://fdnd-agency.directus.app/items/'

export async function load({params}) {
const url = `${baseURL}/avl_webinars?fields=*.*.*&filter[slug][_eq]=${params.slug}`

const webinar = await fetchJson(url)

return {
webinar: webinar.data[0]
}
}
31 changes: 31 additions & 0 deletions src/routes/webinars/[slug]/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<script>
export let data;
</script>

<video controls width="250">
<source src="https://fdnd-agency.directus.app/assets/{data.webinar.video.id}">
<track kind="captions">
</video>

<h1>{data.webinar.title}</h1>

<div class='description'>
{@html data.webinar.description}
</div>

<style>
.description :global(p) {
padding-block: .2rem;
}
video {
width: 90vw;
margin: var(--margin-center);
}
@media screen and (min-width: 600px){
video {
width: 50vw;
}
}
</style>

0 comments on commit 4d21cf2

Please sign in to comment.