Creating this page. I have an element I want to rotate on scroll. Would prefer to use react syntax to create this 'animation'.
LeftGear = () => {
const rotate = window.scrollY / 10 % Math.PI
const divStyle = {
backgroundColor: 'purple',
transform: `scroll(${rotate})`,
}
return <img
className={this.changeClassName('circleImage')}
src="../../assets/icons/red-gear.svg"
alt="Circles Icon"
style={divStyle}
/>
}
render(){
return <LeftGear/>
}
this works to give the image a background but does not work for that scroll. So Im wondering what I'm doing wrong ?