Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount() {
this.props.fetchUserServers();
if (this.props.match.path !== '/home') {
// this.props.fetchServerRooms(this.props.match.params.serverId);
// this.props.fetchServerMembers(this.props.match.params.serverId);
} else {
// this.props.fetchPMRooms();
}
let addButton = document.getElementById('add-server-button');
this.buttonAnim = loadAnimation({
container: addButton,
renderer: 'svg',
loop: false,
prerender:false,
autoplay: false,
autoloadSegments: false,
animationData: this.checkAnim,
rendererSettings: {
context: '',
scaleMode: 'noScale',
clearCanvas: false,
progressiveLoad: false,
hideOnTransparent: true,
className: 'add-server'
}
useEffect(() => {
animationRef.current = lottie.loadAnimation({
container: illustrationRef.current, // the dom element that will contain the animation
renderer: 'svg',
loop: true,
autoplay: true,
animationData: landingIllustration,
})
return () => animationRef.current.destroy()
}, [])
animations.forEach(a => {
if (a.type !== 'svg') {
this.animations[a.id] = lottie.loadAnimation({
wrapper: this.svgWrappers[a.id],
animType: 'svg',
loop: true,
animationData: a.data
});
}
});
};
lottieRender = () => {
lottie.destroy()
let animation = lottie.loadAnimation({
container: document.getElementById("preview"),
renderer: "svg",
loop: true,
autoplay:true,
animationData: this.state.data,
});
if(this.state.paused) animation.goToAndStop(this.state.currentFrameTime,true)
animation.addEventListener('enterFrame',this.updateCurrentFrame)
}
segments,
} = options;
this.options = {
container: this.el,
renderer: 'svg',
loop: loop !== false,
autoplay: autoplay !== false,
segments: segments !== false,
animationData,
rendererSettings,
};
this.options = { ...this.options, ...options };
this.anim = lottie.loadAnimation(this.options);
this.setSpeed();
this.setDirection();
this.animApi = lottieApi.createAnimationApi(this.anim);
this.registerEvents(eventListeners);
this.setAnimationControl();
}
this.$nextTick(() => {
lottie.loadAnimation({
container: this.$refs.lottie as Element,
renderer: 'svg',
loop: true,
autoplay: true,
animationData: animationData(this.path),
});
this.coreStatus = true;
});
}
const memphis = (container) => {
lottie.loadAnimation({
container: container,
renderer: 'svg',
rendererSettings: {
className: 'absolute-player'
},
loop: false,
autoplay: true,
animationData: animationData,
onComplete: lottie.destroy()
})
}
export default memphis
useEffect(() => {
if (!canContinue) setContinue(true)
if (illustration) {
animationRef.current = lottie.loadAnimation({
container: illustrationRef.current,
renderer: 'svg',
loop: true,
autoplay: true,
animationData: illustration,
})
}
return () => {
if (animationRef.current) {
animationRef.current.destroy()
}
}
}, [])
useEffect(() => {
const options = {
container: container.current,
renderer: 'svg',
animationData: data,
loop: loop || false,
autoplay: !paused,
};
const _animation = lottie.loadAnimation(options);
if (segments) {
_animation.playSegments(segments);
}
if (typeof onEnd === 'function') {
_animation.addEventListener('complete', onEnd);
}
setAnimation(_animation);
return () => {
_animation.destroy();
};
}, []);
function bm(el, name) {
lottie.loadAnimation({
container: el,
renderer: 'svg',
loop: true,
name: name,
autoplay: true,
path: el.getAttribute('data-json'),
rendererSettings: {
clearCanvas: true,
progressiveLoad: true,
hideOnTransparent: false
}
})
}