tests mise en page

This commit is contained in:
sarahgarcin1 2026-03-08 11:09:35 +01:00
parent 581d60f883
commit bc350af540
52 changed files with 961 additions and 72 deletions

View file

@ -0,0 +1,49 @@
name: Image flottante
icon: image
preview: image
fields:
image:
label: field.blocks.image.name
type: files
query: model.images
multiple: false
image:
back: black
uploads:
template: blocks/image
imagered:
label: Image (couche rouge)
type: files
query: model.images
multiple: false
image:
back: black
uploads:
template: blocks/image
imagegreen:
label: Image (couche verte)
type: files
query: model.images
multiple: false
image:
back: black
uploads:
template: blocks/image
imageblue:
label: Image (couche bleu)
type: files
query: model.images
multiple: false
image:
back: black
uploads:
template: blocks/image
alt:
label: field.blocks.image.alt
type: text
icon: title
caption:
label: field.blocks.image.caption
type: writer
icon: text
inline: true

View file

@ -7,6 +7,14 @@ columns:
fields:
type: fields
fields:
author:
label: Auteur·ice
type: text
width: 1/2
cover:
label: Image de couverture
type: files
multiple: false
chapeau:
label: Chapeau
type: writer
@ -29,6 +37,7 @@ columns:
fieldsets:
- gallery
- image
- imagefloat
- fullpageimage
- spreadimage
others:

View file

@ -9,7 +9,7 @@ Kirby::plugin('sarahgarcin/notes-tag', [
'html' => function($tag) {
$note = $tag->attr('note');
return '<span class="footnote">'.$note.'</span>';
return '<span class="margin-note">'.$note.'</span>';
}
]

View file

@ -0,0 +1,46 @@
<?php
/** @var \Kirby\Cms\Block $block */
$alt = $block->alt();
$caption = $block->caption();
$src = $block->image()->toFile()->url();
?>
<?php if ($src): ?>
<figure class="web-image">
<img src="<?= $src ?>" alt="<?= $alt->esc() ?>">
<?php if ($caption->isNotEmpty()): ?>
<figcaption>
<?= $caption->kt() ?>
</figcaption>
<?php endif ?>
</figure>
<figure class="print-image float-image">
<?php if($srcred = $block->imagered()->toFile()):?>
<div class="print-red red-layer">
<img src="<?= $srcred->url() ?>" alt="<?= $alt->esc() ?>">
</div>
<?php endif ?>
<?php if($srcgreen = $block->imagegreen()->toFile()):?>
<div class="print-green green-layer">
<img src="<?= $srcgreen->url() ?>" alt="<?= $alt->esc() ?>">
</div>
<?php endif ?>
<?php if($srcblue = $block->imageblue()->toFile()):?>
<div class="print-blue blue-layer">
<img src="<?= $srcblue->url() ?>" alt="<?= $alt->esc() ?>">
</div>
<?php endif ?>
<?php if ($caption->isNotEmpty()): ?>
<figcaption>
<?= $caption->kt() ?>
</figcaption>
<?php endif ?>
</figure>
<?php endif ?>

View file

@ -49,6 +49,7 @@
"assets/js/plugins/full-page.js",
"assets/js/plugins/margin-notes.js",
"assets/js/plugins/toc.js",
"assets/js/handlers.js",
'@auto'
]) ?>

View file

