Website/components/trianglesbg.js

16 lines
811 B
JavaScript
Raw Normal View History

2021-12-22 18:59:23 +00:00
import { useState, useEffect } from "react"
2021-12-21 19:08:36 +00:00
export default function TrianglesBG() {
2022-02-15 17:08:29 +00:00
const [thePositionX, setPositionX] = useState(0);
2021-12-22 18:59:23 +00:00
useEffect(() => {
const interval = setInterval(() => {
2022-02-15 17:08:29 +00:00
setPositionX(thePositionX + 0.5);
2021-12-22 18:59:23 +00:00
}, 10);
2022-02-15 17:08:29 +00:00
return function () { clearInterval(interval) };
2021-12-22 18:59:23 +00:00
});
2021-12-21 19:08:36 +00:00
return (
2022-02-15 17:08:29 +00:00
<div style={{width: '100%', height: '100%', position: 'absolute', top: '0', left: '0', zIndex: '0', color: 'white'}} className="steve">
<div className="whatIsItLikeInsideSteve" width='100%' height='99%' style={{objectFit: 'fill', imageRendering: 'pixelated', backgroundImage: 'url("/background.webp")', width: '100%', height: '100%', backgroundRepeat: 'repeat', backgroundSize: '100%', backgroundPositionX: thePositionX}}/>
2021-12-21 19:08:36 +00:00
</div>
)
}