Add presentations to the portfolio
This commit is contained in:
18
src/components/portfolio/presentation.css.ts
Normal file
18
src/components/portfolio/presentation.css.ts
Normal 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',
|
||||
})
|
41
src/components/portfolio/presentation.svelte
Normal file
41
src/components/portfolio/presentation.svelte
Normal 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>
|
Reference in New Issue
Block a user