This script produce the video scroll effect that we can find on the Apple Website's

Overview

Scrollable Sequence

Description

This script produce the video scroll effect that we can find on the Apple Website's.

This script is inspired from the article on CSS Tricks.

Documentation

General

To produce this effect, the scripts uses a HTMLElement to draw the images on scroll event. The transition is done using the requestAnimationFrame javascript method.

All the images of the animated sequence should be stored in a directory, and named buy there index, without or without number padding, and in a continuous sequence. Example :

1.jpg
2.jpg

[...]

10.jpg

The script will draw the image using a scalle-to-fit sizing. This sizing is computed for each image, and at every window resize event.

Usage

The whole script is contained in a ScrollableSequence class. The class uses the data- attributes of the element to make its configuration.

Parameters are :

  • data-framecount: The number of image to use in the animation. Error will be thrown if not set.
  • data-imagepath: Path to the image. More precisely, a format patter for building the image path. Will be used in the image src attribute. Can be URL. This variable must contain the {framenumber} replacement token. It will be automatically replaced by the current frame number. Error will be thrown if not set, or not containing the replacement token.
  • data-framenumbepading: The number of digits that represents the Frame Number. This number will be used with a padStart() method in the file name generation. Default is 0;

In order to be responsive, it is required to encapsulate the HTMLElement into a

HTMLElement. The ScrollableSequence class will adapt the size of the to it's parent container. Give the parent the desired responsive size.

">
<div id="sequence-container">
    <canvas id="sequence-canvas" data-framecount="200" data-imagepath="./images/ezgif-frame-{framenumber}.jpg" data-framenumberpading="3">canvas>
div>

Script activation

Instanciate the ScrollableSequence class and call it's init() method.

Constructor of the class requires the canvasId parameter, which is the id given to the HTMLElement.

">
<script>
    new ScrollableSequence("sequence-canvas").init();
script>

Style

In order to produce the correct effect when scrolling, the canvas, or better the containing parent (see responsive), must have the CSS postion attribute set to fixed.

Image preload

To ensure a smooth animation, all images will be preloaded in the browser cach at the initialisation of the script.

Images source

All image are extracted from the free Pexels video Drone Footage Of A Mountain Landscape With Snow

You might also like...

A bot that kills boredom giving you new websites to explore. Inspired by and courtesy of BoredButton

A bot that kills boredom giving you new websites to explore. Inspired by and courtesy of BoredButton

TheBoredBot A bot that kills boredom giving you new websites to explore. Inspired by and courtesy of BoredButton What it can do? Anybody of the server

Mar 24, 2022

Bot to automatically find and book appointment for renewal/creation of a Swedish passport or national identity card.

passport-appointment-bot 🛂 🤖 Bot to automatically find and book an appointment for renewal/creation of a Swedish passport or national identity card.

Dec 4, 2022

Find roblox bot alts.

NoMorals Alt Gen What does this do? This tool will use a predefined list of bot names on roblox, find which groups that bot is in, then scrape every o

Dec 28, 2022

Simple WhatsApp Bot Script using WhatsApp Web Multi-Device API

Simple WhatsApp Bot Script using WhatsApp Web Multi-Device API

Shiina Mashiro MD Shiina Multi Device Using NodeJS Framework & Baileys WhatsApp Web API Information WhatsApp Bot using WhatsApp Web API. If you find a

Feb 4, 2022

Simple example script that receives the signal from one iptv channel and relays it via websocket to another server to replicate the stream to multiple players

Simple example script that receives the signal from one iptv channel and relays it via websocket to another server to replicate the stream to multiple players

Simple example script that receives the signal from one iptv channel and relays it via websocket to another server to replicate the stream to multiple players

Feb 20, 2022

Hisoka-waweb.js: Script WhatsaApp Bot Multi Device Using Lib whatsapp-web.js

Rules read the rules at term-of-service hisoka-waweb.js Script Bot WhatsApp Multi Device dengan menggunakan Library whatsapp-web.js Config Isi semua y

