Getting Started
Shader Grid, a powerful, responsive, and extremely customizable, versatile grid with image(.jpg, jpeg, .png, .webp), seamlessly running on all major browsers and mobile devices, including iPhone, iPad, iOS, Android, MAC, and Windows, elevating your website's audio experience to a whole new level.
It is built using EcmaScript6 using the latest JavaScript and CSS standards. The 3D sphere and particles use Three.js and WebGL shaders running exclusively on the device's GPU.
It is crucial to optimize your images, especially since they are used as textures. Larger image files demand more GPU power to display due to the increased number of pixels. To minimize performance impact, select images that are visually close in size to the grid mesh, also optimize the size using tinypng.com or squoosh.app.
Please note that the mettrix are units so visual aproximation is needed, since the grid runs in 3D space and various aspects like camera position or camera rotation, using pixels is not possible.
Please note that it will not work locally, it has to run on an HTTP or HTTPS protocol.
Installation
Choose one of the preset HTML files from the build folder and open it in a text editor as a refference.
In the download files inside the build folder you will find the src folder that contains the JavaScript code and content folder that contains the CSS file and other important files like the ripple brush texture, the content folder has to be uploaded on the server where The grid is used.
Use the any HTML file from the build folder as refference.
Include the grid CSS file and JavaScript in the header:
<head>
<!-- ... -->
<link rel="stylesheet" href="./content/global.css">
<script type="text/javascript" src="./src/FWDSG.js"></script>
<!-- ... -->
</head>
The next step is to add the initialize code in the page header or footer after the inclusion of the grid JavaScript and CSS files.
<script type="text/javascript">
if(document.readyState == 'complete'){
fwdSetupGrids();
}else{
document.addEventListener('DOMContentLoaded', ()=>{
fwdSetupGrids();
});
}
function fwdSetupGrids(){
new FWDSG({
// Main settings.
instance: 'fwdsg0',
parentId: 'myDiv',
gridDataId: 'gridData',
displayType: 'responsive',
initializeWhenVisible: 'no',
maxWidth: 1920,
maxHeight:900,
stopScrollingForPx: 0,
paralax: 'yes',
autoScale: 'yes',
antialias: 'yes',
stats: 'yes',
gui: 'yes',
showPreloader: 'yes',
preloaderColor: '#FFFFFF',
backgroundColor: '#0c0101',
planeSize: 4,
planeGap: 5,
showMaskGradient: 'no',
useCaption: 'yes',
captionBackgroundColor: '#000000',
blackAndWhiteFadeDistance: 0,
snap: 'yes',
showMouseScrollIcon: 'yes',
autoScrollHorizontal: 'no',
autoScrollVertical: 'yes',
autoScrollSpeed: 1.5,
hoverScale: 1.2,
scrollSpeedStrength: 0.5,
scrollDragDirection: 'vertical',
tiltType: 'right',
// Post processing.
waveFrequency: 0.1,
waveAmplitude: 0.02,
waveRgbShiftStrength: 0,
flowmapRGBShift: 'yes',
flowmapRGBShiftAmount: 0.006,
flowmapRGBShiftStrength: 1,
flowmapStrength: 1,
flowmapRadius: 0.1,
flowmapSensitivity: 1,
flowmapForce: 4.4,
flowmapFalloff: 1.8,
glitch: 'no',
buldgeType: 'pointerDown',
buldgeRGBStrength: 1,
rippleDistortion: 'no',
rippleDistortionStrength: 0.2,
rippleDistortionSize: 0.5,
grid: 'yes',
gridAddRGBDistortion: 'yes',
gridSize: 400,
gridMouseRadiusFactor: 0.1,
gridMouseStrengthFactor: 0.48,
gridMouseRelaxation: 0.9,
afterImage: 'no',
afterImageDumping: 0.75,
// Lightbox.
rlPath: 'content/rl',
useLightbox: "yes",
rlUseDeepLinking: "yes",
rlItemBackgroundColor: "#212121",
rlDefaultItemWidth: 1527,
rlDefaultItemHeight: 859,
rlItemOffsetHeight: 37,
rlItemOffsetHeightButtonsTop: 47,
rlItemBorderSize: 0,
rlItemBorderColor: "#FFFFFF",
rlMaxZoom: 1.2,
rlPreloaderBkColor: "#2e2e2e",
rlPreloaderFillColor: "#FFFFFF",
rlButtonsAlignment: "in",
rlButtonsHideDelay: 5,
rlMediaLazyLoading: "yes",
rlUseDrag: "yes",
rlUseAsModal: "no",
rlShowSlideShowButton: "yes",
rlShowSlideShowAnimation: "yes",
rlSlideShowAutoPlay: "no",
rlSlideShowAutoStop: "no",
rlSlideShowDelay: 6,
rlSlideShowBkColor: "#2e2e2e",
rlSlideShowFillColor: "#FFFFFF",
rlUseKeyboard: "yes",
rlUseDoubleClick: "yes",
rlShowCloseButton: "yes",
rlShowFullscreenButton: "yes",
rlShowZoomButton: "yes",
rlShowCounter: "yes",
rlShowNextAndPrevBtns: "yes",
rlSpaceBetweenBtns: 8,
rlButtonsOffsetIn: 10,
rlButtonsOffsetOut: 10,
rlBackgroundColor: "rgba(0,0,0,.99)",
rlShareButtons: ['facebook', 'twitter', 'linkedin', 'tumblr', 'pinterest', 'reddit', 'buffer', 'digg','blogger'],
rlShareText: "Share on",
rlSharedURL: "deeplink",
rlShareMainBackgroundColor: "rgba(0,0,0,.4)",
rlShareBackgroundColor: "#FFFFFF",
rlShowThumbnails: "yes",
rlShowThumbnailsIcon: "yes",
rlThumbnailsHeight: 80,
rlThumbnailsOverlayColor: "rgba(0,0,0,.4)",
rlThumbnailsBorderSize: 2,
rlThumbnailsBorderColor: "#FFFFFF",
rlSpaceBetweenThumbnailsAndItem: 10,
rlThumbnailsOffsetBottom: 10,
rlSpaceBetweenThumbnails: 5,
rlShowCaption: "yes",
rlCaptionPosition: "bottomout",
rlShowCaptionOnSmallScreens: "no",
rlCaptionAnimationType: "motion",
rlUseVideo: "yes",
rlFillEntireScreenWithPoster: "yes",
rlVolume: 1,
rlVideoAutoPlay: "yes",
rlNextVideoAutoPlay: "no",
rlVideoAutoPlayText: "Click to unmute",
rlShowLogo: "yes",
rlLogoPath: "content/rl/content/evp/skin/logo.png",
rlLogoLink: "",
rlShowDefaultControllerForVimeo: "yes",
rlShowScrubberWhenControllerIsHidden: "yes",
rlShowRewindButton: "yes",
rlShowVolumeButton: "yes",
rlShowChromecastButton: "yes",
rlShowPlaybackRateButton: "no",
rlShowQualityButton: "yes",
rlShowFullScreenButton: "yes",
rlShowScrubberToolTipLabel: "yes",
rlShowTime: "yes",
rlTimeColor: "#B9B9B9",
rlYoutubeQualityButtonNormalColor: "#B9B9B9",
rlYoutubeQualityButtonSelectedColor: "#FFFFFF",
rlScrubbersToolTipLabelBackgroundColor: "#FFFFFF",
rlScrubbersToolTipLabelFontColor: "#5a5a5a",
rlAudioVisualizerLinesColor: "#D60E63",
rlAudioVisualizerCircleColor: "#FFFFFF",
rlThumbnailsPreviewWidth: 196,
rlThumbnailsPreviewBackgroundColor: "#2e2e2e",
rlThumbnailsPreviewBorderColor: "#414141",
rlThumbnailsPreviewLabelBackgroundColor: "#414141",
rlThumbnailsPreviewLabelFontColor: "#CCCCCC",
rlSkipToVideoText: "You can skip to video in: ",
rlSkipToVideoButtonText: "Skip Ad"
});
}
</script>
The last step adding the grid is to create a div with an unique ID that will act as the parent/holder for the grid and set the parentId option to point to the div id ex: parentId: 'myDiv', this div can be added anywhere in your page.
<!--Grid holder. -->
<div id="myDiv"></div>
To add multiple grids just redo the steps explained above and make sure to change the instance to fwdsg1, fwdsg2, fwdsg3, etc... depending on how manygrids are added, also change the parentId to a different ID and if you want add a different grid gallery by also change the gridDataId to point to a different grid gallery.
Please read the settings section to understand the grid configuration options.
Setup grid gallery
A grid gallery is created by adding in the page inside the body a div with an unique ID and setting the display style to none, this will be used only as the grid gallery data markup, This unique ID has to be added as the value of the gridDataId option in the grid settings like this gridDataId: 'gridData'.
<!-- Grid data -->
<div id="gridData" style="display: none;">
<div>
<div data-src="media/images/mp4.jpg" data-width="900" data-height="600"></div>
<div data-rl-src="media/videos/fwd-1080p.mp4" data-rl-poster-src="media/large-images/mp4.jpg" data-rl-subtitle-src="media/subtitles/english_subtitle.vtt"></div>
<div data-caption="">
<div class="fwdfg caption">Lightbox MP4</div>
</div>
<div data-rl-caption="">
<p class="fwdrl-title">MP4 Self/External Hosted With Subtitle</p>
<p class="fwdrl-desc">Shader Carousel has included <a href="https://webdesign-flash.ro/p/evp" target="_blank">Easy Video Player</a> with amazing features.</p>
</div>
</div>
<div>
<div data-src="media/images/link.jpg" data-width="900" data-height="600"></div>
<div data-rl-src="link:https://fwdapps.net" data-rl-target="_blank"></div>
<div data-caption="">
<div class="fwdfg caption">Link Support</div>
</div>
</div>
<div>
<div data-src="media/images/pass.jpg" data-width="900" data-height="600"></div>
<div data-rl-src="media/videos/fwd-1080p.mp4" data-rl-poster-src="media/large-images/pass.jpg" data-rl-password="dd1d878544e988bb644756ca5e0ba56b" data-rl-preview-src="auto"></div>
<div data-caption="">
<div class="fwdfg caption">Private/Protected Video</div>
</div>
<div data-rl-caption="">
<p class="fwdrl-title">Private/Protected Video With Thumbnails Preview</p>
<p class="fwdrl-desc">Private/password protected videos with auto-generated thumbnails preview, test password is <strong>Meli</strong>.</p>
</div>
</div>
</div>
Adding grid items is done by adding inside the grid div one or more div's with data paremeters expplained below.
Grid item parameters
- data-src - required media path (.jpg, .jpeg, .png, .webp) or video (.mp4)
- data-width - video or image width in px.
- data-height - video or image height in px.
Lightbox item parameters
- data-rl-src - supported lightbox sources: mp4, mp3, YouTube (use the YouTube video URL), Vimeo (use the Vimeo video URL), HLS, Google Drive and other cloud formats, iframe (use the page URL), HTML content (use the element ID, e.g.,
#myId), Google Maps (use the Google Maps embed URL), PDF (use a.pdfURL). If you want no action when the item is clicked, set this to none. To open a new page when the center/front item is clicked, set this to the page URL and prefix it withlink:(for example, link:https://your-page.com). To open it in the same window, set data-rl-target to _self; to open it in a new page, set it to _blank. - data-rl-poster-src - optional poster. This holds the poster src, the supported formats are .jpg, .jpeg and .png, the poster.
- data-rl-subtitle-src - optional subtitle for video. The sbutitle format has to be srt/vtt, a subtitle file example can be found in the media/subtitles folder.
- data-rl-vast-src - optional VAST/IMA URL.
Grid item and lightbox caption
To add a thumbnail caption, just add a <div> with a data-caption attribute. For a lightbox caption, add a <div> with a data-rl-caption attribute, as shown above in the template example. The classes can be styled with CSS in the global.css file.
<div data-caption="">
<div class="fwdfg caption">Private/Protected Video</div>
</div>
<div data-rl-caption="">
<p class="fwdrl-title">Private/Protected Video With Thumbnails Preview</p>
<p class="fwdrl-desc">Private/password protected videos with auto-generated thumbnails preview, test password is <strong>Meli</strong>.</p>
</div>
Settings
Shader Grid has many options that allows to customize it's features. They are added directly in the grid constructor as it can be seen in the installation section.
Example
<script type="text/javascript">
if(document.readyState == 'complete'){
fwdSetupGrids();
}else{
document.addEventListener('DOMContentLoaded', ()=>{
fwdSetupGrids();
});
}
function fwdSetupGrids(){
new FWDSG({
// Main settings.
instance: 'fwdsg0',
displayType: 'responsive',
parentId: 'myDiv',
gridDataId: 'gridData',
etc...
})
}
</script>
instance
Type: (String) - default: unset
The grid instance name, this is used to call the API. In the examples files the instance name is set to fwdsg0, if you are using multiplegrids instances just change the instance to fwdsg1, fwdsg2, fwdsg3, etc...
displayType
Type: (String) - default: responsive
Grid display type.
- responsive - displays the grid in responsive type based on the maxWidth and maxHeight settings.
- afterparent - displays the grid based on the parent width and height.
parentId
Type: (String) - default: unset
The grid holder/div ID, please make sure that this has an unique ID, it can be added anywhere in your page.
gridDataId
Type: (String) - default: unset
The grid gallery data div ID, please read the grid gallery section for more info.
textDataId
Type: (String) - default: unset
The grid gallery captiontext div ID, please read the grid gallery section for more info, add any HTML here and format it in the global.css file.
initializeWhenVisible
Type: (String) - default: yes
This can be yes or no, lazy scrolling / loading, the posibility to initialize SS on scroll when the product is visible in the page, this way for example if the product is in a section of a page that is not visible it will not be initialized, instead SS will be initalized only when the user is scrolling to that section in which SS is added.
maxWidth
Type: (Number) - default: 1920
The grid maximum width in px.
maxHeight
Type: (Number) - default: 800
The grid maximum height in px.
autoScale
Type: (String) - default: yes
This can be yes or no and applies if the displayType is reponsive. If set to yes thisgrid height will always be proportional to The grid width, if set to no the height will be fixed based on the maxHeight property.
stopScrollingForPx
Type: (Number) - default: 0
This can be a number starting from zero. It represents the number of pixels to add vertically to keep the grid sticky while scrolling. Please note that this option will only work correctly if the grid height matches the browser viewport height
paralax
Type: (String) - default: yes
This can be yes or no, enable paralax.
antialias
Type: (String) - default: yes
This can be yes or no, ads post-processing antialiasing. this is barely noticeable but it dose make a visual difference.
stats
Type: (String) - default: yes
This can be yes or no, show the stats, frame rate/memory.
gui
Type: (String) - default: yes
This can be yes or no, show the live settings.
showPreloader
Type: (String) - default: yes
This can be yes or no, show the preloader.
preloaderColor
Type: (String) - default: #FFFFFF
This can be yes or no, the preloader color.
backgroundColor
Type: (String) - default: #000000
This main background color, if you want to use a transparent color please make sure to se the useUnrealBloomPass to no.
planeSize
Type: (Number) - default: 6
This parameter accepts a float value from 0 to n. Please note that since the grid operates in three-dimensional space, pixels cannot be used—instead, units are employed. You may need to adjust this value until the images appear as desired.
planeGap
Type: (Number) - default: 6
This parameter accepts a float value from 0 to n. The gap between images, the same metrix apply as for the planeSize
showMaskGradient
Type: (String) - default: yes
This can be yes or no, show a bottom gradient mask.
useCaption
Type: (String) - default: yes
This can be yes or no, set this to no if you don't want to use a caption.
captionBackgroundColor
Type: (String) - default: captionBackgroundColor
The caption background color.
blackAndWhiteFadeDistance
Type: (Number) - default: 0
This is how far in px from the center the images are with color, thik of this as radius color in px.
snap
Type: (String) - default: yes
This can be yes or no, snaps the grid to the colosest center image.
showMouseScrollIcon
Type: (String) - default: no
This can be yes or no, show or not the mouse scroll icon.
autoScrollHorizontal
Type: (String) - default: no
This can be yes or no, ads horizontal autoscroll.
autoScrollVertical
Type: (String) - default: no
This can be yes or no, ads vertical autoscroll
autoScrollSpeed
Type: (Number) - default: 1.5
The autoscroll speed strength.
hoverScale
Type: (Number) - default: 1.1
The hover scale, 1 is the default scale.
scrollSpeedStrength
Type: (Number) - default: 0.5
The drag scroll strength.
scrollDragDirection
Type: (String) - default: both
Limit drag direction, it can be both, horizontal, vertical.
tiltType
Type: (String) - default: none
Tilt rotation, it can be right, left, top and bottom.
waveFrequency
Type: (Number) - default: 0.1
The post-porocessing wave frequency.
waveAmplitude
Type: (Number) - default: 0.02
The post-porocessing wave amplitude.
waveRgbShiftStrength
Type: (Number) - default: 0
The post-porocessing wave RGB shift strength.
flowmapRGBShift
Type: (String) - default: yes
This can be yes or no, enables flowmap RGB shift.
flowmapRGBShiftAmount
Type: (Number) - default: 0.005
The RGB shift amount used by the flowmap post-processing pass.
flowmapRGBShiftStrength
Type: (Number) - default: 1
The RGB shift strength multiplier for the flowmap pass.
flowmapStrength
Type: (Number) - default: 1
The overall flowmap displacement strength.
flowmapRadius
Type: (Number) - default: 0.1
The flowmap brush radius.
flowmapSensitivity
Type: (Number) - default: 1
Controls how quickly the flowmap radius grows with mouse speed.
flowmapForce
Type: (Number) - default: 4.4
The flowmap force injected into the velocity field.
flowmapFalloff
Type: (Number) - default: 1.8
The flowmap brush falloff (edge softness/sharpness).
glitch
Type: (String) - default: yes
This can be yes or no, ads post-porocessing glitch.
buldgeType
Type: (String) - default: yes
This can be pointerDown, pointerDown or fixed, the post-porocessing buldge type.
buldgeRGBStrength
Type: (Number) - default: 1
The post-porocessing buldge post-processing strength.
addrippleDistortionRGBDistortion
Type: (String) - default: yes
This can be yes or no, ads post-processing ripple.
rippleDistortionStrength
Type: (Number) - default: 0.2
The post-porocessing ripple strength.
rippleDistortionSize
Type: (Number) - default: 0.5
The post-porocessing ripple size.
addRGBDistortion
Type: (String) - default: yes
This can be yes or no, ads RGB (red, green and blue) mouse distortion.
grid
Type: (String) - default: yes
This can be yes or no, ads grid post-porocessing effect.
gridAddRGBDistortion
Type: (String) - default: yes
This can be yes or no, ads grid post-porocessing RGB shift.
gridSize
Type: (Number) - default: 24
The grid mouse distortion gird size.
gridMouseRadiusFactor
Type: (Number) - default: 0.2
A number from 0 to 1, the grid mouse distortion radius factor.
gridMouseStrengthFactor
Type: (Number) - default: 1
A number from 0 to 2, the grid mouse distortion strength factor.
gridMouseRelaxation
Type: (Number) - default: 0.9
A number from 0 to 1. This value determines how quickly the grid squares return to their original positions. The higher the number, the slower the squares will move back into place.
afterImage
Type: (String) - default: yes
This can be yes or no, ads grid post-porocessing after image.
afterImageDumping
Type: (Number) - default: 0.75
Grid post-porocessing after image strength.
rlPath
Type: (String) - default: content/rl
The lightbox folder path. The lightbox is loaded asynchronously at run time, and this path can be either relative or absolute.
useLightbox
Type: (String) - default: yes
This can be yes or no, loads the lightbox, set it to no if you don't use the lightbox.
rlUseDeepLinking
Type: (String) - default: yes
This can be yes or no, creates an unique and shareable link and history entry for the current opened media lightbox item.
rlItemBackgroundColor
Type: (String) - default: #212121
Background color for the lightbox items.
rlDefaultItemWidth
Type: (Number) - default: 1527
The default global lightbox item width in px if its Iframe, video or HTML content.
rlDefaultItemHeight
Type: (Number) - default: 1527
The default global lightbox item height in px if its Iframe, video or HTML content.
rlItemOffsetHeight
Type: (Number) - default: 37
Offset/gap in px for the lightbox items when buttons are aligned in or out.
rlItemOffsetHeightButtonsTop
Type: (Number) - default: 47
Offset/gap in px for the lightbox items when buttons are aligned top.
rlItemBorderSize
Type: (Number) - default: 0
Lightbox item border size in px.
rlItemBorderColor
Type: (String) - default: #FFFFFF
Lightbox item border color.
rlMaxZoom
Type: (Number) - default: 1.2
The zoom factor for the lightbox item if it is an image and it is zoomed in. For example to zoom the image 150% set this option to 1.5.
rlPreloaderBkColor
Type: (String) - default: #2e2e2e
The lightbox preloader circular animation background color.
rlPreloaderFillColor
Type: (String) - default: #FFFFFF
The lightbox preloader circular animation fill color.
rlButtonsAlignment
Type: (String) - default: in
This can be in, out and top the lightbox button alignment.
rlButtonsHideDelay
Type: (Number) - default: 5
Duration in seconds until the lightbox buttons will hide after several seconds of user inactivity.
rlMediaLazyLoading
Type: (String) - default: yes
This can be yes or no, loads the lightbox images and video posters in the background this way the user does not have to wait to load an image or a poster while navigating the lightbox gallery.
rlUseDrag
Type: (String) - default: yes
This can be yes or no, drag the lightbox media item to navigate to the next or previous slide.
rlUseAsModal
Type: (String) - default: no
This can be yes or no, close the lightbox only if the close button is used.
rlShowSlideShowButton
Type: (String) - default: yes
This can be yes or no, show the lightbox slideshow play/pause button.
rlShowSlideShowAnimation
Type: (String) - default: yes
This can be yes or no, show the lightbox slideshow circular animation.
rlSlideShowAutoPlay
Type: (String) - default: no
This can be yes or no, the lightbox will start the slideshow as soon as the first media item is showed.
rlSlideShowAutoStop
Type: (String) - default: no
This can be yes or no, the lightbox will stop the slideshow when the last media item is displayed.
rlSlideShowDelay
Type: (Number) - default: 6
The lightbox slideshow delay in seconds, floats are accepted as well for example 6.5 seconds.
rlSlideShowBkColor
Type: (String) - default: #2e2e2e
The lightbox slideshow circular animation background color.
rlSlideShowFillColor
Type: (String) - default: #FFFFFF
The lightbox slideshow circular animation fill color
rlUseKeyboard
Type: (String) - default: yes
This can be yes or no, add keyboard support. ESC: close lightbox, LEFT & RIGHT ARROWS: skip video 10 seconds forward or backward if video playing or change slides if the video is not playing, F: video fullscreen/normalscreen.
rlUseDoubleClick
Type: (String) - default: yes
This can be yes or no, use double click or double tap to maximize and minimize the lightbox item if it's an image.
rlShowCloseButton
Type: (String) - default: yes
This can be yes or no, show the lightbox close button.
rlShowFullscreenButton
Type: (String) - default: yes
This can be yes or no, show the lightbox fullscreen button.
rlShowZoomButton
Type: (String) - default: yes
This can be yes or no, show the lightbox zoom in and zoom out button.
rlShowCounter
Type: (String) - default: yes
This can be yes or no, show the lightbox counter (item current number and total number of items).
rlShowNextAndPrevBtns
Type: (String) - default: yes
This can be yes or no, show the next and previous lightbox item button.
rlSpaceBetweenBtns
Type: (Number) - default: 5
Space/gap in px between lightbox buttons.
rlButtonsOffsetIn
Type: (Number) - default: 10
Space/gap between the buttons and the lightbox item.
rlButtonsOffsetOut
Type: (Number) - default: 10
Space/gap between the buttons and the and window left or right side.
rlBackgroundColor
Type: (String) - default: rgba(0,0,0,.99)
Main lightbox background RGBA color.
rlShareButtons
Type: (String) - default: ['facebook', 'twitter', 'linkedin', 'tumblr', 'pinterest', 'reddit', 'buffer', 'digg','blogger']
Lightbox share button and share buttons window. Set the order as you want and remove the ones that you don't need. If you don't want to use the share button leave this option empty shareButtons:[].
rlShareText
Type: (String) - default: Share on
The lihgtbox share window text.
rlSharedURL
Type: (String) - default: deeplink
This can be deeplink, page and media, the URL used to share the current showed lightbox item.
rlShareMainBackgroundColor
Type: (String) - default: rgba(0,0,0,.4)
The lightbox main share window background RGBA color.
rlShareBackgroundColor
Type: (String) - default: #FFFFFF
The lightbox small share window background color.
rlShowThumbnails
Type: (String) - default: yes
This can be yes or no, show the lightbox thumbnails.
rlShowThumbnailsIcon
Type: (String) - default: yes
This can be yes or no, show the lightbox thumbnails play icon for the videos.
rlThumbnailsHeight
Type: (Number) - default: 80
The lightbox thumbnails height in px, the width is set automatically to keep a correct image ratio.
rlThumbnailsOverlayColor
Type: (String) - default: rgba(0,0,0,.4)
The lightbox thumbnails transparent overlay RGBA color.
rlThumbnailsBorderSize
Type: (Number) - default: 2
The lightbox thumbnails boder size in px.
rlThumbnailsBorderColor
Type: (Number) - default: #FFFFFF
The lightbox thumbnails border color.
rlSpaceBetweenThumbnailsAndItem
Type: (Number) - default: 10
The lightbox space/gap in px between the thumbnails and the item.
rlThumbnailsOffsetBottom
Type: (Number) - default: 10
The space/gap in px between thumbnails and the lightbox bottom part.
rlSpaceBetweenThumbnails
Type: (Number) - default: 5
The lightbox space/gap in px between thumbnails.
rlShowCaption
Type: (String) - default: yes
This can be yes or no, show the lightbox caption.
rlCaptionPosition
Type: (String) - default: yes
This can be bottomout, bottomin or topin, the caption position.
rlShowCaptionOnSmallScreens
Type: (String) - default: no
This can be yes or no, show the lightbox caption on small screens if the lightbox height is smaller than 220px.
rlCaptionAnimationType
Type: (String) - default: motion
This can be motion or opacity, the lightbox caption animation type.
rlUseVideo
Type: (String) - default: yes
This can be yes or no, enable video support inside the lightbox, please make sure to set this to no if you are not using video.
rlFillEntireScreenWithPoster
Type: (String) - default: yes
This can be yes or no, fill the video screen poster to cover the entire video screen viewport.
rlVolume
Type: (Number) - default: 1
The lightbox video/audio start volume.
rlVideoAutoPlay
Type: (String) - default: no
This can be yes or no, the lightbox video/audio autoplay for the first lightbox item when it is showed first time.
rlNextVideoAutoPlay
Type: (String) - default: no
This can be yes or no, the lightbox video/audio autoplay for the next or previous item, when the lightbox is changed/navigating to a different item.
rlVideoAutoPlayText
Type: (String) - default: Click to unmute
Lihgtox video autoplay unmute button text. In some cases, the video can't autoplay with sound, for this cases an unmute button will appear with the text set in this option.
rlShowLogo
Type: (String) - default: yes
This can be yes or no, show the lightbox video/audio logo.
rlLogoPath
Type: (String) - default: content/rl/content/evp/skin/logo.png
The lihgtbox video/audio logo path, the supported formats are .jpg, .jpeg, .png.
rlLogoLink
Type: (String) - default:
The page URL to open when the video/audio logo is clicked, if you don't want this option leave it black.
rlShowDefaultControllerForVimeo
Type: (String) - default: yes
This can be yes or no, use the player controller instead of the default Vimeo controller.
rlShowScrubberWhenControllerIsHidden
Type: (String) - default: yes
This can be yes or no, show the lightbox video/audio main scrubber when the controller is hidden.
rlShowRewindButton
Type: (String) - default: yes
This can be yes or no, show the lightbox video/audio rewind button.
rlShowVolumeButton
Type: (String) - default: yes
This can be yes or no, show the lightbox video/audio volume button.
rlShowChromecastButton
Type: (String) - default: yes
This can be yes or no, show the lightbox video/audio chromecast button.
rlShowPlaybackRateButton
Type: (String) - default: yes
This can be yes or no, show the lightbox video/audio playbackrate speed button.
rlShowQualityButton
Type: (String) - default: yes
This can be yes or no, show the lightbox video/audio quality button.
rlShowFullScreenButton
Type: (String) - default: yes
This can be yes or no, show the lightbox video/audio fullscreen button.
rlShowScrubberToolTipLabel
Type: (String) - default: yes
This can be yes or no, show the lightbox video/audio scrubber tooltip label.
rlShowTime
Type: (String) - default: yes
This can be yes or no, show the lightbox video/audio current and total time.
rlTimeColor
Type: (String) - default: #B9B9B9
The lihgtbox video/audio current and total time HEX color.
rlYoutubeQualityButtonNormalColor
Type: (String) - default: #B9B9B9
The lihgtbox Youtube quality button text normal color.
rlYoutubeQualityButtonSelectedColor
Type: (String) - default: #B9B9B9
The lihgtbox Youtube quality button text selected color.
rlScrubbersToolTipLabelBackgroundColor
Type: (String) - default: #FFFFFF
The lihgtbox video and volume scrubbers tooltips background color.
rlAudioVisualizerLinesColor
Type: (String) - default: #D60E63
The lihgtbox audio visualizer lines color.
rlAudioVisualizerCircleColor
Type: (String) - default: #FFFFFF
The lihgtbox audio visualizer circle color.
rlThumbnailsPreviewBackgroundColor
Type: (String) - default: #2e2e2e
The lightbox thumbnails preview background color.
rlThumbnailsPreviewBorderColor
Type: (String) - default: #414141
The lightbox thumbnails preview border color.
rlThumbnailsPreviewLabelBackgroundColor
Type: (String) - default: #CCCCCC
The lightbox thumbnails preview label background color.
rlSkipToVideoText
Type: (String) - default: You can skip to video in:
The lightbox advertisement skip text.
rlSkipToVideoButtonText
Type: (String) - default: Skip Ad
The lightbox advertisement skip to video button text.
Methods
Methods are functions that can be called via the API to execute certain actions.
JavaScript methods look like fwdsg0.methodName( /* arguments */ ), please note that fwdsg0 is the grid instance name, if you are using multiplegrids don't forget to set the instance unique for each instance like this fwdsg1, fwdsg2, fwdsg3, etc... depending on how manygrids are added.
destroy
.destroy():Void
Destory the grid instance and remove it from DOM.
Events
Shader Grid has many events, they are added via the addEventListener method add accessed via the instance name.
The events must be registered when the API is ready.
// API.
let fwdsgAPI = setInterval(() =>{
if(window['fwdsg0']){
console.log('SC API ready')
clearInterval(fwdsgAPI);
// Register the LIKE event.
fwdsg0.addEventListener(FWDSG.CLICK, onClick);
}
}, 100);
// Listen for the LIKE event.
function onClick(e){
console.log(e)
}
FWDSG.CLICK
FWDSG.CLICK
Dispatched when the a grid image is clicked, it also has a parameter associated called e that contains data about the clicked image like, id, src etc...
Notes
Ever since the early days of Adobe Flash, I've envisioned a grid that would let me bend and manipulate pixels at my will. Today, I'm thrilled to say that this dream has finally been fulfilled.
For me this is more than a job, it is my passion, I love to create innovative tools that my clients can benefit from. @Tibi - FWD.
For support and customizations please write to me directly at this email.
