Skip to content

Commit

Permalink
Merge pull request #42 from techdivision/SPIN-114
Browse files Browse the repository at this point in the history
Spin 114 - improved animations for red planet and blue section planets
  • Loading branch information
mbiberger authored Oct 24, 2023
2 parents 93be4e2 + bd59927 commit 99f6aeb
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 57 deletions.
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

0 comments on commit 99f6aeb

Please sign in to comment.