From 3979836f52a0876d831f586745e96a7ad268e3d6 Mon Sep 17 00:00:00 2001 From: voggenauerm Date: Fri, 20 Sep 2024 15:34:01 +0200 Subject: [PATCH 1/2] Fix scroll planet behavior between two planet-to-background sections --- scripts/scripts.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/scripts.js b/scripts/scripts.js index f994b51..7e43464 100644 --- a/scripts/scripts.js +++ b/scripts/scripts.js @@ -110,7 +110,7 @@ function decorateSectionsWithPlanetToBackgroundAnimation(main) { }); }, { rootMargin: `-${planetAnimationRootMargin}px 0px` }); - main.querySelectorAll('.planet-to-background').forEach((section) => { + main.querySelectorAll('.planet-to-background').forEach((section, index) => { section.classList.add('background-hidden'); const previousSection = section.previousElementSibling; const nextSection = section.nextElementSibling; @@ -127,10 +127,12 @@ function decorateSectionsWithPlanetToBackgroundAnimation(main) { } const previousPlanet = planet.cloneNode(); previousPlanet.classList.add('section-planet-entering'); + previousPlanet.style.setProperty('--scroll-planet', `var(--scroll-planet-${index})`); previousSection.appendChild(previousPlanet); const nextPlanet = planet.cloneNode(); nextPlanet.classList.add('section-planet-leaving'); nextPlanet.classList.add('hidden'); + nextPlanet.style.setProperty('--scroll-planet', `var(--scroll-planet-${index})`); nextSection.appendChild(nextPlanet); registerCustomScrollLinkedVariable( previousSection, @@ -138,7 +140,7 @@ function decorateSectionsWithPlanetToBackgroundAnimation(main) { (elementDistanceToWindowTop, elementRect) => elementDistanceToWindowTop + elementRect.height / 2 - window.innerHeight / 2, // eslint-disable-next-line max-len (elementDistanceToWindowTop, elementRect) => elementDistanceToWindowTop + elementRect.height - window.innerHeight + planetAnimationRootMargin, - '--scroll-planet', + `--scroll-planet-${index}`, ); registerCustomScrollLinkedVariable( nextSection, @@ -146,7 +148,7 @@ function decorateSectionsWithPlanetToBackgroundAnimation(main) { (elementDistanceToWindowTop) => elementDistanceToWindowTop - planetAnimationRootMargin, // eslint-disable-next-line max-len (elementDistanceToWindowTop, elementRect) => elementDistanceToWindowTop + elementRect.height / 2 - window.innerHeight / 2, - '--scroll-planet', + `--scroll-planet-${index}`, ); planetSectionIntersectionObserver.observe(section); }); From 6bd7dbc13915dc80986b195cb658e8be96c89857 Mon Sep 17 00:00:00 2001 From: voggenauerm Date: Fri, 20 Sep 2024 15:36:22 +0200 Subject: [PATCH 2/2] Fix URLs to eds system --- .github/pull_request_template.md | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 4f65a56..115e067 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,3 +1,3 @@ Test URLs: -- before: https://main--franklin-spin-landingpage--techdivision.hlx.page/ -- after: https://--franklin-spin-landingpage--techdivision.hlx.page/ +- before: https://main--eds-spin-landingpage--techdivision.hlx.page/ +- after: https://--eds-spin-landingpage--techdivision.hlx.page/ diff --git a/README.md b/README.md index 75b78ed..99d0a65 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ npm run lint Mehr Infos: https://www.hlx.live/docs/admin.html#tag/code/operation/codeStatus ```sh -curl -X POST "https://admin.hlx.page/code/techdivision/franklin-spin-landingpage/{branch}/*?branch={branch}" -H "x-github-token: {GitHub token}" +curl -X POST "https://admin.hlx.page/code/techdivision/eds-spin-landingpage/{branch}/*?branch={branch}" -H "x-github-token: {GitHub token}" ``` Als Antwort wird bei einem Erfolg ein json Objekt übertragen