-
Notifications
You must be signed in to change notification settings - Fork 12
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
Task #770 Lottie - block #832
Conversation
* | ||
* @returns {object} Object without `null`, `undefined` and empty values. | ||
*/ | ||
export function cleanObject(object) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file should go to the frontend-libs helpers folder
https://github.com/infinum/eightshift-frontend-libs/tree/main/scripts/helpers
|
||
lottieControl.init(); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unecesery space
[...lottieElements].forEach((lottieElement) => { | ||
const lottieControl = new LottieControl({ | ||
lottieElement, | ||
lottieContainerSelector: `${lottieElementSelector}-container`, | ||
breakpoints, | ||
}); | ||
|
||
lottieControl.init(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[...lottieElements].forEach((lottieElement) => { | |
const lottieControl = new LottieControl({ | |
lottieElement, | |
lottieContainerSelector: `${lottieElementSelector}-container`, | |
breakpoints, | |
}); | |
lottieControl.init(); | |
}); | |
[...lottieElements].forEach((lottieElement) => { | |
const lottieControl = new LottieControl({ | |
lottieElement, | |
lottieContainerSelector: `${lottieElementSelector}-container`, | |
breakpoints, | |
}).init(); | |
}); |
@@ -0,0 +1,232 @@ | |||
import lottie from 'lottie-web'; | |||
import { cleanObject } from '../../../assets/scripts/helpers/cleanObject'; | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add space
@@ -0,0 +1,232 @@ | |||
import lottie from 'lottie-web'; | |||
import { cleanObject } from '../../../assets/scripts/helpers/cleanObject'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
load it from the new location using @frontend-libs alias like in the other examples as this will not work this way when moved to your project
</ButtonGroup> | ||
</BaseControl> | ||
} | ||
<hr /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why hr?
$blockJsClass = $manifest['blockJsClass'] ?? ''; | ||
|
||
$lottieUse = Helpers::checkAttr('lottieUse', $attributes, $manifest); | ||
$lottieTriggerResponsive = Helpers::checkAttrResponsive('lottieTrigger', $attributes, $manifest); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like to keep variable names the same as attribute names when ever that is possible so please check if this is possible
|
||
$dataTimelineOffsetFactor = ''; | ||
|
||
$unique = Helpers::getUnique(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for variable if you are using it once
"description": "Lottie block with custom settings.", | ||
"category": "eightshift", | ||
"blockClass": "lottie", | ||
"blockJsClass": "js-lottie", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
block has its own blockJsClass by default either use that or js-block-lottie
or create a new selector. Aslo for blockClass
{ | ||
"inverse": true, | ||
"variable": { | ||
"lottieAspectRatio": "%value%%" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why double %? %value%%
is this working?
Description
The Lottie block enables the integration of smooth, vector-based animations to enhance user engagement. It allows easy embedding and customisation of Lottie animations.
Task
https://app.productive.io/1-infinum/tasks/8267990