From 99b1c2b5f548253d8d1cf1791bd59c349fad8e06 Mon Sep 17 00:00:00 2001 From: isUnknown Date: Tue, 3 Sep 2024 14:18:49 +0200 Subject: [PATCH] add and animate info banner --- assets/css/src/footer.css | 1 - assets/css/src/nav.css | 27 +++++++++++++++++++++ site/blueprints/site.yml | 14 ++++++++++- site/snippets/header-banner.php | 0 site/snippets/header.php | 4 +-- site/snippets/info-banner.php | 43 +++++++++++++++++++++++++++++++++ 6 files changed, 85 insertions(+), 4 deletions(-) delete mode 100644 site/snippets/header-banner.php create mode 100644 site/snippets/info-banner.php diff --git a/assets/css/src/footer.css b/assets/css/src/footer.css index 5ad986b..a9be888 100644 --- a/assets/css/src/footer.css +++ b/assets/css/src/footer.css @@ -4,7 +4,6 @@ display: grid; grid-template-columns: 0.5fr 1fr 1fr 1fr; column-gap: calc(var(--space-m)); - border-top: var(--border); } .main-footer p { diff --git a/assets/css/src/nav.css b/assets/css/src/nav.css index 6ec8ac8..7d1c48d 100644 --- a/assets/css/src/nav.css +++ b/assets/css/src/nav.css @@ -1,3 +1,30 @@ +@keyframes scroll-left { + 0% { + transform: translateX(0); + } + 100% { + transform: translateX(calc(0px - ((100% / 3) - var(--space-m) / 1.6))); + } +} + +.info-banner { + overflow: hidden; + white-space: nowrap; +} + +.info-banner ul { + box-sizing: border-box; + padding: 1rem var(--space-m); + background-color: var(--color-salmon); + display: inline-block; + animation: scroll-left 12s linear infinite; +} + +.info-banner li { + display: inline-block; + padding-right: 6vw; +} + .main-header { position: sticky; top: 0; diff --git a/site/blueprints/site.yml b/site/blueprints/site.yml index ffcb981..6e64554 100644 --- a/site/blueprints/site.yml +++ b/site/blueprints/site.yml @@ -9,8 +9,20 @@ tabs: fields: infoBanner: label: Bannière d'info - type: writer + type: structure help: Affichée en haut de la page d'accueil. + fields: + message: + label: Message + type: text + width: 1/2 + link: + label: Lien + type: link + width: 1/2 + options: + - url + - page separator1: type: line - width: 1/1 diff --git a/site/snippets/header-banner.php b/site/snippets/header-banner.php deleted file mode 100644 index e69de29..0000000 diff --git a/site/snippets/header.php b/site/snippets/header.php index e258f91..8592ed2 100644 --- a/site/snippets/header.php +++ b/site/snippets/header.php @@ -33,9 +33,9 @@ - + isHomePage()): ?> - +
diff --git a/site/snippets/info-banner.php b/site/snippets/info-banner.php new file mode 100644 index 0000000..f11882d --- /dev/null +++ b/site/snippets/info-banner.php @@ -0,0 +1,43 @@ +
+
    + infoBanner()->toStructure() as $info): ?> +
  • + link()->isNotEmpty()): ?> + + message() ?> + + +

    + message() ?> +

    + +
  • + + infoBanner()->toStructure() as $info): ?> +
  • + link()->isNotEmpty()): ?> + + message() ?> + + +

    + message() ?> +

    + +
  • + + infoBanner()->toStructure() as $info): ?> +
  • + link()->isNotEmpty()): ?> + + message() ?> + + +

    + message() ?> +

    + +
  • + +
+
\ No newline at end of file