lightGallery
beckorz edited this page Apr 23, 2024
·
1 revision
let g:previm_extra_libraries = [
\ {
\ 'name': 'lightgallery',
\ 'files': [
\ {
\ 'type': 'css',
\ 'path': '_/css/extra/lightgallery-bundle.min.css',
\ 'url': 'https://raw.githubusercontent.com/sachinchoolur/lightGallery/master/dist/css/lightgallery-bundle.min.css',
\ },
\ {
\ 'type': 'image',
\ 'path': '_/css/images/loading.gif',
\ 'url': 'https://raw.githubusercontent.com/sachinchoolur/lightGallery/master/dist/images/loading.gif',
\ },
\ {
\ 'type': 'font',
\ 'path': '_/css/fonts/lg.woff',
\ 'url': 'https://raw.githubusercontent.com/sachinchoolur/lightGallery/master/dist/fonts/lg.woff',
\ },
\ {
\ 'type': 'font',
\ 'path': '_/css/fonts/lg.woff2',
\ 'url': 'https://raw.githubusercontent.com/sachinchoolur/lightGallery/master/dist/fonts/lg.woff2',
\ },
\ {
\ 'type': 'js',
\ 'path': '_/js/extra/lightgallery.min.js',
\ 'url': 'https://raw.githubusercontent.com/sachinchoolur/lightGallery/master/dist/lightgallery.min.js',
\ 'code': [
\ 'var i;',
\ 'for (i = 0; i < _doc.images.length; i++) {',
\ ' var elem = _doc.images[i];',
\ ' elem.setAttribute(''class'', ''lightGallery-img''); // add Style Sheet Class',
\ ' elem.outerHTML = ''<div class="lightgallery-default" data-src="''+elem.src+''"><a href="" title="''+elem.alt+''">''+elem.outerHTML+''</a></div>''; // insert Before a tag',
\ ' _doc.images[i].parentNode.setAttribute(''href'', elem.src); // copy src to parent a tag href',
\ ' // clean up',
\ ' elem = null;',
\ '}',
\ 'lightGallery(document.getElementById(''preview''), { ',
\ ' plugins: [lgZoom], ',
\ ' selector: ''.lightgallery-default'', ',
\ ' });',
\ ],
\ },
\ {
\ 'type': 'js',
\ 'path': '_/js/extra/plugins/thumbnail/lg-thumbnail.min.js',
\ 'url': 'https://raw.githubusercontent.com/sachinchoolur/lightGallery/master/dist/plugins/thumbnail/lg-thumbnail.min.js',
\ },
\ {
\ 'type': 'js',
\ 'path': '_/js/extra/plugins/thumbnail/lg-zoom.min.js',
\ 'url': 'https://raw.githubusercontent.com/sachinchoolur/lightGallery/master/dist/plugins/zoom/lg-zoom.min.js',
\ },
\ {
\ 'type': 'css',
\ 'style': [
\ '/* lightGallery */',
\ '@media screen, print {',
\ ' .lightgallery-default {',
\ ' display: inline;',
\ ' }',
\ ' .lightGallery-img {',
\ ' max-width: 50%;',
\ ' padding: 4px;',
\ ' border: 1px solid #cccccc;',
\ ' margin: 30px;',
\ ' -webkit-box-shadow: 1px 2px 40px rgba(0,0,0,.5);',
\ ' -moz-box-shadow: 1px 2px 40px rgba(0,0,0,.5);',
\ ' box-shadow: 1px 2px 40px rgba(0,0,0,.5);',
\ ' }',
\ '}',
\ '@media screen {',
\ ' .lightGallery-img {',
\ ' max-width: 50%;',
\ ' }',
\ '}',
\ '@media print {',
\ ' .lightGallery-img {',
\ ' max-width: 70%;',
\ ' }',
\ '}',
\ ],
\ },
\ ],
\ },
\]