Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42,945 changes: 42,945 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"react-dom": "^16.13.1",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.3"
"react-scripts": "3.4.3",
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.2"
},
"scripts": {
"start": "react-scripts start",
Expand Down Expand Up @@ -58,4 +60,4 @@
"pre-commit": "lint-staged"
}
}
}
}
19 changes: 2 additions & 17 deletions src/components/App/App.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,18 @@ import Private from '../Private';
import Fortune from '../Fortune';
import Layout from '../Layout';
import { random } from '../../utils/fns';
import data from '../Files/youtube-videos-mock.json';

function App() {
useLayoutEffect(() => {
const { body } = document;

function rotateBackground() {
const xPercent = random(100);
const yPercent = random(100);
body.style.setProperty('--bg-position', `${xPercent}% ${yPercent}%`);
}

const intervalId = setInterval(rotateBackground, 3000);
body.addEventListener('click', rotateBackground);

return () => {
clearInterval(intervalId);
body.removeEventListener('click', rotateBackground);
};
}, []);

return (
<BrowserRouter>
<AuthProvider>
<Layout>
<Switch>
<Route exact path="/">
<HomePage />
<HomePage data={data} />
</Route>
<Route exact path="/login">
<LoginPage />
Expand Down
Loading