c80_album_gallery 0.1.0.1 → 0.1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/app/assets/javascripts/c80_album_gallery/gallery.js +2 -2
- data/app/assets/javascripts/c80_album_gallery/gallery_list_grayscaled.js +16 -0
- data/app/assets/stylesheets/c80_album_gallery/_mixins/slot_item_overlayed.scss +6 -6
- data/app/assets/stylesheets/c80_album_gallery/gallery_list_grayscaled.scss +50 -0
- data/app/helpers/c80_album_gallery/c80_album_gallery_application_helper.rb +9 -2
- data/app/uploaders/c80_album_gallery/gphoto_uploader.rb +44 -4
- data/app/views/c80_album_gallery/_gallery_list_grayscaled.html.erb +38 -0
- data/lib/c80_album_gallery/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 533460b44411baf820bf5306a8a8993c9ada3b90
|
4
|
+
data.tar.gz: 7502687ae707545f9bf3a59f4c69ea33acc5a996
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 303f78fe06d3b7182490519e41c93509b6ba45a063effd1c4c3a9a1c29157cbae1dbf2d431ed5d7ff2963a7b2b94a5084d3f1cd4150312844096f2484cf12555
|
7
|
+
data.tar.gz: 59a531060779543c18c112f66af1de9647eb694871980b3a074f0444641c5981892e7aef54f048808f4c6f011dc9eab5dabb069d6b918d747b2bc8a1e9dd2380
|
data/.gitignore
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
$(document).ready(function () {
|
2
2
|
|
3
|
-
var $butts = $("ul#gallery_list").find("a");
|
3
|
+
/*var $butts = $("ul#gallery_list").find("a");
|
4
4
|
|
5
5
|
$butts.bind({
|
6
6
|
mouseenter: function() {
|
@@ -9,5 +9,5 @@ $(document).ready(function () {
|
|
9
9
|
mouseleave: function() {
|
10
10
|
$(this).removeClass("plusOpacity");
|
11
11
|
}
|
12
|
-
})
|
12
|
+
})*/
|
13
13
|
});
|
@@ -0,0 +1,16 @@
|
|
1
|
+
$(document).ready(function () {
|
2
|
+
|
3
|
+
var $gallery_list_grayscaled = $('.gallery_list_grayscaled');
|
4
|
+
//console.log('<$gallery_list_grayscaled>');
|
5
|
+
//console.log($gallery_list_grayscaled);
|
6
|
+
|
7
|
+
if ($gallery_list_grayscaled.length) {
|
8
|
+
//console.log('<+>');
|
9
|
+
|
10
|
+
setTimeout(function () {
|
11
|
+
//console.log('<setTimeout>');
|
12
|
+
$gallery_list_grayscaled.find('a.gray').addClass('my_fade');
|
13
|
+
},1000);
|
14
|
+
}
|
15
|
+
|
16
|
+
});
|
@@ -9,12 +9,12 @@
|
|
9
9
|
> a {
|
10
10
|
|
11
11
|
> img {
|
12
|
-
|
13
|
-
transition: all 0.5s
|
12
|
+
/*-webkit-transition: all 0.5s;
|
13
|
+
transition: all 0.5s;*/
|
14
14
|
|
15
|
-
filter: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg"><filter id="filter"><feComponentTransfer color-interpolation-filters="sRGB"><feFuncR type="linear" slope="1.4" /><feFuncG type="linear" slope="1.4" /><feFuncB type="linear" slope="1.4" /></feComponentTransfer></filter></svg>#filter');
|
15
|
+
/*filter: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg"><filter id="filter"><feComponentTransfer color-interpolation-filters="sRGB"><feFuncR type="linear" slope="1.4" /><feFuncG type="linear" slope="1.4" /><feFuncB type="linear" slope="1.4" /></feComponentTransfer></filter></svg>#filter');
|
16
16
|
filter: grayscale(1);
|
17
|
-
-webkit-filter: grayscale(1)
|
17
|
+
-webkit-filter: grayscale(1);*/
|
18
18
|
|
19
19
|
}
|
20
20
|
|
@@ -51,9 +51,9 @@
|
|
51
51
|
div.photo {
|
52
52
|
> a {
|
53
53
|
> img {
|
54
|
-
filter: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg"><filter id="filter"><feComponentTransfer color-interpolation-filters="sRGB"><feFuncR type="linear" slope="1.4" /><feFuncG type="linear" slope="1.4" /><feFuncB type="linear" slope="1.4" /></feComponentTransfer></filter></svg>#filter');
|
54
|
+
/*filter: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg"><filter id="filter"><feComponentTransfer color-interpolation-filters="sRGB"><feFuncR type="linear" slope="1.4" /><feFuncG type="linear" slope="1.4" /><feFuncB type="linear" slope="1.4" /></feComponentTransfer></filter></svg>#filter');
|
55
55
|
filter: grayscale(0);
|
56
|
-
-webkit-filter: grayscale(0)
|
56
|
+
-webkit-filter: grayscale(0);*/
|
57
57
|
}
|
58
58
|
}
|
59
59
|
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
div.gallery_list_grayscaled {
|
2
|
+
|
3
|
+
@extend %gallery_list_default;
|
4
|
+
|
5
|
+
&.style_photostudio {
|
6
|
+
@include style_photostudio;
|
7
|
+
}
|
8
|
+
|
9
|
+
&.style_photostudio_widget {
|
10
|
+
@include style_photostudio_widget;
|
11
|
+
}
|
12
|
+
|
13
|
+
.slot_item {
|
14
|
+
|
15
|
+
div.photo {
|
16
|
+
|
17
|
+
a {
|
18
|
+
position: absolute;
|
19
|
+
|
20
|
+
&.color {
|
21
|
+
z-index: 0;
|
22
|
+
}
|
23
|
+
|
24
|
+
&.gray {
|
25
|
+
z-index: 1;
|
26
|
+
background-image: none !important;
|
27
|
+
|
28
|
+
&:hover {
|
29
|
+
img {
|
30
|
+
opacity: 0;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
&.my_fade {
|
35
|
+
img {
|
36
|
+
-webkit-transition: opacity 0.45s linear;
|
37
|
+
-o-transition: opacity 0.45s linear;
|
38
|
+
transition: opacity 0.45s linear;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
}
|
43
|
+
|
44
|
+
}
|
45
|
+
|
46
|
+
}
|
47
|
+
|
48
|
+
}
|
49
|
+
|
50
|
+
}
|
@@ -97,9 +97,16 @@ module C80AlbumGallery
|
|
97
97
|
# 3. С помощью css_klass можно регулировать количество элементов в ряду.
|
98
98
|
# 4. С помощью css_list_klass можно кастомизировать внеший вид списка.
|
99
99
|
# 5. С помощью thumb_size можно регулировать размер картинки
|
100
|
+
# 6. С помощью is_grayscaled можно получить список из чб картинок.
|
100
101
|
def render_gallery_list( css_list_klass='style_1',
|
101
102
|
css_item_klass='col-lg-4 col-md-4 col-sm-6 col-xs-6',
|
102
|
-
thumb_size='thumb_md'
|
103
|
+
thumb_size='thumb_md',
|
104
|
+
is_grayscaled=false)
|
105
|
+
|
106
|
+
partial_name = 'c80_album_gallery/gallery_list'
|
107
|
+
if is_grayscaled
|
108
|
+
partial_name = 'c80_album_gallery/gallery_list_grayscaled'
|
109
|
+
end
|
103
110
|
|
104
111
|
galleries_list = Gallery.all.def_order
|
105
112
|
|
@@ -109,7 +116,7 @@ module C80AlbumGallery
|
|
109
116
|
h_style = "height:#{h}px"
|
110
117
|
# wh_style = "#{w_style};#{h_style}"
|
111
118
|
|
112
|
-
render :partial =>
|
119
|
+
render :partial => partial_name,
|
113
120
|
:locals => {
|
114
121
|
list: galleries_list,
|
115
122
|
css_list_klass: css_list_klass,
|
@@ -1,7 +1,11 @@
|
|
1
|
+
require 'carrierwave/processing/mini_magick'
|
2
|
+
|
1
3
|
module C80AlbumGallery
|
2
4
|
|
3
5
|
class GphotoUploader < BaseFileUploader
|
4
6
|
|
7
|
+
include CarrierWave::MiniMagick
|
8
|
+
|
5
9
|
def store_dir
|
6
10
|
"uploads/gallery/#{format("%03d",model.gallery_id)}"
|
7
11
|
end
|
@@ -13,21 +17,37 @@ module C80AlbumGallery
|
|
13
17
|
process :resize_to_lg
|
14
18
|
end
|
15
19
|
|
20
|
+
version :thumb_lg_gray do
|
21
|
+
process :resize_to_lg => 'gray'
|
22
|
+
end
|
23
|
+
|
16
24
|
version :thumb_md do
|
17
25
|
process :resize_to_md
|
18
26
|
end
|
19
27
|
|
28
|
+
version :thumb_md_gray do
|
29
|
+
process :resize_to_md => 'gray'
|
30
|
+
end
|
31
|
+
|
20
32
|
version :thumb_sm do
|
21
33
|
process :resize_to_sm
|
22
34
|
end
|
35
|
+
|
36
|
+
version :thumb_sm_gray do
|
37
|
+
process :resize_to_sm => 'gray'
|
38
|
+
end
|
23
39
|
|
24
40
|
version :thumb_preview do
|
25
41
|
process :resize_to_preview
|
26
42
|
end
|
27
43
|
|
44
|
+
version :thumb_preview_gray do
|
45
|
+
process :resize_to_preview => 'gray'
|
46
|
+
end
|
47
|
+
|
28
48
|
# ------------------------------------------------------------------------------------------------------------------------
|
29
49
|
|
30
|
-
def resize_to_lg
|
50
|
+
def resize_to_lg(type='normal')
|
31
51
|
|
32
52
|
manipulate! do |img|
|
33
53
|
|
@@ -37,6 +57,11 @@ module C80AlbumGallery
|
|
37
57
|
img.resize "#{w}x#{h}^"
|
38
58
|
img.gravity 'center'
|
39
59
|
img.extent "#{w}x#{h}"
|
60
|
+
|
61
|
+
if type == 'gray'
|
62
|
+
img = img.colorspace 'Gray'
|
63
|
+
end
|
64
|
+
|
40
65
|
img = yield(img) if block_given?
|
41
66
|
img
|
42
67
|
|
@@ -44,7 +69,7 @@ module C80AlbumGallery
|
|
44
69
|
|
45
70
|
end
|
46
71
|
|
47
|
-
def resize_to_md
|
72
|
+
def resize_to_md(type='normal')
|
48
73
|
|
49
74
|
manipulate! do |img|
|
50
75
|
|
@@ -54,6 +79,11 @@ module C80AlbumGallery
|
|
54
79
|
img.resize "#{w}x#{h}^"
|
55
80
|
img.gravity 'center'
|
56
81
|
img.extent "#{w}x#{h}"
|
82
|
+
|
83
|
+
if type == 'gray'
|
84
|
+
img = img.colorspace 'gray'
|
85
|
+
end
|
86
|
+
|
57
87
|
img = yield(img) if block_given?
|
58
88
|
img
|
59
89
|
|
@@ -61,7 +91,7 @@ module C80AlbumGallery
|
|
61
91
|
|
62
92
|
end
|
63
93
|
|
64
|
-
def resize_to_sm
|
94
|
+
def resize_to_sm(type='normal')
|
65
95
|
|
66
96
|
manipulate! do |img|
|
67
97
|
|
@@ -71,6 +101,11 @@ module C80AlbumGallery
|
|
71
101
|
img.resize "#{w}x#{h}^"
|
72
102
|
img.gravity 'center'
|
73
103
|
img.extent "#{w}x#{h}"
|
104
|
+
|
105
|
+
if type == 'gray'
|
106
|
+
img = img.colorspace 'gray'
|
107
|
+
end
|
108
|
+
|
74
109
|
img = yield(img) if block_given?
|
75
110
|
img
|
76
111
|
|
@@ -78,7 +113,7 @@ module C80AlbumGallery
|
|
78
113
|
|
79
114
|
end
|
80
115
|
|
81
|
-
def resize_to_preview
|
116
|
+
def resize_to_preview(type='normal')
|
82
117
|
|
83
118
|
manipulate! do |img|
|
84
119
|
|
@@ -88,6 +123,11 @@ module C80AlbumGallery
|
|
88
123
|
img.resize "#{w}x#{h}^"
|
89
124
|
img.gravity 'center'
|
90
125
|
img.extent "#{w}x#{h}"
|
126
|
+
|
127
|
+
if type == 'gray'
|
128
|
+
img = img.colorspace 'gray'
|
129
|
+
end
|
130
|
+
|
91
131
|
img = yield(img) if block_given?
|
92
132
|
img
|
93
133
|
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<div class="gallery_list_grayscaled <%= css_list_klass %> clearfix">
|
2
|
+
|
3
|
+
<% list.each_with_index do |gallery,i| %>
|
4
|
+
<% title = gallery.title %>
|
5
|
+
<% image = nil %>
|
6
|
+
<% image_grayscale = nil %>
|
7
|
+
<% a_klass = 'nil_img' %>
|
8
|
+
<% image = gallery.gphotos.first.image.send(thumb_size) if gallery.gphotos.count > 0 %>
|
9
|
+
<% image_grayscale = gallery.gphotos.first.image.send("#{thumb_size}_gray") if gallery.gphotos.count > 0 %>
|
10
|
+
<% a_klass = '' if gallery.gphotos.count > 0 %>
|
11
|
+
<% url = my_url_for_gallery(gallery) %>
|
12
|
+
|
13
|
+
<div class="slot_item <%= css_item_klass %> n_<%= i %>">
|
14
|
+
<div class="photo" style="<%= "#{w_style};#{h_style}" %>">
|
15
|
+
<%= render_image_link_lazy({
|
16
|
+
:alt_image => title,
|
17
|
+
:image => image,
|
18
|
+
:a_href => url,
|
19
|
+
:a_class => "#{a_klass} color",
|
20
|
+
:a_css_style => "#{w_style};#{h_style}",
|
21
|
+
:a_rel => 'nofollow'
|
22
|
+
}) %>
|
23
|
+
<%= render_image_link_lazy({
|
24
|
+
:alt_image => title,
|
25
|
+
:image => image_grayscale,
|
26
|
+
:a_href => url,
|
27
|
+
:a_class => "#{a_klass} gray",
|
28
|
+
:a_css_style => "#{w_style};#{h_style}",
|
29
|
+
:a_rel => 'nofollow'
|
30
|
+
}) %>
|
31
|
+
</div>
|
32
|
+
<div class="title" style="<%= "#{w_style}" %>">
|
33
|
+
<%= link_to title, url, :title => title %>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
<% end %>
|
37
|
+
|
38
|
+
</div>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: c80_album_gallery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- C80609A
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -83,12 +83,14 @@ files:
|
|
83
83
|
- app/admin/c80_album_gallery/galleries.rb
|
84
84
|
- app/assets/javascripts/c80_album_gallery.js.coffee
|
85
85
|
- app/assets/javascripts/c80_album_gallery/gallery.js
|
86
|
+
- app/assets/javascripts/c80_album_gallery/gallery_list_grayscaled.js
|
86
87
|
- app/assets/stylesheets/c80_album_gallery.scss
|
87
88
|
- app/assets/stylesheets/c80_album_gallery/_mixins/gallery_list_default.scss
|
88
89
|
- app/assets/stylesheets/c80_album_gallery/_mixins/slot_item_overlayed.scss
|
89
90
|
- app/assets/stylesheets/c80_album_gallery/_styles/style_photostudio.scss
|
90
91
|
- app/assets/stylesheets/c80_album_gallery/_styles/style_photostudio_widget.scss
|
91
92
|
- app/assets/stylesheets/c80_album_gallery/gallery_list.scss
|
93
|
+
- app/assets/stylesheets/c80_album_gallery/gallery_list_grayscaled.scss
|
92
94
|
- app/assets/stylesheets/c80_album_gallery/gallery_list_slots.scss
|
93
95
|
- app/assets/stylesheets/c80_album_gallery/gallery_view.scss
|
94
96
|
- app/helpers/c80_album_gallery/c80_album_gallery_application_helper.rb
|
@@ -98,6 +100,7 @@ files:
|
|
98
100
|
- app/uploaders/c80_album_gallery/gphoto_uploader.rb
|
99
101
|
- app/views/c80_album_gallery/_flow_galleries_slots.html.erb
|
100
102
|
- app/views/c80_album_gallery/_gallery_list.html.erb
|
103
|
+
- app/views/c80_album_gallery/_gallery_list_grayscaled.html.erb
|
101
104
|
- app/views/c80_album_gallery/_gallery_view_page.html.erb
|
102
105
|
- bin/console
|
103
106
|
- bin/setup
|