$ show peachananr/onepage-scroll
This repository is a jQuery plugin that enables a full-page scrolling experience on websites, similar to Apple's iPhone 5S product page. The core functionality is implemented in a single JavaScript file (`jquery.onepage-scroll.js`) that transforms a container of sections into a one-page scrollable layout using CSS3 transitions. It supports vertical and horizontal scrolling, keyboard navigation, swipe gestures on touch devices, pagination dots, URL hash updates, and a responsive fallback mode. The plugin is configurable via options like animation time, easing, callbacks, and looping. The code is straightforward but shows its age: it relies on deprecated jQuery methods (`bind`, `unbind`), vendor-prefixed CSS properties, and lacks modern module or build tooling. The repository also includes a demo page and a minified version. Despite its popularity (9.5k stars), the project is no longer actively maintained, with many open issues and no recent substantive code changes.
The LLM identified 1 files worth highlighting for reuse:
The main plugin file. It defines `$.fn.onepage_scroll` and includes a reusable `$.fn.swipeEvents` utility that adds custom swipe events (`swipeUp`, `swipeDown`, `swipeLeft`, `swipeRight`) to any element using touchstart/touchmove. This swipe detection logic is self-contained and could be extracted into a standalone jQuery plugin or vanilla JS utility for touch gesture handling. The rest of the file implements the full-page scroll mechanics, pagination, keyboard controls, and responsive fallback, but those are tightly coupled to the plugin's specific DOM structure and options.