type-on-strap 2.3.11 → 2.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +14 -2
- data/_includes/default/head.liquid +2 -2
- data/_includes/default/tags_list.liquid +1 -1
- data/_includes/gallery.html +4 -4
- data/_layouts/default.html +1 -1
- data/_layouts/home.liquid +19 -3
- data/_layouts/post.liquid +10 -1
- data/_sass/base/_highlight.scss +17 -13
- data/_sass/base/_utility.scss +1 -2
- data/_sass/base/_variables.scss +5 -5
- data/_sass/includes/_footer.scss +3 -8
- data/_sass/layouts/_blog.scss +6 -6
- data/_sass/layouts/_posts.scss +4 -0
- data/_sass/layouts/_tags.scss +4 -4
- data/assets/js/main.min.js +1 -1
- data/assets/js/partials/navbar.js +3 -3
- data/assets/js/vendor/imagesloaded.pkgd.min.js +12 -0
- data/assets/js/vendor/mermaid.min.js +3 -32
- data/assets/js/vendor/simple-jekyll-search.min.js +2 -2
- metadata +25 -13
- data/assets/js/vendor/imagesloaded.min.js +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b4bbb13277b77d2a93d2837456b45e0350026ce480a4a980c216cb2ab6b694b
|
4
|
+
data.tar.gz: a54cdf0f90bf33af04b42bd27fed0c29f1a409df5e8e857382b12eed7145deb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9c51c7fbdfe7c4a5ea6d460fdca02b156df66a46371517ba5d0d116a12fcd2c510fc461e0c0019f51c85ed6a1af70e4aedc09629c9e4a8f774395490a0e66ba
|
7
|
+
data.tar.gz: 5beac4a06c5a55a8571a8d089364d07bef4095509a422579c739beff8f1f7390858d482a5c67c4b26daeb9fb294c40a545297dda9d579915f5becc1fb465146c
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -141,12 +141,24 @@ Customize your site header/footer with these variables in `_config.yml`:
|
|
141
141
|
|
142
142
|
```yml
|
143
143
|
header_text: Welcome to my Jekyll blog
|
144
|
-
header_feature_image: assets/img/sample3.png
|
145
144
|
footer_text: Copyright 2017
|
146
145
|
```
|
147
146
|
|
148
147
|
If you don't want anything, replace the value by `" "`.
|
149
148
|
|
149
|
+
#### Header's image
|
150
|
+
|
151
|
+
The header's image (tested with 2480x1280) can be set as one image with `header_feature_image`
|
152
|
+
but can also be responsive:
|
153
|
+
|
154
|
+
```yml
|
155
|
+
header_feature_image: assets/img/header/my-header-image.png
|
156
|
+
header_feature_image_responsive: true
|
157
|
+
```
|
158
|
+
|
159
|
+
By setting `header_feature_image_responsive` to true, it will look for images
|
160
|
+
with suffix `-small` (620x320) and `-medium` (1240x640) to display on smaller screen.
|
161
|
+
|
150
162
|
#### Localisation string
|
151
163
|
|
152
164
|
Localization string is a way to quickly change the template language for text like *Next Post* or *Follow on*, ...
|
@@ -616,4 +628,4 @@ remote_theme: sylhare/Type-on-Strap
|
|
616
628
|
This theme is licensed under the [The MIT License (MIT)](/LICENSE)
|
617
629
|
|
618
630
|
- Pictures from [Pexels](https://www.pexels.com/) are under Creative Commons Zero (CC0) license
|
619
|
-
- Fonts are licensed under the [SIL Open Font License (OFL)](https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL)
|
631
|
+
- Fonts are licensed under the [SIL Open Font License (OFL)](https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL)
|
@@ -41,12 +41,12 @@
|
|
41
41
|
<script defer src="{{ '/assets/js/vendor/auto-render.min.js' | relative_url }}" onload="renderMathInElement(document.body);"></script>
|
42
42
|
{% endif %}
|
43
43
|
|
44
|
-
<!-- Mermaid
|
44
|
+
<!-- Mermaid 9.1.0 -->
|
45
45
|
{% if site.mermaid %}
|
46
46
|
<script defer src="{{ '/assets/js/vendor/mermaid.min.js' | relative_url }}" onload="mermaid.initialize({startOnLoad:true});"></script>
|
47
47
|
{% endif %}
|
48
48
|
|
49
|
-
<!-- Simple Jekyll Search 1.
|
49
|
+
<!-- Simple Jekyll Search 1.10.0 -->
|
50
50
|
<script src="{{ '/assets/js/vendor/simple-jekyll-search.min.js' | relative_url }}" type="text/javascript"></script>
|
51
51
|
|
52
52
|
<!-- Google Analytics / Cookie Consent -->
|
@@ -10,7 +10,7 @@
|
|
10
10
|
{% endif %}
|
11
11
|
|
12
12
|
{% for tag in tags %}
|
13
|
-
<li><a class="button" href="#{{ tag | cgi_escape }}">
|
13
|
+
<li><a class="button" href="{% unless 'Tags' == page.title %}{{ site.baseurl }}/tags{% endunless %}#{{ tag | cgi_escape }}">
|
14
14
|
<p><i class="fas fa-tag fa-fw fa-sm"></i> {{ tag }}</p>
|
15
15
|
</a></li>
|
16
16
|
{% endfor %}
|
data/_includes/gallery.html
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
<style>
|
2
2
|
/* force scrollbar */
|
3
3
|
html { overflow-y: scroll; }
|
4
|
-
|
4
|
+
|
5
5
|
/* To overwrite page's padding, to get bigger images */
|
6
6
|
/* article {padding:2%;} */
|
7
7
|
</style>
|
@@ -13,10 +13,10 @@ html { overflow-y: scroll; }
|
|
13
13
|
{% if image.path contains include.gallery_path %}
|
14
14
|
{% unless image.path contains '.md' %}
|
15
15
|
<img src="{{ image.path | relative_url }}" alt="" class="grid-item" style="padding: 0;">
|
16
|
-
{% endunless %}
|
16
|
+
{% endunless %}
|
17
17
|
{% endif %}
|
18
18
|
{% endfor %}
|
19
|
-
</div>
|
19
|
+
</div>
|
20
20
|
|
21
|
-
<script src="{{ '/assets/js/vendor/imagesloaded.min.js' | relative_url }}" type="text/javascript"></script>
|
21
|
+
<script src="{{ '/assets/js/vendor/imagesloaded.pkgd.min.js' | relative_url }}" type="text/javascript"></script>
|
22
22
|
<script src="{{ '/assets/js/vendor/masonry.pkgd.min.js' | relative_url }}" type="text/javascript"></script>
|
data/_layouts/default.html
CHANGED
data/_layouts/home.liquid
CHANGED
@@ -3,9 +3,25 @@ layout: default
|
|
3
3
|
---
|
4
4
|
|
5
5
|
<div class="home">
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
<style scoped>
|
7
|
+
{% assign image = site.header_feature_image | relative_url | split: '.' %}
|
8
|
+
.call-out_img {
|
9
|
+
background-image: url('{{ image | join: '.' }}');
|
10
|
+
}
|
11
|
+
{% if site.header_feature_image_responsive %}
|
12
|
+
@media screen and (max-width: 768px) {
|
13
|
+
.call-out_img {
|
14
|
+
background-image: url('{{ image[0] | append: '-medium.' | append: image[1] | default: image}}');
|
15
|
+
}
|
16
|
+
}
|
17
|
+
@media screen and (max-width: 576px) {
|
18
|
+
.call-out_img {
|
19
|
+
background-image: url('{{ image[0] | append: '-small.' | append: image[1] }}');
|
20
|
+
}
|
21
|
+
}
|
22
|
+
{% endif %}
|
23
|
+
</style>
|
24
|
+
<div id="main" class="call-out call-out_img">
|
9
25
|
<h1> {{ site.header_text | default: "Change <code>header_text</code> in <code>_config.yml</code>"}} </h1>
|
10
26
|
</div>
|
11
27
|
|
data/_layouts/post.liquid
CHANGED
@@ -56,10 +56,19 @@ layout: default
|
|
56
56
|
}
|
57
57
|
|
58
58
|
{% if page.color %}
|
59
|
-
.
|
59
|
+
.post-content a { color: {{ page.color }} !important; }
|
60
|
+
.share-buttons a { color: {{ page.color }} !important; }
|
61
|
+
.tag-list a:not(:hover) { color: {{ page.color }} !important; }
|
60
62
|
div#post-nav a { color: {{ page.color }} !important; }
|
61
63
|
footer a { color: {{ page.color }} !important; }
|
62
64
|
.site-header nav a:hover { color: {{ page.color }} !important; }
|
65
|
+
a.button:hover {
|
66
|
+
background: {{ page.color }} !important;
|
67
|
+
border: 1px solid {{ page.color }} !important;
|
68
|
+
color: white;
|
69
|
+
text-decoration: none;
|
70
|
+
filter: none;
|
71
|
+
}
|
63
72
|
header#main {
|
64
73
|
background-color: {{ page.color }} !important;
|
65
74
|
background-image: url('{{ site.color_image | relative_url }}');
|
data/_sass/base/_highlight.scss
CHANGED
@@ -7,7 +7,7 @@ figure.highlight,
|
|
7
7
|
.highlight code {
|
8
8
|
position: relative;
|
9
9
|
background: var(--base00);
|
10
|
-
color: var(--
|
10
|
+
color: var(--base07);
|
11
11
|
font-family: $monospace;
|
12
12
|
font-size: $font-size-code;
|
13
13
|
line-height: $font-height-code;
|
@@ -121,7 +121,7 @@ table.rouge-table {
|
|
121
121
|
.ge{ /* Generic.Emph */
|
122
122
|
font-style: italic }
|
123
123
|
.gh{ /* Generic.Heading */
|
124
|
-
color: var(--
|
124
|
+
color: var(--base07);font-weight: bold }
|
125
125
|
.gi{ /* Generic.Inserted */
|
126
126
|
color: var(--base0a) }
|
127
127
|
.gp{ /* Generic.Prompt */
|
@@ -135,7 +135,7 @@ table.rouge-table {
|
|
135
135
|
.k { /* Keyword */
|
136
136
|
color: var(--base0d) }
|
137
137
|
.kc{ /* Keyword.Constant */
|
138
|
-
color: var(--
|
138
|
+
color: var(--base0f) }
|
139
139
|
.kd{ /* Keyword.Declaration */
|
140
140
|
color: var(--base0d) }
|
141
141
|
.kn{ /* Keyword.Namespace */
|
@@ -163,19 +163,19 @@ table.rouge-table {
|
|
163
163
|
.mo{ /* Literal.Number.Oct */
|
164
164
|
color: var(--base0e) }
|
165
165
|
.n{ /* Name */
|
166
|
-
color: var(--
|
166
|
+
color: var(--base07) }
|
167
167
|
.na{ /* Name.Attribute */
|
168
|
-
color: var(--
|
168
|
+
color: var(--base0c) }
|
169
169
|
.nb{ /* Name.Builtin */
|
170
170
|
color: var(--base0c) }
|
171
171
|
.nc{ /* Name.Class */
|
172
|
-
color: var(--
|
172
|
+
color: var(--base07) }
|
173
173
|
.no{ /* Name.Constant */
|
174
|
-
color: var(--
|
174
|
+
color: var(--base07) }
|
175
175
|
.nd{ /* Name.Decorator */
|
176
176
|
color: var(--base0f) }
|
177
177
|
.ni{ /* Name.Entity */
|
178
|
-
color: var(--
|
178
|
+
color: var(--base07) }
|
179
179
|
.ne{ /* Name.Exception */
|
180
180
|
color: var(--base0c) }
|
181
181
|
.nf{ /* Name.Function */
|
@@ -183,27 +183,31 @@ table.rouge-table {
|
|
183
183
|
.nl{ /* Name.Label */
|
184
184
|
color: var(--base0c) }
|
185
185
|
.nn{ /* Name.Namespace */
|
186
|
-
color: var(--
|
186
|
+
color: var(--base07) }
|
187
187
|
.nt{ /* Name.Tag */
|
188
188
|
color: var(--base08) }
|
189
189
|
.nv{ /* Name.Variable */
|
190
190
|
color: var(--base0c) }
|
191
191
|
.nx{ /* Name.Other */
|
192
|
-
color: var(--
|
192
|
+
color: var(--base07) }
|
193
193
|
.o{ /* Operator */
|
194
194
|
color: var(--base08) }
|
195
195
|
.ow{ /* Operator.Word */
|
196
196
|
color: var(--base0d) }
|
197
197
|
.p{ /* Punctuation */
|
198
198
|
color: var(--base05) }
|
199
|
+
.pi{ /* Name.Property */
|
200
|
+
color: var(--base07) }
|
199
201
|
.py{ /* Name.Property */
|
200
|
-
color: var(--
|
202
|
+
color: var(--base0d) }
|
201
203
|
.s{ /* Literal.String */
|
202
204
|
color: var(--base0a) }
|
205
|
+
.sa{ /* Literal.String.raw */
|
206
|
+
color: var(--base0a) }
|
203
207
|
.sb{ /* Literal.String.Backtick */
|
204
208
|
color: var(--base0a) }
|
205
209
|
.sc{ /* Literal.String.Char */
|
206
|
-
color: var(--
|
210
|
+
color: var(--base07) }
|
207
211
|
.sd{ /* Literal.String.Doc */
|
208
212
|
color: var(--base04) }
|
209
213
|
.s2{ /* Literal.String.Double */
|
@@ -229,7 +233,7 @@ table.rouge-table {
|
|
229
233
|
.vi{ /* Name.Variable.Instance */
|
230
234
|
color: var(--base0c) }
|
231
235
|
.w{ /* Text.Whitespace */
|
232
|
-
color: var(--
|
236
|
+
color: var(--base07) }
|
233
237
|
}
|
234
238
|
|
235
239
|
// Fix Github syntax display
|
data/_sass/base/_utility.scss
CHANGED
@@ -68,13 +68,13 @@ a.button {
|
|
68
68
|
border: 1px solid var(--link);
|
69
69
|
color: var(--background);
|
70
70
|
text-decoration: none;
|
71
|
+
filter: none;
|
71
72
|
}
|
72
73
|
}
|
73
74
|
|
74
75
|
.body-link {
|
75
76
|
&:hover {
|
76
77
|
text-decoration: underline;
|
77
|
-
color: var(--link);
|
78
78
|
filter: brightness(0.85);
|
79
79
|
}
|
80
80
|
}
|
@@ -83,7 +83,6 @@ a.button {
|
|
83
83
|
&:hover {
|
84
84
|
text-decoration: none;
|
85
85
|
color: var(--link);
|
86
|
-
filter: brightness(1.1);
|
87
86
|
}
|
88
87
|
}
|
89
88
|
|
data/_sass/base/_variables.scss
CHANGED
@@ -33,7 +33,7 @@ html, html[data-theme="light"] {
|
|
33
33
|
--blockquote: #eef7fa;
|
34
34
|
--selection: #d4d4d4;
|
35
35
|
--meta: #595959;
|
36
|
-
--link: #
|
36
|
+
--link: #0072B5;
|
37
37
|
--header-background: #24292e;
|
38
38
|
--header-text: #ffffff;
|
39
39
|
--header-link: #383838;
|
@@ -81,11 +81,11 @@ html, html[data-theme="light"] {
|
|
81
81
|
--base01: #2e3c43; // Lighter Background (Used for status bars) - NOT USED
|
82
82
|
--base02: #314549; // Selection Background
|
83
83
|
--base03: #546e7a; // Comments, Invisible, Line Highlighting
|
84
|
-
--base04: #b2ccd6; // Dark Foreground (Used for status bars)
|
85
|
-
--base05: #eeffff; //
|
86
|
-
--base06: #eeffff; // Light Background
|
84
|
+
--base04: #b2ccd6; // Dark Foreground (Used for status bars)
|
85
|
+
--base05: #eeffff; // Punctuation
|
86
|
+
--base06: #eeffff; // Highlight, Light Background
|
87
87
|
--base07: #ffffff; // Default Foreground, Default text color
|
88
|
-
--base08: #f07178; // Parenthesis, Caret, Delimiters
|
88
|
+
--base08: #f07178; // Operators (and Parenthesis, Caret, Delimiters)
|
89
89
|
--base09: #f78c6c; // Classes, Markup Bold, Search Text Background
|
90
90
|
--base0a: #ffcb6b; // Strings, Inherited Class, Markup Code, Diff Inserted
|
91
91
|
--base0b: #98c379; // Functions, Methods, Attribute IDs, Headings
|
data/_sass/includes/_footer.scss
CHANGED
@@ -20,15 +20,10 @@
|
|
20
20
|
color: var(--link);
|
21
21
|
}
|
22
22
|
|
23
|
-
@media (prefers-color-scheme: dark) {
|
24
|
-
a {
|
25
|
-
color: var(--meta);
|
26
|
-
}
|
27
|
-
}
|
28
|
-
|
29
23
|
a:hover {
|
30
|
-
|
31
|
-
|
24
|
+
.fa-circle {
|
25
|
+
filter: brightness(0.85);
|
26
|
+
}
|
32
27
|
}
|
33
28
|
}
|
34
29
|
}
|
data/_sass/layouts/_blog.scss
CHANGED
@@ -17,20 +17,20 @@
|
|
17
17
|
}
|
18
18
|
|
19
19
|
/* --- Responsive --- */
|
20
|
-
@media screen and (
|
21
|
-
background-size:
|
20
|
+
@media screen and (max-width: $m-break) {
|
21
|
+
background-size: 170% auto;
|
22
22
|
}
|
23
23
|
|
24
|
-
@media screen and (max-width:
|
24
|
+
@media screen and (max-width: 450px) {
|
25
25
|
background-size: 200% auto;
|
26
26
|
}
|
27
27
|
|
28
|
-
@media screen and (max-width:
|
28
|
+
@media screen and (max-width: 400px) {
|
29
29
|
background-size: 250% auto;
|
30
30
|
}
|
31
31
|
|
32
|
-
@media screen and (max-width:
|
33
|
-
background-size:
|
32
|
+
@media screen and (max-width: 380px) {
|
33
|
+
background-size: 280% auto;
|
34
34
|
}
|
35
35
|
|
36
36
|
p:last-child {
|
data/_sass/layouts/_posts.scss
CHANGED
data/_sass/layouts/_tags.scss
CHANGED
data/assets/js/main.min.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
function createCookie(e,t,o){var n,i="";o&&((n=new Date).setTime(n.getTime()+24*o*60*60*1e3),i="; expires="+n.toUTCString()),document.cookie=`${e}=${t}${i}; path=/`}function readCookie(e){for(var t=e+"=",o=document.cookie.split(";"),n=0;n<o.length;n++){for(var i=o[n];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return i.substring(t.length,i.length)}return null}function addCookieConsentListener(){document.getElementById("cookie-notice-accept").addEventListener("click",function(){createCookie(cookieName,"true",31),document.getElementById("cookie-notice").style.display="none",location.reload()})}function googleAnalytics(){function e(){dataLayer.push(arguments)}""!==analyticsName.toLowerCase()&&(window.dataLayer=window.dataLayer||[],e("js",new Date),e("config",analyticsName),window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)},ga.l=+new Date,ga("create",analyticsName,"auto"),ga("send","pageview"))}"true"===isCookieConsent.toLowerCase()?(addCookieConsentListener(),"true"===readCookie(cookieName)?googleAnalytics():document.getElementById("cookie-notice").style.display="block"):googleAnalytics();const themeButton={light:'<i class="fas fa-adjust" aria-hidden="true"></i>',dark:'<i class="fas fa-adjust fa-rotate-180" aria-hidden="true"></i>'},currentTheme=()=>sessionStorage.getItem("theme");function setMode(e){document.documentElement.setAttribute("data-theme",e),sessionStorage.setItem("theme",e),document.getElementById("theme-toggle").innerHTML=themeButton[e]}function themeToggle(){setMode("light"===currentTheme()?"dark":"light")}window.onload=function(){if(isAutoTheme){if(!currentTheme()){let e=window.matchMedia("(prefers-color-scheme: dark)");e.addEventListener("change",()=>{e.matches&&sessionStorage.setItem("theme","dark")})}var e=currentTheme();setMode(e||"light")}};try{var elem=document.querySelector(".grid"),msnry=new Masonry(elem,{itemSelector:".grid-item",columnWidth:".grid-sizer",gutter:".gutter-sizer",percentPosition:!0}),imgLoad=imagesLoaded(elem);imgLoad.on("progress",function(e,t){msnry.layout()})}catch(e){if(!(e instanceof ReferenceError))throw e}document.addEventListener("DOMContentLoaded",function(e){
|
1
|
+
function createCookie(e,t,o){var n,i="";o&&((n=new Date).setTime(n.getTime()+24*o*60*60*1e3),i="; expires="+n.toUTCString()),document.cookie=`${e}=${t}${i}; path=/`}function readCookie(e){for(var t=e+"=",o=document.cookie.split(";"),n=0;n<o.length;n++){for(var i=o[n];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return i.substring(t.length,i.length)}return null}function addCookieConsentListener(){document.getElementById("cookie-notice-accept").addEventListener("click",function(){createCookie(cookieName,"true",31),document.getElementById("cookie-notice").style.display="none",location.reload()})}function googleAnalytics(){function e(){dataLayer.push(arguments)}""!==analyticsName.toLowerCase()&&(window.dataLayer=window.dataLayer||[],e("js",new Date),e("config",analyticsName),window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)},ga.l=+new Date,ga("create",analyticsName,"auto"),ga("send","pageview"))}"true"===isCookieConsent.toLowerCase()?(addCookieConsentListener(),"true"===readCookie(cookieName)?googleAnalytics():document.getElementById("cookie-notice").style.display="block"):googleAnalytics();const themeButton={light:'<i class="fas fa-adjust" aria-hidden="true"></i>',dark:'<i class="fas fa-adjust fa-rotate-180" aria-hidden="true"></i>'},currentTheme=()=>sessionStorage.getItem("theme");function setMode(e){document.documentElement.setAttribute("data-theme",e),sessionStorage.setItem("theme",e),document.getElementById("theme-toggle").innerHTML=themeButton[e]}function themeToggle(){setMode("light"===currentTheme()?"dark":"light")}window.onload=function(){if(isAutoTheme){if(!currentTheme()){let e=window.matchMedia("(prefers-color-scheme: dark)");e.addEventListener("change",()=>{e.matches&&sessionStorage.setItem("theme","dark")})}var e=currentTheme();setMode(e||"light")}};try{var elem=document.querySelector(".grid"),msnry=new Masonry(elem,{itemSelector:".grid-item",columnWidth:".grid-sizer",gutter:".gutter-sizer",percentPosition:!0}),imgLoad=imagesLoaded(elem);imgLoad.on("progress",function(e,t){msnry.layout()})}catch(e){if(!(e instanceof ReferenceError))throw e}document.addEventListener("DOMContentLoaded",function(e){const t=document.getElementById("pull"),o=document.querySelector("nav ul");["click","touch"].forEach(function(e){t.addEventListener(e,function(){o.classList.toggle("hide")},!1)}),window.addEventListener("scroll",function(){var e=-(window.scrollY||window.pageYOffset||document.body.scrollTop)/3;document.getElementById("main").style.backgroundPosition="100% "+(e-50)+"px, 0%, center top"})});
|
@@ -4,8 +4,8 @@ document.addEventListener("DOMContentLoaded", function (event) {
|
|
4
4
|
/*
|
5
5
|
* Display the menu items on smaller screens
|
6
6
|
*/
|
7
|
-
|
8
|
-
|
7
|
+
const pull = document.getElementById('pull');
|
8
|
+
const menu = document.querySelector('nav ul');
|
9
9
|
|
10
10
|
['click', 'touch'].forEach(function (e) {
|
11
11
|
pull.addEventListener(e, function () {
|
@@ -17,7 +17,7 @@ document.addEventListener("DOMContentLoaded", function (event) {
|
|
17
17
|
* Make the header images move on scroll
|
18
18
|
*/
|
19
19
|
window.addEventListener('scroll', function () {
|
20
|
-
|
20
|
+
const offset = -(window.scrollY || window.pageYOffset || document.body.scrollTop) / 3;
|
21
21
|
document.getElementById("main").style.backgroundPosition = '100% ' + (offset - 50) + 'px' + ', 0%, center top';
|
22
22
|
});
|
23
23
|
});
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/*!
|
2
|
+
* imagesLoaded PACKAGED v5.0.0
|
3
|
+
* JavaScript is all like "You images are done yet or what?"
|
4
|
+
* MIT License
|
5
|
+
*/
|
6
|
+
!function(t,e){"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,(function(){function t(){}let e=t.prototype;return e.on=function(t,e){if(!t||!e)return this;let i=this._events=this._events||{},s=i[t]=i[t]||[];return s.includes(e)||s.push(e),this},e.once=function(t,e){if(!t||!e)return this;this.on(t,e);let i=this._onceEvents=this._onceEvents||{};return(i[t]=i[t]||{})[e]=!0,this},e.off=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;let s=i.indexOf(e);return-1!=s&&i.splice(s,1),this},e.emitEvent=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;i=i.slice(0),e=e||[];let s=this._onceEvents&&this._onceEvents[t];for(let n of i){s&&s[n]&&(this.off(t,n),delete s[n]),n.apply(this,e)}return this},e.allOff=function(){return delete this._events,delete this._onceEvents,this},t})),
|
7
|
+
/*!
|
8
|
+
* imagesLoaded v5.0.0
|
9
|
+
* JavaScript is all like "You images are done yet or what?"
|
10
|
+
* MIT License
|
11
|
+
*/
|
12
|
+
function(t,e){"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}("undefined"!=typeof window?window:this,(function(t,e){let i=t.jQuery,s=t.console;function n(t,e,o){if(!(this instanceof n))return new n(t,e,o);let r=t;var h;("string"==typeof t&&(r=document.querySelectorAll(t)),r)?(this.elements=(h=r,Array.isArray(h)?h:"object"==typeof h&&"number"==typeof h.length?[...h]:[h]),this.options={},"function"==typeof e?o=e:Object.assign(this.options,e),o&&this.on("always",o),this.getImages(),i&&(this.jqDeferred=new i.Deferred),setTimeout(this.check.bind(this))):s.error(`Bad element for imagesLoaded ${r||t}`)}n.prototype=Object.create(e.prototype),n.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)};const o=[1,9,11];n.prototype.addElementImages=function(t){"IMG"===t.nodeName&&this.addImage(t),!0===this.options.background&&this.addElementBackgroundImages(t);let{nodeType:e}=t;if(!e||!o.includes(e))return;let i=t.querySelectorAll("img");for(let t of i)this.addImage(t);if("string"==typeof this.options.background){let e=t.querySelectorAll(this.options.background);for(let t of e)this.addElementBackgroundImages(t)}};const r=/url\((['"])?(.*?)\1\)/gi;function h(t){this.img=t}function d(t,e){this.url=t,this.element=e,this.img=new Image}return n.prototype.addElementBackgroundImages=function(t){let e=getComputedStyle(t);if(!e)return;let i=r.exec(e.backgroundImage);for(;null!==i;){let s=i&&i[2];s&&this.addBackground(s,t),i=r.exec(e.backgroundImage)}},n.prototype.addImage=function(t){let e=new h(t);this.images.push(e)},n.prototype.addBackground=function(t,e){let i=new d(t,e);this.images.push(i)},n.prototype.check=function(){if(this.progressedCount=0,this.hasAnyBroken=!1,!this.images.length)return void this.complete();let t=(t,e,i)=>{setTimeout((()=>{this.progress(t,e,i)}))};this.images.forEach((function(e){e.once("progress",t),e.check()}))},n.prototype.progress=function(t,e,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount===this.images.length&&this.complete(),this.options.debug&&s&&s.log(`progress: ${i}`,t,e)},n.prototype.complete=function(){let t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){let t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},h.prototype=Object.create(e.prototype),h.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.img.crossOrigin&&(this.proxyImage.crossOrigin=this.img.crossOrigin),this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.currentSrc||this.img.src)},h.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},h.prototype.confirm=function(t,e){this.isLoaded=t;let{parentNode:i}=this.img,s="PICTURE"===i.nodeName?i:this.img;this.emitEvent("progress",[this,s,e])},h.prototype.handleEvent=function(t){let e="on"+t.type;this[e]&&this[e](t)},h.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},h.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},h.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype=Object.create(h.prototype),d.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},d.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},n.makeJQueryPlugin=function(e){(e=e||t.jQuery)&&(i=e,i.fn.imagesLoaded=function(t,e){return new n(this,t,e).jqDeferred.promise(i(this))})},n.makeJQueryPlugin(),n}));
|