Socket
Socket
Sign inDemoInstall

vue3-carousel-3d

Package Overview
Dependencies
318
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.3 to 1.0.4

850

dist/carousel-3d.es.js

@@ -1,405 +0,8 @@

function normalizeStyle(value) {
if (isArray(value)) {
const res = {};
for (let i = 0; i < value.length; i++) {
const item = value[i];
const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
if (normalized) {
for (const key in normalized) {
res[key] = normalized[key];
}
}
}
return res;
} else if (isString(value)) {
return value;
} else if (isObject(value)) {
return value;
}
}
const listDelimiterRE = /;(?![^(]*\))/g;
const propertyDelimiterRE = /:(.+)/;
function parseStringStyle(cssText) {
const ret = {};
cssText.split(listDelimiterRE).forEach((item) => {
if (item) {
const tmp = item.split(propertyDelimiterRE);
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
}
});
return ret;
}
function normalizeClass(value) {
let res = "";
if (isString(value)) {
res = value;
} else if (isArray(value)) {
for (let i = 0; i < value.length; i++) {
const normalized = normalizeClass(value[i]);
if (normalized) {
res += normalized + " ";
}
}
} else if (isObject(value)) {
for (const name in value) {
if (value[name]) {
res += name + " ";
}
}
}
return res.trim();
}
const EMPTY_ARR = [];
const onRE = /^on[^a-z]/;
const isOn = (key) => onRE.test(key);
const extend = Object.assign;
const isArray = Array.isArray;
const isFunction = (val) => typeof val === "function";
const isString = (val) => typeof val === "string";
const isObject = (val) => val !== null && typeof val === "object";
const cacheStringFunction = (fn) => {
const cache = /* @__PURE__ */ Object.create(null);
return (str) => {
const hit = cache[str];
return hit || (cache[str] = fn(str));
};
};
const camelizeRE = /-(\w)/g;
const camelize = cacheStringFunction((str) => {
return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
});
const capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));
function isReactive(value) {
if (isReadonly(value)) {
return isReactive(value["__v_raw"]);
}
return !!(value && value["__v_isReactive"]);
}
function isReadonly(value) {
return !!(value && value["__v_isReadonly"]);
}
function isProxy(value) {
return isReactive(value) || isReadonly(value);
}
function isRef(r) {
return !!(r && r.__v_isRef === true);
}
let currentRenderingInstance = null;
let currentScopeId = null;
const isSuspense = (type) => type.__isSuspense;
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
const isTeleport = (type) => type.__isTeleport;
const COMPONENTS = "components";
function resolveComponent(name, maybeSelfReference) {
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
}
const NULL_DYNAMIC_COMPONENT = Symbol();
function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
const instance = currentRenderingInstance || currentInstance;
if (instance) {
const Component = instance.type;
if (type === COMPONENTS) {
const selfName = getComponentName(Component);
if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
return Component;
}
}
const res = resolve(instance[type] || Component[type], name) || resolve(instance.appContext[type], name);
if (!res && maybeSelfReference) {
return Component;
}
return res;
}
}
function resolve(registry, name) {
return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
}
const Fragment = Symbol(void 0);
const Text = Symbol(void 0);
const Comment = Symbol(void 0);
const blockStack = [];
let currentBlock = null;
function openBlock(disableTracking = false) {
blockStack.push(currentBlock = disableTracking ? null : []);
}
function closeBlock() {
blockStack.pop();
currentBlock = blockStack[blockStack.length - 1] || null;
}
function setupBlock(vnode) {
vnode.dynamicChildren = currentBlock || EMPTY_ARR;
closeBlock();
if (currentBlock) {
currentBlock.push(vnode);
}
return vnode;
}
function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
return setupBlock(createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, true));
}
function createBlock(type, props, children, patchFlag, dynamicProps) {
return setupBlock(createVNode(type, props, children, patchFlag, dynamicProps, true));
}
function isVNode(value) {
return value ? value.__v_isVNode === true : false;
}
const InternalObjectKey = `__vInternal`;
const normalizeKey = ({ key }) => key != null ? key : null;
const normalizeRef = ({ ref, ref_key, ref_for }) => {
return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
};
function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
const vnode = {
__v_isVNode: true,
__v_skip: true,
type,
props,
key: props && normalizeKey(props),
ref: props && normalizeRef(props),
scopeId: currentScopeId,
slotScopeIds: null,
children,
component: null,
suspense: null,
ssContent: null,
ssFallback: null,
dirs: null,
transition: null,
el: null,
anchor: null,
target: null,
targetAnchor: null,
staticCount: 0,
shapeFlag,
patchFlag,
dynamicProps,
dynamicChildren: null,
appContext: null
};
if (needFullChildrenNormalization) {
normalizeChildren(vnode, children);
if (shapeFlag & 128) {
type.normalize(vnode);
}
} else if (children) {
vnode.shapeFlag |= isString(children) ? 8 : 16;
}
if (!isBlockNode && currentBlock && (vnode.patchFlag > 0 || shapeFlag & 6) && vnode.patchFlag !== 32) {
currentBlock.push(vnode);
}
return vnode;
}
const createVNode = _createVNode;
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
if (!type || type === NULL_DYNAMIC_COMPONENT) {
type = Comment;
}
if (isVNode(type)) {
const cloned = cloneVNode(type, props, true);
if (children) {
normalizeChildren(cloned, children);
}
return cloned;
}
if (isClassComponent(type)) {
type = type.__vccOpts;
}
if (props) {
props = guardReactiveProps(props);
let { class: klass, style } = props;
if (klass && !isString(klass)) {
props.class = normalizeClass(klass);
}
if (isObject(style)) {
if (isProxy(style) && !isArray(style)) {
style = extend({}, style);
}
props.style = normalizeStyle(style);
}
}
const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
return createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, isBlockNode, true);
}
function guardReactiveProps(props) {
if (!props)
return null;
return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
}
function cloneVNode(vnode, extraProps, mergeRef = false) {
const { props, ref, patchFlag, children } = vnode;
const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
const cloned = {
__v_isVNode: true,
__v_skip: true,
type: vnode.type,
props: mergedProps,
key: mergedProps && normalizeKey(mergedProps),
ref: extraProps && extraProps.ref ? mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps) : ref,
scopeId: vnode.scopeId,
slotScopeIds: vnode.slotScopeIds,
children,
target: vnode.target,
targetAnchor: vnode.targetAnchor,
staticCount: vnode.staticCount,
shapeFlag: vnode.shapeFlag,
patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
dynamicProps: vnode.dynamicProps,
dynamicChildren: vnode.dynamicChildren,
appContext: vnode.appContext,
dirs: vnode.dirs,
transition: vnode.transition,
component: vnode.component,
suspense: vnode.suspense,
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
el: vnode.el,
anchor: vnode.anchor
};
return cloned;
}
function createTextVNode(text = " ", flag = 0) {
return createVNode(Text, null, text, flag);
}
function createCommentVNode(text = "", asBlock = false) {
return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
}
function normalizeChildren(vnode, children) {
let type = 0;
const { shapeFlag } = vnode;
if (children == null) {
children = null;
} else if (isArray(children)) {
type = 16;
} else if (typeof children === "object") {
if (shapeFlag & (1 | 64)) {
const slot = children.default;
if (slot) {
slot._c && (slot._d = false);
normalizeChildren(vnode, slot());
slot._c && (slot._d = true);
}
return;
} else {
type = 32;
const slotFlag = children._;
if (!slotFlag && !(InternalObjectKey in children)) {
children._ctx = currentRenderingInstance;
} else if (slotFlag === 3 && currentRenderingInstance) {
if (currentRenderingInstance.slots._ === 1) {
children._ = 1;
} else {
children._ = 2;
vnode.patchFlag |= 1024;
}
}
}
} else if (isFunction(children)) {
children = { default: children, _ctx: currentRenderingInstance };
type = 32;
} else {
children = String(children);
if (shapeFlag & 64) {
type = 16;
children = [createTextVNode(children)];
} else {
type = 8;
}
}
vnode.children = children;
vnode.shapeFlag |= type;
}
function mergeProps(...args) {
const ret = {};
for (let i = 0; i < args.length; i++) {
const toMerge = args[i];
for (const key in toMerge) {
if (key === "class") {
if (ret.class !== toMerge.class) {
ret.class = normalizeClass([ret.class, toMerge.class]);
}
} else if (key === "style") {
ret.style = normalizeStyle([ret.style, toMerge.style]);
} else if (isOn(key)) {
const existing = ret[key];
const incoming = toMerge[key];
if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
ret[key] = existing ? [].concat(existing, incoming) : incoming;
}
} else if (key !== "") {
ret[key] = toMerge[key];
}
}
}
return ret;
}
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) {
return createVNode("slot", name === "default" ? null : { name }, fallback && fallback());
}
let slot = slots[name];
if (slot && slot._c) {
slot._d = false;
}
openBlock();
const validSlotContent = slot && ensureValidVNode(slot(props));
const rendered = createBlock(Fragment, { key: props.key || `_${name}` }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2);
if (!noSlotted && rendered.scopeId) {
rendered.slotScopeIds = [rendered.scopeId + "-s"];
}
if (slot && slot._c) {
slot._d = true;
}
return rendered;
}
function ensureValidVNode(vnodes) {
return vnodes.some((child) => {
if (!isVNode(child))
return true;
if (child.type === Comment)
return false;
if (child.type === Fragment && !ensureValidVNode(child.children))
return false;
return true;
}) ? vnodes : null;
}
let currentInstance = null;
function getComponentName(Component) {
return isFunction(Component) ? Component.displayName || Component.name : Component.name;
}
function isClassComponent(value) {
return isFunction(value) && "__vccOpts" in value;
}
const systemModifiers = ["ctrl", "shift", "alt", "meta"];
const modifierGuards = {
stop: (e) => e.stopPropagation(),
prevent: (e) => e.preventDefault(),
self: (e) => e.target !== e.currentTarget,
ctrl: (e) => !e.ctrlKey,
shift: (e) => !e.shiftKey,
alt: (e) => !e.altKey,
meta: (e) => !e.metaKey,
left: (e) => "button" in e && e.button !== 0,
middle: (e) => "button" in e && e.button !== 1,
right: (e) => "button" in e && e.button !== 2,
exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
};
const withModifiers = (fn, modifiers) => {
return (event, ...args) => {
for (let i = 0; i < modifiers.length; i++) {
const guard = modifierGuards[modifiers[i]];
if (guard && guard(event, modifiers))
return;
}
return fn(event, ...args);
};
};
var Slide_vue_vue_type_style_index_0_lang = "";
var _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props) {
target[key] = val;
}
return target;
};
const _sfc_main$2 = {
import { openBlock as d, createElementBlock as c, normalizeClass as u, normalizeStyle as h, renderSlot as m, createElementVNode as l, withModifiers as f, resolveComponent as v, createBlock as x, createCommentVNode as I } from "vue";
const p = (t, i) => {
const e = t.__vccOpts || t;
for (const [n, s] of i)
e[n] = s;
return e;
}, y = {
name: "Slide",

@@ -423,30 +26,14 @@ props: {

leftIndex() {
if (this.parent.oneDirectional && this.getSideIndex(this.parent.leftIndices) > this.parent.currentIndex - 1)
return -1;
return this.getSideIndex(this.parent.leftIndices);
return this.parent.oneDirectional && this.getSideIndex(this.parent.leftIndices) > this.parent.currentIndex - 1 ? -1 : this.getSideIndex(this.parent.leftIndices);
},
rightIndex() {
if (this.parent.oneDirectional && this.getSideIndex(this.parent.rightIndices) > this.parent.total - this.parent.currentIndex - 2)
return -1;
return this.getSideIndex(this.parent.rightIndices);
return this.parent.oneDirectional && this.getSideIndex(this.parent.rightIndices) > this.parent.total - this.parent.currentIndex - 2 ? -1 : this.getSideIndex(this.parent.rightIndices);
},
slideStyle() {
let styles = {};
let t = {};
if (!this.isCurrent) {
const lIndex = this.leftIndex;
const rIndex = this.rightIndex;
if (rIndex >= 0 || lIndex >= 0) {
styles = rIndex >= 0 ? this.calculatePosition(rIndex, true, this.zIndex) : this.calculatePosition(lIndex, false, this.zIndex);
styles.opacity = 1;
styles.visibility = "visible";
}
if (this.parent.hasHiddenSlides) {
if (this.matchIndex(this.parent.leftOutIndex)) {
styles = this.calculatePosition(this.parent.leftIndices.length - 1, false, this.zIndex);
} else if (this.matchIndex(this.parent.rightOutIndex)) {
styles = this.calculatePosition(this.parent.rightIndices.length - 1, true, this.zIndex);
}
}
const i = this.leftIndex, e = this.rightIndex;
(e >= 0 || i >= 0) && (t = e >= 0 ? this.calculatePosition(e, !0, this.zIndex) : this.calculatePosition(i, !1, this.zIndex), t.opacity = 1, t.visibility = "visible"), this.parent.hasHiddenSlides && (this.matchIndex(this.parent.leftOutIndex) ? t = this.calculatePosition(this.parent.leftIndices.length - 1, !1, this.zIndex) : this.matchIndex(this.parent.rightOutIndex) && (t = this.calculatePosition(this.parent.rightIndices.length - 1, !0, this.zIndex)));
}
return Object.assign(styles, {
return Object.assign(t, {
"border-width": this.parent.border + "px",

@@ -467,34 +54,25 @@ width: this.parent.slideWidth + "px",

methods: {
getSideIndex(array) {
let index2 = -1;
array.forEach((pos, i) => {
if (this.matchIndex(pos)) {
index2 = i;
}
});
return index2;
getSideIndex(t) {
let i = -1;
return t.forEach((e, n) => {
this.matchIndex(e) && (i = n);
}), i;
},
matchIndex(index2) {
return index2 >= 0 ? this.index === index2 : this.parent.total + index2 === this.index;
matchIndex(t) {
return t >= 0 ? this.index === t : this.parent.total + t === this.index;
},
calculatePosition(i, positive, zIndex) {
const z = !this.parent.disable3d ? parseInt(this.parent.inverseScaling) + (i + 1) * 100 : 0;
const y = !this.parent.disable3d ? parseInt(this.parent.perspective) : 0;
const leftRemain = this.parent.space === "auto" ? parseInt((i + 1) * (this.parent.width / 1.5), 10) : parseInt((i + 1) * this.parent.space, 10);
const transform = positive ? "translateX(" + leftRemain + "px) translateZ(-" + z + "px) rotateY(-" + y + "deg)" : "translateX(-" + leftRemain + "px) translateZ(-" + z + "px) rotateY(" + y + "deg)";
const top = this.parent.space === "auto" ? 0 : parseInt((i + 1) * this.parent.space);
calculatePosition(t, i, e) {
const n = this.parent.disable3d ? 0 : parseInt(this.parent.inverseScaling) + (t + 1) * 100, s = this.parent.disable3d ? 0 : parseInt(this.parent.perspective), r = this.parent.space === "auto" ? parseInt((t + 1) * (this.parent.width / 1.5), 10) : parseInt((t + 1) * this.parent.space, 10), a = i ? "translateX(" + r + "px) translateZ(-" + n + "px) rotateY(-" + s + "deg)" : "translateX(-" + r + "px) translateZ(-" + n + "px) rotateY(" + s + "deg)", g = this.parent.space === "auto" ? 0 : parseInt((t + 1) * this.parent.space);
return {
transform,
top,
zIndex: zIndex - (Math.abs(i) + 1)
transform: a,
top: g,
zIndex: e - (Math.abs(t) + 1)
};
},
goTo() {
if (!this.isCurrent) {
if (this.parent.clickable === true) {
this.parent.goFar(this.index);
}
} else {
const { index: index2 } = this;
this.parent.onMainSlideClick({ index: index2 });
if (!this.isCurrent)
this.parent.clickable === !0 && this.parent.goFar(this.index);
else {
const { index: t } = this;
this.parent.onMainSlideClick({ index: t });
}

@@ -504,22 +82,21 @@ }

};
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("div", {
class: normalizeClass(["carousel-3d-slide", $options.computedClasses]),
style: normalizeStyle($options.slideStyle),
onClick: _cache[0] || (_cache[0] = ($event) => $options.goTo())
function S(t, i, e, n, s, r) {
return d(), c("div", {
class: u(["carousel-3d-slide", r.computedClasses]),
style: h(r.slideStyle),
onClick: i[0] || (i[0] = (a) => r.goTo())
}, [
renderSlot(_ctx.$slots, "default", {
index: $props.index,
isCurrent: $options.isCurrent,
leftIndex: $options.leftIndex,
rightIndex: $options.rightIndex
m(t.$slots, "default", {
index: e.index,
isCurrent: r.isCurrent,
leftIndex: r.leftIndex,
rightIndex: r.rightIndex
})
], 6);
}
var Slide = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
const autoplay = {
const b = /* @__PURE__ */ p(y, [["render", S]]), w = {
props: {
autoplay: {
type: Boolean,
default: false
default: !1
},

@@ -532,3 +109,3 @@ autoplayTimeout: {

type: Boolean,
default: true
default: !0
}

@@ -542,32 +119,19 @@ },

destroyed() {
if (!this.process_server) {
this.pauseAutoplay();
this.$el.removeEventListener("mouseenter", this.pauseAutoplay);
this.$el.removeEventListener("mouseleave", this.startAutoplay);
}
this.process_server || (this.pauseAutoplay(), this.$el.removeEventListener("mouseenter", this.pauseAutoplay), this.$el.removeEventListener("mouseleave", this.startAutoplay));
},
methods: {
pauseAutoplay() {
if (this.autoplayInterval) {
this.autoplayInterval = clearInterval(this.autoplayInterval);
}
this.autoplayInterval && (this.autoplayInterval = clearInterval(this.autoplayInterval));
},
startAutoplay() {
if (this.autoplay) {
this.autoplayInterval = setInterval(() => {
this.dir === "ltr" ? this.goPrev() : this.goNext();
}, this.autoplayTimeout);
}
this.autoplay && (this.autoplayInterval = setInterval(() => {
this.dir === "ltr" ? this.goPrev() : this.goNext();
}, this.autoplayTimeout));
}
},
mounted() {
if (!this.process_server && this.autoplayHoverPause) {
this.$el.addEventListener("mouseenter", this.pauseAutoplay);
this.$el.addEventListener("mouseleave", this.startAutoplay);
this.startAutoplay();
}
!this.process_server && this.autoplayHoverPause && (this.$el.addEventListener("mouseenter", this.pauseAutoplay), this.$el.addEventListener("mouseleave", this.startAutoplay), this.startAutoplay());
}
};
var Controls_vue_vue_type_style_index_0_scoped_true_lang = "";
const _sfc_main$1 = {
const _ = {
name: "Controls",

@@ -597,36 +161,31 @@ props: {

}
};
const _hoisted_1 = { class: "carousel-3d-controls" };
const _hoisted_2 = ["innerHTML"];
const _hoisted_3 = ["innerHTML"];
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("div", _hoisted_1, [
createBaseVNode("a", {
}, M = { class: "carousel-3d-controls" }, C = ["innerHTML"], L = ["innerHTML"];
function N(t, i, e, n, s, r) {
return d(), c("div", M, [
l("a", {
href: "#",
class: normalizeClass(["prev", { disabled: !$data.parent.isPrevPossible }]),
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => $data.parent.goPrev(), ["prevent"])),
style: normalizeStyle(`width: ${$props.width}px; height: ${$props.height}px; line-height: ${$props.height}px;`),
class: u(["prev", { disabled: !s.parent.isPrevPossible }]),
onClick: i[0] || (i[0] = f((a) => s.parent.goPrev(), ["prevent"])),
style: h(`width: ${e.width}px; height: ${e.height}px; line-height: ${e.height}px;`),
"aria-label": "Previous slide"
}, [
createBaseVNode("span", { innerHTML: $props.prevHtml }, null, 8, _hoisted_2)
l("span", { innerHTML: e.prevHtml }, null, 8, C)
], 6),
createBaseVNode("a", {
l("a", {
href: "#",
class: normalizeClass(["next", { disabled: !$data.parent.isNextPossible }]),
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => $data.parent.goNext(), ["prevent"])),
style: normalizeStyle(`width: ${$props.width}px; height: ${$props.height}px; line-height: ${$props.height}px;`),
class: u(["next", { disabled: !s.parent.isNextPossible }]),
onClick: i[1] || (i[1] = f((a) => s.parent.goNext(), ["prevent"])),
style: h(`width: ${e.width}px; height: ${e.height}px; line-height: ${e.height}px;`),
"aria-label": "Next slide"
}, [
createBaseVNode("span", { innerHTML: $props.nextHtml }, null, 8, _hoisted_3)
l("span", { innerHTML: e.nextHtml }, null, 8, L)
], 6)
]);
}
var Controls = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-067f74c8"]]);
var Carousel3d_vue_vue_type_style_index_0_scoped_true_lang = "";
const noop = () => {
};
const _sfc_main = {
const $ = /* @__PURE__ */ p(_, [["render", N], ["__scopeId", "data-v-475a7b20"]]);
const o = () => {
}, O = {
name: "Carousel3d",
components: {
Controls
Controls: $
},

@@ -648,3 +207,3 @@ props: {

type: Boolean,
default: true
default: !0
},

@@ -681,7 +240,7 @@ animationSpeed: {

type: Boolean,
default: true
default: !0
},
disable3d: {
type: Boolean,
default: false
default: !1
},

@@ -698,3 +257,3 @@ minSwipeDistance: {

type: Boolean,
default: false
default: !1
},

@@ -719,7 +278,7 @@ controlsPrevHtml: {

type: Function,
default: noop
default: o
},
onSlideChange: {
type: Function,
default: noop
default: o
},

@@ -732,7 +291,7 @@ bias: {

type: Function,
default: noop
default: o
},
oneDirectional: {
type: Boolean,
default: false
default: !1
}

@@ -749,3 +308,3 @@ },

dragStartY: 0,
mousedown: false,
mousedown: !1,
zIndex: 998,

@@ -755,3 +314,3 @@ process_server: typeof window === void 0

},
mixins: [autoplay],
mixins: [w],
watch: {

@@ -776,15 +335,11 @@ count() {

slideWidth() {
const vw = this.viewport;
const sw = parseInt(this.width) + parseInt(this.border, 10) * 2;
return vw < sw && !this.process_server ? vw : sw;
const t = this.viewport, i = parseInt(this.width) + parseInt(this.border, 10) * 2;
return t < i && !this.process_server ? t : i;
},
slideHeight() {
const sw = parseInt(this.width, 10) + parseInt(this.border, 10) * 2;
const sh = parseInt(parseInt(this.height) + this.border * 2, 10);
const ar = this.calculateAspectRatio(sw, sh);
return this.slideWidth / ar;
const t = parseInt(this.width, 10) + parseInt(this.border, 10) * 2, i = parseInt(parseInt(this.height) + this.border * 2, 10), e = this.calculateAspectRatio(t, i);
return this.slideWidth / e;
},
visible() {
const v = this.display > this.total ? this.total : this.display;
return v;
return this.display > this.total ? this.total : this.display;
},

@@ -795,38 +350,24 @@ hasHiddenSlides() {

leftIndices() {
let n = (this.visible - 1) / 2;
n = this.bias.toLowerCase() === "left" ? Math.ceil(n) : Math.floor(n);
const indices = [];
for (let m = 1; m <= n; m++) {
indices.push(this.dir === "ltr" ? (this.currentIndex + m) % this.total : (this.currentIndex - m) % this.total);
}
return indices;
let t = (this.visible - 1) / 2;
t = this.bias.toLowerCase() === "left" ? Math.ceil(t) : Math.floor(t);
const i = [];
for (let e = 1; e <= t; e++)
i.push(this.dir === "ltr" ? (this.currentIndex + e) % this.total : (this.currentIndex - e) % this.total);
return i;
},
rightIndices() {
let n = (this.visible - 1) / 2;
n = this.bias.toLowerCase() === "right" ? Math.ceil(n) : Math.floor(n);
const indices = [];
for (let m = 1; m <= n; m++) {
indices.push(this.dir === "ltr" ? (this.currentIndex - m) % this.total : (this.currentIndex + m) % this.total);
}
return indices;
let t = (this.visible - 1) / 2;
t = this.bias.toLowerCase() === "right" ? Math.ceil(t) : Math.floor(t);
const i = [];
for (let e = 1; e <= t; e++)
i.push(this.dir === "ltr" ? (this.currentIndex - e) % this.total : (this.currentIndex + e) % this.total);
return i;
},
leftOutIndex() {
let n = (this.visible - 1) / 2;
n = this.bias.toLowerCase() === "left" ? Math.ceil(n) : Math.floor(n);
n++;
if (this.dir === "ltr") {
return this.total - this.currentIndex - n <= 0 ? -parseInt(this.total - this.currentIndex - n) : this.currentIndex + n;
} else {
return this.currentIndex - n;
}
let t = (this.visible - 1) / 2;
return t = this.bias.toLowerCase() === "left" ? Math.ceil(t) : Math.floor(t), t++, this.dir === "ltr" ? this.total - this.currentIndex - t <= 0 ? -parseInt(this.total - this.currentIndex - t) : this.currentIndex + t : this.currentIndex - t;
},
rightOutIndex() {
let n = (this.visible - 1) / 2;
n = this.bias.toLowerCase() === "right" ? Math.ceil(n) : Math.floor(n);
n++;
if (this.dir === "ltr") {
return this.currentIndex - n;
} else {
return this.total - this.currentIndex - n <= 0 ? -parseInt(this.total - this.currentIndex - n, 10) : this.currentIndex + n;
}
let t = (this.visible - 1) / 2;
return t = this.bias.toLowerCase() === "right" ? Math.ceil(t) : Math.floor(t), t++, this.dir === "ltr" ? this.currentIndex - t : this.total - this.currentIndex - t <= 0 ? -parseInt(this.total - this.currentIndex - t, 10) : this.currentIndex + t;
}

@@ -836,182 +377,103 @@ },

goNext() {
if (this.isNextPossible) {
this.isLastSlide ? this.goSlide(0) : this.goSlide(this.currentIndex + 1);
}
this.isNextPossible && (this.isLastSlide ? this.goSlide(0) : this.goSlide(this.currentIndex + 1));
},
goPrev() {
if (this.isPrevPossible) {
this.isFirstSlide ? this.goSlide(this.total - 1) : this.goSlide(this.currentIndex - 1);
}
this.isPrevPossible && (this.isFirstSlide ? this.goSlide(this.total - 1) : this.goSlide(this.currentIndex - 1));
},
goSlide(index2) {
this.currentIndex = index2 < 0 || index2 > this.total - 1 ? 0 : index2;
if (this.isLastSlide) {
if (this.onLastSlide !== noop) {
console.warn("onLastSlide deprecated, please use @last-slide");
}
this.onLastSlide(this.currentIndex);
this.$emit("last-slide", this.currentIndex);
}
this.$emit("before-slide-change", this.currentIndex);
setTimeout(() => this.animationEnd(), this.animationSpeed);
goSlide(t) {
this.currentIndex = t < 0 || t > this.total - 1 ? 0 : t, this.isLastSlide && (this.onLastSlide !== o && console.warn("onLastSlide deprecated, please use @last-slide"), this.onLastSlide(this.currentIndex), this.$emit("last-slide", this.currentIndex)), this.$emit("before-slide-change", this.currentIndex), setTimeout(() => this.animationEnd(), this.animationSpeed);
},
goFar(index2) {
let diff = index2 === this.total - 1 && this.isFirstSlide ? -1 : index2 - this.currentIndex;
if (this.isLastSlide && index2 === 0) {
diff = 1;
}
const diff2 = diff < 0 ? -diff : diff;
let timeBuff = 0;
let i = 0;
while (i < diff2) {
i += 1;
const timeout = diff2 === 1 ? 0 : timeBuff;
setTimeout(() => diff < 0 ? this.goPrev(diff2) : this.goNext(diff2), timeout);
timeBuff += this.animationSpeed / diff2;
}
goFar(t) {
let i = t === this.total - 1 && this.isFirstSlide ? -1 : t - this.currentIndex;
this.isLastSlide && t === 0 && (i = 1);
const e = i < 0 ? -i : i;
let n = 0, s = 0;
for (; s < e; )
s += 1, setTimeout(() => i < 0 ? this.goPrev(e) : this.goNext(e), e === 1 ? 0 : n), n += this.animationSpeed / e;
},
animationEnd() {
if (this.onSlideChange !== noop) {
console.warn("onSlideChange deprecated, please use @after-slide-change");
}
this.onSlideChange(this.currentIndex);
this.$emit("after-slide-change", this.currentIndex);
this.onSlideChange !== o && console.warn("onSlideChange deprecated, please use @after-slide-change"), this.onSlideChange(this.currentIndex), this.$emit("after-slide-change", this.currentIndex);
},
handleMouseup() {
this.mousedown = false;
this.dragOffsetX = 0;
this.dragOffsetY = 0;
this.mousedown = !1, this.dragOffsetX = 0, this.dragOffsetY = 0;
},
handleMousedown(e) {
if (!e.touches) {
e.preventDefault();
}
this.mousedown = true;
this.dragStartX = "ontouchstart" in window ? e.touches[0].clientX : e.clientX;
this.dragStartY = "ontouchstart" in window ? e.touches[0].clientY : e.clientY;
handleMousedown(t) {
t.touches || t.preventDefault(), this.mousedown = !0, this.dragStartX = "ontouchstart" in window ? t.touches[0].clientX : t.clientX, this.dragStartY = "ontouchstart" in window ? t.touches[0].clientY : t.clientY;
},
handleMousemove(e) {
if (!this.mousedown) {
handleMousemove(t) {
if (!this.mousedown)
return;
}
const eventPosX = "ontouchstart" in window ? e.touches[0].clientX : e.clientX;
const eventPosY = "ontouchstart" in window ? e.touches[0].clientY : e.clientY;
const deltaX = this.dragStartX - eventPosX;
const deltaY = this.dragStartY - eventPosY;
this.dragOffsetX = deltaX;
this.dragOffsetY = deltaY;
if (Math.abs(this.dragOffsetY) > Math.abs(this.dragOffsetX)) {
return;
}
if (this.dragOffsetX > this.minSwipeDistance) {
this.handleMouseup();
this.goNext();
} else if (this.dragOffsetX < -this.minSwipeDistance) {
this.handleMouseup();
this.goPrev();
}
const i = "ontouchstart" in window ? t.touches[0].clientX : t.clientX, e = "ontouchstart" in window ? t.touches[0].clientY : t.clientY, n = this.dragStartX - i, s = this.dragStartY - e;
this.dragOffsetX = n, this.dragOffsetY = s, !(Math.abs(this.dragOffsetY) > Math.abs(this.dragOffsetX)) && (this.dragOffsetX > this.minSwipeDistance ? (this.handleMouseup(), this.goNext()) : this.dragOffsetX < -this.minSwipeDistance && (this.handleMouseup(), this.goPrev()));
},
attachMutationObserver() {
const MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
if (MutationObserver) {
const config = {
attributes: true,
childList: true,
characterData: true
const t = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
if (t) {
const i = {
attributes: !0,
childList: !0,
characterData: !0
};
this.mutationObserver = new MutationObserver(() => {
this.mutationObserver = new t(() => {
this.$nextTick(() => {
this.computeData();
});
});
if (this.$el) {
this.mutationObserver.observe(this.$el, config);
}
}), this.$el && this.mutationObserver.observe(this.$el, i);
}
},
detachMutationObserver() {
if (this.mutationObserver) {
this.mutationObserver.disconnect();
}
this.mutationObserver && this.mutationObserver.disconnect();
},
getSlideCount() {
const children = this.$slots.default();
if (children.length > 0) {
return children[0].children.length;
}
return 0;
const t = this.$slots.default();
return t.length > 0 ? t[0].children.length : 0;
},
calculateAspectRatio(width, height) {
return Math.min(width / height);
calculateAspectRatio(t, i) {
return Math.min(t / i);
},
computeData(firstRun) {
this.total = this.getSlideCount();
if (firstRun || this.currentIndex >= this.total) {
this.currentIndex = parseInt(this.startIndex) > this.total - 1 ? this.total - 1 : parseInt(this.startIndex);
}
this.viewport = this.$el.clientWidth;
computeData(t) {
this.total = this.getSlideCount(), (t || this.currentIndex >= this.total) && (this.currentIndex = parseInt(this.startIndex) > this.total - 1 ? this.total - 1 : parseInt(this.startIndex)), this.viewport = this.$el.clientWidth;
},
setSize() {
this.$el.style.cssText += "height:" + this.slideHeight + "px;";
this.$el.childNodes[0].style.cssText += "width:" + this.slideWidth + "px; height:" + this.slideHeight + "px;";
this.$el.style.cssText += "height:" + this.slideHeight + "px;", this.$el.childNodes[0].style.cssText += "width:" + this.slideWidth + "px; height:" + this.slideHeight + "px;";
}
},
mounted() {
if (!this.process_server) {
this.computeData(true);
this.attachMutationObserver();
window.addEventListener("resize", this.setSize);
if ("ontouchstart" in window) {
this.$el.addEventListener("touchstart", this.handleMousedown);
this.$el.addEventListener("touchend", this.handleMouseup);
this.$el.addEventListener("touchmove", this.handleMousemove);
} else {
this.$el.addEventListener("mousedown", this.handleMousedown);
this.$el.addEventListener("mouseup", this.handleMouseup);
this.$el.addEventListener("mousemove", this.handleMousemove);
}
}
this.process_server || (this.computeData(!0), this.attachMutationObserver(), window.addEventListener("resize", this.setSize), "ontouchstart" in window ? (this.$el.addEventListener("touchstart", this.handleMousedown), this.$el.addEventListener("touchend", this.handleMouseup), this.$el.addEventListener("touchmove", this.handleMousemove)) : (this.$el.addEventListener("mousedown", this.handleMousedown), this.$el.addEventListener("mouseup", this.handleMouseup), this.$el.addEventListener("mousemove", this.handleMousemove)));
},
beforeDestroy() {
if (!this.process_server) {
this.detachMutationObserver();
if ("ontouchstart" in window) {
this.$el.removeEventListener("touchmove", this.handleMousemove);
} else {
this.$el.removeEventListener("mousemove", this.handleMousemove);
}
window.removeEventListener("resize", this.setSize);
}
this.process_server || (this.detachMutationObserver(), "ontouchstart" in window ? this.$el.removeEventListener("touchmove", this.handleMousemove) : this.$el.removeEventListener("mousemove", this.handleMousemove), window.removeEventListener("resize", this.setSize));
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_controls = resolveComponent("controls");
return openBlock(), createElementBlock("div", {
function P(t, i, e, n, s, r) {
const a = v("controls");
return d(), c("div", {
class: "carousel-3d-container",
style: normalizeStyle({ height: this.slideHeight + "px" })
style: h({ height: this.slideHeight + "px" })
}, [
createBaseVNode("div", {
l("div", {
class: "carousel-3d-slider",
style: normalizeStyle({ width: this.slideWidth + "px", height: this.slideHeight + "px" })
style: h({ width: this.slideWidth + "px", height: this.slideHeight + "px" })
}, [
renderSlot(_ctx.$slots, "default", {}, void 0, true)
m(t.$slots, "default", {}, void 0, !0)
], 4),
$props.controlsVisible ? (openBlock(), createBlock(_component_controls, {
e.controlsVisible ? (d(), x(a, {
key: 0,
"next-html": $props.controlsNextHtml,
"prev-html": $props.controlsPrevHtml,
width: $props.controlsWidth,
height: $props.controlsHeight
}, null, 8, ["next-html", "prev-html", "width", "height"])) : createCommentVNode("", true)
"next-html": e.controlsNextHtml,
"prev-html": e.controlsPrevHtml,
width: e.controlsWidth,
height: e.controlsHeight
}, null, 8, ["next-html", "prev-html", "width", "height"])) : I("", !0)
], 4);
}
var Carousel3d = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-164aa45b"]]);
const install = (Vue) => {
Vue.component("Carousel3d", Carousel3d);
Vue.component("Slide", Slide);
const H = /* @__PURE__ */ p(O, [["render", P], ["__scopeId", "data-v-d1f6685d"]]), E = (t) => {
t.component("Carousel3d", H), t.component("Slide", b);
}, z = {
install: E
};
var index = {
install
export {
H as Carousel3d,
b as Slide,
z as default
};
export { Carousel3d, Slide, index as default };
//# sourceMappingURL=carousel-3d.es.js.map

3

dist/carousel-3d.umd.js

@@ -1,3 +0,2 @@

var __vite_style__=document.createElement("style");__vite_style__.innerHTML=`.carousel-3d-slide{position:absolute;opacity:0;visibility:hidden;overflow:hidden;top:0;border-radius:1px;border-color:#000;border-color:#0006;border-style:solid;background-size:cover;background-color:#ccc;display:block;margin:0;box-sizing:border-box}.carousel-3d-slide{text-align:left}.carousel-3d-slide img{width:100%}.carousel-3d-slide.current{opacity:1!important;visibility:visible!important;transform:none!important;z-index:999}.carousel-3d-controls[data-v-067f74c8]{position:absolute;top:50%;height:0;margin-top:-30px;left:0;width:100%;z-index:1000}.next[data-v-067f74c8],.prev[data-v-067f74c8]{width:60px;position:absolute;z-index:1010;font-size:60px;height:60px;line-height:60px;color:#333;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;top:0}.next[data-v-067f74c8]:hover,.prev[data-v-067f74c8]:hover{cursor:pointer;opacity:.7}.prev[data-v-067f74c8]{left:10px;text-align:left}.next[data-v-067f74c8]{right:10px;text-align:right}.disabled[data-v-067f74c8]{opacity:.2;cursor:default}.disabled[data-v-067f74c8]:hover{cursor:default;opacity:.2}.carousel-3d-container[data-v-164aa45b]{min-height:1px;width:100%;position:relative;z-index:0;overflow:hidden;margin:20px auto;box-sizing:border-box}.carousel-3d-slider[data-v-164aa45b]{position:relative;margin:0 auto;transform-style:preserve-3d;-webkit-perspective:1000px;-moz-perspective:1000px;perspective:1000px}
(function(d,u){typeof exports=="object"&&typeof module!="undefined"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(d=typeof globalThis!="undefined"?globalThis:d||self,u(d["carousel-3d"]={}))})(this,function(d){"use strict";`;document.head.appendChild(__vite_style__);function u(t){if(m(t)){const e={};for(let i=0;i<t.length;i++){const n=t[i],s=h(n)?G(n):u(n);if(s)for(const r in s)e[r]=s[r]}return e}else{if(h(t))return t;if(_(t))return t}}const U=/;(?![^(]*\))/g,Z=/:(.+)/;function G(t){const e={};return t.split(U).forEach(i=>{if(i){const n=i.split(Z);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}function g(t){let e="";if(h(t))e=t;else if(m(t))for(let i=0;i<t.length;i++){const n=g(t[i]);n&&(e+=n+" ")}else if(_(t))for(const i in t)t[i]&&(e+=i+" ");return e.trim()}const J=[],Q=/^on[^a-z]/,tt=t=>Q.test(t),$=Object.assign,m=Array.isArray,y=t=>typeof t=="function",h=t=>typeof t=="string",_=t=>t!==null&&typeof t=="object",P=t=>{const e=Object.create(null);return i=>e[i]||(e[i]=t(i))},et=/-(\w)/g,b=P(t=>t.replace(et,(e,i)=>i?i.toUpperCase():"")),E=P(t=>t.charAt(0).toUpperCase()+t.slice(1));function F(t){return H(t)?F(t.__v_raw):!!(t&&t.__v_isReactive)}function H(t){return!!(t&&t.__v_isReadonly)}function T(t){return F(t)||H(t)}function it(t){return!!(t&&t.__v_isRef===!0)}let c=null,st=null;const nt=t=>t.__isSuspense,rt=t=>!!t.type.__asyncLoader,ot=t=>t.__isTeleport,A="components";function lt(t,e){return ut(A,t,!0,e)||t}const at=Symbol();function ut(t,e,i=!0,n=!1){const s=c||xt;if(s){const r=s.type;if(t===A){const l=yt(r);if(l&&(l===e||l===b(e)||l===E(b(e))))return r}const o=R(s[t]||r[t],e)||R(s.appContext[t],e);return!o&&n?r:o}}function R(t,e){return t&&(t[e]||t[b(e)]||t[E(b(e))])}const I=Symbol(void 0),ct=Symbol(void 0),S=Symbol(void 0),w=[];let f=null;function x(t=!1){w.push(f=t?null:[])}function dt(){w.pop(),f=w[w.length-1]||null}function D(t){return t.dynamicChildren=f||J,dt(),f&&f.push(t),t}function N(t,e,i,n,s,r){return D(p(t,e,i,n,s,r,!0))}function O(t,e,i,n,s){return D(M(t,e,i,n,s,!0))}function X(t){return t?t.__v_isVNode===!0:!1}const Y="__vInternal",B=({key:t})=>t!=null?t:null,C=({ref:t,ref_key:e,ref_for:i})=>t!=null?h(t)||it(t)||y(t)?{i:c,r:t,k:e,f:!!i}:t:null;function p(t,e=null,i=null,n=0,s=null,r=t===I?0:1,o=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&B(e),ref:e&&C(e),scopeId:st,slotScopeIds:null,children:i,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:n,dynamicProps:s,dynamicChildren:null,appContext:null};return l?(L(a,i),r&128&&t.normalize(a)):i&&(a.shapeFlag|=h(i)?8:16),!o&&f&&(a.patchFlag>0||r&6)&&a.patchFlag!==32&&f.push(a),a}const M=ht;function ht(t,e=null,i=null,n=0,s=null,r=!1){if((!t||t===at)&&(t=S),X(t)){const l=z(t,e,!0);return i&&L(l,i),l}if(vt(t)&&(t=t.__vccOpts),e){e=ft(e);let{class:l,style:a}=e;l&&!h(l)&&(e.class=g(l)),_(a)&&(T(a)&&!m(a)&&(a=$({},a)),e.style=u(a))}const o=h(t)?1:nt(t)?128:ot(t)?64:_(t)?4:y(t)?2:0;return p(t,e,i,n,s,o,r,!0)}function ft(t){return t?T(t)||Y in t?$({},t):t:null}function z(t,e,i=!1){const{props:n,ref:s,patchFlag:r,children:o}=t,l=e?mt(n||{},e):n;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:l,key:l&&B(l),ref:e&&e.ref?i&&s?m(s)?s.concat(C(e)):[s,C(e)]:C(e):s,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:o,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==I?r===-1?16:r|16:r,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&z(t.ssContent),ssFallback:t.ssFallback&&z(t.ssFallback),el:t.el,anchor:t.anchor}}function pt(t=" ",e=0){return M(ct,null,t,e)}function gt(t="",e=!1){return e?(x(),O(S,null,t)):M(S,null,t)}function L(t,e){let i=0;const{shapeFlag:n}=t;if(e==null)e=null;else if(m(e))i=16;else if(typeof e=="object")if(n&65){const s=e.default;s&&(s._c&&(s._d=!1),L(t,s()),s._c&&(s._d=!0));return}else{i=32;const s=e._;!s&&!(Y in e)?e._ctx=c:s===3&&c&&(c.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else y(e)?(e={default:e,_ctx:c},i=32):(e=String(e),n&64?(i=16,e=[pt(e)]):i=8);t.children=e,t.shapeFlag|=i}function mt(...t){const e={};for(let i=0;i<t.length;i++){const n=t[i];for(const s in n)if(s==="class")e.class!==n.class&&(e.class=g([e.class,n.class]));else if(s==="style")e.style=u([e.style,n.style]);else if(tt(s)){const r=e[s],o=n[s];o&&r!==o&&!(m(r)&&r.includes(o))&&(e[s]=r?[].concat(r,o):o)}else s!==""&&(e[s]=n[s])}return e}function V(t,e,i={},n,s){if(c.isCE||c.parent&&rt(c.parent)&&c.parent.isCE)return M("slot",e==="default"?null:{name:e},n&&n());let r=t[e];r&&r._c&&(r._d=!1),x();const o=r&&W(r(i)),l=O(I,{key:i.key||`_${e}`},o||(n?n():[]),o&&t._===1?64:-2);return!s&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),r&&r._c&&(r._d=!0),l}function W(t){return t.some(e=>X(e)?!(e.type===S||e.type===I&&!W(e.children)):!0)?t:null}let xt=null;function yt(t){return y(t)&&t.displayName||t.name}function vt(t){return y(t)&&"__vccOpts"in t}const _t=["ctrl","shift","alt","meta"],bt={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>_t.some(i=>t[`${i}Key`]&&!e.includes(i))},j=(t,e)=>(i,...n)=>{for(let s=0;s<e.length;s++){const r=bt[e[s]];if(r&&r(i,e))return}return t(i,...n)};var Et="",k=(t,e)=>{const i=t.__vccOpts||t;for(const[n,s]of e)i[n]=s;return i};const It={name:"Slide",props:{index:{type:Number}},data(){return{parent:this.$parent,styles:{},zIndex:999}},computed:{isCurrent(){return this.index===this.parent.currentIndex},leftIndex(){return this.parent.oneDirectional&&this.getSideIndex(this.parent.leftIndices)>this.parent.currentIndex-1?-1:this.getSideIndex(this.parent.leftIndices)},rightIndex(){return this.parent.oneDirectional&&this.getSideIndex(this.parent.rightIndices)>this.parent.total-this.parent.currentIndex-2?-1:this.getSideIndex(this.parent.rightIndices)},slideStyle(){let t={};if(!this.isCurrent){const e=this.leftIndex,i=this.rightIndex;(i>=0||e>=0)&&(t=i>=0?this.calculatePosition(i,!0,this.zIndex):this.calculatePosition(e,!1,this.zIndex),t.opacity=1,t.visibility="visible"),this.parent.hasHiddenSlides&&(this.matchIndex(this.parent.leftOutIndex)?t=this.calculatePosition(this.parent.leftIndices.length-1,!1,this.zIndex):this.matchIndex(this.parent.rightOutIndex)&&(t=this.calculatePosition(this.parent.rightIndices.length-1,!0,this.zIndex)))}return Object.assign(t,{"border-width":this.parent.border+"px",width:this.parent.slideWidth+"px",height:this.parent.slideHeight+"px",transition:" transform "+this.parent.animationSpeed+"ms, opacity "+this.parent.animationSpeed+"ms, visibility "+this.parent.animationSpeed+"ms"})},computedClasses(){return{[`left-${this.leftIndex+1}`]:this.leftIndex>=0,[`right-${this.rightIndex+1}`]:this.rightIndex>=0,current:this.isCurrent}}},methods:{getSideIndex(t){let e=-1;return t.forEach((i,n)=>{this.matchIndex(i)&&(e=n)}),e},matchIndex(t){return t>=0?this.index===t:this.parent.total+t===this.index},calculatePosition(t,e,i){const n=this.parent.disable3d?0:parseInt(this.parent.inverseScaling)+(t+1)*100,s=this.parent.disable3d?0:parseInt(this.parent.perspective),r=this.parent.space==="auto"?parseInt((t+1)*(this.parent.width/1.5),10):parseInt((t+1)*this.parent.space,10),o=e?"translateX("+r+"px) translateZ(-"+n+"px) rotateY(-"+s+"deg)":"translateX(-"+r+"px) translateZ(-"+n+"px) rotateY("+s+"deg)",l=this.parent.space==="auto"?0:parseInt((t+1)*this.parent.space);return{transform:o,top:l,zIndex:i-(Math.abs(t)+1)}},goTo(){if(!this.isCurrent)this.parent.clickable===!0&&this.parent.goFar(this.index);else{const{index:t}=this;this.parent.onMainSlideClick({index:t})}}}};function St(t,e,i,n,s,r){return x(),N("div",{class:g(["carousel-3d-slide",r.computedClasses]),style:u(r.slideStyle),onClick:e[0]||(e[0]=o=>r.goTo())},[V(t.$slots,"default",{index:i.index,isCurrent:r.isCurrent,leftIndex:r.leftIndex,rightIndex:r.rightIndex})],6)}var K=k(It,[["render",St]]);const wt={props:{autoplay:{type:Boolean,default:!1},autoplayTimeout:{type:Number,default:2e3},autoplayHoverPause:{type:Boolean,default:!0}},data(){return{autoplayInterval:null}},destroyed(){this.process_server||(this.pauseAutoplay(),this.$el.removeEventListener("mouseenter",this.pauseAutoplay),this.$el.removeEventListener("mouseleave",this.startAutoplay))},methods:{pauseAutoplay(){this.autoplayInterval&&(this.autoplayInterval=clearInterval(this.autoplayInterval))},startAutoplay(){this.autoplay&&(this.autoplayInterval=setInterval(()=>{this.dir==="ltr"?this.goPrev():this.goNext()},this.autoplayTimeout))}},mounted(){!this.process_server&&this.autoplayHoverPause&&(this.$el.addEventListener("mouseenter",this.pauseAutoplay),this.$el.addEventListener("mouseleave",this.startAutoplay),this.startAutoplay())}};var Ft="";const Ct={name:"Controls",props:{width:{type:[String,Number],default:50},height:{type:[String,Number],default:60},prevHtml:{type:String,default:"&lsaquo;"},nextHtml:{type:String,default:"&rsaquo;"}},data(){return{parent:this.$parent}}},Mt={class:"carousel-3d-controls"},Nt=["innerHTML"],Ot=["innerHTML"];function zt(t,e,i,n,s,r){return x(),N("div",Mt,[p("a",{href:"#",class:g(["prev",{disabled:!s.parent.isPrevPossible}]),onClick:e[0]||(e[0]=j(o=>s.parent.goPrev(),["prevent"])),style:u(`width: ${i.width}px; height: ${i.height}px; line-height: ${i.height}px;`),"aria-label":"Previous slide"},[p("span",{innerHTML:i.prevHtml},null,8,Nt)],6),p("a",{href:"#",class:g(["next",{disabled:!s.parent.isNextPossible}]),onClick:e[1]||(e[1]=j(o=>s.parent.goNext(),["prevent"])),style:u(`width: ${i.width}px; height: ${i.height}px; line-height: ${i.height}px;`),"aria-label":"Next slide"},[p("span",{innerHTML:i.nextHtml},null,8,Ot)],6)])}var Lt=k(Ct,[["render",zt],["__scopeId","data-v-067f74c8"]]),Ht="";const v=()=>{},kt={name:"Carousel3d",components:{Controls:Lt},props:{count:{type:[Number,String],default:0},perspective:{type:[Number,String],default:35},display:{type:[Number,String],default:5},loop:{type:Boolean,default:!0},animationSpeed:{type:[Number,String],default:500},dir:{type:String,default:"rtl"},width:{type:[Number,String],default:360},height:{type:[Number,String],default:270},border:{type:[Number,String],default:1},space:{type:[Number,String],default:"auto"},startIndex:{type:[Number,String],default:0},clickable:{type:Boolean,default:!0},disable3d:{type:Boolean,default:!1},minSwipeDistance:{type:Number,default:10},inverseScaling:{type:[Number,String],default:300},controlsVisible:{type:Boolean,default:!1},controlsPrevHtml:{type:String,default:"&lsaquo;"},controlsNextHtml:{type:String,default:"&rsaquo;"},controlsWidth:{type:[String,Number],default:50},controlsHeight:{type:[String,Number],default:50},onLastSlide:{type:Function,default:v},onSlideChange:{type:Function,default:v},bias:{type:String,default:"left"},onMainSlideClick:{type:Function,default:v},oneDirectional:{type:Boolean,default:!1}},data(){return{viewport:0,currentIndex:0,total:0,dragOffsetX:0,dragStartX:0,dragOffsetY:0,dragStartY:0,mousedown:!1,zIndex:998,process_server:typeof window===void 0}},mixins:[wt],watch:{count(){this.computeData()}},computed:{isLastSlide(){return this.currentIndex===this.total-1},isFirstSlide(){return this.currentIndex===0},isNextPossible(){return!(!this.loop&&this.isLastSlide)},isPrevPossible(){return!(!this.loop&&this.isFirstSlide)},slideWidth(){const t=this.viewport,e=parseInt(this.width)+parseInt(this.border,10)*2;return t<e&&!this.process_server?t:e},slideHeight(){const t=parseInt(this.width,10)+parseInt(this.border,10)*2,e=parseInt(parseInt(this.height)+this.border*2,10),i=this.calculateAspectRatio(t,e);return this.slideWidth/i},visible(){return this.display>this.total?this.total:this.display},hasHiddenSlides(){return this.total>this.visible},leftIndices(){let t=(this.visible-1)/2;t=this.bias.toLowerCase()==="left"?Math.ceil(t):Math.floor(t);const e=[];for(let i=1;i<=t;i++)e.push(this.dir==="ltr"?(this.currentIndex+i)%this.total:(this.currentIndex-i)%this.total);return e},rightIndices(){let t=(this.visible-1)/2;t=this.bias.toLowerCase()==="right"?Math.ceil(t):Math.floor(t);const e=[];for(let i=1;i<=t;i++)e.push(this.dir==="ltr"?(this.currentIndex-i)%this.total:(this.currentIndex+i)%this.total);return e},leftOutIndex(){let t=(this.visible-1)/2;return t=this.bias.toLowerCase()==="left"?Math.ceil(t):Math.floor(t),t++,this.dir==="ltr"?this.total-this.currentIndex-t<=0?-parseInt(this.total-this.currentIndex-t):this.currentIndex+t:this.currentIndex-t},rightOutIndex(){let t=(this.visible-1)/2;return t=this.bias.toLowerCase()==="right"?Math.ceil(t):Math.floor(t),t++,this.dir==="ltr"?this.currentIndex-t:this.total-this.currentIndex-t<=0?-parseInt(this.total-this.currentIndex-t,10):this.currentIndex+t}},methods:{goNext(){this.isNextPossible&&(this.isLastSlide?this.goSlide(0):this.goSlide(this.currentIndex+1))},goPrev(){this.isPrevPossible&&(this.isFirstSlide?this.goSlide(this.total-1):this.goSlide(this.currentIndex-1))},goSlide(t){this.currentIndex=t<0||t>this.total-1?0:t,this.isLastSlide&&(this.onLastSlide!==v&&console.warn("onLastSlide deprecated, please use @last-slide"),this.onLastSlide(this.currentIndex),this.$emit("last-slide",this.currentIndex)),this.$emit("before-slide-change",this.currentIndex),setTimeout(()=>this.animationEnd(),this.animationSpeed)},goFar(t){let e=t===this.total-1&&this.isFirstSlide?-1:t-this.currentIndex;this.isLastSlide&&t===0&&(e=1);const i=e<0?-e:e;let n=0,s=0;for(;s<i;)s+=1,setTimeout(()=>e<0?this.goPrev(i):this.goNext(i),i===1?0:n),n+=this.animationSpeed/i},animationEnd(){this.onSlideChange!==v&&console.warn("onSlideChange deprecated, please use @after-slide-change"),this.onSlideChange(this.currentIndex),this.$emit("after-slide-change",this.currentIndex)},handleMouseup(){this.mousedown=!1,this.dragOffsetX=0,this.dragOffsetY=0},handleMousedown(t){t.touches||t.preventDefault(),this.mousedown=!0,this.dragStartX="ontouchstart"in window?t.touches[0].clientX:t.clientX,this.dragStartY="ontouchstart"in window?t.touches[0].clientY:t.clientY},handleMousemove(t){if(!this.mousedown)return;const e="ontouchstart"in window?t.touches[0].clientX:t.clientX,i="ontouchstart"in window?t.touches[0].clientY:t.clientY,n=this.dragStartX-e,s=this.dragStartY-i;this.dragOffsetX=n,this.dragOffsetY=s,!(Math.abs(this.dragOffsetY)>Math.abs(this.dragOffsetX))&&(this.dragOffsetX>this.minSwipeDistance?(this.handleMouseup(),this.goNext()):this.dragOffsetX<-this.minSwipeDistance&&(this.handleMouseup(),this.goPrev()))},attachMutationObserver(){const t=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(t){const e={attributes:!0,childList:!0,characterData:!0};this.mutationObserver=new t(()=>{this.$nextTick(()=>{this.computeData()})}),this.$el&&this.mutationObserver.observe(this.$el,e)}},detachMutationObserver(){this.mutationObserver&&this.mutationObserver.disconnect()},getSlideCount(){const t=this.$slots.default();return t.length>0?t[0].children.length:0},calculateAspectRatio(t,e){return Math.min(t/e)},computeData(t){this.total=this.getSlideCount(),(t||this.currentIndex>=this.total)&&(this.currentIndex=parseInt(this.startIndex)>this.total-1?this.total-1:parseInt(this.startIndex)),this.viewport=this.$el.clientWidth},setSize(){this.$el.style.cssText+="height:"+this.slideHeight+"px;",this.$el.childNodes[0].style.cssText+="width:"+this.slideWidth+"px; height:"+this.slideHeight+"px;"}},mounted(){this.process_server||(this.computeData(!0),this.attachMutationObserver(),window.addEventListener("resize",this.setSize),"ontouchstart"in window?(this.$el.addEventListener("touchstart",this.handleMousedown),this.$el.addEventListener("touchend",this.handleMouseup),this.$el.addEventListener("touchmove",this.handleMousemove)):(this.$el.addEventListener("mousedown",this.handleMousedown),this.$el.addEventListener("mouseup",this.handleMouseup),this.$el.addEventListener("mousemove",this.handleMousemove)))},beforeDestroy(){this.process_server||(this.detachMutationObserver(),"ontouchstart"in window?this.$el.removeEventListener("touchmove",this.handleMousemove):this.$el.removeEventListener("mousemove",this.handleMousemove),window.removeEventListener("resize",this.setSize))}};function $t(t,e,i,n,s,r){const o=lt("controls");return x(),N("div",{class:"carousel-3d-container",style:u({height:this.slideHeight+"px"})},[p("div",{class:"carousel-3d-slider",style:u({width:this.slideWidth+"px",height:this.slideHeight+"px"})},[V(t.$slots,"default",{},void 0,!0)],4),i.controlsVisible?(x(),O(o,{key:0,"next-html":i.controlsNextHtml,"prev-html":i.controlsPrevHtml,width:i.controlsWidth,height:i.controlsHeight},null,8,["next-html","prev-html","width","height"])):gt("",!0)],4)}var q=k(kt,[["render",$t],["__scopeId","data-v-164aa45b"]]),Pt={install:t=>{t.component("Carousel3d",q),t.component("Slide",K)}};d.Carousel3d=q,d.Slide=K,d.default=Pt,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
(function(o,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(o=typeof globalThis<"u"?globalThis:o||self,s(o["carousel-3d"]={},o.Vue))})(this,function(o,s){"use strict";const C="",d=(t,i)=>{const e=t.__vccOpts||t;for(const[r,n]of i)e[r]=n;return e},p={name:"Slide",props:{index:{type:Number}},data(){return{parent:this.$parent,styles:{},zIndex:999}},computed:{isCurrent(){return this.index===this.parent.currentIndex},leftIndex(){return this.parent.oneDirectional&&this.getSideIndex(this.parent.leftIndices)>this.parent.currentIndex-1?-1:this.getSideIndex(this.parent.leftIndices)},rightIndex(){return this.parent.oneDirectional&&this.getSideIndex(this.parent.rightIndices)>this.parent.total-this.parent.currentIndex-2?-1:this.getSideIndex(this.parent.rightIndices)},slideStyle(){let t={};if(!this.isCurrent){const i=this.leftIndex,e=this.rightIndex;(e>=0||i>=0)&&(t=e>=0?this.calculatePosition(e,!0,this.zIndex):this.calculatePosition(i,!1,this.zIndex),t.opacity=1,t.visibility="visible"),this.parent.hasHiddenSlides&&(this.matchIndex(this.parent.leftOutIndex)?t=this.calculatePosition(this.parent.leftIndices.length-1,!1,this.zIndex):this.matchIndex(this.parent.rightOutIndex)&&(t=this.calculatePosition(this.parent.rightIndices.length-1,!0,this.zIndex)))}return Object.assign(t,{"border-width":this.parent.border+"px",width:this.parent.slideWidth+"px",height:this.parent.slideHeight+"px",transition:" transform "+this.parent.animationSpeed+"ms, opacity "+this.parent.animationSpeed+"ms, visibility "+this.parent.animationSpeed+"ms"})},computedClasses(){return{[`left-${this.leftIndex+1}`]:this.leftIndex>=0,[`right-${this.rightIndex+1}`]:this.rightIndex>=0,current:this.isCurrent}}},methods:{getSideIndex(t){let i=-1;return t.forEach((e,r)=>{this.matchIndex(e)&&(i=r)}),i},matchIndex(t){return t>=0?this.index===t:this.parent.total+t===this.index},calculatePosition(t,i,e){const r=this.parent.disable3d?0:parseInt(this.parent.inverseScaling)+(t+1)*100,n=this.parent.disable3d?0:parseInt(this.parent.perspective),a=this.parent.space==="auto"?parseInt((t+1)*(this.parent.width/1.5),10):parseInt((t+1)*this.parent.space,10),l=i?"translateX("+a+"px) translateZ(-"+r+"px) rotateY(-"+n+"deg)":"translateX(-"+a+"px) translateZ(-"+r+"px) rotateY("+n+"deg)",M=this.parent.space==="auto"?0:parseInt((t+1)*this.parent.space);return{transform:l,top:M,zIndex:e-(Math.abs(t)+1)}},goTo(){if(!this.isCurrent)this.parent.clickable===!0&&this.parent.goFar(this.index);else{const{index:t}=this;this.parent.onMainSlideClick({index:t})}}}};function f(t,i,e,r,n,a){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["carousel-3d-slide",a.computedClasses]),style:s.normalizeStyle(a.slideStyle),onClick:i[0]||(i[0]=l=>a.goTo())},[s.renderSlot(t.$slots,"default",{index:e.index,isCurrent:a.isCurrent,leftIndex:a.leftIndex,rightIndex:a.rightIndex})],6)}const u=d(p,[["render",f]]),m={props:{autoplay:{type:Boolean,default:!1},autoplayTimeout:{type:Number,default:2e3},autoplayHoverPause:{type:Boolean,default:!0}},data(){return{autoplayInterval:null}},destroyed(){this.process_server||(this.pauseAutoplay(),this.$el.removeEventListener("mouseenter",this.pauseAutoplay),this.$el.removeEventListener("mouseleave",this.startAutoplay))},methods:{pauseAutoplay(){this.autoplayInterval&&(this.autoplayInterval=clearInterval(this.autoplayInterval))},startAutoplay(){this.autoplay&&(this.autoplayInterval=setInterval(()=>{this.dir==="ltr"?this.goPrev():this.goNext()},this.autoplayTimeout))}},mounted(){!this.process_server&&this.autoplayHoverPause&&(this.$el.addEventListener("mouseenter",this.pauseAutoplay),this.$el.addEventListener("mouseleave",this.startAutoplay),this.startAutoplay())}},N="",g={name:"Controls",props:{width:{type:[String,Number],default:50},height:{type:[String,Number],default:60},prevHtml:{type:String,default:"&lsaquo;"},nextHtml:{type:String,default:"&rsaquo;"}},data(){return{parent:this.$parent}}},x={class:"carousel-3d-controls"},I=["innerHTML"],v=["innerHTML"];function y(t,i,e,r,n,a){return s.openBlock(),s.createElementBlock("div",x,[s.createElementVNode("a",{href:"#",class:s.normalizeClass(["prev",{disabled:!n.parent.isPrevPossible}]),onClick:i[0]||(i[0]=s.withModifiers(l=>n.parent.goPrev(),["prevent"])),style:s.normalizeStyle(`width: ${e.width}px; height: ${e.height}px; line-height: ${e.height}px;`),"aria-label":"Previous slide"},[s.createElementVNode("span",{innerHTML:e.prevHtml},null,8,I)],6),s.createElementVNode("a",{href:"#",class:s.normalizeClass(["next",{disabled:!n.parent.isNextPossible}]),onClick:i[1]||(i[1]=s.withModifiers(l=>n.parent.goNext(),["prevent"])),style:s.normalizeStyle(`width: ${e.width}px; height: ${e.height}px; line-height: ${e.height}px;`),"aria-label":"Next slide"},[s.createElementVNode("span",{innerHTML:e.nextHtml},null,8,v)],6)])}const S=d(g,[["render",y],["__scopeId","data-v-475a7b20"]]),L="",h=()=>{},b={name:"Carousel3d",components:{Controls:S},props:{count:{type:[Number,String],default:0},perspective:{type:[Number,String],default:35},display:{type:[Number,String],default:5},loop:{type:Boolean,default:!0},animationSpeed:{type:[Number,String],default:500},dir:{type:String,default:"rtl"},width:{type:[Number,String],default:360},height:{type:[Number,String],default:270},border:{type:[Number,String],default:1},space:{type:[Number,String],default:"auto"},startIndex:{type:[Number,String],default:0},clickable:{type:Boolean,default:!0},disable3d:{type:Boolean,default:!1},minSwipeDistance:{type:Number,default:10},inverseScaling:{type:[Number,String],default:300},controlsVisible:{type:Boolean,default:!1},controlsPrevHtml:{type:String,default:"&lsaquo;"},controlsNextHtml:{type:String,default:"&rsaquo;"},controlsWidth:{type:[String,Number],default:50},controlsHeight:{type:[String,Number],default:50},onLastSlide:{type:Function,default:h},onSlideChange:{type:Function,default:h},bias:{type:String,default:"left"},onMainSlideClick:{type:Function,default:h},oneDirectional:{type:Boolean,default:!1}},data(){return{viewport:0,currentIndex:0,total:0,dragOffsetX:0,dragStartX:0,dragOffsetY:0,dragStartY:0,mousedown:!1,zIndex:998,process_server:typeof window===void 0}},mixins:[m],watch:{count(){this.computeData()}},computed:{isLastSlide(){return this.currentIndex===this.total-1},isFirstSlide(){return this.currentIndex===0},isNextPossible(){return!(!this.loop&&this.isLastSlide)},isPrevPossible(){return!(!this.loop&&this.isFirstSlide)},slideWidth(){const t=this.viewport,i=parseInt(this.width)+parseInt(this.border,10)*2;return t<i&&!this.process_server?t:i},slideHeight(){const t=parseInt(this.width,10)+parseInt(this.border,10)*2,i=parseInt(parseInt(this.height)+this.border*2,10),e=this.calculateAspectRatio(t,i);return this.slideWidth/e},visible(){return this.display>this.total?this.total:this.display},hasHiddenSlides(){return this.total>this.visible},leftIndices(){let t=(this.visible-1)/2;t=this.bias.toLowerCase()==="left"?Math.ceil(t):Math.floor(t);const i=[];for(let e=1;e<=t;e++)i.push(this.dir==="ltr"?(this.currentIndex+e)%this.total:(this.currentIndex-e)%this.total);return i},rightIndices(){let t=(this.visible-1)/2;t=this.bias.toLowerCase()==="right"?Math.ceil(t):Math.floor(t);const i=[];for(let e=1;e<=t;e++)i.push(this.dir==="ltr"?(this.currentIndex-e)%this.total:(this.currentIndex+e)%this.total);return i},leftOutIndex(){let t=(this.visible-1)/2;return t=this.bias.toLowerCase()==="left"?Math.ceil(t):Math.floor(t),t++,this.dir==="ltr"?this.total-this.currentIndex-t<=0?-parseInt(this.total-this.currentIndex-t):this.currentIndex+t:this.currentIndex-t},rightOutIndex(){let t=(this.visible-1)/2;return t=this.bias.toLowerCase()==="right"?Math.ceil(t):Math.floor(t),t++,this.dir==="ltr"?this.currentIndex-t:this.total-this.currentIndex-t<=0?-parseInt(this.total-this.currentIndex-t,10):this.currentIndex+t}},methods:{goNext(){this.isNextPossible&&(this.isLastSlide?this.goSlide(0):this.goSlide(this.currentIndex+1))},goPrev(){this.isPrevPossible&&(this.isFirstSlide?this.goSlide(this.total-1):this.goSlide(this.currentIndex-1))},goSlide(t){this.currentIndex=t<0||t>this.total-1?0:t,this.isLastSlide&&(this.onLastSlide!==h&&console.warn("onLastSlide deprecated, please use @last-slide"),this.onLastSlide(this.currentIndex),this.$emit("last-slide",this.currentIndex)),this.$emit("before-slide-change",this.currentIndex),setTimeout(()=>this.animationEnd(),this.animationSpeed)},goFar(t){let i=t===this.total-1&&this.isFirstSlide?-1:t-this.currentIndex;this.isLastSlide&&t===0&&(i=1);const e=i<0?-i:i;let r=0,n=0;for(;n<e;)n+=1,setTimeout(()=>i<0?this.goPrev(e):this.goNext(e),e===1?0:r),r+=this.animationSpeed/e},animationEnd(){this.onSlideChange!==h&&console.warn("onSlideChange deprecated, please use @after-slide-change"),this.onSlideChange(this.currentIndex),this.$emit("after-slide-change",this.currentIndex)},handleMouseup(){this.mousedown=!1,this.dragOffsetX=0,this.dragOffsetY=0},handleMousedown(t){t.touches||t.preventDefault(),this.mousedown=!0,this.dragStartX="ontouchstart"in window?t.touches[0].clientX:t.clientX,this.dragStartY="ontouchstart"in window?t.touches[0].clientY:t.clientY},handleMousemove(t){if(!this.mousedown)return;const i="ontouchstart"in window?t.touches[0].clientX:t.clientX,e="ontouchstart"in window?t.touches[0].clientY:t.clientY,r=this.dragStartX-i,n=this.dragStartY-e;this.dragOffsetX=r,this.dragOffsetY=n,!(Math.abs(this.dragOffsetY)>Math.abs(this.dragOffsetX))&&(this.dragOffsetX>this.minSwipeDistance?(this.handleMouseup(),this.goNext()):this.dragOffsetX<-this.minSwipeDistance&&(this.handleMouseup(),this.goPrev()))},attachMutationObserver(){const t=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(t){const i={attributes:!0,childList:!0,characterData:!0};this.mutationObserver=new t(()=>{this.$nextTick(()=>{this.computeData()})}),this.$el&&this.mutationObserver.observe(this.$el,i)}},detachMutationObserver(){this.mutationObserver&&this.mutationObserver.disconnect()},getSlideCount(){const t=this.$slots.default();return t.length>0?t[0].children.length:0},calculateAspectRatio(t,i){return Math.min(t/i)},computeData(t){this.total=this.getSlideCount(),(t||this.currentIndex>=this.total)&&(this.currentIndex=parseInt(this.startIndex)>this.total-1?this.total-1:parseInt(this.startIndex)),this.viewport=this.$el.clientWidth},setSize(){this.$el.style.cssText+="height:"+this.slideHeight+"px;",this.$el.childNodes[0].style.cssText+="width:"+this.slideWidth+"px; height:"+this.slideHeight+"px;"}},mounted(){this.process_server||(this.computeData(!0),this.attachMutationObserver(),window.addEventListener("resize",this.setSize),"ontouchstart"in window?(this.$el.addEventListener("touchstart",this.handleMousedown),this.$el.addEventListener("touchend",this.handleMouseup),this.$el.addEventListener("touchmove",this.handleMousemove)):(this.$el.addEventListener("mousedown",this.handleMousedown),this.$el.addEventListener("mouseup",this.handleMouseup),this.$el.addEventListener("mousemove",this.handleMousemove)))},beforeDestroy(){this.process_server||(this.detachMutationObserver(),"ontouchstart"in window?this.$el.removeEventListener("touchmove",this.handleMousemove):this.$el.removeEventListener("mousemove",this.handleMousemove),window.removeEventListener("resize",this.setSize))}};function w(t,i,e,r,n,a){const l=s.resolveComponent("controls");return s.openBlock(),s.createElementBlock("div",{class:"carousel-3d-container",style:s.normalizeStyle({height:this.slideHeight+"px"})},[s.createElementVNode("div",{class:"carousel-3d-slider",style:s.normalizeStyle({width:this.slideWidth+"px",height:this.slideHeight+"px"})},[s.renderSlot(t.$slots,"default",{},void 0,!0)],4),e.controlsVisible?(s.openBlock(),s.createBlock(l,{key:0,"next-html":e.controlsNextHtml,"prev-html":e.controlsPrevHtml,width:e.controlsWidth,height:e.controlsHeight},null,8,["next-html","prev-html","width","height"])):s.createCommentVNode("",!0)],4)}const c=d(b,[["render",w],["__scopeId","data-v-d1f6685d"]]),_={install:t=>{t.component("Carousel3d",c),t.component("Slide",u)}};o.Carousel3d=c,o.Slide=u,o.default=_,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
//# sourceMappingURL=carousel-3d.umd.js.map

@@ -0,0 +0,0 @@ {

{
"name": "vue3-carousel-3d",
"version": "1.0.3",
"version": "1.0.4",
"description": "Beautiful, flexible and touch supported 3D Carousel for Vue.js",

@@ -21,3 +21,3 @@ "main": "./dist/carousel-3d.es.js",

],
"author": "Vladimir Bujanovic Ray93",
"author": "Vladimir Bujanovic & Ray93",
"license": "MIT",

@@ -29,8 +29,8 @@ "bugs": {

"dependencies": {
"vue": "^3.2.25"
"vue": "^3.2.38"
},
"devDependencies": {
"@vitejs/plugin-vue": "^2.3.1",
"vite": "^2.9.7"
"@vitejs/plugin-vue": "^3.0.3",
"vite": "^3.0.9"
}
}

@@ -0,0 +0,0 @@ import { createApp } from 'vue'

@@ -20,3 +20,15 @@ import { defineConfig } from "vite";

sourcemap: true,
rollupOptions: {
external: ["vue"],
output: {
globals: {
vue: "Vue",
},
assetFileNames: (assetInfo) => {
if (assetInfo.name == "style.css") return "index.css";
return assetInfo.name;
},
},
},
},
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc