decor-6-site/site/templates/print.php

169 lines
6.6 KiB
PHP
Raw Normal View History

2026-03-18 08:44:44 +01:00
<?php snippet('head') ?>
<?php $sizes = "(min-width: 1200px) 25vw,
(min-width: 900px) 33vw,
(min-width: 600px) 50vw,
100vw";
?>
<header id="interface-header" w3-include-html="assets/pagedjs/interface.html"></header>
<div id="render-book"></div>
<template id="book-content">
2026-03-08 11:09:35 +01:00
2026-03-18 08:44:44 +01:00
<section class="cover">
<h1><?= $site->title()->html()?></h1>
</section>
2026-03-08 11:09:35 +01:00
2026-03-31 17:07:00 +02:00
<div class="blank-page"></div>
2026-03-18 08:44:44 +01:00
<section class="toc">
2026-04-12 23:47:04 +02:00
<h2>Sommaire</h2>
2026-03-18 08:44:44 +01:00
<article id="table-of-contents"></article>
</section>
2026-01-05 19:33:15 +01:00
2026-04-13 09:13:56 +02:00
<div class="interpage full-bleed-image" id="toc-interpage">
<figure>
<img src="http://localhost:8000/media/pages/e-l-aria-diventa-piu-respirabile-per-tutti-une-television-pirate-pour-le-quartier/c1795ba60a-1775838245/dither-ascii-pro-1775051501302.png">
</figure></div>
2026-03-18 08:44:44 +01:00
<?php foreach($site->index()->filterBy('intendedTemplate', 'chapitre')->listed() as $chapitre):?>
<!-- Interpage chapitre -->
2026-03-18 08:44:44 +01:00
<?php if($cover = $chapitre->cover()->toFile()):?>
2026-03-24 02:34:20 +01:00
<div class="interpage full-bleed-image">
2026-04-08 20:33:31 +02:00
<figure id="cover-<?= $chapitre->uid() ?>">
2026-03-18 08:44:44 +01:00
<img src="<?= $cover->url() ?>" alt="">
</figure>
</div>
<?php endif;?>
2026-03-24 02:34:20 +01:00
<section class="chapter <?= $chapitre->typeof()->esc()?>" data-chapter="<?= $chapitre->typeof()->esc()?>" id="<?= $chapitre->uid()?>">
<!-- titre courant -->
<span class="nav-decor">D6cor</span>
<span class="nav-author"><?= $chapitre->author()->html()->smartypants() ?></span>
<span class="nav-title"><?= $chapitre->title()->html()->smartypants() ?></span>
2026-04-11 20:51:26 +02:00
<!-- Image avant le titre -->
<?php $avantTitre = $chapitre->avant_titre()->toObject(); ?>
<?php if ($avantTitre->image()->isNotEmpty() && ($img = $avantTitre->image()->toFile())): ?>
<figure class="intro-portfolio <?= $avantTitre->doublepage()->toBool() ? 'double-page' : '' ?>">
<img src="<?= $img->url() ?>" alt="">
<?php if ($avantTitre->caption()->isNotEmpty()): ?>
<figcaption><?= $avantTitre->caption()->html() ?></figcaption>
<?php endif ?>
</figure>
<?php endif ?>
<!-- Entrées des chapitres -->
2026-03-24 02:34:20 +01:00
<div class="chapter-header">
2026-04-07 18:09:15 +02:00
<?php
$type = $chapitre->typeof()->value();
switch ($type) {
case 'entretien':
$symbol = '@';
$before = '@/////////';
$after = '/////////@';
$separator = '@///////////////////////////@';
break;
case 'portfolio':
$symbol = '+';
$before = '+/////////';
$after = '/////////+';
$separator = '+///////////////////////////+';
break;
default:
$symbol = '*';
$before = '*//////////';
$after = '//////////*';
$separator = '*///////////////////////////*';
break;
}
?>
<div class="hgroup">
<div class="type-container">
<div class="before"><?= $before ?></div>
<div class="type"><?= $chapitre->typeof()->html() ?></div>
<div class="after"><?= $after ?></div>
</div>
<div class="type-separator"><?= $separator ?></div>
<h2><span><?= $chapitre->title()->html()->smartypants() ?></span></h2>
<div class="title-between">/ / </div>
<p class="author"><span><?= $chapitre->author()->html()->smartypants() ?></span></p>
<div class="title-after">/ / / / / / </div>
</div>
2026-03-24 02:34:20 +01:00
</div>
2026-03-08 11:09:35 +01:00
2026-03-18 08:44:44 +01:00
<div class="chapter-content">
2026-04-12 16:46:06 +02:00
<?php $figCount = 0; $figTypes = ['image', 'imagefloat', 'gallery', 'fullpageimage', 'spreadimage']; ?>
2026-03-31 17:07:00 +02:00
<?php foreach ($chapitre->text()->toBlocks() as $block): ?>
2026-04-12 16:46:06 +02:00
<?php
$isFig = in_array($block->type(), $figTypes);
if ($isFig) {
$figCount++;
$blockId = 'fig-' . Str::slug($chapitre->author()) . '-' . $figCount;
} else {
$blockId = $block->id();
}
?>
<div id="<?= $blockId ?>" class="block block-type-<?= $block->type() ?><?= $block->classes()->isNotEmpty() ? ' ' . implode(' ', $block->classes()->split(',')) : '' ?>">
2026-03-31 17:07:00 +02:00
<?= $block ?>
</div>
<?php endforeach ?>
<!-- Pour les portfolios -->
<?php if($chapitre->portfolio()->isNotEmpty()):?>
<?php
$portfolio = $chapitre->portfolio()->toStructure();
$counter = 0;
?>
<?php foreach($portfolio as $portfolioEl): ?>
<?php $counter ++?>
<?php if($spread = $portfolioEl->spread()->toFile()):?>
<div class="spread">
<div class="spread-inner">
2026-04-08 20:33:31 +02:00
<figure id="spread-<?= $counter ?>-left" class="spread__left">
2026-03-31 17:07:00 +02:00
<div class="spread-content">
<img src="<?= $spread->url() ?>">
</div>
</figure>
<?php if($portfolioEl->position() == "topleft" || $portfolioEl->position() == "bottomleft"):?>
<?php if($image = $portfolioEl->imageontop()->toFile()):?>
<div class="image__top <?= $portfolioEl->position()?>" style="width: <?= $portfolioEl->largeur() ?>cm">
<img src="<?= $image->url() ?>">
</div>
<?php endif;?>
<?php endif;?>
2026-04-01 15:36:02 +02:00
<!-- <div class="pagebreak"></div> -->
2026-04-08 20:33:31 +02:00
<figure id="spread-<?= $counter ?>-right" class="spread__right">
2026-03-31 17:07:00 +02:00
<div class="spread-content">
<img src="<?= $spread->url() ?>">
</div>
</figure>
<?php if($portfolioEl->position() == "topright" || $portfolioEl->position() == "bottomright" || $portfolioEl->position() == "center"):?>
<?php if($image = $portfolioEl->imageontop()->toFile()):?>
<div class="image__top <?= $portfolioEl->position()?>" style="width: <?= $portfolioEl->largeur() ?>cm">
<img src="<?= $image->url() ?>">
</div>
<?php endif;?>
<?php endif;?>
</div>
</div>
<div class="pagebreak"></div>
<?php endif;?>
<?php endforeach ?>
<?php endif;?>
2026-01-05 19:33:15 +01:00
</div>
2026-03-08 11:09:35 +01:00
2026-03-18 08:44:44 +01:00
</section>
<?php endforeach;?>
2026-01-05 19:33:15 +01:00
2026-03-18 08:44:44 +01:00
</template>
2026-03-31 17:07:00 +02:00
<?php snippet('footer');?>