$ show impress/impress.js
impress.js is a client-side JavaScript presentation framework that leverages CSS3 3D transforms and transitions to create dynamic, Prezi-like slideshows. The core library manages step navigation, camera positioning, and event handling, exposing a simple API (`impress().init()`, `next()`, `prev()`, `goto()`). It features a plugin system where each plugin is a separate file under `src/plugins/`, communicating via events. Plugins add functionality such as autoplay, markdown rendering, speaker console, touch/swipe navigation, and relative positioning. The build process (`build.js`) concatenates the core and all plugins into a single distributable file (`js/impress.js`) and minifies it with Terser. The repository includes multiple example presentations demonstrating various features, a QUnit test suite, and CI configuration. There are no runtime dependencies; the library is designed to work in modern browsers with CSS 3D support. The codebase is well-structured with clear separation of concerns, though some tooling (jshint, jscs, ESLint 6) and a Node requirement of >=7.6 indicate moderate technical drift.
The LLM identified 4 files worth highlighting for reuse:
A lightweight garbage collection helper that tracks DOM elements, event listeners, and callbacks for orderly teardown. It provides a LIFO cleanup mechanism via `gc.teardown()`, making it reusable in any client-side project that needs to manage disposable resources.
A collection of utility functions for DOM traversal (`$`, `$$`), array conversion, `data-*` attribute parsing (hyphenated to camelCase), throttle, and toolbar creation. These are generic helpers that can be extracted and used in other web projects without modification.
Provides rotation math utilities for CSS 3D transforms, including quaternion-based rotation combination and relative positioning calculations. This module encapsulates non-trivial coordinate system logic and can be reused in any project requiring 3D transform computations.
A plugin that allows step positioning relative to the previous step using `data-rel-to`, `data-rel-x/y/z`, and `data-rel-rotate-*` attributes. It runs as a pre-init plugin, modifying DOM attributes before the core processes them. This demonstrates a clean pattern for extending core behavior without modifying the core source.