But now I find another problem. I have two different anchors: one is before the grid (#work) and the other one is after the link (#contact). If I want to go to the first anchor everything's right, but when it auto-scrolls to the second anchor, the animation speed seems too fast.

I guess there's a possible solution but I don't know how to code it. It would be different animation durations for each anchor. The logic would be something like: if anchor is #work = X duration; if anchor is #contact = Y duration.

Does it makes sense? There's another better solution? Can you help me with it?