yefeme 0.8.2 → 0.8.3

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: ed0199dd1d91cedd1a8a0120ea61490ebad253d41eec07af9be7c95352307363
4
- data.tar.gz: 2d97f48217a11e8b30b55f21b43cb23a355c87956e5b37cdfe35420481021cf2
3
+ metadata.gz: 98cdc649f2205522fd9a3f7eabc889d1895a3d38d789455ad2bc26c8bd53d721
4
+ data.tar.gz: a7717bbf58c188e7bad0a63bca69b06ec0fe98e9ca5e2c2a76895659d5a204c6
5
5
  SHA512:
6
- metadata.gz: ef18f21c9cccd8092fdcd8da3ba93b47f678b2dad695a6e57cc37712da1a551ee8c63b58f5dc4503ab0a5a94ed3cc814d38b427e7d38f8822489f2ef98304c82
7
- data.tar.gz: c180febcd4ec4b6c676f8e4ce25e447dfaee3d1f89bbbc85abfcebe8347f2e3d576ed8557668518e24d0318877ffa126f271a0229e4fb749c75170141862299a
6
+ metadata.gz: 39c62a0d0aeff0a7f595b9864bcb067f79cc70e3e8296c72a1e3b0243b8d1f97d0b4ab502420c5934db51736cb474af01d6013e259d4c3e30eecc1eade1044df
7
+ data.tar.gz: 0430a250c774e61977c0158377e9221ebcb59952b5c7018ec568c0d19b480d8d09b0aa73896a3af366fc06beafd86c4cccc15d4dea25670ba8def031acc8b8bb
data/_sass/yefeme.scss CHANGED
@@ -385,6 +385,10 @@ img[data-blurhash] {
385
385
  background-size: cover;
386
386
  }
387
387
 
388
+ img.blurhash-loading {
389
+ color: transparent;
390
+ }
391
+
388
392
  .social {
389
393
  display: flex;
390
394
  gap: 16px;
data/assets/blurhash.js CHANGED
@@ -98,6 +98,15 @@
98
98
 
99
99
  if (!hash || !intrinsicWidth || !intrinsicHeight) return;
100
100
 
101
+ function finishLoading() {
102
+ image.classList.remove("blurhash-loading");
103
+ }
104
+
105
+ image.classList.add("blurhash-loading");
106
+ image.addEventListener("load", finishLoading, { once: true });
107
+ image.addEventListener("error", finishLoading, { once: true });
108
+ if (image.complete) finishLoading();
109
+
101
110
  var width = intrinsicWidth >= intrinsicHeight ? 32 : Math.max(1, Math.round(32 * intrinsicWidth / intrinsicHeight));
102
111
  var height = intrinsicHeight >= intrinsicWidth ? 32 : Math.max(1, Math.round(32 * intrinsicHeight / intrinsicWidth));
103
112
  var cacheKey = hash + ":" + width + "x" + height;
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.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yefim Vedernikoff