1
0
This commit is contained in:
Philip Wagner
2024-08-31 10:01:49 +02:00
commit 78b6c0d381
1169 changed files with 235103 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
<?php foreach ($data->file()->toFiles() as $file): ?>
<audio controls controlsList="nodownload" src="<?= $file->url() ?>" <?= $data->loop()->toBool() ? "loop" : "" ?>></audio>
<?php endforeach ?>

View File

@@ -0,0 +1,3 @@
<?php if ($block->language() == "css"): ?>
<style><?= $block->code()->value() ?></style>
<?php endif; ?>

View File

@@ -0,0 +1,52 @@
<?php if ($embed = $data->embed()->toEmbed()): ?>
<?php
$biggestImage = $embed->image()->value();
$biggestImageSize = 0;
$images = $embed->images()->value();
if ($images) {
foreach ($images as $image) {
$size = $image['width'] * $image['height'];
if ($biggestImageSize < $size) {
$biggestImageSize = $size;
$biggestImage = $image['url'];
}
}
}
$iframe = str_replace('src="', 'data-src="', $embed->code()->value());
if (
$data->loop()->toBool() === true || true
) {
preg_match('/\?v=(.*)/', $embed->url()->value(), $m);
if ($m) {
$iframe = preg_replace('/data-src="(.+?)"/', "data-src=\"\$1&playlist={$m[1]}&loop=1\"", $iframe);
}
}
$btnClass = $embed->providerName()->value() === 'YouTube' ? 'yt' : '';
?>
<?php if ($embed->providerName()->value() === 'thealit'): ?>
<div class="embed">
<?= $embed->code() ?>
</div>
<?php elseif ($embed->providerName()->value() === 'Mixcloud'): ?>
<?= $embed->code()->value() ?>
<?php else: ?>
<div class="embed">
<div class="iframe"><?= $iframe ?></div>
<div>
<img src="<?= $biggestImage ?>" loading="lazy">
<div class="embed-btn <?= $btnClass ?>"></div>
</div>
</div>
<?php endif ?>
<?php if ($data->text()->isNotEmpty()): ?>
<div class="text-10"><?= $data->text()->html() ?></div>
<?php endif ?>
<?php endif ?>

View File

@@ -0,0 +1,5 @@
<?php
/** @var \Kirby\Cms\Block $block */
?>
<iframe class="iframe" src="<?= $block->url() ?>"></iframe>

View File

@@ -0,0 +1,23 @@
<?php
/** @var \Kirby\Cms\Block $block */
$image = $block->image()->toFile();
$alt = $block->alt() ?? $image->alt();
$caption = $block->caption();
$src = $image->url();
?>
<?php if ($src): ?>
<?php if ($block->link()->isNotEmpty()): ?>
<a href="<?= $block->link()->value() ?>">
<?php endif ?>
<figure>
<img srcset="<?= $image->srcset('full') ?>" alt="<?= $alt->esc() ?>" loading="lazy">
<?php if ($caption->isNotEmpty()): ?>
<figcaption>
<?= $caption ?>
</figcaption>
<?php endif ?>
<?php if ($block->link()->isNotEmpty()): ?>
</a>
<?php endif ?>
</figure>
<?php endif ?>

View File

@@ -0,0 +1,7 @@
<div class="siema">
<div class="siema-gallery">
<?php foreach ($data->images()->toFiles() as $image): ?>
<div><img srcset="<?= $image->srcset('full') ?>" loading="lazy"></div>
<?php endforeach ?>
</div>
</div>

View File

@@ -0,0 +1,10 @@
<?php /** @var \Kirby\Cms\Block $block */ ?>
<?php
$centerHorizontal = $block->center_horizontal()->toBool();
$centerVertical = $block->center_vertical()->toBool();
?>
<div class="<?= $centerHorizontal ? "text-center" : "" ?> <?= $centerVertical ? "align-self-center" : "" ?>">
<?= $block->text() ?>
</div>

View File

@@ -0,0 +1,17 @@
<?php
$id = uniqid('twitch');
?>
<div>
<div id="<?= $id ?>"></div>
<script src="https://player.twitch.tv/js/embed/v1.js"></script>
<script>
new Twitch.Player("<?= $id ?>", {
channel: "<?= $data->channel()->value() ?>",
width: '100%',
height: 480,
})
</script>
</div>

View File

@@ -0,0 +1,9 @@
<?php
$video = $data->file()->toFile();
$poster = $data->poster()->toFile();
$loop = $data->loop()->toBool();
?>
<?php if ($video): ?>
<video controls controlsList="nodownload" src="<?= $video->url() ?>" <?= $poster ? "poster=\"{$poster->url()}\"" : "" ?> <?= $loop ? "loop" : "" ?>></video>
<?php endif ?>