vvjc
The Vanilla Views suite F.L.A.S.H.C.R.P.T.B FlashCrptb is a collection of ten powerful Drupal modules designed to enhance the visual and interactive experience of Drupal Views using pure, lightweight Vanilla JavaScript. Originally developed as Paragraphs Bundles, these modules Accordion, Basic Carousel, 3D Carousel, 3D FlipBox, Hero, Lightbox, Parallax, Reveal, Slideshow, and Tabs.
Additionally, I have created a demo for each module: Accordion Demo, 3D Carousel Demo, Carousel Demo, 3D FlipBox Demo, Hero Demo, Lightbox Demo, Parallax Demo, Reveal Demo, Slideshow Demo, and Tabs Demo.
To get started, check out our Video Demo for a step-by-step guide on using the module effectively. Explore our mixed demos here: Live Demo One | Live Demo Two. The site for the live demo is built with the Solo Theme.
Overview
The Views Vanilla JavaScript 3D Carousel module (machine name: vvjc) allows you to create dynamic, responsive, and visually striking 3D carousels for displaying content items on your Drupal site. Seamlessly integrated with the Views module, this module introduces a new display style that can be selected when creating or editing views. Built using pure vanilla JavaScript, the VVJC module avoids jQuery dependencies, ensuring a lightweight and modern user experience.
Features
- No jQuery: By using vanilla JavaScript, the module ensures faster performance, reduced page load times, and no reliance on heavy external libraries. This makes it an ideal choice for modern, lightweight Drupal websites.
- 3D Carousel Format: Renders content items in an interactive 3D carousel format for engaging and visually captivating displays.
- Comprehensive Customization Options: Provides a variety of settings, including maximum width, screen heights for different devices, set the background color with opacity, and perspective depth to fine-tune the carousel’s appearance.
- Responsive Design: Built-in breakpoints ensure the carousel adapts seamlessly to various screen sizes, offering a consistent experience across devices.
- Play/Pause Functionality: Includes an automatic scrolling feature with a play/pause button, giving users control over the carousel's movement.
- Customizable Intervals: Set the time interval for slide transitions, with options ranging from 3 to 15 seconds, or disable automatic transitions entirely to allow users full control.
- Keyboard Navigation: Supports arrow keys and the space bar for intuitive slideshow navigation.
- Touch and Swipe Support: Includes swipe gestures for seamless navigation on mobile devices.
- Accessibility-Enhanced: Announces active slides to screen readers and includes ARIA attributes for improved accessibility.
- Hover Pause: Automatically pauses the slideshow on hover and resumes on mouseout for better user interaction.
- Unique ID Generation: To prevent conflicts and ensure consistency across different views, the module automatically generates a unique numeric ID for each slideshow instance.
- Pause on Tab Switch: The carousel automatically pauses when the user switches to another browser tab, preserving content visibility when they return.
- Reduced Motion Support: Respects the user's "prefers-reduced-motion" system setting to reduce animations for users who prefer less movement.
Accessibility
The Views Vanilla JavaScript 3D Carousel module is designed with accessibility in mind, ensuring that your carousels are usable by all visitors, including those who rely on screen readers. Accessibility features include:
- ARIA Roles and Properties: Proper ARIA roles and properties provide context and state information to screen readers, enhancing accessibility.
- Keyboard Navigation: Users can navigate through carousel items using keyboard shortcuts, ensuring full functionality without the need for a mouse.
- Focus Management: The module ensures that the currently displayed item receives focus, improving the experience for keyboard and screen reader users.
Configuration
After installing and enabling the module, you can configure it through the Views UI:
- Max Width: Define the maximum width of the carousel, choosing from preset options such as 300px, 400px, 500px, etc.
- Time in Seconds: Set the interval between slides, with options ranging from 3 to 15 seconds. Setting this to 0 disables automatic scrolling.
- Large Screen Height: Specify the carousel’s height on large screens, ensuring an optimal display on desktops and larger devices.
- Small Screen Height: Adjust the carousel’s height for smaller screens, enhancing the mobile viewing experience.
- Perspective: The perspective is automatically set based on the maximum width for optimal 3D display, but you can override this by specifying a custom value in pixels.
- Available Breakpoints: Select breakpoints to ensure the carousel is responsive, with options such as 576px, 768px, 992px, and more.
- Background Color: Set the background color of the carousel using a color picker to enhance its visual appeal.
- Background Opacity: Adjust the opacity of the background with a range slider, allowing values from 0 (fully transparent) to 100 (fully opaque) to achieve the desired transparency effect.
- Disable Background: Use this checkbox to completely disable the background, making the carousel transparent if checked.
Custom Token for views header/footer from first row
In Views header/footer, if you add a field using Global: Text area or Global: Unfiltered text, there is an option called "Use replacement tokens from the first row."
The default tokens will not work in this case. Please use the custom tokens created by VVJA instead.
For example:
-
The default token
{{ title }}should be replaced with[vvjc:title]. -
The default token
{{ field_image }}should be replaced with[vvjc:field_image].
You can append :plain to the token to strip any HTML.
Example: [vvjc:title:plain]
Note: The [vvjc:*] tokens pull data directly from the rendered View fields.
Fields using complex rewrites (e.g., Global: Custom text with {{ tokens }}) are not supported by default for token replacement. Please use individual field tokens like [vvjc:title], [vvjc:field_image], etc.
Example Usage
- Install and enable the Views Vanilla JavaScript 3D Carousel module.
- Create or edit a view using the Views module.
- In the Format section, choose 3D Carousel as the display style.
- Configure the available options under Format Settings to tailor the carousel to your specific needs.
Additional Information
- Dependencies: This module has no dependencies on other contributed modules.
Installation
- Download and install the VVJC module from Drupal.org:
composer require drupal/vvjc - Enable the module through the Drupal admin interface or using Drush:
drush en vvjc - Clear caches to ensure the new plugin is available:
drush cr
Support and Contributions
If you encounter any issues or have suggestions for improvements, please open an issue in the module's issue queue. Contributions are welcome and appreciated!
3D Carousel - Developer & Site Builder Tips:
- Every view created with this plugin has a CSS class
vvj-carouselplaced alongsidejs-view-dom-id. - The active item has the class
activefor easy customization. - You can use a view mode or row styles for your carousel items.
- Carousel items are wrapped in a single
<div>, and the navigation is wrapped in a separate<div>.
Developed & Designed By: Alaa Haddad
A Personal Thank You for Your Support
Every project you see here, including this one, reflects countless hours of work driven by my passion for making Drupal better for everyone. Your support truly makes a difference, and there are a few simple ways you can help these projects grow and reach others who might benefit:
- Use & Share Feedback: Have you found this project (or any of my other work) helpful? Let me know what worked well or how it could be improved. Real user input drives better tools for the entire community.
- Click "Like" on Drupal.org: It may seem small, but liking this project on Drupal.org helps others discover and trust these tools.
- Spread the Word: Share these projects on social media, Slack groups, or anywhere Drupal folks connect. Your word of mouth helps these tools find the people who need them.
- Explore More of My Work: Check out my other projects on Drupal.org to see what else might support your workflow or inspire your next build.
W3CSS Theme (d8w3css) - Solo - W3CSS Paragraphs - Paragraphs Bundles - Amun - Amunet - Anhur - Acquia Purge Varnish - Cloudflare Purge - Reference Blocked Users - Solo Copy Blocks - Solo Utilities - PB Import - VVJA - Accordion - VVJC - 3D Carousel - VVJB - Basic Carousel - VVJF - 3D FlipBox - VVJH - Hero - VVJL - Lightbox - VVJP - Parallax - VVJR - Reveal - VVJS - Slideshow - VVJT - Tabs - Module Matrix - Selectify - Utilikit
If you have any questions, ideas, or feedback about my Drupal.org projects, I’d love to hear from you! To keep things open and helpful for the entire community, I encourage you to post directly in the project's issue queue on Drupal.org. This way, your questions and the answers can benefit others who may have the same needs.
At the end of the day, my goal is to make Drupal easier and more enjoyable for everyone, especially small businesses and site builders who want to create professional sites without extra hassle. Together, we can build something even better. Thank you for your support, and for being part of this journey!