init
This commit is contained in:
3
site/snippets/blocks/audio.php
Normal file
3
site/snippets/blocks/audio.php
Normal 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 ?>
|
||||
3
site/snippets/blocks/code.php
Normal file
3
site/snippets/blocks/code.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php if ($block->language() == "css"): ?>
|
||||
<style><?= $block->code()->value() ?></style>
|
||||
<?php endif; ?>
|
||||
52
site/snippets/blocks/embed.php
Normal file
52
site/snippets/blocks/embed.php
Normal 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 ?>
|
||||
5
site/snippets/blocks/iframe.php
Normal file
5
site/snippets/blocks/iframe.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
/** @var \Kirby\Cms\Block $block */
|
||||
?>
|
||||
|
||||
<iframe class="iframe" src="<?= $block->url() ?>"></iframe>
|
||||
23
site/snippets/blocks/image.php
Normal file
23
site/snippets/blocks/image.php
Normal 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 ?>
|
||||
7
site/snippets/blocks/image_gallery.php
Normal file
7
site/snippets/blocks/image_gallery.php
Normal 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>
|
||||
10
site/snippets/blocks/texts.php
Normal file
10
site/snippets/blocks/texts.php
Normal 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>
|
||||
17
site/snippets/blocks/twitch.php
Normal file
17
site/snippets/blocks/twitch.php
Normal 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>
|
||||
9
site/snippets/blocks/video.php
Normal file
9
site/snippets/blocks/video.php
Normal 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 ?>
|
||||
91
site/snippets/footer.php
Normal file
91
site/snippets/footer.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<?php $dontShowFooter = isset($dont_show_footer) && $dont_show_footer === true ?>
|
||||
|
||||
<?php if (!$dontShowFooter): ?>
|
||||
<div class="container <?= remember("") ?>" style="display:flex; justify-content: space-between">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; width: 439px;">
|
||||
<a href="https://www.instagram.com/thealit_fkl/" class="block link">Instagram</a>
|
||||
<a href="https://www.thealit.de" class="block link">Thealit</a>
|
||||
<a href="https://www.thealit.de/newsletter" class="block link">Newsletter</a>
|
||||
</div>
|
||||
|
||||
<div class="text-12">
|
||||
<?php $impressum = $pages->findBy('uid', 'impressum') ?>
|
||||
<a href="<?= $impressum->url() ?>" class="link"><?= $impressum->title() ?></a>
|
||||
<?php $datenschutz = $pages->findBy('uid', 'datenschutzerklaerung') ?>
|
||||
<a href="<?= $datenschutz->url() ?>" class="link"><?= $datenschutz->title() ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="font-kobata text-40 uppercase border-top container" style="line-height:1;letter-spacing:1.5rem">Re Capitulating. Queer</footer>
|
||||
|
||||
<script src="<?= url('assets/siema.min.js') ?>"></script>
|
||||
|
||||
<script defer>
|
||||
const $menu = document.getElementById('menu')
|
||||
const $open = document.getElementById('menu_open')
|
||||
const $close = document.getElementById('menu_close')
|
||||
|
||||
$open.addEventListener('click', () => {
|
||||
$menu.classList.add('flex')
|
||||
$open.classList.remove('flex')
|
||||
$close.classList.add('flex')
|
||||
})
|
||||
$close.addEventListener('click', () => {
|
||||
$menu.classList.remove('flex')
|
||||
$open.classList.add('flex')
|
||||
$close.classList.remove('flex')
|
||||
})
|
||||
|
||||
for (const $embed of document.querySelectorAll('.embed')) {
|
||||
$embed.addEventListener('click', () => {
|
||||
const $iframe = $embed.querySelector('iframe')
|
||||
$iframe.src = $iframe.dataset.src + '&autoplay=1&autopause=0'
|
||||
const $iframeDiv = $embed.querySelector('.iframe')
|
||||
$iframeDiv.style.display = 'block'
|
||||
$iframeDiv.classList.add('active')
|
||||
$embed.querySelector('img').style.display = 'none'
|
||||
})
|
||||
}
|
||||
|
||||
const $audios = document.getElementsByTagName('audio')
|
||||
for (const $audio of $audios) {
|
||||
$audio.addEventListener('play', () => {
|
||||
for (const $a of $audios) {
|
||||
if ($a != $audio) $a.pause()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function siemaResize() {
|
||||
const $div = this.innerElements[this.currentSlide]
|
||||
const height = $div.offsetHeight
|
||||
if (height !== 0) {
|
||||
this.selector.style.height = `${height}px`
|
||||
}
|
||||
}
|
||||
|
||||
for (const $siema of document.querySelectorAll('.siema')) {
|
||||
const instance = new Siema({
|
||||
selector: $siema.querySelector('.siema-gallery'),
|
||||
onInit: function () {
|
||||
const $img = this.innerElements[this.currentSlide].querySelector('img')
|
||||
if ($img.complete) siemaResize.call(this)
|
||||
else $img.addEventListener('load', () => siemaResize.call(this))
|
||||
},
|
||||
onChange: siemaResize
|
||||
})
|
||||
|
||||
const $prev = document.createElement('button')
|
||||
$prev.className = 'prev'; $prev.innerHTML = '←'
|
||||
const $next = document.createElement('button')
|
||||
$next.className = 'next'; $next.innerHTML = '→'
|
||||
$siema.appendChild($prev); $siema.appendChild($next)
|
||||
$prev.addEventListener('click', () => instance.prev())
|
||||
$next.addEventListener('click', () => instance.next())
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
51
site/snippets/header.php
Normal file
51
site/snippets/header.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?= $kirby->language()->code() ?>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Re Capitulating. Queer | <?= $page->title()->esc() ?></title>
|
||||
<style>
|
||||
@font-face { font-family: 'Kobata'; src: url('<?= url('assets/Kobata-Bold.woff2') ?>') format('woff2') }
|
||||
@font-face { font-family: 'VG5000'; src: url('<?= url('assets/VG5000-Regular_web.woff2') ?>') format('woff2') }
|
||||
<?= F::read('assets/style.css') ?>
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div style="position: relative">
|
||||
|
||||
<div id="menu-container">
|
||||
<div style="display: flex; height: 36pt; position: absolute; top: 22pt; left: 22pt">
|
||||
<div style="width: 376pt; margin-left: 1px;">
|
||||
<button id="menu_open" aria-label="Menu Open" class="menu-button no-button flex" style="gap: 10px"><div></div><div></div><div></div></button>
|
||||
<button id="menu_close" aria-label="Menu Close" class="menu-button no-button" style="margin-top: 4px"><div style="transform: rotate(45deg);"></div><div style="transform: translate(0,-6px) rotate(135deg);"></div></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<nav id="menu" class="bg-white-pink container">
|
||||
<div>
|
||||
<?php $menu = $site->menuItems() ?>
|
||||
<?php if ($menu->isNotEmpty()): ?>
|
||||
<?php foreach ($menu->toPages() as $menuPage): ?>
|
||||
<a href="<?= $menuPage->url() ?>" class="font-kobata text-30 link uppercase block" style="margin-bottom: 1.5rem"><?= $menuPage->title() ?></a>
|
||||
<?php endforeach ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<a href="https://www.instagram.com/thealit_fkl/" class="block link">Instagram</a>
|
||||
<a href="https://www.thealit.de" class="block link">Thealit</a>
|
||||
<a href="https://www.thealit.de/newsletter" class="block link">Newsletter</a>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div id="lang-switch" class="container">
|
||||
<?php foreach($kirby->languages() as $language): ?>
|
||||
<?php if ($kirby->language() != $language): ?>
|
||||
<a href="<?= $page->url($language->code()) ?>" hreflang="<?= $language->code() ?>" class="font-kobata text-40 uppercase link leading-none">
|
||||
<?= html($language->code()) ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
0
site/snippets/index.html
Normal file
0
site/snippets/index.html
Normal file
9
site/snippets/layouts.php
Normal file
9
site/snippets/layouts.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php foreach ($layouts as $layout): ?>
|
||||
<section class="grid container <?= $layout->columns()->count() == 2 ? "two" : "" ?> <?= bg($layout->background(), $layout->grid()) ?>">
|
||||
<?php foreach ($layout->columns() as $column): ?>
|
||||
<div class="column" style="--span:<?= $column->span() ?>">
|
||||
<?= $column->blocks() ?>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</section>
|
||||
<?php endforeach ?>
|
||||
Reference in New Issue
Block a user