From 277807ef4b9dfa2caa1e6bc240b75fafb1be3b14 Mon Sep 17 00:00:00 2001 From: Valentin Date: Wed, 4 Dec 2024 00:06:58 +0100 Subject: [PATCH] parallax --- web/themes/erabletheme/js/erabletheme.js | 9 ++++++++- .../erabletheme/templates/html.html.twig | 1 + .../erabletheme/templates/page/page.html.twig | 18 +++++++++--------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/web/themes/erabletheme/js/erabletheme.js b/web/themes/erabletheme/js/erabletheme.js index afb9875..ea905f7 100644 --- a/web/themes/erabletheme/js/erabletheme.js +++ b/web/themes/erabletheme/js/erabletheme.js @@ -375,7 +375,7 @@ function toggleBgMiddle(pageHeight) { const bgMiddle = document.querySelector('#bg-middle'); const bgOnze = document.querySelector('#bg-11'); - if (pageHeight < 2000) { + if (pageHeight < 2500) { bgMiddle.style.display = 'none'; bgOnze.style.display = 'none'; } else { @@ -383,6 +383,13 @@ bgOnze.style.display = 'block'; } } + + // + // bg parallax animation + // + var rellax = new Rellax('.bgImg', { + wrapper: 'body', + }); } } diff --git a/web/themes/erabletheme/templates/html.html.twig b/web/themes/erabletheme/templates/html.html.twig index 107c56b..c5b9827 100644 --- a/web/themes/erabletheme/templates/html.html.twig +++ b/web/themes/erabletheme/templates/html.html.twig @@ -31,6 +31,7 @@ {{ head_title|safe_join(' | ') }} + diff --git a/web/themes/erabletheme/templates/page/page.html.twig b/web/themes/erabletheme/templates/page/page.html.twig index c1a1bd7..a70b3bc 100644 --- a/web/themes/erabletheme/templates/page/page.html.twig +++ b/web/themes/erabletheme/templates/page/page.html.twig @@ -102,21 +102,21 @@
{# #} - - - + + + {# #}
{# #} - - - + + +
- - - + + +