добавлен адаптив при высоте экрана менее 700px, добавлено меню учатсников для мобильной версии, логика открытия закрытия его

This commit is contained in:
DmitriyB
2022-08-10 14:21:23 +05:00
parent 0a839601df
commit 7a771bd3e6
21 changed files with 443 additions and 62 deletions
+32 -2
View File
@@ -1,11 +1,41 @@
import React from 'react';
import React, { useEffect, useState } from 'react';
import './App.css';
import { ContextWindowHeight } from './components/contextWindowHeight';
import { MainScreen } from './components/mainScreen/mainScreen';
function App() {
const [windowHeight, setWindowHeight] = useState<number>(window.screen.availHeight);
window.addEventListener('resize', e => {
//@ts-ignore
setWindowHeight(e.currentTarget.screen.availHeight)
})
window.onload = function () {
hideAddressBar();
window.addEventListener("orientationchange", function () {
hideAddressBar();
}, false);
}
function hideAddressBar() {
setTimeout(function () {
document.body.style.height = window.outerHeight + 'px';
setTimeout(function () {
window.scrollTo(0, 1);
}, 1100);
}, 1000);
return false;
}
return (
<div className="App">
<MainScreen />
<ContextWindowHeight.Provider value={windowHeight}>
<MainScreen />
</ContextWindowHeight.Provider>
</div>
);
}