@ -0,0 +1,49 @@
<?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">
<section class="cover">
<h1><?= $site->title()->html()?></h1>
</section>
<section class="toc">
<h2>Sommaire</h2>
<article id="table-of-contents"></article>
</section>
<?php foreach($site->index()->filterBy('intendedTemplate', 'chapitre') as $chapitre):?>
<section class="chapter">
<div class="chapter-title">
<!-- REMPLISSAGE HAUT -->
<div class="ascii-fill fill-top"></div>
<h2><?= $chapitre->title()->html()->smartypants() ?></h2>
<h3><?= $chapitre->author()->html()->smartypants() ?></h3>
<!-- REMPLISSAGE BAS -->
<div class="ascii-fill fill-mid"></div>
<div class="biographie" id="biographie">
<p>Biographie Nus adit pressit et rem dolor ratibus. Ut atem et res ab id ut est lit, iscia cum que am verum sapici dolestorpora placeat laborit asinctate omnihilis aspelen dicatusam voluptae eum ipsandit undempos aut et laceptati omniminveris quam sim qui corem harum qui invenihita volorer sperumquas el mi, tectota tesequu ntioneserit, corem qui as earchit ipis di cum litios pro conse perspel ipsae eturi unt, sundae enimus aut ut endero cumquam faccatem duci quo quatqua meturion event fuga. Et volore videndia solorro runtis doluptas rem netum aborporaepro te quos raes at. Haritas sim quam, soluptate venem quam, earum vendunte omnisi ad endebisqui opta vel magnam conseditas eicia ditibearum rem explabo.</p>
</div>
<!-- REMPLISSAGE BAS FINAL -->
<div class="ascii-fill fill-bottom"></div>
</div>
<div class="chapeau"><?= $chapitre->chapeau()->kt()->smartypants() ?></div>
<?php foreach ($chapitre->text()->toBlocks() as $block): ?>
<div id="<?= $block->id() ?>" class="block block-type-<?= $block->type() ?>">
<?= $block ?>
</div>
<?php endforeach ?>
</section>
<?php endforeach;?>
</template>
<?php snippet('footer');?>

View file

@ -1,36 +1,58 @@
<?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">
<section class="cover">
<h1><?= $site->title()->html()?></h1>
</section>
<section class="toc">
<h2>Sommaire</h2>
<article id="table-of-contents"></article>
</section>
<?php foreach($site->index()->filterBy('intendedTemplate', 'chapitre') as $chapitre):?>
<section class="chapter">
<?php foreach($site->index()->filterBy('intendedTemplate', 'chapitre')->listed() as $chapitre):?>
<section class="chapter">
<?php if($cover = $chapitre->cover()->toFile()):?>
<div class="interpage full-bleed-image full-page">
<figure>
<img src="<?= $cover->url() ?>" alt="">
</figure>
</div>
<?php endif;?>
<div class="chapter-title">
<div class="ascii-fill fill-top"></div>
<h2><?= $chapitre->title()->html()->smartypants() ?></h2>
<div class="chapeau"><?= $chapitre->chapeau()->kt()->smartypants() ?></div>
<h3><?= $chapitre->author()->html()->smartypants() ?></h3>
<div class="ascii-fill fill-mid"></div>
<div class="biographie">
<p>Biographie Nus adit pressit et rem dolor ratibus. Ut atem et res ab id ut est lit, iscia cum que am verum sapici dolestorpora placeat laborit asinctate omnihilis aspelen dicatusam voluptae eum ipsandit undempos aut et laceptati omniminveris quam sim qui corem harum qui invenihita volorer sperumquas el mi, tectota tesequu ntioneserit, corem qui as earchit ipis di cum litios pro conse perspel ipsae eturi unt, sundae enimus aut ut endero cumquam faccatem duci quo quatqua meturion event fuga. Et volore videndia solorro runtis doluptas rem netum aborporaepro te quos raes at. Haritas sim quam, soluptate venem quam, earum vendunte omnisi ad endebisqui opta vel magnam conseditas eicia ditibearum rem explabo.</p>
</div>
<div class="ascii-fill fill-bottom"></div>
</div>
<div class="chapeau"><?= $chapitre->chapeau()->kt()->smartypants() ?></div>
<div class="chapter-content">
<?php foreach ($chapitre->text()->toBlocks() as $block): ?>
<div id="<?= $block->id() ?>" class="block block-type-<?= $block->type() ?>">
<?= $block ?>
</div>
<?php endforeach ?>
</section>
<?php endforeach;?>
</template>
<?php endforeach ?>
</div>
<?php snippet('footer');?>
</section>
<?php endforeach;?>
</template>
<?php snippet('footer');?>