KKVANONYMOUS / kkvanonymous.github.io

Source Code for my personal website
https://kkvanonymous.github.io/
MIT License
1 stars 1 forks source link

Navbar is covering the content while using internal links. #2

Open AmanMatrix opened 4 years ago

AmanMatrix commented 4 years ago

While using the "About" internal link navbar covers the Title of the content linked.Please refer to the image attached below...

issue 1

While it should appear like this

sol1

Same goes for the "Projects" internal link.

issue 2

While it should appear like this

Sol2

AmanMatrix commented 4 years ago

I would like to try and fix this issue @KKVANONYMOUS

KKVANONYMOUS commented 4 years ago

@AmanMatrix Cool!!! Go ahead

AmanMatrix commented 4 years ago

i tried to fix the issue by adding following code in .js file:

function shiftWindow() {
        if (window.location.hash == "#home") {
            setTimeout(() => {
                scrollBy(0, 0)
            }, 720);
        }
        else if (window.location.hash == "#about") {
            setTimeout(() => {
                scrollBy(0, -40)
            }, 600);;
        }
        else if (window.location.hash == "#projects") {
            setTimeout(() => {
                scrollBy(0, -100)
            }, 720);
        }
        else {

        }
    }
    window.addEventListener("hashchange", shiftWindow);
    if (window.location.hash) shiftWindow();

But this is only working for laptop website....Can anybody suggest a fix to keep the website responsive?

ShoryaThakur commented 1 year ago

Hello @KKVANONYMOUS & @AmanMatrix , I analyzed the problem raised by @AmanMatrix and I think I have the solution to this Problem. Adding a div of height zero above the section of class 'projects container' and assigning the id 'projects' to that div might solve the problem. Hope that this will help you. :)