добавлен адаптив при высоте экрана менее 700px, добавлено меню учатсников для мобильной версии, логика открытия закрытия его
This commit is contained in:
+32
-2
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user