Add presentations to the portfolio

This commit is contained in:
2022-01-02 20:23:43 +01:00
parent a9ecb8fd7e
commit 2322066430
9 changed files with 159 additions and 57 deletions

View File

@ -0,0 +1,18 @@
import { sprinkles } from '$lib/styles/sprinkles.css'
export const presentationFrameClass = sprinkles({
width: 'image',
height: 'image',
})
export const presentationPreviewLinksClass = sprinkles({
fontSize: 'sm',
})
export const presentationDescriptionClass = sprinkles({
paddingLeft: '1x',
})
export const presentationNameClass = sprinkles({
fontSize: 'base',
})

View File

@ -0,0 +1,41 @@
<script lang="ts">
import type { PresentationAttributes } from 'src/routes/portfolio/index.json'
import {
presentationDescriptionClass,
presentationFrameClass,
presentationNameClass,
presentationPreviewLinksClass,
} from './presentation.css'
export let presentation: PresentationAttributes
export let previewVisible = false
function togglePreviewVisible() {
previewVisible = !previewVisible
}
</script>
<article>
<a href={presentation.link} target="_blank">
<h3 class={presentationNameClass}>{presentation.name}</h3>
</a>
<section class="description {presentationDescriptionClass}">
{@html presentation.description}
</section>
<section class="preview">
<div class={presentationPreviewLinksClass}>
<a href="#presentation" on:click|preventDefault={togglePreviewVisible}
>{previewVisible ? 'Close' : 'Open'} preview</a
>
</div>
{#if previewVisible}
<iframe
class={presentationFrameClass}
src={presentation.link}
title="Presentation of {presentation.name}"
/>
{/if}
</section>
</article>