yefeme 0.8.2 → 0.8.4

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