mirror of
https://github.com/asimonson1125/asimonson1125.github.io.git
synced 2026-02-25 05:09:49 -06:00
patch mobile menu
This commit is contained in:
Binary file not shown.
@@ -10,6 +10,7 @@ import Activities from './pages/Activities';
|
|||||||
import AboutMe from './pages/AboutMe';
|
import AboutMe from './pages/AboutMe';
|
||||||
import AOS from 'aos';
|
import AOS from 'aos';
|
||||||
import 'aos/dist/aos.css'; // You can also use <link> for styles
|
import 'aos/dist/aos.css'; // You can also use <link> for styles
|
||||||
|
import './responsive'
|
||||||
|
|
||||||
AOS.init();
|
AOS.init();
|
||||||
function App() {
|
function App() {
|
||||||
@@ -21,7 +22,7 @@ function App() {
|
|||||||
<img src={menu} alt="menu" id='menu'/>
|
<img src={menu} alt="menu" id='menu'/>
|
||||||
<Nav id='navbar'>
|
<Nav id='navbar'>
|
||||||
<Link to='/'>Home</Link>
|
<Link to='/'>Home</Link>
|
||||||
<a href='https://github.com/asimonson1125/Resume/raw/main/Resume.pdf' rel='noreferrer' target='_blank'>Resume</a>
|
<a href='Resume.pdf' target='_blank'>Resume</a>
|
||||||
<Link to='/projects'>Projects</Link>
|
<Link to='/projects'>Projects</Link>
|
||||||
{/* <Link to='/activities'>Activities</Link> */}
|
{/* <Link to='/activities'>Activities</Link> */}
|
||||||
<Link to='/about'>About Me</Link>
|
<Link to='/about'>About Me</Link>
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import React from 'react';
|
|||||||
import { createRoot } from 'react-dom/client';
|
import { createRoot } from 'react-dom/client';
|
||||||
import App from './App';
|
import App from './App';
|
||||||
import reportWebVitals from './reportWebVitals';
|
import reportWebVitals from './reportWebVitals';
|
||||||
import './responsive.js'
|
|
||||||
|
|
||||||
const container = document.getElementById('root');
|
const container = document.getElementById('root');
|
||||||
const root = createRoot(container);
|
const root = createRoot(container);
|
||||||
|
|||||||
@@ -1,28 +1,27 @@
|
|||||||
window.onload = function () { onLoaded() };
|
window.onpageshow = function () { onLoaded() };
|
||||||
|
|
||||||
function onLoaded() {
|
function onLoaded() {
|
||||||
scrollFunction();
|
|
||||||
resizer();
|
|
||||||
window.onresize = function () { resizer() };
|
window.onresize = function () { resizer() };
|
||||||
document.getElementById("menu").onclick = function () { toggleMenu() };
|
document.getElementById("menu").onclick = function () { toggleMenu() };
|
||||||
|
resizer();
|
||||||
}
|
}
|
||||||
|
|
||||||
function resizer() {
|
function resizer() {
|
||||||
scrollFunction();
|
scrollFunction();
|
||||||
const e = document.querySelector(".navControl");
|
const e = document.querySelector(".navControl");
|
||||||
if (window.innerWidth > 1200) { // desktop view
|
if (window.innerWidth > 1200) { // desktop view
|
||||||
|
window.onscroll = function () { scrollFunction() };
|
||||||
bottomBorderOff();
|
bottomBorderOff();
|
||||||
e.style.maxHeight = `${e.scrollHeight + 10}px`;
|
e.style.maxHeight = `${e.scrollHeight + 10}px`;
|
||||||
window.onscroll = function () { scrollFunction() };
|
|
||||||
}
|
}
|
||||||
else { // mobile view
|
else { // mobile view
|
||||||
e.style.maxHeight = '0px';
|
|
||||||
bottomBorderOn();
|
|
||||||
window.onscroll = '';
|
window.onscroll = '';
|
||||||
document.querySelector('.header').style.backgroundColor = '#1a1a1a';
|
document.querySelector('.header').style.backgroundColor = '#1a1a1a';
|
||||||
document.querySelector('.header > a > h1').style.fontSize = "1.5rem";
|
document.querySelector('.header > a > h1').style.fontSize = "1.5rem";
|
||||||
// document.querySelector('.header > h1').style.color = "#a8a8a8";
|
// document.querySelector('.header > h1').style.color = "#a8a8a8";
|
||||||
document.querySelectorAll('.navElement').forEach(x => { x.style.paddingTop = '.3rem'; x.style.paddingBottom = '.3rem'; x.style.fontSize = '1rem' });
|
document.querySelectorAll('.navElement').forEach(x => { x.style.paddingTop = '.3rem'; x.style.paddingBottom = '.3rem'; x.style.fontSize = '1rem' });
|
||||||
|
e.style.maxHeight = '0px';
|
||||||
|
bottomBorderOn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user