Skip to content

Commit

Permalink
release 1.1.14
Browse files Browse the repository at this point in the history
henrygd committed Jan 5, 2024
1 parent 1a5f528 commit 07b1bd0
Showing 6 changed files with 123 additions and 111 deletions.
76 changes: 40 additions & 36 deletions dist/bigger-picture.cjs
Original file line number Diff line number Diff line change
@@ -696,32 +696,32 @@ const defaultTweenOptions = (duration) => ({
duration: prefersReducedMotion ? 0 : duration,
});

const getThumbBackground = (activeItem) =>
!activeItem.thumb || `url(${activeItem.thumb})`;

/* src/components/loading.svelte generated by Svelte v3.47.0 */

function create_if_block_1$2(ctx) {
let div;
let span0;
let span1;
let div_outro;
let current;

return {
c() {
div = element("div");
span0 = element("span");
span1 = element("span");
attr(span0, "class", "bp-bar");
attr(span1, "class", "bp-o");
div.innerHTML = `<span class="bp-bar"></span><span class="bp-o"></span>`;
attr(div, "class", "bp-load");
attr(div, "style", /*style*/ ctx[2]);
set_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[0]));
},
m(target, anchor) {
insert(target, div, anchor);
append(div, span0);
append(div, span1);
current = true;
},
p: noop,
p(ctx, dirty) {
if (dirty & /*activeItem*/ 1) {
set_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[0]));
}
},
i(local) {
if (current) return;
if (div_outro) div_outro.end(1);
@@ -741,7 +741,7 @@ function create_if_block_1$2(ctx) {
};
}

// (9:140) {#if $closing}
// (11:57) {#if $closing}
function create_if_block$2(ctx) {
let div;
let div_intro;
@@ -750,12 +750,16 @@ function create_if_block$2(ctx) {
c() {
div = element("div");
attr(div, "class", "bp-load");
attr(div, "style", /*style*/ ctx[2]);
set_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[0]));
},
m(target, anchor) {
insert(target, div, anchor);
},
p: noop,
p(ctx, dirty) {
if (dirty & /*activeItem*/ 1) {
set_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[0]));
}
},
i(local) {
if (!div_intro) {
add_render_callback(() => {
@@ -774,8 +778,8 @@ function create_if_block$2(ctx) {
function create_fragment$4(ctx) {
let if_block0_anchor;
let if_block1_anchor;
let if_block0 = !/*loaded*/ ctx[0] && create_if_block_1$2(ctx);
let if_block1 = /*$closing*/ ctx[1] && create_if_block$2(ctx);
let if_block0 = !/*loaded*/ ctx[1] && create_if_block_1$2(ctx);
let if_block1 = /*$closing*/ ctx[2] && create_if_block$2(ctx);

return {
c() {
@@ -791,11 +795,11 @@ function create_fragment$4(ctx) {
insert(target, if_block1_anchor, anchor);
},
p(ctx, [dirty]) {
if (!/*loaded*/ ctx[0]) {
if (!/*loaded*/ ctx[1]) {
if (if_block0) {
if_block0.p(ctx, dirty);

if (dirty & /*loaded*/ 1) {
if (dirty & /*loaded*/ 2) {
transition_in(if_block0, 1);
}
} else {
@@ -814,11 +818,11 @@ function create_fragment$4(ctx) {
check_outros();
}

if (/*$closing*/ ctx[1]) {
if (/*$closing*/ ctx[2]) {
if (if_block1) {
if_block1.p(ctx, dirty);

if (dirty & /*$closing*/ 2) {
if (dirty & /*$closing*/ 4) {
transition_in(if_block1, 1);
}
} else {
@@ -850,23 +854,22 @@ function create_fragment$4(ctx) {

function instance$4($$self, $$props, $$invalidate) {
let $closing;
component_subscribe($$self, closing, $$value => $$invalidate(1, $closing = $$value));
let { thumb } = $$props;
component_subscribe($$self, closing, $$value => $$invalidate(2, $closing = $$value));
let { activeItem } = $$props;
let { loaded } = $$props;
const style = `background-image:url(${thumb})`;

$$self.$$set = $$props => {
if ('thumb' in $$props) $$invalidate(3, thumb = $$props.thumb);
if ('loaded' in $$props) $$invalidate(0, loaded = $$props.loaded);
if ('activeItem' in $$props) $$invalidate(0, activeItem = $$props.activeItem);
if ('loaded' in $$props) $$invalidate(1, loaded = $$props.loaded);
};

return [loaded, $closing, style, thumb];
return [activeItem, loaded, $closing];
}

class Loading extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$4, create_fragment$4, not_equal, { thumb: 3, loaded: 0 });
init(this, options, instance$4, create_fragment$4, not_equal, { activeItem: 0, loaded: 1 });
}
}

@@ -928,7 +931,7 @@ function create_if_block$1(ctx) {

loading = new Loading({
props: {
thumb: /*activeItem*/ ctx[7].thumb,
activeItem: /*activeItem*/ ctx[7],
loaded: /*loaded*/ ctx[2]
}
});
@@ -965,6 +968,7 @@ function create_fragment$3(ctx) {
let div1;
let div0;
let if_block0_anchor;
let style_transform = `translate3d(${/*$imageDimensions*/ ctx[0][0] / -2 + /*$zoomDragTranslate*/ ctx[6][0]}px, ${/*$imageDimensions*/ ctx[0][1] / -2 + /*$zoomDragTranslate*/ ctx[6][1]}px, 0)`;
let current;
let mounted;
let dispose;
@@ -979,12 +983,12 @@ function create_fragment$3(ctx) {
if_block0_anchor = empty();
if (if_block1) if_block1.c();
attr(div0, "class", "bp-img");
set_style(div0, "background-image", "url(" + /*activeItem*/ ctx[7].thumb + ")");
set_style(div0, "width", /*$imageDimensions*/ ctx[0][0] + "px");
set_style(div0, "height", /*$imageDimensions*/ ctx[0][1] + "px");
set_style(div0, "transform", "translate3d(" + (/*$imageDimensions*/ ctx[0][0] / -2 + /*$zoomDragTranslate*/ ctx[6][0]) + "px, " + (/*$imageDimensions*/ ctx[0][1] / -2 + /*$zoomDragTranslate*/ ctx[6][1]) + "px, 0)");
toggle_class(div0, "bp-drag", /*pointerDown*/ ctx[4]);
toggle_class(div0, "bp-canzoom", /*maxZoom*/ ctx[11] > 1 && /*$imageDimensions*/ ctx[0][0] < /*naturalWidth*/ ctx[12]);
set_style(div0, "background-image", getThumbBackground(/*activeItem*/ ctx[7]));
set_style(div0, "transform", style_transform);
attr(div1, "class", "bp-img-wrap");
toggle_class(div1, "bp-close", /*closingWhileZoomed*/ ctx[5]);
},
@@ -1064,10 +1068,6 @@ function create_fragment$3(ctx) {
set_style(div0, "height", /*$imageDimensions*/ ctx[0][1] + "px");
}

if (!current || dirty[0] & /*$imageDimensions, $zoomDragTranslate*/ 65) {
set_style(div0, "transform", "translate3d(" + (/*$imageDimensions*/ ctx[0][0] / -2 + /*$zoomDragTranslate*/ ctx[6][0]) + "px, " + (/*$imageDimensions*/ ctx[0][1] / -2 + /*$zoomDragTranslate*/ ctx[6][1]) + "px, 0)");
}

if (dirty[0] & /*pointerDown*/ 16) {
toggle_class(div0, "bp-drag", /*pointerDown*/ ctx[4]);
}
@@ -1076,6 +1076,10 @@ function create_fragment$3(ctx) {
toggle_class(div0, "bp-canzoom", /*maxZoom*/ ctx[11] > 1 && /*$imageDimensions*/ ctx[0][0] < /*naturalWidth*/ ctx[12]);
}

if (dirty[0] & /*$imageDimensions, $zoomDragTranslate*/ 65 && style_transform !== (style_transform = `translate3d(${/*$imageDimensions*/ ctx[0][0] / -2 + /*$zoomDragTranslate*/ ctx[6][0]}px, ${/*$imageDimensions*/ ctx[0][1] / -2 + /*$zoomDragTranslate*/ ctx[6][1]}px, 0)`)) {
set_style(div0, "transform", style_transform);
}

if (dirty[0] & /*closingWhileZoomed*/ 32) {
toggle_class(div1, "bp-close", /*closingWhileZoomed*/ ctx[5]);
}
@@ -1524,7 +1528,7 @@ function create_fragment$2(ctx) {

loading = new Loading({
props: {
thumb: /*activeItem*/ ctx[2].thumb,
activeItem: /*activeItem*/ ctx[2],
loaded: /*loaded*/ ctx[0]
}
});
@@ -1622,7 +1626,7 @@ function create_fragment$1(ctx) {

loading = new Loading({
props: {
thumb: /*activeItem*/ ctx[2].thumb,
activeItem: /*activeItem*/ ctx[2],
loaded: /*loaded*/ ctx[0]
}
});
@@ -1634,7 +1638,7 @@ function create_fragment$1(ctx) {
attr(div, "class", "bp-vid");
set_style(div, "width", /*dimensions*/ ctx[1][0] + "px");
set_style(div, "height", /*dimensions*/ ctx[1][1] + "px");
set_style(div, "background-image", "url(" + /*activeItem*/ ctx[2].thumb + ")");
set_style(div, "background-image", getThumbBackground(/*activeItem*/ ctx[2]));
},
m(target, anchor) {
insert(target, div, anchor);
2 changes: 1 addition & 1 deletion dist/bigger-picture.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/bigger-picture.min.mjs

Large diffs are not rendered by default.

Loading

0 comments on commit 07b1bd0

Please sign in to comment.