bay_jekyll_theme 1.0.15 → 1.0.18
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 +4 -4
- data/CHANGELOG.md +80 -0
- data/README.md +3 -0
- data/_includes/foot.html +0 -1
- data/_includes/footer.html +38 -37
- data/_layouts/home.html +1 -1
- data/_sass/_layout.scss +10 -2
- data/_sass/_site.scss +31 -22
- data/assets/img/content/post-example/Banner.jpg +0 -0
- data/assets/img/icons/dribbble.png +0 -0
- data/assets/img/icons/email.png +0 -0
- data/assets/img/icons/facebook.png +0 -0
- data/assets/img/icons/github.png +0 -0
- data/assets/img/icons/keybase.png +0 -0
- data/assets/img/icons/linkedin.png +0 -0
- data/assets/img/icons/rss.png +0 -0
- data/assets/img/icons/twitter.png +0 -0
- data/assets/img/icons/wechat.png +0 -0
- data/assets/img/icons/weibo.png +0 -0
- data/assets/img/menu.png +0 -0
- data/assets/img/profile-pic.jpg +0 -0
- data/assets/img/title.png +0 -0
- data/assets/img/wechat-qr-code.png +0 -0
- data/assets/img/work/sand.png +0 -0
- data/assets/img/work/water.png +0 -0
- metadata +8 -25
- data/assets/img/content/post-example/Banner@2x.jpg +0 -0
- data/assets/img/icons/dribbble@2x.png +0 -0
- data/assets/img/icons/email@2x.png +0 -0
- data/assets/img/icons/facebook@2x.png +0 -0
- data/assets/img/icons/github@2x.png +0 -0
- data/assets/img/icons/keybase@2x.png +0 -0
- data/assets/img/icons/linkedin@2x.png +0 -0
- data/assets/img/icons/rss@2x.png +0 -0
- data/assets/img/icons/twitter@2x.png +0 -0
- data/assets/img/icons/wechat@2x.png +0 -0
- data/assets/img/icons/weibo@2x.png +0 -0
- data/assets/img/menu@2x.png +0 -0
- data/assets/img/profile-pic@2x.jpg +0 -0
- data/assets/img/title@2x.png +0 -0
- data/assets/img/wechat-qr-code@2x.png +0 -0
- data/assets/img/work/sand@2x.png +0 -0
- data/assets/img/work/water@2x.png +0 -0
- data/assets/js/vendor/retina-1.3.0.min.js +0 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b9a8be7fd3561d01ef4998eb0958857ea56888be40a5eb75eafbcb2c117a1cb1
|
|
4
|
+
data.tar.gz: 61fa2c79a83cbbecb5871d751849b5a63dc0032f6a91a8ca04ad01ec451d4bb6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b8cc52efe9cad0e4b39d8b8e0f60e50196f5f0ef3efa4723080ce229d38601ca95442cc75a213c21d3097ea8c0cc7792e68ab2e710abfade026d008fcfc57dbd
|
|
7
|
+
data.tar.gz: caa09de23ada9b0e33f8b79d0132d0241b6e9970af073cbb44f3d8ea032e3005610479d1afd820a8bab5567b6f56bb2bdd638a00cb254365d5d8c3ec0f4c477f
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
### [1.0.18](https://github.com/eliottvincent/bay/compare/v1.0.17...v1.0.18) (2022-08-30)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- Update dependencies
|
|
10
|
+
|
|
11
|
+
### [1.0.17](https://github.com/eliottvincent/bay/compare/v1.0.16...v1.0.17) (2021-06-05)
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- Remove support for Retina-sized images
|
|
16
|
+
|
|
17
|
+
### [1.0.16](https://github.com/eliottvincent/bay/compare/v1.0.15...v1.0.16) (2021-02-23)
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
- Rework footer's elements sizing ([1f1384b](https://github.com/eliottvincent/bay/commit/1f1384b2cfc07bc152cb8e44756e5a0fcbfbef11)), closes [#5](https://github.com/eliottvincent/bay/issues/5)
|
|
22
|
+
|
|
23
|
+
### [1.0.15](https://github.com/eliottvincent/bay/compare/v1.0.14...v1.0.15) (2020-12-21)
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
- Add Dribbble to supported "follow" list items
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
- Fix `remote_theme` value in configuration (for GitHub Pages)
|
|
32
|
+
|
|
33
|
+
### [1.0.14](https://github.com/eliottvincent/bay/compare/v1.0.13...v1.0.14) (2020-09-02)
|
|
34
|
+
|
|
35
|
+
### Bug Fixes
|
|
36
|
+
|
|
37
|
+
- Fix WeChat widget not moving anymore
|
|
38
|
+
|
|
39
|
+
### [1.0.13](https://github.com/eliottvincent/bay/compare/v1.0.12...v1.0.13) (2020-08-12)
|
|
40
|
+
|
|
41
|
+
### Bug Fixes
|
|
42
|
+
|
|
43
|
+
- Update dependencies
|
|
44
|
+
|
|
45
|
+
### [1.0.12](https://github.com/eliottvincent/bay/compare/v1.0.11...v1.0.12) (2020-08-05)
|
|
46
|
+
|
|
47
|
+
### Bug Fixes
|
|
48
|
+
|
|
49
|
+
- Make sure menu doesn't disappear ([ff45445](https://github.com/eliottvincent/bay/commit/ff45445761314a9b4a9b1e53f04c040ab2b62e3f)), closes [#1](https://github.com/eliottvincent/bay/issues/1)
|
|
50
|
+
- Fix WeChat widget not moving anymore
|
|
51
|
+
|
|
52
|
+
### [1.0.11](https://github.com/eliottvincent/bay/compare/v1.0.10...v1.0.11) (2020-08-01)
|
|
53
|
+
|
|
54
|
+
### Bug Fixes
|
|
55
|
+
|
|
56
|
+
- Fix work item spacing
|
|
57
|
+
- Year displayed in footer is now dynamic
|
|
58
|
+
|
|
59
|
+
### [1.0.10](https://github.com/eliottvincent/bay/compare/v1.0.9...v1.0.10) (2019-10-31)
|
|
60
|
+
|
|
61
|
+
### Bug Fixes
|
|
62
|
+
|
|
63
|
+
- Add GA
|
|
64
|
+
|
|
65
|
+
### [1.0.9](https://github.com/eliottvincent/bay/compare/v1.0.8...v1.0.9) (2019-10-28)
|
|
66
|
+
|
|
67
|
+
### Bug Fixes
|
|
68
|
+
|
|
69
|
+
- Render WeChat widget only if necessary
|
|
70
|
+
|
|
71
|
+
### [1.0.8](https://github.com/eliottvincent/bay/compare/v1.0.7...v1.0.8) (2019-10-27)
|
|
72
|
+
|
|
73
|
+
### Bug Fixes
|
|
74
|
+
|
|
75
|
+
- Update configuration to support GitHub Pages deployment
|
|
76
|
+
- Load assets through absolute path
|
|
77
|
+
|
|
78
|
+
### 1.0.7 (2019-10-27)
|
|
79
|
+
|
|
80
|
+
Initial version.
|
data/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# bay
|
|
2
2
|
|
|
3
|
+
[](https://rubygems.org/gems/bay_jekyll_theme)
|
|
4
|
+
[](https://rubygems.org/gems/bay_jekyll_theme)
|
|
5
|
+
|
|
3
6
|
Bay is a simple theme for Jekyll. [[view live]](https://eliottvincent.github.io/bay)
|
|
4
7
|
|
|
5
8
|
Inspired by [dangrover.com](http://dangrover.com/). Current theme used at [eliottvincent.com](http://eliottvincent.com/).
|
data/_includes/foot.html
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
<script type="text/javascript" src="{{ "/assets/js/vendor/retina-1.3.0.min.js" | absolute_url }}"></script>
|
|
2
1
|
<script type="text/javascript" src="{{ "/assets/js/vendor/cash-4.1.5.min.js" | absolute_url }}"></script>
|
|
3
2
|
<script type="text/javascript" src="{{ "/assets/js/site.js" | absolute_url }}"></script>
|
data/_includes/footer.html
CHANGED
|
@@ -1,53 +1,54 @@
|
|
|
1
1
|
<footer class="site-footer">
|
|
2
2
|
<div class="wrapper">
|
|
3
3
|
<div class="footer-col-wrapper">
|
|
4
|
-
<div class="footer-col footer-col-1
|
|
4
|
+
<div class="footer-col footer-col-1">
|
|
5
5
|
<h4>CONTACT</h4>
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
<div class="social-links">
|
|
8
|
+
{% for contact in site.footer.contact %}
|
|
9
|
+
<div class="social-link contact-links">
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
{% assign contact_icon_path = "/assets/img/icons/" | append: contact.name | downcase | append: ".png" | absolute_url %}
|
|
12
|
+
<img
|
|
13
|
+
src="{{ contact_icon_path }}"
|
|
14
|
+
alt="{{ contact.name | downcase }}"
|
|
15
|
+
/>
|
|
16
|
+
<a href="{{ contact.link }}" id="{{ contact.name | downcase }}-link">
|
|
17
|
+
{% if contact.value and contact.value != "" and contact.value != nil %}
|
|
18
|
+
{{ contact.value }}
|
|
19
|
+
{% else %}
|
|
20
|
+
{{ contact.name }}
|
|
21
|
+
{% endif %}
|
|
22
|
+
</a>
|
|
23
|
+
</div>
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
{% endfor %}
|
|
26
|
+
</div>
|
|
24
27
|
</div>
|
|
25
28
|
|
|
26
|
-
<div class="footer-col footer-col-2
|
|
29
|
+
<div class="footer-col footer-col-2">
|
|
27
30
|
<h4>FOLLOW</h4>
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{% assign follow_icon_path = "/assets/img/icons/" | append: follow.name | downcase | append: ".png" | absolute_url %}
|
|
33
|
-
<img
|
|
34
|
-
src="{{ follow_icon_path }}"
|
|
35
|
-
alt="{{ follow.name | downcase }}"
|
|
36
|
-
/>
|
|
37
|
-
<a href="{{ follow.link }}">
|
|
38
|
-
{% if follow.value and follow.value != "" and follow.value != nil %}
|
|
39
|
-
{{ follow.value }}
|
|
40
|
-
{% else %}
|
|
41
|
-
{{ follow.name }}
|
|
42
|
-
{% endif %}
|
|
43
|
-
</a>
|
|
44
|
-
</span>
|
|
32
|
+
<div class="social-links follow-links">
|
|
33
|
+
{% for follow in site.footer.follow %}
|
|
34
|
+
<div class="social-link">
|
|
45
35
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
{% assign follow_icon_path = "/assets/img/icons/" | append: follow.name | downcase | append: ".png" | absolute_url %}
|
|
37
|
+
<img
|
|
38
|
+
src="{{ follow_icon_path }}"
|
|
39
|
+
alt="{{ follow.name | downcase }}"
|
|
40
|
+
/>
|
|
41
|
+
<a href="{{ follow.link }}">
|
|
42
|
+
{% if follow.value and follow.value != "" and follow.value != nil %}
|
|
43
|
+
{{ follow.value }}
|
|
44
|
+
{% else %}
|
|
45
|
+
{{ follow.name }}
|
|
46
|
+
{% endif %}
|
|
47
|
+
</a>
|
|
48
|
+
</div>
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
{% endfor %}
|
|
51
|
+
</div>
|
|
51
52
|
</div>
|
|
52
53
|
|
|
53
54
|
{% if site.footer.show_powered_by == true %}
|
data/_layouts/home.html
CHANGED
data/_sass/_layout.scss
CHANGED
|
@@ -21,9 +21,12 @@
|
|
|
21
21
|
font-size: 26px;
|
|
22
22
|
line-height: 56px;
|
|
23
23
|
letter-spacing: -1px;
|
|
24
|
-
|
|
25
24
|
float: left;
|
|
26
25
|
|
|
26
|
+
img {
|
|
27
|
+
height: 28px;
|
|
28
|
+
}
|
|
29
|
+
|
|
27
30
|
&,
|
|
28
31
|
&:visited {
|
|
29
32
|
color: $grey-color-dark;
|
|
@@ -71,6 +74,7 @@
|
|
|
71
74
|
text-align: center;
|
|
72
75
|
|
|
73
76
|
background: #ffffff url($base-url + '/assets/img/menu.png') 6px 4px no-repeat;
|
|
77
|
+
background-size: 26px 26px;
|
|
74
78
|
}
|
|
75
79
|
|
|
76
80
|
.menu {
|
|
@@ -132,8 +136,12 @@
|
|
|
132
136
|
width: calc(33% - (#{$spacing-unit} / 2));
|
|
133
137
|
}
|
|
134
138
|
|
|
139
|
+
.follow-links > .social-link {
|
|
140
|
+
flex: 0 50%;
|
|
141
|
+
}
|
|
142
|
+
|
|
135
143
|
.powered-by {
|
|
136
|
-
font-size: 13px;
|
|
144
|
+
font-size: 13px !important;
|
|
137
145
|
color: $grey-color;
|
|
138
146
|
}
|
|
139
147
|
|
data/_sass/_site.scss
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
.
|
|
1
|
+
.profile-pic {
|
|
2
2
|
float: right;
|
|
3
|
+
width: 202px;
|
|
3
4
|
border: #ccc 1px solid;
|
|
4
5
|
margin-left: 20px;
|
|
5
6
|
|
|
@@ -10,34 +11,42 @@
|
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
.
|
|
14
|
+
.footer-col {
|
|
14
15
|
font-size: 12px;
|
|
15
|
-
line-height: 30px;
|
|
16
|
-
|
|
17
|
-
@include media-query($on-mobile) {
|
|
18
|
-
font-size: 14px;
|
|
19
|
-
line-height: 38px;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
img {
|
|
23
|
-
margin-right: 3px;
|
|
24
|
-
vertical-align: middle;
|
|
25
|
-
margin-top: -2px;
|
|
26
|
-
}
|
|
27
16
|
|
|
28
17
|
h4 {
|
|
29
18
|
margin-bottom: 0;
|
|
30
|
-
font-size: 12px;
|
|
31
19
|
margin-top: 0;
|
|
20
|
+
line-height: 30px;
|
|
32
21
|
}
|
|
33
22
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
23
|
+
.social-links {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-wrap: wrap;
|
|
26
|
+
|
|
27
|
+
.social-link {
|
|
28
|
+
display: flex;
|
|
29
|
+
width: 100%;
|
|
30
|
+
align-items: flex-start;
|
|
31
|
+
line-height: 16px;
|
|
32
|
+
margin-top: 6.5px;
|
|
33
|
+
margin-bottom: 10px;
|
|
34
|
+
|
|
35
|
+
img {
|
|
36
|
+
width: 16px;
|
|
37
|
+
height: 16px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
a {
|
|
41
|
+
margin-left: 6px;
|
|
42
|
+
word-break: break-all;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@include media-query($on-mobile) {
|
|
47
|
+
font-size: 14px;
|
|
48
|
+
line-height: 38px;
|
|
49
|
+
}
|
|
41
50
|
}
|
|
42
51
|
}
|
|
43
52
|
|
|
Binary file
|
|
Binary file
|
data/assets/img/icons/email.png
CHANGED
|
Binary file
|
|
Binary file
|
data/assets/img/icons/github.png
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/assets/img/icons/rss.png
CHANGED
|
Binary file
|
|
Binary file
|
data/assets/img/icons/wechat.png
CHANGED
|
Binary file
|
data/assets/img/icons/weibo.png
CHANGED
|
Binary file
|
data/assets/img/menu.png
CHANGED
|
Binary file
|
data/assets/img/profile-pic.jpg
CHANGED
|
Binary file
|
data/assets/img/title.png
CHANGED
|
Binary file
|
|
Binary file
|
data/assets/img/work/sand.png
CHANGED
|
Binary file
|
data/assets/img/work/water.png
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bay_jekyll_theme
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.18
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Eliott Vincent
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-07-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jekyll
|
|
@@ -38,13 +38,14 @@ dependencies:
|
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '2.0'
|
|
41
|
-
description:
|
|
41
|
+
description:
|
|
42
42
|
email:
|
|
43
43
|
- hello@eliottvincent.com
|
|
44
44
|
executables: []
|
|
45
45
|
extensions: []
|
|
46
46
|
extra_rdoc_files: []
|
|
47
47
|
files:
|
|
48
|
+
- CHANGELOG.md
|
|
48
49
|
- LICENSE.md
|
|
49
50
|
- README.md
|
|
50
51
|
- _includes/draft-banner.html
|
|
@@ -67,47 +68,29 @@ files:
|
|
|
67
68
|
- _sass/_work.scss
|
|
68
69
|
- assets/css/main.scss
|
|
69
70
|
- assets/img/content/post-example/Banner.jpg
|
|
70
|
-
- assets/img/content/post-example/Banner@2x.jpg
|
|
71
71
|
- assets/img/icons/dribbble.png
|
|
72
|
-
- assets/img/icons/dribbble@2x.png
|
|
73
72
|
- assets/img/icons/email.png
|
|
74
|
-
- assets/img/icons/email@2x.png
|
|
75
73
|
- assets/img/icons/facebook.png
|
|
76
|
-
- assets/img/icons/facebook@2x.png
|
|
77
74
|
- assets/img/icons/github.png
|
|
78
|
-
- assets/img/icons/github@2x.png
|
|
79
75
|
- assets/img/icons/keybase.png
|
|
80
|
-
- assets/img/icons/keybase@2x.png
|
|
81
76
|
- assets/img/icons/linkedin.png
|
|
82
|
-
- assets/img/icons/linkedin@2x.png
|
|
83
77
|
- assets/img/icons/rss.png
|
|
84
|
-
- assets/img/icons/rss@2x.png
|
|
85
78
|
- assets/img/icons/twitter.png
|
|
86
|
-
- assets/img/icons/twitter@2x.png
|
|
87
79
|
- assets/img/icons/wechat.png
|
|
88
|
-
- assets/img/icons/wechat@2x.png
|
|
89
80
|
- assets/img/icons/weibo.png
|
|
90
|
-
- assets/img/icons/weibo@2x.png
|
|
91
81
|
- assets/img/menu.png
|
|
92
|
-
- assets/img/menu@2x.png
|
|
93
82
|
- assets/img/profile-pic.jpg
|
|
94
|
-
- assets/img/profile-pic@2x.jpg
|
|
95
83
|
- assets/img/title.png
|
|
96
|
-
- assets/img/title@2x.png
|
|
97
84
|
- assets/img/wechat-qr-code.png
|
|
98
|
-
- assets/img/wechat-qr-code@2x.png
|
|
99
85
|
- assets/img/work/sand.png
|
|
100
|
-
- assets/img/work/sand@2x.png
|
|
101
86
|
- assets/img/work/water.png
|
|
102
|
-
- assets/img/work/water@2x.png
|
|
103
87
|
- assets/js/site.js
|
|
104
88
|
- assets/js/vendor/cash-4.1.5.min.js
|
|
105
|
-
- assets/js/vendor/retina-1.3.0.min.js
|
|
106
89
|
homepage: https://github.com/eliottvincent/bay
|
|
107
90
|
licenses:
|
|
108
91
|
- MIT
|
|
109
92
|
metadata: {}
|
|
110
|
-
post_install_message:
|
|
93
|
+
post_install_message:
|
|
111
94
|
rdoc_options: []
|
|
112
95
|
require_paths:
|
|
113
96
|
- lib
|
|
@@ -122,8 +105,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
122
105
|
- !ruby/object:Gem::Version
|
|
123
106
|
version: '0'
|
|
124
107
|
requirements: []
|
|
125
|
-
rubygems_version: 3.
|
|
126
|
-
signing_key:
|
|
108
|
+
rubygems_version: 3.3.11
|
|
109
|
+
signing_key:
|
|
127
110
|
specification_version: 4
|
|
128
111
|
summary: A simple and minimal Jekyll theme..
|
|
129
112
|
test_files: []
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/assets/img/icons/rss@2x.png
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/assets/img/menu@2x.png
DELETED
|
Binary file
|
|
Binary file
|
data/assets/img/title@2x.png
DELETED
|
Binary file
|
|
Binary file
|
data/assets/img/work/sand@2x.png
DELETED
|
Binary file
|
|
Binary file
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Retina.js v1.3.0
|
|
3
|
-
*
|
|
4
|
-
* Copyright 2014 Imulus, LLC
|
|
5
|
-
* Released under the MIT license
|
|
6
|
-
*
|
|
7
|
-
* Retina.js is an open source script that makes it easy to serve
|
|
8
|
-
* high-resolution images to devices with retina displays.
|
|
9
|
-
*/
|
|
10
|
-
!function(){function a(){}function b(a){return f.retinaImageSuffix+a}function c(a,c){if(this.path=a||"","undefined"!=typeof c&&null!==c)this.at_2x_path=c,this.perform_check=!1;else{if(void 0!==document.createElement){var d=document.createElement("a");d.href=this.path,d.pathname=d.pathname.replace(g,b),this.at_2x_path=d.href}else{var e=this.path.split("?");e[0]=e[0].replace(g,b),this.at_2x_path=e.join("?")}this.perform_check=!0}}function d(a){this.el=a,this.path=new c(this.el.getAttribute("src"),this.el.getAttribute("data-at2x"));var b=this;this.path.check_2x_variant(function(a){a&&b.swap()})}var e="undefined"==typeof exports?window:exports,f={retinaImageSuffix:"@2x",check_mime_type:!0,force_original_dimensions:!0};e.Retina=a,a.configure=function(a){null===a&&(a={});for(var b in a)a.hasOwnProperty(b)&&(f[b]=a[b])},a.init=function(a){null===a&&(a=e);var b=a.onload||function(){};a.onload=function(){var a,c,e=document.getElementsByTagName("img"),f=[];for(a=0;a<e.length;a+=1)c=e[a],c.getAttributeNode("data-no-retina")||f.push(new d(c));b()}},a.isRetina=function(){var a="(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)";return e.devicePixelRatio>1?!0:e.matchMedia&&e.matchMedia(a).matches?!0:!1};var g=/\.\w+$/;e.RetinaImagePath=c,c.confirmed_paths=[],c.prototype.is_external=function(){return!(!this.path.match(/^https?\:/i)||this.path.match("//"+document.domain))},c.prototype.check_2x_variant=function(a){var b,d=this;return this.is_external()?a(!1):this.perform_check||"undefined"==typeof this.at_2x_path||null===this.at_2x_path?this.at_2x_path in c.confirmed_paths?a(!0):(b=new XMLHttpRequest,b.open("HEAD",this.at_2x_path),b.onreadystatechange=function(){if(4!==b.readyState)return a(!1);if(b.status>=200&&b.status<=399){if(f.check_mime_type){var e=b.getResponseHeader("Content-Type");if(null===e||!e.match(/^image/i))return a(!1)}return c.confirmed_paths.push(d.at_2x_path),a(!0)}return a(!1)},b.send(),void 0):a(!0)},e.RetinaImage=d,d.prototype.swap=function(a){function b(){c.el.complete?(f.force_original_dimensions&&(c.el.setAttribute("width",c.el.offsetWidth),c.el.setAttribute("height",c.el.offsetHeight)),c.el.setAttribute("src",a)):setTimeout(b,5)}"undefined"==typeof a&&(a=this.path.at_2x_path);var c=this;b()},a.isRetina()&&a.init(e)}();
|