save before move tabs outside from header
This commit is contained in:
parent
f9397935bd
commit
94d404288f
13 changed files with 116 additions and 64 deletions
|
|
@ -1,10 +1,5 @@
|
||||||
main.article {
|
.article-header .title-wrapper {
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.article-header {
|
|
||||||
--margin-left: 2;
|
--margin-left: 2;
|
||||||
padding-left: calc(var(--unit--horizontal) * var(--margin-left));
|
|
||||||
margin-bottom: calc(var(--unit--vertical) * 4);
|
|
||||||
width: calc(100% - (var(--margin-left) * var(--unit--horizontal)));
|
width: calc(100% - (var(--margin-left) * var(--unit--horizontal)));
|
||||||
|
padding-left: calc(var(--margin-left) * var(--unit--horizontal));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,3 +6,9 @@
|
||||||
padding: var(--unit--horizontal);
|
padding: var(--unit--horizontal);
|
||||||
padding-top: var();
|
padding-top: var();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#main-footer a {
|
||||||
|
text-shadow: 0 0 2px #000;
|
||||||
|
-moz-text-shadow: 0 0 2px #000;
|
||||||
|
-webkit-text-shadow: 0 0 2px #000;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#header {
|
#main-header {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|
@ -7,17 +7,16 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(var(--unit--vertical) * 5);
|
height: calc(var(--unit--vertical) * 5);
|
||||||
padding: var(--unit--vertical) var(--unit--horizontal);
|
padding: var(--unit--vertical) var(--unit--horizontal);
|
||||||
|
|
||||||
transition: height 0.2s ease-in-out;
|
transition: height 0.2s ease-in-out;
|
||||||
}
|
}
|
||||||
#header.minimized {
|
#main-header.minimized {
|
||||||
height: calc(var(--unit--vertical) * 3);
|
height: calc(var(--unit--vertical) * 3);
|
||||||
}
|
}
|
||||||
#logo {
|
#logo {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
#header.open #actuel {
|
#main-header.open #actuel {
|
||||||
color: var(--color-background);
|
color: var(--color-background);
|
||||||
}
|
}
|
||||||
#logo #actuel {
|
#logo #actuel {
|
||||||
|
|
@ -33,6 +32,22 @@
|
||||||
bottom: -48%;
|
bottom: -48%;
|
||||||
transition: bottom 0.2s ease-in-out;
|
transition: bottom 0.2s ease-in-out;
|
||||||
}
|
}
|
||||||
#header.minimized #logo #inactuel {
|
#main-header.minimized #logo #inactuel {
|
||||||
bottom: 0%;
|
bottom: 0%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.page-cover {
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: calc(7 * var(--unit--vertical)) 0;
|
||||||
|
margin-bottom: 0rem;
|
||||||
|
|
||||||
|
transition: margin-bottom 0.5s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-cover.open {
|
||||||
|
margin-bottom: calc(100vh - 10 * var(--unit--vertical));
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1 @@
|
||||||
main#home .toggle-btns {
|
|
||||||
margin-top: calc(var(--unit--vertical) * 6);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ body {
|
||||||
position: relative;
|
position: relative;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
padding: var(--unit--vertical) var(--unit--horizontal);
|
padding: 0 var(--unit--horizontal);
|
||||||
background-color: var(--color-background);
|
background-color: var(--color-background);
|
||||||
color: var(--color-primary);
|
color: var(--color-primary);
|
||||||
}
|
}
|
||||||
|
|
@ -26,10 +26,6 @@ html {
|
||||||
scroll-behavior: smooth;
|
scroll-behavior: smooth;
|
||||||
}
|
}
|
||||||
|
|
||||||
main {
|
|
||||||
margin-top: calc(6 * var(--unit--vertical));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Works on Firefox */
|
/* Works on Firefox */
|
||||||
|
|
||||||
* {
|
* {
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,18 @@ button.toggle.right.open::before {
|
||||||
content: "-";
|
content: "-";
|
||||||
}
|
}
|
||||||
|
|
||||||
.active-tab {
|
#tabs {
|
||||||
margin-top: calc(var(--unit--vertical) * 0.5);
|
position: relative;
|
||||||
overflow: auto;
|
}
|
||||||
max-height: calc(100vh - 7.5 * var(--unit--vertical));
|
|
||||||
margin-bottom: calc(2 * var(--unit--vertical));
|
.active-tab {
|
||||||
|
position: absolute;
|
||||||
|
overflow: auto;
|
||||||
|
margin-top: calc(var(--unit--vertical) * 0.5);
|
||||||
|
height: 0px;
|
||||||
|
transition: height 0.5s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-cover.open .active-tab {
|
||||||
|
height: calc(100vh - 7.5 * var(--unit--vertical));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
8
assets/dist/script.js
vendored
8
assets/dist/script.js
vendored
|
|
@ -1,7 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
function openTab(data, tab) {
|
function openTab(data, tab) {
|
||||||
data.activeTab === tab ? data.activeTab = "" : data.activeTab = tab;
|
data.activeTab === tab ? (data.activeTab = "") : (data.activeTab = tab);
|
||||||
}
|
}
|
||||||
function scrollToElem(selector) {
|
function scrollToElem(selector) {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
|
|
@ -10,7 +10,7 @@ function scrollToElem(selector) {
|
||||||
var top = elem.getBoundingClientRect().top;
|
var top = elem.getBoundingClientRect().top;
|
||||||
window.scrollTo({
|
window.scrollTo({
|
||||||
top: top + window.scrollY + yOffset,
|
top: top + window.scrollY + yOffset,
|
||||||
behavior: "smooth"
|
behavior: "smooth",
|
||||||
});
|
});
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
@ -18,9 +18,9 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||||
function toggleLogoState() {
|
function toggleLogoState() {
|
||||||
var scrollY = window.scrollY || window.pageYOffset;
|
var scrollY = window.scrollY || window.pageYOffset;
|
||||||
if (scrollY > 10) {
|
if (scrollY > 10) {
|
||||||
document.querySelector("#header").classList.add("minimized");
|
document.querySelector("#main-header").classList.add("minimized");
|
||||||
} else {
|
} else {
|
||||||
document.querySelector("#header").classList.remove("minimized");
|
document.querySelector("#main-header").classList.remove("minimized");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
window.addEventListener("scroll", function () {
|
window.addEventListener("scroll", function () {
|
||||||
|
|
|
||||||
18
assets/dist/style.css
vendored
18
assets/dist/style.css
vendored
|
|
@ -125,7 +125,7 @@ button {
|
||||||
article p {
|
article p {
|
||||||
margin-bottom: var(--unit--vertical);
|
margin-bottom: var(--unit--vertical);
|
||||||
}
|
}
|
||||||
#header {
|
#main-header {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|
@ -136,7 +136,7 @@ article p {
|
||||||
padding: var(--unit--vertical) var(--unit--horizontal);
|
padding: var(--unit--vertical) var(--unit--horizontal);
|
||||||
transition: height 0.2s ease-in-out;
|
transition: height 0.2s ease-in-out;
|
||||||
}
|
}
|
||||||
#header.minimized {
|
#main-header.minimized {
|
||||||
height: calc(var(--unit--vertical) * 3);
|
height: calc(var(--unit--vertical) * 3);
|
||||||
}
|
}
|
||||||
#logo,
|
#logo,
|
||||||
|
|
@ -147,7 +147,7 @@ article p {
|
||||||
margin-top: var(--unit--vertical);
|
margin-top: var(--unit--vertical);
|
||||||
margin-left: var(--unit--horizontal);
|
margin-left: var(--unit--horizontal);
|
||||||
}
|
}
|
||||||
#header.open #actuel {
|
#main-header.open #actuel {
|
||||||
color: var(--color-background);
|
color: var(--color-background);
|
||||||
}
|
}
|
||||||
#logo #actuel,
|
#logo #actuel,
|
||||||
|
|
@ -165,8 +165,8 @@ article p {
|
||||||
bottom: -48%;
|
bottom: -48%;
|
||||||
transition: bottom 0.2s ease-in-out;
|
transition: bottom 0.2s ease-in-out;
|
||||||
}
|
}
|
||||||
#header.minimized #logo #inactuel,
|
#main-header.minimized #logo #inactuel,
|
||||||
#header.minimized #logo-nav #inactuel-nav {
|
#main-header.minimized #logo-nav #inactuel-nav {
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
}
|
}
|
||||||
#nav-btn {
|
#nav-btn {
|
||||||
|
|
@ -187,9 +187,9 @@ article p {
|
||||||
background-color: var(--color-primary);
|
background-color: var(--color-primary);
|
||||||
transition: all 0.3s ease-in-out;
|
transition: all 0.3s ease-in-out;
|
||||||
}
|
}
|
||||||
#header.open .line-center,
|
#main-header.open .line-center,
|
||||||
#header.open .line-down,
|
#main-header.open .line-down,
|
||||||
#header.open .line-up {
|
#main-header.open .line-up {
|
||||||
background-color: var(--color-background);
|
background-color: var(--color-background);
|
||||||
}
|
}
|
||||||
#nav-btn .line-up {
|
#nav-btn .line-up {
|
||||||
|
|
@ -227,7 +227,7 @@ nav {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
transition: all 0.5s ease-in-out;
|
transition: all 0.5s ease-in-out;
|
||||||
}
|
}
|
||||||
#header.open nav {
|
#main-header.open nav {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
#spaces {
|
#spaces {
|
||||||
|
|
|
||||||
|
|
@ -6,14 +6,17 @@ function toggleTab(data, tab) {
|
||||||
scrollToElem("body");
|
scrollToElem("body");
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
data.activeTab = "";
|
data.activeTab = "";
|
||||||
|
data.isOpen = false;
|
||||||
}, 200);
|
}, 200);
|
||||||
} else {
|
} else {
|
||||||
data.activeTab = tab;
|
data.activeTab = tab;
|
||||||
|
data.isOpen = true;
|
||||||
scrollToElem(".active-tab");
|
scrollToElem(".active-tab");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function scrollToElem(selector) {
|
function scrollToElem(selector) {
|
||||||
|
document.querySelector(".active-tab").scrollTop = 0;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const yOffset = -7 * verticalUnit;
|
const yOffset = -7 * verticalUnit;
|
||||||
const elem = document.querySelector(selector);
|
const elem = document.querySelector(selector);
|
||||||
|
|
@ -30,9 +33,9 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||||
const scrollY = window.scrollY || window.pageYOffset;
|
const scrollY = window.scrollY || window.pageYOffset;
|
||||||
|
|
||||||
if (scrollY > 10) {
|
if (scrollY > 10) {
|
||||||
document.querySelector("#header").classList.add("minimized");
|
document.querySelector("#main-header").classList.add("minimized");
|
||||||
} else {
|
} else {
|
||||||
document.querySelector("#header").classList.remove("minimized");
|
document.querySelector("#main-header").classList.remove("minimized");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
16
site/snippets/cover.php
Normal file
16
site/snippets/cover.php
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?php
|
||||||
|
$isOpen = isset($isOpen) ? $isOpen : false;
|
||||||
|
?>
|
||||||
|
|
||||||
|
<header
|
||||||
|
x-data="{
|
||||||
|
isOpen: <?= $isOpen ?>
|
||||||
|
}"
|
||||||
|
class="page-cover"
|
||||||
|
:class="isOpen ? 'open' : 'close'"
|
||||||
|
>
|
||||||
|
<div class="title-wrapper">
|
||||||
|
<?= $slots->title() ?>
|
||||||
|
</div>
|
||||||
|
<?= $slots->tabs() ?>
|
||||||
|
</header>
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
$left['slug'] = Str::slug($left['label']);
|
$left['slug'] = Str::slug($left['label']);
|
||||||
$authorFilter = isset($authorFilter) ? $authorFilter : false;
|
$authorFilter = isset($authorFilter) ? $authorFilter : false;
|
||||||
|
$activeTab = isset($activeTab) ? Str::slug($activeTab) : '';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div id="tabs" x-data="{
|
<div id="tabs" x-data="{
|
||||||
activeTab: ''
|
activeTab: '<?= $activeTab ?>'
|
||||||
}">
|
}">
|
||||||
<div class="toggle-btns | flex space-between" style="
|
<div class="toggle-btns | flex space-between" style="
|
||||||
--content:space-between;
|
--content:space-between;
|
||||||
|
|
@ -20,7 +21,7 @@ $authorFilter = isset($authorFilter) ? $authorFilter : false;
|
||||||
@click="toggleTab($data, 'texts')"
|
@click="toggleTab($data, 'texts')"
|
||||||
>textes</button>
|
>textes</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="active-tab">
|
<div class="active-tab" x-show="activeTab.length > 0">
|
||||||
<section
|
<section
|
||||||
x-show="activeTab === '<?=$left['slug'] ?>'">
|
x-show="activeTab === '<?=$left['slug'] ?>'">
|
||||||
<?= $left['content'] ?>
|
<?= $left['content'] ?>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?php snippet('header') ?>
|
<?php snippet('header') ?>
|
||||||
<header id="header">
|
<header id="main-header">
|
||||||
<div id="logo">
|
<div id="logo">
|
||||||
<a href="/" class="no-line">
|
<a href="/" class="no-line">
|
||||||
<h1 id="actuel">actuel</h1>
|
<h1 id="actuel">actuel</h1>
|
||||||
|
|
@ -9,15 +9,22 @@
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main id="<?= $page->template() ?>">
|
<main id="<?= $page->template() ?>">
|
||||||
|
<?php snippet('cover', slots: true) ?>
|
||||||
|
<?php slot('title') ?>
|
||||||
<h3 class="title-center">
|
<h3 class="title-center">
|
||||||
critique des arts<br />
|
revue critique<br>
|
||||||
et des techniques<br>
|
des arts et des techniques<br>
|
||||||
</h3>
|
</h3>
|
||||||
|
<?php endslot() ?>
|
||||||
|
|
||||||
|
<?php slot('tabs') ?>
|
||||||
<?php snippet('tabs', [
|
<?php snippet('tabs', [
|
||||||
'left' => [
|
'left' => [
|
||||||
'label' => 'édito',
|
'label' => 'édito',
|
||||||
'content' => $site->edito()
|
'content' => $site->edito()
|
||||||
]
|
]
|
||||||
]) ?>
|
]) ?>
|
||||||
|
<?php endslot() ?>
|
||||||
|
<?php endsnippet() ?>
|
||||||
</main>
|
</main>
|
||||||
<?php snippet('footer') ?>
|
<?php snippet('footer') ?>
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?php snippet('header') ?>
|
<?php snippet('header') ?>
|
||||||
<header id="header" class="minimized">
|
<header id="main-header" class="minimized">
|
||||||
<div id="logo" >
|
<div id="logo" >
|
||||||
<a href="/" class="no-line">
|
<a href="/" class="no-line">
|
||||||
<h2 id="actuel">actuel</h2>
|
<h2 id="actuel">actuel</h2>
|
||||||
|
|
@ -9,16 +9,22 @@
|
||||||
</header>
|
</header>
|
||||||
<main id="<?= $page->template() ?>">
|
<main id="<?= $page->template() ?>">
|
||||||
<article>
|
<article>
|
||||||
<div class="article-header">
|
<?php snippet('cover', ['isOpen' => true], slots: true) ?>
|
||||||
|
<?php slot('title') ?>
|
||||||
<h1 class="main-title title-center <?= setTitleFontSizeClass($page->title()) ?>"><?= $page->title() ?></h1>
|
<h1 class="main-title title-center <?= setTitleFontSizeClass($page->title()) ?>"><?= $page->title() ?></h1>
|
||||||
<p><span class="opacity" style="--opacity:.5">par</span> <a class="author no-line" href="/auteurs/<?= Str::slug($page->author()->toUser()->name()) ?>" title="Voir les articles d'<?= $page->author()->toUser()->name() ?>"><?= $page->author()->toUser()->name() ?></a></p>
|
<p><span class="opacity" style="--opacity:.5">par</span> <a class="author no-line" href="/auteurs/<?= Str::slug($page->author()->toUser()->name()) ?>" title="Voir les articles d'<?= $page->author()->toUser()->name() ?>"><?= $page->author()->toUser()->name() ?></a></p>
|
||||||
</div>
|
<?php endslot() ?>
|
||||||
|
<?php slot('tabs') ?>
|
||||||
<?php snippet('tabs', [
|
<?php snippet('tabs', [
|
||||||
'left' => [
|
'left' => [
|
||||||
'label' => 'Édito ' . $page->parent()->title(),
|
'label' => 'édito ' . $page->parent()->title(),
|
||||||
'content' => $page->parent()->edito()
|
'content' => $page->parent()->edito()
|
||||||
]
|
],
|
||||||
|
'activeTab' => 'édito ' . $page->parent()->title()
|
||||||
]) ?>
|
]) ?>
|
||||||
|
<?php endslot() ?>
|
||||||
|
<?php endsnippet() ?>
|
||||||
|
<?= $page->body() ?>
|
||||||
</article>
|
</article>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue