mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
upLG
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
export interface MediumZoomSettings {
|
||||
/**
|
||||
* Enable/Disable medium like zoom experience
|
||||
*/
|
||||
mediumZoom: boolean;
|
||||
/**
|
||||
* Space between the gallery outer area and images
|
||||
*/
|
||||
margin: number;
|
||||
/**
|
||||
* Background color for the gallery
|
||||
* This can be overwritten by passing background color via `lg-background-color` for each item
|
||||
*/
|
||||
backgroundColor: string;
|
||||
}
|
||||
export declare const mediumZoomSettings: MediumZoomSettings;
|
||||
@@ -0,0 +1,12 @@
|
||||
import { LgQuery } from '../../lgQuery';
|
||||
import { LightGallery } from '../../lightgallery';
|
||||
import { MediumZoomSettings } from './lg-medium-zoom-settings';
|
||||
export default class MediumZoom {
|
||||
core: LightGallery;
|
||||
settings: MediumZoomSettings;
|
||||
private $LG;
|
||||
constructor(instance: LightGallery, $LG: LgQuery);
|
||||
private toggleItemClass;
|
||||
init(): void;
|
||||
destroy(): void;
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
/*!
|
||||
* lightgallery | 2.9.0 | October 1st 2025
|
||||
* http://www.lightgalleryjs.com/
|
||||
* Copyright (c) 2020 Sachin Neravath;
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
|
||||
var __assign = function() {
|
||||
__assign = Object.assign || function __assign(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
|
||||
/**
|
||||
* List of lightGallery events
|
||||
* All events should be documented here
|
||||
* Below interfaces are used to build the website documentations
|
||||
* */
|
||||
var lGEvents = {
|
||||
afterAppendSlide: 'lgAfterAppendSlide',
|
||||
init: 'lgInit',
|
||||
hasVideo: 'lgHasVideo',
|
||||
containerResize: 'lgContainerResize',
|
||||
updateSlides: 'lgUpdateSlides',
|
||||
afterAppendSubHtml: 'lgAfterAppendSubHtml',
|
||||
beforeOpen: 'lgBeforeOpen',
|
||||
afterOpen: 'lgAfterOpen',
|
||||
slideItemLoad: 'lgSlideItemLoad',
|
||||
beforeSlide: 'lgBeforeSlide',
|
||||
afterSlide: 'lgAfterSlide',
|
||||
posterClick: 'lgPosterClick',
|
||||
dragStart: 'lgDragStart',
|
||||
dragMove: 'lgDragMove',
|
||||
dragEnd: 'lgDragEnd',
|
||||
beforeNextSlide: 'lgBeforeNextSlide',
|
||||
beforePrevSlide: 'lgBeforePrevSlide',
|
||||
beforeClose: 'lgBeforeClose',
|
||||
afterClose: 'lgAfterClose',
|
||||
rotateLeft: 'lgRotateLeft',
|
||||
rotateRight: 'lgRotateRight',
|
||||
flipHorizontal: 'lgFlipHorizontal',
|
||||
flipVertical: 'lgFlipVertical',
|
||||
autoplay: 'lgAutoplay',
|
||||
autoplayStart: 'lgAutoplayStart',
|
||||
autoplayStop: 'lgAutoplayStop',
|
||||
};
|
||||
|
||||
var mediumZoomSettings = {
|
||||
margin: 40,
|
||||
mediumZoom: true,
|
||||
backgroundColor: '#000',
|
||||
};
|
||||
|
||||
var MediumZoom = /** @class */ (function () {
|
||||
function MediumZoom(instance, $LG) {
|
||||
var _this = this;
|
||||
// get lightGallery core plugin instance
|
||||
this.core = instance;
|
||||
this.$LG = $LG;
|
||||
// Set margin
|
||||
this.core.getMediaContainerPosition = function () {
|
||||
return {
|
||||
top: _this.settings.margin,
|
||||
bottom: _this.settings.margin,
|
||||
};
|
||||
};
|
||||
// Override some of lightGallery default settings
|
||||
var defaultSettings = {
|
||||
controls: false,
|
||||
download: false,
|
||||
counter: false,
|
||||
showCloseIcon: false,
|
||||
extraProps: ['lgBackgroundColor'],
|
||||
closeOnTap: false,
|
||||
enableSwipe: false,
|
||||
enableDrag: false,
|
||||
swipeToClose: false,
|
||||
addClass: this.core.settings.addClass + ' lg-medium-zoom',
|
||||
};
|
||||
this.core.settings = __assign(__assign({}, this.core.settings), defaultSettings);
|
||||
// extend module default settings with lightGallery core settings
|
||||
this.settings = __assign(__assign(__assign({}, mediumZoomSettings), this.core.settings), defaultSettings);
|
||||
return this;
|
||||
}
|
||||
MediumZoom.prototype.toggleItemClass = function () {
|
||||
for (var index = 0; index < this.core.items.length; index++) {
|
||||
var $element = this.$LG(this.core.items[index]);
|
||||
$element.toggleClass('lg-medium-zoom-item');
|
||||
}
|
||||
};
|
||||
MediumZoom.prototype.init = function () {
|
||||
var _this = this;
|
||||
if (!this.settings.mediumZoom) {
|
||||
return;
|
||||
}
|
||||
this.core.LGel.on(lGEvents.beforeOpen + ".medium", function () {
|
||||
_this.core.$backdrop.css('background-color', _this.core.galleryItems[_this.core.index].lgBackgroundColor ||
|
||||
_this.settings.backgroundColor);
|
||||
});
|
||||
this.toggleItemClass();
|
||||
this.core.outer.on('click.lg.medium', function () {
|
||||
_this.core.closeGallery();
|
||||
});
|
||||
};
|
||||
MediumZoom.prototype.destroy = function () {
|
||||
this.toggleItemClass();
|
||||
};
|
||||
return MediumZoom;
|
||||
}());
|
||||
|
||||
export default MediumZoom;
|
||||
//# sourceMappingURL=lg-medium-zoom.es5.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* lightgallery | 2.9.0 | October 1st 2025
|
||||
* http://www.lightgalleryjs.com/
|
||||
* Copyright (c) 2020 Sachin Neravath;
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
!function(o,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(o="undefined"!=typeof globalThis?globalThis:o||self).lgMediumZoom=t()}(this,(function(){"use strict";var o=function(){return(o=Object.assign||function(o){for(var t,e=1,i=arguments.length;e<i;e++)for(var n in t=arguments[e])Object.prototype.hasOwnProperty.call(t,n)&&(o[n]=t[n]);return o}).apply(this,arguments)},t="lgBeforeOpen",e={margin:40,mediumZoom:!0,backgroundColor:"#000"};return function(){function i(t,i){var n=this;this.core=t,this.$LG=i,this.core.getMediaContainerPosition=function(){return{top:n.settings.margin,bottom:n.settings.margin}};var s={controls:!1,download:!1,counter:!1,showCloseIcon:!1,extraProps:["lgBackgroundColor"],closeOnTap:!1,enableSwipe:!1,enableDrag:!1,swipeToClose:!1,addClass:this.core.settings.addClass+" lg-medium-zoom"};return this.core.settings=o(o({},this.core.settings),s),this.settings=o(o(o({},e),this.core.settings),s),this}return i.prototype.toggleItemClass=function(){for(var o=0;o<this.core.items.length;o++){this.$LG(this.core.items[o]).toggleClass("lg-medium-zoom-item")}},i.prototype.init=function(){var o=this;this.settings.mediumZoom&&(this.core.LGel.on(t+".medium",(function(){o.core.$backdrop.css("background-color",o.core.galleryItems[o.core.index].lgBackgroundColor||o.settings.backgroundColor)})),this.toggleItemClass(),this.core.outer.on("click.lg.medium",(function(){o.core.closeGallery()})))},i.prototype.destroy=function(){this.toggleItemClass()},i}()}));
|
||||
@@ -0,0 +1,140 @@
|
||||
/*!
|
||||
* lightgallery | 2.9.0 | October 1st 2025
|
||||
* http://www.lightgalleryjs.com/
|
||||
* Copyright (c) 2020 Sachin Neravath;
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.lgMediumZoom = factory());
|
||||
}(this, (function () { 'use strict';
|
||||
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
|
||||
var __assign = function() {
|
||||
__assign = Object.assign || function __assign(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
|
||||
/**
|
||||
* List of lightGallery events
|
||||
* All events should be documented here
|
||||
* Below interfaces are used to build the website documentations
|
||||
* */
|
||||
var lGEvents = {
|
||||
afterAppendSlide: 'lgAfterAppendSlide',
|
||||
init: 'lgInit',
|
||||
hasVideo: 'lgHasVideo',
|
||||
containerResize: 'lgContainerResize',
|
||||
updateSlides: 'lgUpdateSlides',
|
||||
afterAppendSubHtml: 'lgAfterAppendSubHtml',
|
||||
beforeOpen: 'lgBeforeOpen',
|
||||
afterOpen: 'lgAfterOpen',
|
||||
slideItemLoad: 'lgSlideItemLoad',
|
||||
beforeSlide: 'lgBeforeSlide',
|
||||
afterSlide: 'lgAfterSlide',
|
||||
posterClick: 'lgPosterClick',
|
||||
dragStart: 'lgDragStart',
|
||||
dragMove: 'lgDragMove',
|
||||
dragEnd: 'lgDragEnd',
|
||||
beforeNextSlide: 'lgBeforeNextSlide',
|
||||
beforePrevSlide: 'lgBeforePrevSlide',
|
||||
beforeClose: 'lgBeforeClose',
|
||||
afterClose: 'lgAfterClose',
|
||||
rotateLeft: 'lgRotateLeft',
|
||||
rotateRight: 'lgRotateRight',
|
||||
flipHorizontal: 'lgFlipHorizontal',
|
||||
flipVertical: 'lgFlipVertical',
|
||||
autoplay: 'lgAutoplay',
|
||||
autoplayStart: 'lgAutoplayStart',
|
||||
autoplayStop: 'lgAutoplayStop',
|
||||
};
|
||||
|
||||
var mediumZoomSettings = {
|
||||
margin: 40,
|
||||
mediumZoom: true,
|
||||
backgroundColor: '#000',
|
||||
};
|
||||
|
||||
var MediumZoom = /** @class */ (function () {
|
||||
function MediumZoom(instance, $LG) {
|
||||
var _this = this;
|
||||
// get lightGallery core plugin instance
|
||||
this.core = instance;
|
||||
this.$LG = $LG;
|
||||
// Set margin
|
||||
this.core.getMediaContainerPosition = function () {
|
||||
return {
|
||||
top: _this.settings.margin,
|
||||
bottom: _this.settings.margin,
|
||||
};
|
||||
};
|
||||
// Override some of lightGallery default settings
|
||||
var defaultSettings = {
|
||||
controls: false,
|
||||
download: false,
|
||||
counter: false,
|
||||
showCloseIcon: false,
|
||||
extraProps: ['lgBackgroundColor'],
|
||||
closeOnTap: false,
|
||||
enableSwipe: false,
|
||||
enableDrag: false,
|
||||
swipeToClose: false,
|
||||
addClass: this.core.settings.addClass + ' lg-medium-zoom',
|
||||
};
|
||||
this.core.settings = __assign(__assign({}, this.core.settings), defaultSettings);
|
||||
// extend module default settings with lightGallery core settings
|
||||
this.settings = __assign(__assign(__assign({}, mediumZoomSettings), this.core.settings), defaultSettings);
|
||||
return this;
|
||||
}
|
||||
MediumZoom.prototype.toggleItemClass = function () {
|
||||
for (var index = 0; index < this.core.items.length; index++) {
|
||||
var $element = this.$LG(this.core.items[index]);
|
||||
$element.toggleClass('lg-medium-zoom-item');
|
||||
}
|
||||
};
|
||||
MediumZoom.prototype.init = function () {
|
||||
var _this = this;
|
||||
if (!this.settings.mediumZoom) {
|
||||
return;
|
||||
}
|
||||
this.core.LGel.on(lGEvents.beforeOpen + ".medium", function () {
|
||||
_this.core.$backdrop.css('background-color', _this.core.galleryItems[_this.core.index].lgBackgroundColor ||
|
||||
_this.settings.backgroundColor);
|
||||
});
|
||||
this.toggleItemClass();
|
||||
this.core.outer.on('click.lg.medium', function () {
|
||||
_this.core.closeGallery();
|
||||
});
|
||||
};
|
||||
MediumZoom.prototype.destroy = function () {
|
||||
this.toggleItemClass();
|
||||
};
|
||||
return MediumZoom;
|
||||
}());
|
||||
|
||||
return MediumZoom;
|
||||
|
||||
})));
|
||||
//# sourceMappingURL=lg-medium-zoom.umd.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "lightgallery/plugins/mediumZoom",
|
||||
"private": true,
|
||||
"main": "lg-medium-zoom.umd.js",
|
||||
"module": "lg-medium-zoom.es5.js",
|
||||
"typings": "lg-medium-zoom.d.ts"
|
||||
}
|
||||
Reference in New Issue
Block a user