Add all the required files.

This commit is contained in:
camperotactico 2025-03-13 10:54:41 +01:00
parent d5ba0ec5dc
commit 2583692313
3 changed files with 51 additions and 0 deletions

View file

@ -0,0 +1,16 @@
<style>
custom-peertube-link {
display: flex;
align-items: flex-start;
gap: var(--space-xs);
font-size: var(--size-step-min-1);
}
custom-peertube-link svg {
font-size: var(--size-step-0);
}
</style>
<custom-svg aria-hidden="true" src="./src/assets/svg/platform/peertube.svg"></custom-svg>
<a :href="href"><span webc:if="label" @text="label" webc:nokeep></span></a>
<!-- Inspired by https://github.com/zachleat/zachleat.com -->

View file

@ -0,0 +1,31 @@
<script webc:setup>
function getLinkUrl(instance, slug, start) {
return `https://${instance}/w/${slug}${start ? `?start=${start}s` : ''}`;
}
function getEmbedLinkUrl(instance, embedSlug, start) {
return `https://${instance}/videos/embed/${embedSlug}${start ? `?start=${start}s&` : `?`}` + `title=0&warningTitle=0`;
}
</script>
<style>
custom-peertube div {
position: relative;
overflow: hidden;
padding-top: 56.25%;
border-radius: 1rem;
}
custom-peertube iframe {
position: absolute;
inset: 0px;
width: 100%;
height: 100%;
}
</style>
<custom-peertube webc:root class="flow">
<div>
<iframe :title="label" :src="getEmbedLinkUrl(instance,embedSlug,start)" frameborder="0" allowfullscreen="" sandbox="allow-same-origin allow-scripts allow-popups allow-forms">
</iframe>
</div>
</custom-peertube>
<custom-peertube-link @raw="label" :label="label" :href="getLinkUrl(instance,slug, start)"></custom-peertube-link>

View file

@ -0,0 +1,4 @@
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="1em" height="1em">
<title>PeerTube</title>
<path d="M12 6.545v10.91L20.727 12M3.273 12v12L12 17.455M3.273 0v12L12 6.545" />
</svg>

After

Width:  |  Height:  |  Size: 236 B