### Complete Example: Dynamic Gallery with Thumbnails Source: https://vistaview.jujiplay.com/llms-extensions.txt A comprehensive example demonstrating how to dynamically generate a gallery of YouTube videos using VistaView. It uses the `getYouTubeThumbnail` helper for previews. ```html
``` -------------------------------- ### Complete Wistia Video Integration Example Source: https://vistaview.jujiplay.com/llms-extensions.txt A comprehensive example showing dynamic gallery creation with Wistia video thumbnails using `getWistiaThumbnail` and initializing VistaView with the `wistiaVideo` extension. ```html ``` -------------------------------- ### Initialize VistaView with Multiple Extensions (JavaScript) Source: https://vistaview.jujiplay.com/llms-extensions.txt Demonstrates how to initialize VistaView with several extensions, including YouTube, Vimeo, and download, for handling different media types. This example assumes you have the 'vistaview' library and its extensions installed. ```javascript import { vistaView } from 'vistaview'; import { youtubeVideo } from 'vistaview/extensions/youtube-video'; import { vimeoVideo } from 'vistaview/extensions/vimeo-video'; import { download } from 'vistaview/extensions/download'; vistaView({ elements: '#gallery a', extensions: [ youtubeVideo(), vimeoVideo(), download(), // Works for images, not videos ], }); ``` -------------------------------- ### Custom Image Setup Function Implementation Source: https://vistaview.jujiplay.com/llms-api.txt Provides an example of a custom image setup function for vistaView. This enables adding custom logic or modifications to the image setup process, in addition to the default setup provided by the library. ```typescript vistaView({ elements: '#gallery a', imageSetupFunction: (data, vistaView) => { imageSetup(data, vistaView); // Add custom setup logic }, }); ``` -------------------------------- ### Complete Example with Dynamic Gallery Source: https://vistaview.jujiplay.com/llms-extensions.txt A full example demonstrating how to dynamically create a gallery of Vimeo videos using the `vimeoVideo` extension and `getVimeoThumbnail` helper. This includes setting up the gallery, generating thumbnails, and initializing VistaView. ```html ``` -------------------------------- ### Simple VistaView Extension Example Source: https://vistaview.jujiplay.com/llms-extensions.txt A minimal example demonstrating how to create a basic VistaView extension. This extension logs a message to the console when the lightbox opens. It requires the `vistaview` and the extension module to be imported. ```typescript import type { VistaExtension } from 'vistaview'; export function myExtension(): VistaExtension { return { name: 'myExtension', onOpen: (vistaView) => { console.log('Lightbox opened!'); }, }; } ``` ```typescript import { vistaView } from 'vistaview'; import { myExtension } from './my-extension'; vistaView({ elements: '#gallery a', extensions: [myExtension()], }); ``` -------------------------------- ### Complete Example: Dailymotion Video Extension Integration (HTML/JavaScript) Source: https://vistaview.jujiplay.com/llms-extensions.txt A full example demonstrating how to dynamically create a gallery of Dailymotion videos using VistaView. It generates links with thumbnails and initializes VistaView with the Dailymotion Video extension. ```html ``` -------------------------------- ### State Persistence Example using Closures Source: https://vistaview.jujiplay.com/llms-extensions.txt Demonstrates how to maintain state across extension method calls using closure variables. This example shows a simple counter that increments each time the `onImageView` hook is triggered. It's a fundamental pattern for managing extension-specific data. ```typescript export function statefulExtension(): VistaExtension { let count = 0; let cache = new Map(); return { name: 'statefulExtension', onImageView: () => { count++; // Persists between calls }, }; } ``` -------------------------------- ### Wistia Video Extension Usage Example Source: https://vistaview.jujiplay.com/llms-extensions.txt Demonstrates how to link to Wistia videos using the Wistia Video extension. The `href` attribute should point to a valid Wistia video URL. ```html ``` -------------------------------- ### Using VistaView Extensions with ESM Modules Source: https://vistaview.jujiplay.com/llms-extensions.txt Shows how to import and configure VistaView with extensions like 'download' and 'youtubeVideo' when using ESM (ECMAScript Modules) for bundlers. This example initializes VistaView for a gallery and sets custom controls. ```javascript import { vistaView } from 'vistaview'; import { download } from 'vistaview/extensions/download'; import { youtubeVideo } from 'vistaview/extensions/youtube-video'; vistaView({ elements: '#gallery a', controls: { topRight: ['zoomIn', 'zoomOut', 'download', 'close'], }, extensions: [download(), youtubeVideo()], }); ``` -------------------------------- ### HTML Example for Multiple Maps with OSM Links Source: https://vistaview.jujiplay.com/llms-extensions.txt Demonstrates how to create a gallery of images that link to OpenStreetMap tiles using a custom 'osm://' URL scheme. Each link contains coordinates and zoom level for specific locations like Paris, Tokyo, and Sydney. ```html ``` -------------------------------- ### Install Dailymotion Video Extension with UMD (HTML/JavaScript) Source: https://vistaview.jujiplay.com/llms-extensions.txt Demonstrates installing the Dailymotion Video extension using UMD modules via CDN. It includes the necessary script tags for VistaView and the extension, then initializes VistaView in a script block. ```html ``` -------------------------------- ### Initialize VistaView with Mapbox Extension (HTML - UMD) Source: https://vistaview.jujiplay.com/llms-extensions.txt Shows the UMD (CDN) installation of the Mapbox extension for VistaView. Includes necessary script tags for VistaView and the mapbox extension, and initializes the view with a Mapbox access token. ```html ``` -------------------------------- ### Initialize VistaView with Mapbox Extension using Module Script (JavaScript) Source: https://vistaview.jujiplay.com/llms-extensions.txt An example of initializing VistaView with the Mapbox extension within a JavaScript module script. It imports necessary components and configures the extension with an access token. ```javascript import { vistaView } from 'vistaview'; import { mapbox } from 'vistaview/extensions/mapbox'; import 'vistaview/style.css'; vistaView({ elements: '#gallery a', extensions: [mapbox({ accessToken: 'YOUR_TOKEN' })], }); ``` -------------------------------- ### Using VistaView Extensions with UMD (CDN) Source: https://vistaview.jujiplay.com/llms-extensions.txt Illustrates how to integrate VistaView and its extensions using UMD (Universal Module Definition) format via CDN links. This example includes scripts for VistaView, download, and youtube-video extensions, then initializes VistaView with these extensions. ```javascript ``` -------------------------------- ### Import VistaView Image Setup Function Source: https://vistaview.jujiplay.com/llms-api.txt Imports the default image setup function from the 'vistaview' library. This function is responsible for initial setup and configuration of images displayed within the lightbox. ```typescript import { imageSetup } from 'vistaview'; ``` -------------------------------- ### Quick Start with VistaView JavaScript Source: https://context7_llms Demonstrates the basic usage of VistaView in JavaScript. It imports the necessary function and CSS, then initializes VistaView to enhance specified anchor elements as a gallery. ```javascript import { vistaView } from 'vistaview'; import 'vistaview/style.css'; vistaView({ elements: '#gallery a', }); ``` -------------------------------- ### Install YouTube Video Extension (UMD/CDN) Source: https://vistaview.jujiplay.com/llms-extensions.txt Installs the YouTube Video extension for VistaView using UMD via CDN. It includes script tags for VistaView and its extension, then initializes VistaView with the extension. ```html ``` -------------------------------- ### Install Streamable Video Extension (UMD) Source: https://vistaview.jujiplay.com/llms-extensions.txt Installs the Streamable Video extension for VistaView using UMD via CDN. It includes the necessary scripts and initializes VistaView with the streamableVideo extension. ```html ``` -------------------------------- ### Integrate Google Maps Thumbnails with VistaView in HTML Source: https://vistaview.jujiplay.com/llms-extensions.txt Demonstrates how to use generated static map URLs within an HTML structure for a gallery. It shows `This is the story for image ${index + 1}.
`, }), }), ], }); ``` -------------------------------- ### Mixing Images and Google Maps in a VistaView Gallery Source: https://vistaview.jujiplay.com/llms-extensions.txt Illustrates how to create a gallery that combines regular images with interactive Google Maps. This example shows a simple HTML structure where `` tags contain either image `src` attributes or Google Maps links, demonstrating the versatility of VistaView in handling mixed content types. ```html ``` -------------------------------- ### Create a Simple Logger Extension for VistaView Source: https://vistaview.jujiplay.com/llms-extensions.txt This extension provides basic logging for 'onOpen' and 'onClose' events in VistaView. It's a simple example demonstrating how to create a VistaExtension. No external dependencies are required. ```typescript import type { VistaExtension } from 'vistaview'; export function simpleLogger(): VistaExtension { return { name: 'simpleLogger', onOpen: () => console.log('Opened'), onClose: () => console.log('Closed'), }; } ``` -------------------------------- ### Install Wistia Video Extension (UMD/CDN) Source: https://vistaview.jujiplay.com/llms-extensions.txt Installs the Wistia Video extension for VistaView using the Universal Module Definition (UMD) format via CDN. This is useful for direct script inclusion in HTML. ```html ``` -------------------------------- ### Basic VistaView Gallery Implementation in SolidJS Source: https://vistaview.jujiplay.com/llms-integrations.txt Shows a fundamental example of using the `useVistaView` hook in a SolidJS component to create a simple image gallery. It requires importing the hook and CSS, and then initializing VistaView with a selector for gallery elements. ```tsx import { useVistaView } from 'vistaview/solid'; import 'vistaview/style.css'; function Gallery() { const id = 'gallery-' + Math.random().toString(36).slice(2); const vista = useVistaView({ elements: `#${id} a`, }); return ( ); } ``` -------------------------------- ### Install Vimeo Video Extension (ESM) Source: https://vistaview.jujiplay.com/llms-extensions.txt Installs the Vimeo Video extension for VistaView using ESM modules. This method is suitable for modern JavaScript projects using module bundlers. ```javascript import { vistaView } from 'vistaview'; import { vimeoVideo } from 'vistaview/extensions/vimeo-video'; import 'vistaview/style.css'; vistaView({ elements: '#gallery a', extensions: [vimeoVideo()], }); ``` -------------------------------- ### Install VistaView Package (bun) Source: https://vistaview.jujiplay.com/llms-integrations.txt Installs the VistaView package using bun. bun is a fast all-in-one JavaScript runtime. ```bash bun add vistaview ``` -------------------------------- ### Install Streamable Video Extension (ESM) Source: https://vistaview.jujiplay.com/llms-extensions.txt Installs the Streamable Video extension for VistaView using ESM module bundlers. It imports necessary components from 'vistaview' and applies the extension to gallery links. ```javascript import { vistaView } from 'vistaview'; import { streamableVideo } from 'vistaview/extensions/streamable-video'; import 'vistaview/style.css'; vistaView({ elements: '#gallery a', extensions: [streamableVideo()], }); ``` -------------------------------- ### Install VistaView using npm Source: https://context7_llms Installs the VistaView library using the npm package manager. This is the first step to integrate VistaView into your web project. ```bash npm install vistaview ``` -------------------------------- ### Install Vidyard Video Extension (ESM) Source: https://vistaview.jujiplay.com/llms-extensions.txt Installs the Vidyard Video extension for VistaView using ESM module bundlers. It imports necessary components from 'vistaview' and applies the extension to gallery links. ```javascript import { vistaView } from 'vistaview'; import { vidyardVideo } from 'vistaview/extensions/vidyard-video'; import 'vistaview/style.css'; vistaView({ elements: '#gallery a', extensions: [vidyardVideo()], }); ``` -------------------------------- ### Install VistaView using package managers (npm, yarn, pnpm, bun) Source: https://vistaview.jujiplay.com/llms-integrations.txt Demonstrates how to install the vistaview package using various popular JavaScript package managers. This is the initial step before integrating VistaView into your project. ```bash npm install vistaview ``` ```bash yarn add vistaview ``` ```bash pnpm add vistaview ``` ```bash bun add vistaview ``` -------------------------------- ### Example CSS for Sticky Header with VistaView Source: https://vistaview.jujiplay.com/llms-core.txt An example CSS snippet demonstrating how to configure a sticky header to appear above the VistaView lightbox when it is closed. By setting the header's z-index to 2, it will layer correctly over the default `initialZIndex` of 1 for the closed lightbox. ```css /* Your sticky header */ .site-header { position: sticky; z-index: 2; /* Appears above closed lightbox (z-index: 1) */ } ``` -------------------------------- ### Custom Initialization Source: https://vistaview.jujiplay.com/llms-api.txt Override the default initialization process with a custom function to add specific setup logic. ```APIDOC ## Custom Initialization ### Description Allows overriding the default initialization of VistaView to include custom setup steps. ### Method `initFunction` ### Parameters #### Request Body - **vistaView** (VistaView) - Required - The VistaView instance. ### Request Example ```typescript import { vistaView, init } from 'vistaview'; vistaView({ elements: '#gallery a', initFunction: (vistaView) => { // Call default initialization init(vistaView); // Add custom initialization console.log('Custom initialization'); console.log('Total images:', vistaView.state.elmLength); }, }); ``` ### Response N/A (This is a configuration option) ``` -------------------------------- ### Basic VistaView Gallery Initialization (HTML) Source: https://vistaview.jujiplay.com/llms-integrations.txt Demonstrates the basic setup for a VistaView image gallery using HTML anchor tags for image links and a script block for initialization. It requires a container element with anchor tags pointing to images. ```html ``` -------------------------------- ### VistaView Gallery with Control Buttons (HTML) Source: https://vistaview.jujiplay.com/llms-integrations.txt This example shows how to initialize VistaView and bind control buttons (Open, Next, Previous) to its methods. It requires specific HTML elements for the gallery items and buttons, along with JavaScript event listeners. ```html ``` -------------------------------- ### Custom Image Setup Source: https://vistaview.jujiplay.com/llms-api.txt Implement custom logic for setting up images during the viewing process. ```APIDOC ## Custom Image Setup ### Description Provides a way to customize how each image is set up before being displayed. ### Method `imageSetupFunction` ### Parameters #### Request Body - **data** (VistaData) - Required - The data associated with the current image. - **vistaView** (VistaView) - Required - The VistaView instance. ### Request Example ```typescript import { vistaView, imageSetup } from 'vistaview'; vistaView({ elements: '#gallery a', imageSetupFunction: (data, vistaView) => { // Call default setup imageSetup(data, vistaView); // Custom setup logic console.log('Setting up image:', data.index.to); }, }); ``` ### Response N/A (This is a configuration option) ``` -------------------------------- ### Install Logger Extension (ESM) Source: https://vistaview.jujiplay.com/llms-extensions.txt Installs the Logger extension using ECMAScript Modules (ESM), typically with a module bundler like Webpack or Rollup. This method imports the necessary components from the `vistaview` library and its extensions. Ensure `vistaview` and the logger extension are installed via npm or yarn. ```javascript import { vistaView } from 'vistaview'; import { logger } from 'vistaview/extensions/logger'; import 'vistaview/style.css'; vistaView({ elements: '#gallery a', extensions: [logger()], }); ``` -------------------------------- ### OpenStreetMap URL Format Example Source: https://vistaview.jujiplay.com/llms-extensions.txt Illustrates the required URL format for embedding OpenStreetMap maps using the 'osm://' protocol in the href attribute. It specifies the latitude, longitude, and zoom level parameters. ```plaintext osm://LATITUDE,LONGITUDE,ZOOM Example: osm://40.7580,-73.9855,15 ``` -------------------------------- ### Install Google Maps Extension for VistaView (UMD) Source: https://vistaview.jujiplay.com/llms-extensions.txt Installs and initializes the Google Maps extension for VistaView using the Universal Module Definition (UMD) format, suitable for direct inclusion via CDN. It loads VistaView and the Google Maps extension from unpkg.com and then initializes VistaView. ```html ``` -------------------------------- ### VistaImageSetupFn Type for Image Setup Source: https://vistaview.jujiplay.com/llms-api.txt Defines the signature for custom setup functions executed during image navigation. It receives navigation data and the VistaView instance for context. ```typescript type VistaImageSetupFn = (data: VistaData, vistaView: VistaView) => void; ``` -------------------------------- ### Initialize VistaView with OpenStreetMap Extension (UMD) Source: https://vistaview.jujiplay.com/llms-extensions.txt Illustrates how to initialize VistaView with the OpenStreetMap extension using the Universal Module Definition (UMD) format, typically loaded via CDN. This setup is suitable for projects not using module bundlers. ```javascript ``` -------------------------------- ### Start Animated Transition with VistaHiresTransition Source: https://vistaview.jujiplay.com/llms-api.txt The static start method of VistaHiresTransition initiates an animated transition for a VistaBox instance. It requires the VistaBox, a completion callback, a condition to pause the animation, and the target state (dimensions and transform). This is used internally by VistaImage for smooth visual changes. ```typescript static start(options: { vistaImage: VistaBox; onComplete: () => void; shouldWait: () => boolean; target: { width?: number; height?: number; transform?: { x?: number; y?: number; scale?: number }; translate?: { x?: number; y?: number }; }; }): void ``` ```typescript import { VistaHiresTransition } from 'vistaview'; VistaHiresTransition.start({ vistaImage: image, onComplete: () => console.log('Animation complete'), shouldWait: () => false, target: { width: 800, height: 600, transform: { scale: 1.5, x: 0, y: 0 }, }, }); ``` -------------------------------- ### Integrating VistaView Gallery with SolidStart using Lazy Loading Source: https://vistaview.jujiplay.com/llms-integrations.txt Provides an example of how to use VistaView within a SolidStart application, emphasizing the use of client-side rendering and lazy loading for components. This ensures that the gallery is only rendered in the browser. ```tsx import { lazy } from 'solid-js'; const Gallery = lazy(() => import('./Gallery')); function Page() { return (${data.description}
By ${data.author} on ${data.date}
`, }; } catch (error) { return { content: 'Story could not be loaded.
', }; } }, }); ```