Dec 24, 2022

Multi Device WhatsApp bot built with Baileys with Script and Template provided for devs.

Multi Device WhatsApp bot built with Baileys with Script and Template provided for devs.

Miku Nakano (Beta) Konochiwa Senpai, I am "Miku Nakano" a WhatsApp bot made by Fantox to do everything that is possible on WhatsApp based on WhatsApp

Jan 2, 2023

Script bot WhatsApp Md lanjutan dari R-TXZY Lawas Up Ke Versi Alpha Edition

R-TXZY-MD Jangan lupa kasih stars & follow :) https://botcahx-rest-api.herokuapp.com/ Join Group Diskusi NO BOT Install for termux termux-setup-stor

Jan 5, 2023

Script bot WhatsApp Md lanjutan dari R-TXZY Lawas Up Ke Versi Alpha Edition

Script bot WhatsApp Md lanjutan dari R-TXZY Lawas Up Ke Versi Alpha Edition

R-TXZY-MD Jangan lupa kasih stars & follow :) Information Dikarenakan WhatsApp Sekarang Update Jadi Tidak Ada List Menu Terpaksa Bot Ini Di Ganti Menu

Aug 14, 2022
Owner
bpy
bpy
Video.js - open source HTML5 & Flash video player

Video.js - HTML5 Video Player Video.js is a web video player built from the ground up for an HTML5 world. It supports HTML5 video and Media Source Ext

Video.js 34.8k Jan 5, 2023
A Node JS Express/Serverless demo application that creates a slideshow video using the Pexels image library and Shotstack video editing API.

Shotstack Pexels Slideshow Video Demo This project demonstrates how to use the Shotstack cloud video editing API to create a video using an HTML form

Shotstack 25 Dec 9, 2022
A Electron Port of Discord Webapp for Apple Silicon

Discord M1 (Apple Silicon) A Electron Port of Discord Webapp for Apple Silicon This Application is Unofficial Discord Application for Apple Silicon us

Leo Kim 35 Jul 18, 2022
Add Discord rich presence for Apple Music!

Apple Music Presence Connect Apple music with Discord! We all have friends who have Spotify (gross), but it shows what they are listening to in Discor

null 57 Jan 1, 2023
🎼 - MusicBridge Recieves MIDI messages and converts them to AppleScript commands to control Apple Music and Spotify for macOS.

MusicBridge MusicBridge Recieves MIDI messages and converts them to AppleScript commands to control Apple Music and Spotify for macOS. Installation Si

null 3 Dec 20, 2022
Source code for a girlfriend bot that you can talk to in VC, video can be found on youtube

Girlfriend Bot This repo is basically the source code for the main youtube video which was basically me creating a girlfriend that i can talk to in VC

UltraX 16 Dec 2, 2022
Discord-Bot - You can use the discord bot codes that are updated in every video of the codes I use in the discord bot making series that I have published on my youtube channel.

Discord-Bot You can use the discord bot codes that are updated in every video of the codes I use in the discord bot making series that I have publishe

Umut Bayraktar 114 Jan 3, 2023
Resurrection of mediagroup / MediaController (renamed) which can be used to sync and control multiple audio / video elements.

media-group (examples) Resurrection of the mediagroup attribute and MediaController API (but renamed) which can be used to sync and control multiple a

Mux 7 Dec 15, 2022
Resurrection of mediagroup / MediaController (renamed) which can be used to sync and control multiple audio / video elements.

media-group (examples) Resurrection of the mediagroup attribute and MediaController API (but renamed) which can be used to sync and control multiple a

Mux 6 Aug 2, 2022
A simple & easy2use API for obtaining information about a discord user, discord bot or discord guild and their use for some purpose on websites!

discord-web-api A simple & easy2use API for obtaining information about a discord user, discord bot or discord guild and their use for some purpose on

InvalidLenni 2 Jun 28, 2022