Skip to content

Commit

Permalink
Merge pull request #48 from techdivision/hotfix-20240920
Browse files Browse the repository at this point in the history
Hotfix 20240920
  • Loading branch information
anianweber authored Sep 20, 2024
2 parents 8139faf + 6bd7dbc commit b763ab8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Test URLs:
- before: https://main--franklin-spin-landingpage--techdivision.hlx.page/
- after: https://<branch>--franklin-spin-landingpage--techdivision.hlx.page/
- before: https://main--eds-spin-landingpage--techdivision.hlx.page/
- after: https://<branch>--eds-spin-landingpage--techdivision.hlx.page/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

8 changes: 5 additions & 3 deletions scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -127,26 +127,28 @@ 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,
// eslint-disable-next-line max-len
(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,
// eslint-disable-next-line max-len
(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);
});
Expand Down

0 comments on commit b763ab8

Please sign in to comment.