sigmund_liquid 1.0.12 → 1.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/sigmund/liquid/filters/color.rb +33 -0
- data/lib/sigmund/liquid/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmRlNDY5YmM1ZjdjM2Y5ZTVjY2Y3OWVhYmIyMWI2MTZkMGJiZTIzNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTc1ZmI3ZWExYjE2ZGVmZjViZmZlN2NmOWU3Y2E5ODNlMmNmZDhlMw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjMxNmY1YTUwNmIxN2JlMjNiZmJmNGU4MTM0MDFjNzllNGUwOWU2NGYyMTI2
|
10
|
+
ZmQzYTJkNDVmYzdhNTdkOWVlZDQxY2Y4MmJiMGU5NWNkOGNhNGIyN2NlMDUx
|
11
|
+
Nzc2ZjVhNDc2YjI5MDYzOTZiNjBkNzJiZWM1ZWYxMzg1ODBkYjc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
N2YzNGFmY2M1YTVmMzU3MmU1OWEwZjI4NTgwOWE2MmFmNWVjODRjZGM3NjIy
|
14
|
+
Y2Q3NTIzMmEyZGFmM2RmNzYwOTM1YTc2NjJlNjcyYzVkMmFiMWVhNmEyNmU1
|
15
|
+
YmY3MmM0YWMxYzdjNTkwZTIwMWUwMzdkMDNmOTEzMzRjODNjZDY=
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Sigmund
|
2
|
+
module Liquid
|
3
|
+
module Filters
|
4
|
+
module Color
|
5
|
+
def css_gradient(input)
|
6
|
+
|
7
|
+
css = ""
|
8
|
+
if input.blank?
|
9
|
+
return css
|
10
|
+
end
|
11
|
+
|
12
|
+
if colors = input.match(/#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})/i)
|
13
|
+
red, green, blue = colors.captures
|
14
|
+
explorerShit = '#00' + red + green + blue
|
15
|
+
red = red.hex.to_s
|
16
|
+
green = green.hex.to_s
|
17
|
+
blue = blue.hex.to_s
|
18
|
+
|
19
|
+
css << "background: -moz-linear-gradient(left, rgba(#{red}, #{green}, #{blue}, 0) 0%, rgba(#{red}, #{green}, #{blue}, 0.8) 70%, #{input} 100%);"
|
20
|
+
css << "background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(#{red}, #{green}, #{blue}, 0)), color-stop(70%, rgba(#{red}, #{green}, #{blue}, 0.8)), color-stop(100%, #{input}));"
|
21
|
+
css << "background: -webkit-linear-gradient(left, rgba(#{red}, #{green}, #{blue}, 0) 0%, rgba(#{red}, #{green}, #{blue}, 0.8) 70%, #{input} 100%);"
|
22
|
+
css << "background: -o-linear-gradient(left, rgba(#{red}, #{green}, #{blue}, 0) 0%, rgba(#{red}, #{green}, #{blue}, 0.8) 70%, #{input} 100%);"
|
23
|
+
css << "background: -ms-linear-gradient(left, rgba(#{red}, #{green}, #{blue}, 0) 0%, rgba(#{red}, #{green}, #{blue}, 0.8) 70%, #{input} 100%);"
|
24
|
+
css << "background: linear-gradient(to right, rgba(#{red}, #{green}, #{blue}, 0) 0%, rgba(#{red}, #{green}, #{blue}, 0.8) 70%, #{input} 100%);"
|
25
|
+
css << "filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#{explorerShit}, endColorstr='#{input}',GradientType=1 );"
|
26
|
+
end
|
27
|
+
css
|
28
|
+
end
|
29
|
+
end
|
30
|
+
::Liquid::Template.register_filter(Color)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sigmund_liquid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- amainguy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -59,6 +59,7 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
+
- lib/sigmund/liquid/filters/color.rb
|
62
63
|
- lib/sigmund/liquid/tags/children_nav.rb
|
63
64
|
- lib/sigmund/liquid/tags/custom_nav.rb
|
64
65
|
- lib/sigmund/liquid/version.rb
|