I'm using reactjs with material-ui styling, to create a dapp and have an image (circular in shape) which i want to spin continuously which customizable spin speed, maintaining a smooth flow. The spin speed needs to be customizable in which i feed a speed value to the component and it'd spin in that speed accordingly. Any ideas how to go by? Thanks.
PS: this is not related to 'loading components', loading animation, or loading image in any way. also, a solution which can be implemented using withStyles() of material-ui would be preferred. Thanks.
animation: spin 2s linear infinite;
– Upi2s
is animation-duration while it defines how much time is needed to do one animation cycle, the linear part defines the animation is at constant speed.spin 2s linear infinite;
means doing one spin will use two seconds. You can change the animation-duration to a custom value. You might refer to this link for more about css animation: link – Upi<div style={{animationDuration = '2s'}}/>
– Upi<div style={{animationDuration = this.state.customSpdValue}}/>
– Upi