kamifusen 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/app/views/kamifusen/_view.html.erb +27 -12
- 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: 61185a31bdae5117672878baf5e5f05bf66e1ae8288420d54b9614a8be040176
|
4
|
+
data.tar.gz: 4a50a5934a684287b428503d17f0f25c400089b17d69ebffd3b14ebebae19436
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7ada36299ca1dd019e5dc36431b86bb7af361eef886a92056a1c79066ae83b1e5453ed0320739bed31b0393905ace82fa91a4e7c2dc1b4da259f946a124a986
|
7
|
+
data.tar.gz: 3d8845a6231bc7429bb6977aaa0289ca9bef05cda5daaf56bd287921c266930365043f848734a4a33b50a9382cfe161d893af8e1282d59b2aed2d8bf2d1a34ed
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
|
4
|
+
kamifusen (0.9.2)
|
5
5
|
image_processing
|
6
6
|
rails
|
7
7
|
|
@@ -94,7 +94,7 @@ GEM
|
|
94
94
|
mini_mime (1.0.3)
|
95
95
|
minitest (5.14.4)
|
96
96
|
nio4r (2.5.7)
|
97
|
-
nokogiri (1.11.
|
97
|
+
nokogiri (1.11.6-x86_64-darwin)
|
98
98
|
racc (~> 1.4)
|
99
99
|
parallel (1.20.1)
|
100
100
|
parser (3.0.1.1)
|
@@ -162,7 +162,7 @@ GEM
|
|
162
162
|
tzinfo (2.0.4)
|
163
163
|
concurrent-ruby (~> 1.0)
|
164
164
|
unicode-display_width (2.0.0)
|
165
|
-
websocket-driver (0.7.
|
165
|
+
websocket-driver (0.7.4)
|
166
166
|
websocket-extensions (>= 0.1.0)
|
167
167
|
websocket-extensions (0.1.5)
|
168
168
|
zeitwerk (2.4.2)
|
@@ -171,7 +171,7 @@ PLATFORMS
|
|
171
171
|
x86_64-darwin-20
|
172
172
|
|
173
173
|
DEPENDENCIES
|
174
|
-
|
174
|
+
kamifusen!
|
175
175
|
listen
|
176
176
|
rake (~> 13.0)
|
177
177
|
rubocop (~> 1.7)
|
@@ -1,18 +1,33 @@
|
|
1
1
|
<%
|
2
2
|
# image_tag options
|
3
|
+
options ||= {}
|
3
4
|
alt = options[:alt]
|
4
5
|
width = options[:width]
|
5
6
|
height = options[:height]
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
#
|
10
|
-
|
11
|
-
|
12
|
-
jpgs = sizes.map { |size| "#{ url_for source.variant(resize: "#{size}>", format: :jpg, quality: quality) } #{ size } vw" }.join(', ')
|
13
|
-
default = url_for source.variant(resize: "#{sizes.max}>", format: :jpg, quality: quality)
|
7
|
+
klass = options[:class]
|
8
|
+
parameters = " loading=\"lazy\" decoding=\"async\""
|
9
|
+
parameters += " alt=\"#{ options[:alt] }\"" if alt
|
10
|
+
parameters += " width=\"#{ options[:width] }\"" if width
|
11
|
+
parameters += " height=\"#{ options[:height]}\"" if height
|
12
|
+
parameters += " class=\"#{ options[:class] }\"" if klass
|
14
13
|
%>
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
<% if source.variable? %>
|
15
|
+
<%
|
16
|
+
# kamifusen settings
|
17
|
+
sizes = [320, 576, 640, 768, 992, 1152, 1200, 1400, 1536, 1984, 2400]
|
18
|
+
quality = 80
|
19
|
+
# Computing
|
20
|
+
sizes.reject! { |size| size > width * 2 } if width
|
21
|
+
webps = sizes.map { |size| "#{ url_for source.variant(resize: "#{size}>", format: :webp, quality: quality) } #{ size } vw" }.join(', ')
|
22
|
+
jpgs = sizes.map { |size| "#{ url_for source.variant(resize: "#{size}>", format: :jpg, quality: quality) } #{ size } vw" }.join(', ')
|
23
|
+
default = url_for source.variant(resize: "#{sizes.max}>", format: :jpg, quality: quality)
|
24
|
+
%>
|
25
|
+
<picture>
|
26
|
+
<source srcset="<%= webps %>">
|
27
|
+
<img src="<%= default %>" srcset="<%= jpgs %>"<%= raw parameters %>>
|
28
|
+
</picture>
|
29
|
+
<% else %>
|
30
|
+
<picture>
|
31
|
+
<img src="<%= url_for source %>"<%= raw parameters %>>
|
32
|
+
</picture>
|
33
|
+
<% end %>
|
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.2
|
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-05-
|
12
|
+
date: 2021-05-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|