Skip to content
View yanekyuk's full-sized avatar

Highlights

  • Pro
Block or Report

Block or report yanekyuk

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse

Pinned

  1. pevn pevn Public archive

    A template using PostgreSQL, express.js, vue.js, and node.js

    JavaScript 2

  2. Dead simpe pure JavaScript smooth sc... Dead simpe pure JavaScript smooth scroll to top
    1
    function scrollToTop () {
    2
      var val = document.body.scrollTop || document.documentElement.scrollTop // THIS ONE IS HOW MUCH THE PAGE IS SCROLLED DOWN
    3
      if (val > 1) { // if (val > 0) also works, BUT SINCE WE TAKE THE SQUARE ROOT OF THE VAL, WHEN THE VAL IS FLOAT, IT NEVERS REACHES TO ZERO (IN THIS CASE IT IS INTEGER)
    4
        window.scrollBy(0, -Math.sqrt(val * 0.125) * 2) // HERE YOU CAN PLAY WITH THE VALUES TO CUSTOMIZE THE SPEED. 0.125 AFFECTS THE SMOOTHNESS, 2 AFFECTS THE OVERALL SPEED
    5
        timeoutForScroll(true, 10) // OF COURSE YOU CAN CHANGE THE VALUE 10 TO CHANGE THE SPEED