2023-12-29 19:02:58 +00:00
|
|
|
---
|
|
|
|
import { YouTube } from '@astro-community/astro-embed-youtube'
|
|
|
|
export interface Props {
|
|
|
|
id: string
|
|
|
|
thumbnail: string
|
|
|
|
}
|
|
|
|
|
|
|
|
const { id, thumbnail } = Astro.props
|
|
|
|
---
|
|
|
|
|
|
|
|
<div class="youtube-center">
|
2023-12-29 19:20:08 +00:00
|
|
|
<noscript style="display: flex; justify-content: center;">
|
2023-12-29 19:02:58 +00:00
|
|
|
<style>
|
|
|
|
lite-youtube {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<div class="warningtext">
|
|
|
|
<span>
|
2023-12-29 19:20:08 +00:00
|
|
|
To view the video, enable JavaScript or<br /><a
|
2023-12-29 19:02:58 +00:00
|
|
|
href=`https://www.youtube.com/watch?v=${id}`
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer">watch it on YouTube</a
|
|
|
|
>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</noscript>
|
2023-12-29 19:20:08 +00:00
|
|
|
<YouTube id={id} poster={thumbnail} />
|
2023-12-29 19:02:58 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.youtube-center {
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
lite-youtube {
|
|
|
|
width: 100%;
|
|
|
|
max-height: 360px;
|
|
|
|
max-width: 640px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.warningtext {
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
background-color: var(--c-darkgray);
|
|
|
|
width: 640px;
|
|
|
|
height: 360px;
|
|
|
|
}
|
|
|
|
|
|
|
|
span {
|
2023-12-29 19:20:08 +00:00
|
|
|
text-align: center;
|
|
|
|
margin-top: 20%;
|
|
|
|
}
|
|
|
|
|
|
|
|
span > a {
|
|
|
|
font-style: unset;
|
|
|
|
font-weight: bold;
|
2023-12-29 19:02:58 +00:00
|
|
|
}
|
|
|
|
</style>
|