Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spin 114 - improved animations for red planet and blue section planets #42

Merged
merged 10 commits into from
Oct 24, 2023
7 changes: 7 additions & 0 deletions blocks/deco-planets/deco-planets.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,10 @@
.deco-planets-v4 .planet-two {
width: var(--size-small);
}

@media screen and (max-width: 899.98px) {
.hide-deco-planets-on-mobile .deco-planets,
.hide-deco-planets-on-mobile.deco-planets {
display: none;
}
}
1 change: 0 additions & 1 deletion blocks/footer/footer.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ footer {
height: var(--footer-height);
padding: var(--footer-padding-horizontal) var(--footer-padding-vertical);
background-color: var(--footer-background-color);
color: var(--footer-color);
font-size: var(--body-font-size-xs);
}

Expand Down
6 changes: 6 additions & 0 deletions blocks/form/form.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
position: relative;
}

.section-ready-to-fly .columns > div > div:first-child h3,
.section-ready-to-fly .columns picture {
position: relative;
z-index: -1;
}

.section-ready-to-fly .columns > div > div:first-child h3::before,
.section-ready-to-fly .columns picture::before,
.section-ready-to-fly .columns picture::after {
Expand Down
12 changes: 9 additions & 3 deletions blocks/word-cloud/word-cloud.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import {
registerCustomScrollLinkedVariable,
registerElementDimensionsVariables,
registerScrollLinkedVariable,
} from '../../scripts/scroll-linked-variable.js';

export default function decorate(block) {
registerScrollLinkedVariable(block.parentElement);
registerCustomScrollLinkedVariable(
block.parentElement,
// eslint-disable-next-line max-len
(elementDistanceToWindowTop) => elementDistanceToWindowTop - 300,
// eslint-disable-next-line max-len
(elementDistanceToWindowTop, elementRect) => elementDistanceToWindowTop + elementRect.height + -1 * window.innerHeight + 200,
);
registerElementDimensionsVariables(block);

const wordPositions = [
Expand All @@ -16,7 +22,7 @@ export default function decorate(block) {
{ x: 80, y: 65 },
];
const wordCount = block.children.length;
const overLappingAnimations = 3;
const overLappingAnimations = 4;
const animationFrame = (1 / (wordCount + (overLappingAnimations - 1)));
const animationDuration = animationFrame * overLappingAnimations;
Array.from(block.children).forEach((word, index) => {
Expand Down
12 changes: 6 additions & 6 deletions generate-star-svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ const fs = require('fs');
function generateStarSVGs() {
const starsLayerConfigurations = [
{
density: 0.3, // how dense / how many stars there are in this layer
density: 0.25, // how dense / how many stars there are in this layer
starSize: '1', // the size of a singe star
},
{
density: 0.25,
density: 0.2,
starSize: '1.5',
},
{
density: 0.2,
density: 0.15,
starSize: '2',
},
{
density: 0.15,
density: 0.1,
starSize: '2.5',
},
{
density: 0.1,
density: 0.05,
starSize: '3',
},
];
Expand All @@ -48,7 +48,7 @@ function generateStarSVGs() {
}

starSvg += '</svg>';
fs.writeFileSync(`images/layer${index}.svg`, starSvg);
fs.writeFileSync(`images/stars/layer${index}.svg`, starSvg);
});
}

Expand Down
2 changes: 1 addition & 1 deletion images/stars/layer0.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion images/stars/layer1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading