nicco.io/src/components/Work.svelte

62 lines
1.0 KiB
Svelte
Raw Normal View History

2020-09-22 21:47:33 +02:00
<script>
2020-09-28 16:02:16 +02:00
import dj from 'dayjs'
2020-09-23 15:37:12 +02:00
import ImageFrame from '../components/ImageFrame.svelte'
2021-03-06 23:10:17 +01:00
import Icon from '../components/Icon.svelte'
2020-09-23 15:37:12 +02:00
2020-09-22 21:47:33 +02:00
export let work
</script>
2021-03-06 23:10:17 +01:00
<a href={work.link} target="_blank" rel="noopener">
<div class="horizontal">
<div class="title regular">{work.title}</div>
<div>
<Icon icon="link-outline" />
<span>{work.link.replace(/https?:\/\//, '')}</span>
</div>
</div>
<ImageFrame
src={work.image.sizes.medium_large}
alt={work.image.description}
/>
</a>
<div class="horizontal regular">
<div>{work.role}</div>
<div>{dj(work.date * 1000).format('MMM YY')}</div>
</div>
<p>
{@html work.content}
</p>
2020-09-22 21:47:33 +02:00
<style>
.title {
font-size: 2em;
line-height: 1;
}
.horizontal {
display: flex;
justify-content: space-between;
align-items: end;
}
.regular {
font-weight: 400;
}
2020-09-24 19:29:43 +02:00
p {
margin-bottom: 6em;
}
a {
font-family: monospace;
}
2020-09-25 23:51:56 +02:00
@media (max-width: 30em) {
.horizontal {
flex-direction: column;
align-items: flex-start;
}
}
2020-09-22 21:47:33 +02:00
</style>