@titelmedia/bricks-headline
Advanced tools
Comparing version 1.11.0 to 1.11.1
@@ -6,2 +6,12 @@ # Change Log | ||
## [1.11.1](https://github.com/titel-media/bricks-lerna/compare/v1.11.0...v1.11.1) (2023-04-04) | ||
### Bug Fixes | ||
- added 'isAnimationEnable' variable to Headline component ([ddaea0e](https://github.com/titel-media/bricks-lerna/commit/ddaea0e9ba3a3abc7bf4b8648b1e8c8137012ac0)) | ||
### Features | ||
- Added enableAnimation option to set fade animation to Headline & updated field names ([dacbffe](https://github.com/titel-media/bricks-lerna/commit/dacbffe4c50ed869253d465e7cf690d28cdec430)) | ||
# [1.11.0](https://github.com/titel-media/bricks-lerna/compare/v1.10.5...v1.11.0) (2023-03-31) | ||
@@ -8,0 +18,0 @@ |
@@ -24,10 +24,12 @@ "use strict"; | ||
customFontSizeMobile, | ||
durationNumber | ||
enableAnimation, | ||
setAnimationDuration | ||
}) => { | ||
const containerRef = (0, _react.useRef)(null); | ||
const wrapperRef = (0, _react.useRef)(null); | ||
const isAnimationEnable = enableAnimation === 'true' || enableAnimation === true; | ||
(0, _react.useEffect)(() => { | ||
if (containerRef.current) { | ||
if (isAnimationEnable && containerRef.current) { | ||
_bricksUtils.gsap.effects.fade(containerRef.current, { | ||
duration: durationNumber ? durationNumber : 0.75, | ||
duration: setAnimationDuration ? setAnimationDuration : 0.75, | ||
trigger: wrapperRef.current | ||
@@ -45,3 +47,3 @@ }); | ||
fontSize: fontSize, | ||
fontColor: (fontColor === null || fontColor === void 0 ? void 0 : fontColor.hex) || '#000000', | ||
fontColor: fontColor?.hex || '#000000', | ||
fontWeight: fontWeight, | ||
@@ -48,0 +50,0 @@ customFontSizeDesktop: customFontSizeDesktop, |
@@ -16,11 +16,14 @@ import React, { useEffect, useRef } from 'react'; | ||
customFontSizeMobile, | ||
durationNumber | ||
enableAnimation, | ||
setAnimationDuration | ||
}) => { | ||
const containerRef = useRef(null); | ||
const wrapperRef = useRef(null); | ||
const isAnimationEnable = (enableAnimation === 'true' || enableAnimation === true) | ||
// 'true' string is for storybook. | ||
useEffect(() => { | ||
if (containerRef.current) { | ||
if (isAnimationEnable && containerRef.current) { | ||
gsap.effects.fade(containerRef.current, { | ||
duration: durationNumber ? durationNumber : 0.75, | ||
duration: setAnimationDuration ? setAnimationDuration : 0.75, | ||
trigger: wrapperRef.current, | ||
@@ -27,0 +30,0 @@ }); |
{ | ||
"name": "@titelmedia/bricks-headline", | ||
"version": "1.11.0", | ||
"version": "1.11.1", | ||
"description": "> TODO: description", | ||
@@ -31,3 +31,3 @@ "author": "highsnob", | ||
}, | ||
"gitHead": "c8cbffd7ad6abf4ec097a0ef38f0c91f26c4156c" | ||
"gitHead": "f3b9bccbe402335a1329e650ed2aeb850c76fc41" | ||
} |
Sorry, the diff of this file is not supported yet
43349
418