Website/components/trianglesbg.js

18 lines
953 B
JavaScript

import { useState, useEffect } from "react"
export default function TrianglesBG() {
const [positionX, setPositionX] = useState(0);
// use setPositionX(123) to set the background-position-x to 123
useEffect(() => {
const interval = setInterval(() => {
// do magic here using setPositionX
setPositionX(positionX + 1);
}, 10);
return () => clearInterval(interval);
});
return (
<div style={{width: '100vw', height: '100vh', position: 'absolute', top: '0', left: '0', zIndex: '0', color: 'white'}} className="steve">
<div className="whatIsItso that means the proxy (that im about to )LikeInsideSteve" width='100%' height='99%' style={{objectFit: 'fill', imageRendering: 'pixelated', backgroundImage: 'url("/background.webp")', width: '100%', height: '100%', backgroundRepeat: 'repeat', backgroundSize: '100vw', backgroundPositionX: positionX}}/>
</div>
)
}