Speed of scrolling on a biquadratic Bezier curve

I recently came across a fascinating website called that showcases a unique scrolling behavior. It gives the illusion of moving between slides (screens) with snappy scrolling, when in reality, the website actually scrolls continuously. The transitions between slides are achieved using CSS 3D-transforms manipulated at varying speeds based on a bicubic Bezier curve (I examined their minified code).

https://i.sstatic.net/dY8r3.png

Although I don't consider myself proficient in math or working with Bezier curves, I am struggling to replicate this effect. If anyone has insight or guidance on how to implement this, I would greatly appreciate it. Thank you.

Answer №1

It seems like you could benefit from using an approximation curve. Let's create a set of curves for each page (screen).

The given parameters are: ScreenSize, MaxSpeed at times h = 0 and h = ScreenSize, as well as the MinSpeed at time h = ScreenSize/2

We will construct two symmetrical Bezier curves.
Control points:

first curve
P[0]  = (0, MaxSpeed)
P[1]  = (A, MaxSpeed)
P[2]  = (ScreenSize/2 - 3 * A, MinSpeed)
P[3]  = (ScreenSize/2, MinSpeed)
second curve
P[0]  = (ScreenSize/2, MinSpeed)
P[1]  = (ScreenSize/2 + 3 * A, MinSpeed)
P[2]  = (ScreenSize - A, MaxSpeed)
P[3]  = (ScreenSize, MaxSpeed)

Experiment with the parameter A (approximately ScreenSize/10) and the coefficient 3 to achieve your desired shape.

The curves for subsequent screens are offset by ScreenSize, 2*ScreenSize, and so on.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

retrieve information from an array of objects that include promises

Within my react application, I am faced with the task of retrieving email and name data for various user IDs from separate API endpoints. To achieve this, I follow these steps: const promises = ids.map( id => ( {email: axios.get(`blabla/${id}/email ...

Guide on how to compare two arrays in JavaScript and identify mismatches by their respective indices

let x=["e","f","g","h"]; let y=["f","e","g","h"]; I want the following result: Inconsistent array from x Inconsistency array=["e", "f"]; ...

"Efficiently refresh the DOM by updating it solely upon changes in the

Within my AngularJS application, I have observed that the DOM refreshes each time a function is called, even if no $scope variables have been altered by that function. I am utilizing an ng-repeat directive to generate a series of checkboxes, as demonstrat ...

What is the best way to transfer a value from state to a function as a parameter?

I have been struggling to find a way to pass the value from state (personId) as a parameter to the function (fetchPersonInfo). Despite my efforts, nothing seems to be working. That's why I decided to seek your assistance on this matter. class Page ex ...

Troubleshooting JavaScript's onchange Function Dysfunction

Here is the code snippet I am working with: <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="style.css"> <script src="jquery-2.2.1.min.js"></script> <script src="slike.js"></script> ...

send another response following the completion of the request.end()

I am facing challenges with writing the correct callback function. The situation involves a user making a request to "/city", which then triggers the server to make a request to a third-party service for data retrieval using http.request(). I successfully ...

Best method for connecting user input with a class

I'm currently working with a WYSIWYG editor (Tinymce) that allows users to post YouTube videos. In order to make the video content responsive, I need to add the class "video-container" around any "iframe" tags inserted when users paste a YouTube link ...

Can the parameters in a .slice() be customized within a v-for loop?

I am currently working with Laravel 8 and using blade syntax. The following code snippet is from a Vue component I created: <li class="w-3/12 md:w-auto pt-0 md:px-4 md:pt-2 md:pb-0 list-none relative" v-if="comic.item_type === 'b&ap ...

I am experiencing an issue where my Visual Studio Code extension is failing to display code correctly

Hey everyone, I'm a student and a beginner in Visual Studio code. Recently, I was working with Java Script and ran into an issue. Every time I tried to save my code by pressing Ctrl+S, it would automatically indent the code, causing problems in my ter ...

"Implementing database updates with AJAX and utilizing the PUT method: a step-by-step guide

I am attempting to update a database property named "Estado" using ajax. Here is the code I am using: function updateDatabaseProperty(idMarker, newState) { $.ajax ({ url: `/api/IgnicoesAPI/${idMarker}`, type: 'PUT ...

Interact with Dialogflow using fulfillment to retrieve responses by opening an HTTP URL

Despite my efforts, I have yet to find a satisfactory solution. I am in the process of creating an agent on Dialogflow. This agent will be embedded on a webpage, not as part of Facebook Messenger or Google Assistant. The purpose of this agent is to guide ...

The Datatable is only displaying a single record

After fetching data from a firestore collection and storing them in an array, I encountered an issue where only one entry is displayed in the datatable despite retrieving all documents from the firestore collection. What could be causing this problem? Belo ...

While the Mongoose aggregate query is functioning properly in MongoDB, I am encountering difficulties in converting it to a Mongoose

Here is the JSON structure provided: [{ "_id" : ObjectId("626204345ae3d8ec53ef41ee"), "categoryName" : "Test Cate", "__v" : 0, "createdAt" : ISODate("2022-04-22T01:26:11.627Z"), "items" : [ { ...

Utilizing WebView for Initiating AJAX Calls

One common question often asked is whether it's possible to make ajax requests using a webview. In my case, the UI will consist entirely of native Android code, but I still need to interact with the backend using ajax calls. Fortunately, I am well-ver ...

The React material-table only updates and rerenders the table when the data is updated twice

Currently, I am utilizing a tool called material-table (check it out here: https://material-table.com/#/) which has been developed using React. The issue I am facing is that the data passed as a prop to material-table doesn't seem to update correctly ...

The function $.fn.dataTable.render.moment does not exist in npm package

I have encountered an issue with my application that I am struggling to solve: I want to format dates in my data table using Moment.js like I have done in the following script: $().ready(function() { const FROM_PATTERN = 'YYYY-MM-DD HH:mm:ss.SSS&a ...

VS code is showing the directory listing instead of serving the HTML file

Recently, I attempted to use nodejs to serve the Disp.html file by following a code snippet from a tutorial I found on YouTube. const http = require("http"); const fs = require("fs"); const fileContent = fs.readFileSync("Disp.html& ...

Typeahead.js is a powerful tool offered by Twitter that allows for easy auto-completion

I am currently working on a program that has the capability to search for specific university courses based on certain parameters. Within my large JSON object, there are 1360 objects, each consisting of around 20-30 parameters. However, I am only intereste ...

Why is it that vanilla HTML/JS (including React) opts for camelCase in its styling conventions, while CSS does not follow the same pattern

Each type of technology for styling has its own set of conventions when it comes to naming properties, with camelCase and hyphenated-style being the two main options. When applying styles directly to an HTML DOM Node using JavaScript, the syntax would be ...

async.auto: halt the entire sequence upon encountering the initial error

My understanding was that the behavior of async.auto was such that if one task returned an error (err), the global callback would be triggered with this error and no further tasks would execute. It seemed logical - why continue executing tasks when an erro ...