Skip to content
Snippets Groups Projects
Commit a2faed3b authored by Bernard Roland (Student Com20)'s avatar Bernard Roland (Student Com20)
Browse files

Temporarily removed the dynamic background for performance reasons

parent ee576680
No related branches found
No related tags found
No related merge requests found
import { useState, useEffect } from 'react';
import './background.scss';
function getWindowHeight(): number {
return document.body.offsetHeight;
}
export default function DynamicBackground() {
const [height, setHeight] = useState(0);
useEffect(() => {
setHeight(getWindowHeight());
}, [])
let bubbles = [];
let secondary = false;
for (let i = 0; i <= height; i += 700) {
let lr = secondary ? { left: '-5%' } : { right: '-5%' };
bubbles.push(
<div
className={'bubble ' + (secondary ? 'secondary' : 'primary')}
key={i}
style={{ ...lr, top: (i - 200) + 'px' }}>
</div>
)
secondary = !secondary;
}
return (
<div className="background-container">
{bubbles}
</div>
<div />
)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment