yefeme 0.8.6 → 0.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a53d4e13b572c6fc98aa23ab01246954cb507ada25c039b2bbe23b411940f1e0
4
- data.tar.gz: b0d9f04c159ffbb0461de0d3f7bc4c196d076b4e6306e617c853cc7793402878
3
+ metadata.gz: ce7aecef49db3c9b1eb4e27cf6834cb84dd58bf97fd329254583afe478921788
4
+ data.tar.gz: ebae52ad026ca234f6702308a02674a6e2136b408907350f50421c814bf5d477
5
5
  SHA512:
6
- metadata.gz: 452d2b3a08470c568cf4ac73bdd7c029fef5e44ff0f3526c0cc2d23d301e14e15e4772f9bf78f8d190d9e95882477b0f401a36bf25eff9a674af6323b124bcdf
7
- data.tar.gz: edbda65379bb1406841d8bb83c951a59b3e28be7238befc54623000169cd14ab033572fbb1fd8fed43c3e69923f1c2b6db4fca983b819294281fa413541095a2
6
+ metadata.gz: 47f8597e98ed5afc30468477bc98be4c980a25dcccb2393519b96108399ee71423d41f24cec9e9334d6c4b3ae80a622827faa1e3eeb340e840419dd2fc736744
7
+ data.tar.gz: 4316454c2484d435fade0b412b795bbe200b38b5310b6b77d701f4676d4b0a98c42a38f411634eae4d7bdd6409714c279d18ff48d2e5e25dc070fd611ca72b0c
data/README.md CHANGED
@@ -77,7 +77,7 @@ images:
77
77
  ---
78
78
  ```
79
79
 
80
- The theme decodes each BlurHash in the browser and displays it as an immediate placeholder behind the full thumbnail. Selecting a thumbnail opens the shoot in a full-screen lightbox with button, keyboard, and swipe navigation. Scalar image IDs remain supported for existing sites, but do not provide intrinsic sizing or placeholder information.
80
+ The theme decodes each BlurHash in the browser and displays it as an immediate placeholder behind the full thumbnail. Selecting a thumbnail opens the shoot in a full-screen lightbox with button, keyboard, horizontal swipe, and native pinch-to-zoom navigation. Scalar image IDs remain supported for existing sites, but do not provide intrinsic sizing or placeholder information.
81
81
 
82
82
  ## Contributing
83
83
 
@@ -106,7 +106,7 @@
106
106
  opacity: var(--resolution-opacity, 1);
107
107
  position: absolute;
108
108
  top: 50%;
109
- touch-action: pan-x;
109
+ touch-action: manipulation;
110
110
  transform: translate(-50%, calc(-50% - 1.5rem));
111
111
  transition: opacity 0.3s ease;
112
112
  user-select: none;
@@ -122,16 +122,6 @@
122
122
  --resolution-opacity: 1;
123
123
  }
124
124
 
125
- .slide img.dragging {
126
- opacity: calc(var(--resolution-opacity, 1) * var(--drag-opacity, 1));
127
- transform: translate(-50%, calc(-50% - 1.5rem)) translateY(var(--drag-y, 0));
128
- transition: none;
129
- }
130
-
131
- .slide img.dismissing {
132
- transition: opacity 0.2s ease-out, transform 0.2s ease-out;
133
- }
134
-
135
125
  .status {
136
126
  clip: rect(0 0 0 0);
137
127
  clip-path: inset(50%);
@@ -155,10 +145,6 @@
155
145
  max-width: calc(98dvw - 6rem);
156
146
  transform: translate(-50%, -50%);
157
147
  }
158
-
159
- .slide img.dragging {
160
- transform: translate(-50%, -50%) translateY(var(--drag-y, 0));
161
- }
162
148
  }
163
149
 
164
150
  @media (prefers-color-scheme: dark) {
@@ -178,7 +164,7 @@
178
164
 
179
165
  @media (prefers-reduced-motion: reduce) {
180
166
  .modal,
181
- .slide img.dismissing {
167
+ .slide img {
182
168
  transition: none;
183
169
  }
184
170
  }
data/assets/lightbox.js CHANGED
@@ -3,8 +3,6 @@
3
3
 
4
4
  if (!window.customElements || window.customElements.get("shoot-lightbox")) return;
5
5
 
6
- var VERTICAL_DRAG_DISTANCE = 10;
7
-
8
6
  function getImage(photo) {
9
7
  return photo.querySelector("img");
10
8
  }
@@ -51,7 +49,7 @@
51
49
  image.loading = "eager";
52
50
  image.decoding = "async";
53
51
  image.draggable = false;
54
- this.bindImageEvents(image);
52
+ image.addEventListener("click", (event) => event.stopPropagation());
55
53
 
56
54
  slide.appendChild(image);
57
55
  this.track.appendChild(slide);
@@ -60,14 +58,6 @@
60
58
  this.slides = Array.from(this.track.querySelectorAll(".slide"));
61
59
  }
62
60
 
63
- bindImageEvents(image) {
64
- image.addEventListener("click", (event) => event.stopPropagation());
65
- image.addEventListener("touchstart", this.startTouch, { passive: true });
66
- image.addEventListener("touchmove", this.dragVertically, { passive: false });
67
- image.addEventListener("touchend", this.endTouch);
68
- image.addEventListener("touchcancel", this.resetGesture);
69
- }
70
-
71
61
  loadHighResolutionImage(slide, photo) {
72
62
  if (!slide || !photo.href || slide.dataset.highResolutionRequested) return;
73
63
 
@@ -90,7 +80,7 @@
90
80
  image.loading = "eager";
91
81
  image.decoding = "async";
92
82
  image.draggable = false;
93
- this.bindImageEvents(image);
83
+ image.addEventListener("click", (event) => event.stopPropagation());
94
84
 
95
85
  var reveal = () => {
96
86
  if (revealed) return;
@@ -121,7 +111,6 @@
121
111
  this.previousButton.addEventListener("click", this.previous);
122
112
  this.nextButton.addEventListener("click", this.next);
123
113
  this.closeButton.addEventListener("click", this.close);
124
- this.modal.addEventListener("click", this.close);
125
114
  this.track.addEventListener("scroll", this.onScroll, { passive: true });
126
115
  document.addEventListener("keydown", this.onKeydown);
127
116
  window.addEventListener("resize", this.onResize, { passive: true });
@@ -150,7 +139,6 @@
150
139
  this.modal.classList.add("hidden");
151
140
  this.modal.setAttribute("aria-hidden", "true");
152
141
  document.documentElement.classList.remove("lightbox-open");
153
- this.resetGesture();
154
142
 
155
143
  if (this.previouslyFocused) this.previouslyFocused.focus({ preventScroll: true });
156
144
  };
@@ -216,89 +204,6 @@
216
204
  if (this.modal.classList.contains("hidden")) return;
217
205
  this.updateCurrentPhoto(this.currentPhoto, "auto");
218
206
  };
219
-
220
- startTouch = (event) => {
221
- if (event.touches.length !== 1) return;
222
-
223
- this.touchStartX = event.touches[0].clientX;
224
- this.touchStartY = event.touches[0].clientY;
225
- this.gestureDirection = "undecided";
226
- };
227
-
228
- dragVertically = (event) => {
229
- if (event.touches.length !== 1 || this.gestureDirection === "horizontal") return;
230
-
231
- var deltaX = Math.abs(event.touches[0].clientX - this.touchStartX);
232
- var deltaY = Math.abs(event.touches[0].clientY - this.touchStartY);
233
-
234
- if (this.gestureDirection === "undecided") {
235
- if (deltaX < VERTICAL_DRAG_DISTANCE && deltaY < VERTICAL_DRAG_DISTANCE) return;
236
- this.gestureDirection = deltaX > deltaY ? "horizontal" : "vertical";
237
- }
238
-
239
- if (this.gestureDirection !== "vertical") return;
240
-
241
- event.preventDefault();
242
- this.track.style.scrollSnapType = "none";
243
- this.track.style.overflowX = "hidden";
244
- this.applyVerticalDrag(event.touches[0].clientY - this.touchStartY);
245
- };
246
-
247
- applyVerticalDrag(distance) {
248
- var images = this.currentImages();
249
- if (!images.length) return;
250
-
251
- var maxDrag = window.innerHeight * 0.5;
252
- var opacity = Math.max(0, Math.min(1, 1 - Math.abs(distance) / maxDrag));
253
-
254
- images.forEach((image) => {
255
- image.classList.add("dragging");
256
- image.style.setProperty("--drag-y", distance + "px");
257
- image.style.setProperty("--drag-opacity", opacity);
258
- });
259
- }
260
-
261
- endTouch = (event) => {
262
- if (this.gestureDirection !== "vertical") return;
263
-
264
- var distance = event.changedTouches[0].clientY - this.touchStartY;
265
- var dismissDistance = Math.min(window.innerHeight * 0.3, 150);
266
-
267
- if (Math.abs(distance) < dismissDistance) {
268
- this.resetGesture();
269
- return;
270
- }
271
-
272
- var images = this.currentImages();
273
- if (!images.length) return;
274
-
275
- images.forEach((image) => {
276
- image.classList.add("dismissing");
277
- image.style.setProperty("--drag-y", (distance > 0 ? distance + 200 : distance - 200) + "px");
278
- image.style.setProperty("--drag-opacity", "0");
279
- });
280
- window.setTimeout(() => this.close(), 200);
281
- };
282
-
283
- currentImages() {
284
- var slide = this.slides && this.slides[this.currentPhoto];
285
- return slide ? Array.from(slide.querySelectorAll("img")) : [];
286
- }
287
-
288
- resetGesture = () => {
289
- this.currentImages().forEach((image) => {
290
- image.classList.remove("dragging", "dismissing");
291
- image.style.removeProperty("--drag-y");
292
- image.style.removeProperty("--drag-opacity");
293
- });
294
-
295
- if (this.track) {
296
- this.track.style.removeProperty("scroll-snap-type");
297
- this.track.style.removeProperty("overflow-x");
298
- }
299
-
300
- this.gestureDirection = "undecided";
301
- };
302
207
  }
303
208
 
304
209
  window.customElements.define("shoot-lightbox", ShootLightbox);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yefeme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.6
4
+ version: 0.8.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yefim Vedernikoff