kamifusen 0.9.6 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/views/kamifusen/_view.html.erb +15 -2
- data/lib/kamifusen/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2664cf5dea01a7294d0f2c9b017b2d6bd00a3d0a81daaa161f95f924ee62479e
|
4
|
+
data.tar.gz: 5301c3d3ad0733b2a7376f3a8a417b4a02d74c59eebf35f5cde3906e2e179523
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c06c337ed793d477bd3dd9539517c4ba09011e8c0e801b084e8ae477991dc168f45d63165fa4754170003b60aab1ce0ef886eacd98bf2a80823f9dc7ab81eda
|
7
|
+
data.tar.gz: 69acef22af9cb3beb364f593f7fb6005e564f3f93ec95af6005bf3255b166715cb79f11fd3253e56f1fc0e3b1c6cb09f1d171126236a148bb180b737736fa5a0
|
data/Gemfile.lock
CHANGED
@@ -17,7 +17,20 @@ parameters += " class=\"#{ options[:class] }\"" if klass
|
|
17
17
|
sizes = [320, 576, 640, 768, 992, 1152, 1200, 1400, 1536, 1984, 2400]
|
18
18
|
quality = 80
|
19
19
|
# Computing
|
20
|
-
|
20
|
+
if width
|
21
|
+
width_retina = width * 2
|
22
|
+
# If we ask for a 175px width, we should have 320 and 576 sizes
|
23
|
+
size_is_too_big = false
|
24
|
+
sizes.reject! do |size|
|
25
|
+
# If the previous size was too big, we should reject this one
|
26
|
+
should_reject_this_size = size_is_too_big
|
27
|
+
# If this size is the first "too big" size, we should take it
|
28
|
+
size_is_too_big = size > width_retina
|
29
|
+
should_reject_this_size
|
30
|
+
end
|
31
|
+
end
|
32
|
+
default_width = sizes.max
|
33
|
+
default_width = width_retina if width_retina && width_retina > default_width
|
21
34
|
if Kamifusen.with_webp
|
22
35
|
srcset_webp = sizes.map { |size|
|
23
36
|
"#{ url_for source.variant(resize: "#{size}>", format: :webp, quality: quality) } #{ size }w"
|
@@ -26,7 +39,7 @@ parameters += " class=\"#{ options[:class] }\"" if klass
|
|
26
39
|
srcset_default = sizes.map { |size|
|
27
40
|
"#{ url_for source.variant(resize: "#{size}>", quality: quality) } #{ size }w"
|
28
41
|
}.join(', ')
|
29
|
-
default = url_for source.variant(resize: "#{
|
42
|
+
default = url_for source.variant(resize: "#{default_width}>", quality: quality)
|
30
43
|
%>
|
31
44
|
<picture>
|
32
45
|
<% if Kamifusen.with_webp %>
|
data/lib/kamifusen/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kamifusen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sébastien Moulène
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-06-
|
12
|
+
date: 2021-06-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|