Coder Social home page Coder Social logo

Why 468? about smoothscroll HOT 6 CLOSED

iamdustan avatar iamdustan commented on July 4, 2024 2
Why 468?

from smoothscroll.

Comments (6)

iamdustan avatar iamdustan commented on July 4, 2024 1

tbh it's pretty arbitrary. Ideally we would calculate the total scroll diff to make ahead of time and have the SCROLL_TIME be dynamic based upon that.

from smoothscroll.

jeremenichelli avatar jeremenichelli commented on July 4, 2024 1

Yeap, we actually have an issue for that ๐Ÿ‘‰ #13

from smoothscroll.

agudulin avatar agudulin commented on July 4, 2024

@iamdustan if I got it right, to get SCROLL_TIME based on scroll distance we need a function (element.getBoundingClientRect().top, window.innerHeight, someConstant) => SCROLL_TIME then.

In this case the someConstant value would be a magic number as well :)

from smoothscroll.

iamdustan avatar iamdustan commented on July 4, 2024

Yeah, that sounds right to me at first glance. It still wonโ€™t be a perfect representation of the host platform behavior, but itโ€™ll be closer than what it currently is.

from smoothscroll.

thaingnguyen avatar thaingnguyen commented on July 4, 2024

What do you guys think about extending the API to let the callsite overrides the duration if needed?

from smoothscroll.

jeremenichelli avatar jeremenichelli commented on July 4, 2024

@thaingnguyen thanks for the suggestion, I will explore a global constant the polyfill can pick up.

from smoothscroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.