jekyll-theme-yat 1.1.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e400b5095fe94ac655f5b7082ed7a1ed084d2f91df05628303d892261330214
4
- data.tar.gz: b7a07628a1f055962edc70349575cf25b4ee5bdde8720b2f41b476fd22ec3eb8
3
+ metadata.gz: 98ac82995fa7fe0f023cfdbbb2aa005413c8839adfaf3db2cf1a44b6b28b952d
4
+ data.tar.gz: 2e955f528fe54844e7ffbf5605a2f93b3eaf0f5bfa9a9465a1b4dbd518cb80bd
5
5
  SHA512:
6
- metadata.gz: eb2bc388b34096a5044585ba79e176ce17da6ee8f18c8609230e875bd5bc6e84d77effd1b548d010afeba8d364ddf3d8d3a4bc1d9476734f2d0f2b4f05fccffa
7
- data.tar.gz: b4a421865b0ca37cefa41a3cebf68cd3c14b85e1665e1877df3e0e0adbbc33d87ef78c3c95fdfc2c1322ee49f33d17570b01902d747f9a802bef31e8f2a2e13e
6
+ metadata.gz: 4c860e189b2e200c9723262207f8d5d8e69840c710faa4375b84ef99ac542a11fd30dfb19a09dafbc7bdf95fd38c86b4ad54c26e36b1fd3f8fa0e7147457db56
7
+ data.tar.gz: 63e1b8843f8ae8be5234623a914f32cbc7411f9322c5b9b083cedafe2dee51255c41b93dddc378e8046cf0dae57b286b4a886a4d5118037e52d758c41885b672
data/README.md CHANGED
@@ -1,11 +1,21 @@
1
1
  # jekyll-theme-yat
2
+ [![Gem Version](https://badge.fury.io/rb/jekyll-theme-yat.svg)](http://badge.fury.io/rb/jekyll-theme-yat)
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)
4
+ [![Donate (Liberapay)](http://img.shields.io/liberapay/goal/jeffreytse.svg?logo=liberapay)](https://liberapay.com/jeffreytse)
5
+ [![Donate (Patreon)](https://img.shields.io/badge/support-patreon-F96854.svg?style=flat-square)](https://patreon.com/jeffreytse)
6
+ <a href="https://ko-fi.com/jeffreytse">
7
+ <img height="20" src="https://www.ko-fi.com/img/githubbutton_sm.svg"
8
+ alt="Donate (Ko-fi)" />
9
+ </a>
2
10
 
3
- Welcome to your new Jekyll theme! In this directory, you'll find the files you need to be able to package up your theme into a gem. Put your layouts in `_layouts`, your includes in `_includes`, your sass files in `_sass` and any other assets in `assets`.
11
+ Hey, nice to meet you, you found this Jekyll theme. Here the yet another theme is a modern theme, and it's quiet clear, clean and neat for writers and posts.
4
12
 
5
- To experiment with this code, add some sample content and run `bundle exec jekyll serve` – this directory is setup just like a Jekyll site!
6
13
 
7
- TODO: Delete this and the text above, and describe your gem
14
+ <p align="center">
8
15
 
16
+ <img src="https://user-images.githubusercontent.com/9413601/87244819-c34ada80-c472-11ea-9c67-5827dd55d3c7.png" alt="demo-screenshot" width="720px" style="box-shadow: 0px 0px 18px 5px #f2f2f2" />
17
+
18
+ </p>
9
19
 
10
20
  ## Installation
11
21
 
@@ -33,10 +43,6 @@ Or install it yourself as:
33
43
 
34
44
  TODO: Write usage instructions here. Describe your available layouts, includes, sass and/or assets.
35
45
 
36
- ## Contributing
37
-
38
- Bug reports and pull requests are welcome on GitHub at https://github.com/jeffreytse/jekyll-theme-yat. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
39
-
40
46
  ## Development
41
47
 
42
48
  To set up your environment to develop this theme, run `bundle install`.
@@ -46,7 +52,12 @@ Your theme is setup just like a normal Jekyll site! To test your theme, run `bun
46
52
  When your theme is released, only the files in `_data`, `_layouts`, `_includes`, `_sass` and `assets` tracked with Git will be bundled.
47
53
  To add a custom directory to your theme-gem, please edit the regexp in `jekyll-theme-yat.gemspec` accordingly.
48
54
 
49
- ## License
55
+ ## Contributing
56
+
57
+ Issues and Pull Requests are greatly appreciated. If you've never contributed to an open source project before I'm more than happy to walk you through how to create a pull request.
50
58
 
51
- The theme is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
59
+ You can start by [opening an issue](https://github.com/jeffreytse/jekyll-theme-yat/issues/new) describing the problem that you're looking to resolve and we'll go from there.
60
+
61
+ ## License
52
62
 
63
+ This theme is licensed under the [MIT license](https://opensource.org/licenses/mit-license.php) © JeffreyTse.
@@ -13,10 +13,6 @@
13
13
  img: https://www.countryflags.io/cn/flat/64.png
14
14
  text: Chinese(Simple)
15
15
 
16
- - lang: zh-TW
17
- img: https://www.countryflags.io/tw/flat/64.png
18
- text: Chinese(Traditional)
19
-
20
16
  - lang: ja
21
17
  img: https://www.countryflags.io/jp/flat/64.png
22
18
  text: Japan
@@ -1,6 +1,6 @@
1
1
  <div id="gitment_thread"></div>
2
- <link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">
3
- <script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>
2
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/theme-next/theme-next-gitment@1/default.css"/>
3
+ <script src="https://cdn.jsdelivr.net/gh/theme-next/theme-next-gitment@1/gitment.browser.js"></script>
4
4
  <script>
5
5
  var gitment = new Gitment({
6
6
  id: '{{ page.id }}',
@@ -7,30 +7,34 @@
7
7
  return;
8
8
  }
9
9
 
10
- var headerHeight = 0;
11
- var header = document.querySelector('header');
12
- if (header) {
13
- headerHeight = header.offsetHeight;
14
- }
15
- var supportPageOffset = window.pageXOffset !== undefined;
16
- var isCSS1Compat = ((document.compatMode || "") === "CSS1Compat");
17
-
18
- var x = supportPageOffset ? window.pageXOffset : isCSS1Compat ? document.documentElement.scrollLeft : document.body.scrollLeft;
19
- var y = supportPageOffset ? window.pageYOffset : isCSS1Compat ? document.documentElement.scrollTop : document.body.scrollTop;
10
+ var header = document.querySelector('header.site-header');
11
+ var headerRect = header.getBoundingClientRect();
12
+ var headerTop = Math.floor(headerRect.top);
13
+ var headerHeight = Math.floor(headerRect.height);
14
+ var scrollPos = getScrollPos();
15
+ var offsetY = element.offsetTop - (headerTop + headerHeight + 20);
20
16
 
21
- var offsetY = element.offsetTop - headerHeight - 12;
22
- if (y === offsetY) {
17
+ if (offsetY == scrollPos.y) {
23
18
  return;
24
19
  }
25
20
 
26
- window.scrollTo(x, offsetY);
21
+ if (headerTop == 0 && offsetY > scrollPos.y) {
22
+ offsetY += headerHeight + 2;
23
+ } else if (headerTop < 0 && offsetY < scrollPos.y) {
24
+ offsetY -= headerHeight - 2;
25
+ }
26
+
27
+ smoothScrollTo(offsetY);
27
28
  }
28
29
 
29
30
  // The first event occurred
30
- if (window.location.hash) {
31
- hashLocate(window.location.hash);
32
- }
31
+ window.addEventListener('load', function(event) {
32
+ if (window.location.hash) {
33
+ hashLocate(window.location.hash);
34
+ }
35
+ });
33
36
 
37
+ // The first event occurred
34
38
  window.addEventListener('click', function(event) {
35
39
  if (event.target.matches('a')) {
36
40
  hashLocate(event.target.getAttribute('href'));
@@ -8,16 +8,19 @@
8
8
 
9
9
  <script src="https://cdnjs.cloudflare.com/ajax/libs/trianglify/2.0.0/trianglify.min.js"></script>
10
10
  <script>
11
- function setRandomBgImage(selector, seed) {
11
+ function setRandomBgImage(selector, seed, zoom) {
12
12
  var element = document.querySelector(selector);
13
13
  if (!element) return;
14
14
  var pattern = Trianglify({
15
- width: screen.width,
16
- height: element.offsetHeight,
15
+ width: screen.width * zoom,
16
+ height: element.offsetHeight * zoom,
17
17
  seed: seed
18
18
  });
19
- element.appendChild(pattern.canvas());
19
+
20
+ var image = document.createElement("div");
21
+ image.style.backgroundImage = "url(" + pattern.png() + ")";
22
+ element.appendChild(image);
20
23
  }
21
24
 
22
- setRandomBgImage('{{ selector }}', '{{ seed }}');
25
+ setRandomBgImage('{{ selector }}', '{{ seed }}', {{ zoom | default: 1}});
23
26
  </script>
@@ -0,0 +1,41 @@
1
+ {% if include.article %}
2
+ {% assign article = include.article %}
3
+ {% endif %}
4
+
5
+ {% if include.speed %}
6
+ {% assign speed = include.speed %}
7
+ {% else %}
8
+ {% assign speed = 160 %}
9
+ {% endif %}
10
+
11
+ {% assign total_mins = article
12
+ | number_of_words
13
+ | divided_by: speed
14
+ | at_least: 1 %}
15
+
16
+ {% assign hours = total_mins | divided_by: 60 %}
17
+ {% assign mins = total_mins | modulo: 60 %}
18
+
19
+ {% assign return = "About" %}
20
+
21
+ {% if hours > 0 %}
22
+ {% assign unit = "hour" %}
23
+ {% if hours > 1 %}
24
+ {% assign unit = unit | append: "s" %}
25
+ {% endif %}
26
+ {% assign return = return
27
+ | append: " "
28
+ | append: hours
29
+ | append: " "
30
+ | append: unit %}
31
+ {% endif %}
32
+
33
+ {% assign unit = "min" %}
34
+ {% if mins > 1 %}
35
+ {% assign unit = unit | append: "s" %}
36
+ {% endif %}
37
+ {% assign return = return
38
+ | append: " "
39
+ | append: mins
40
+ | append: " "
41
+ | append: unit %}
@@ -6,9 +6,17 @@
6
6
  {%- seo -%}
7
7
  <link rel="shortcut icon" href="{{ site.favicon }}">
8
8
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
9
- <link rel="stylesheet" href="{{ "/assets/main.css" | relative_url }}">
9
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/typeface-noto-sans@0.0.72/index.min.css">
10
+ <link rel="stylesheet"
11
+ href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/default.min.css">
12
+ <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js"></script>
13
+ <!-- and it's easy to individually load additional languages -->
14
+ <script charset="UTF-8"
15
+ src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/languages/go.min.js"></script>
16
+ <link rel="stylesheet" href="{{ "/assets/css/main.css" | relative_url }}">
17
+ <script src="{{ "/assets/js/main.js" | relative_url }}"></script>
10
18
  {%- feed_meta -%}
11
19
  {%- if jekyll.environment == 'production' and site.google_analytics -%}
12
- {%- include extensions/google-analytics.html -%}
20
+ {%- include extensions/google-analytics.html -%}
13
21
  {%- endif -%}
14
22
  </head>
@@ -7,53 +7,64 @@
7
7
  </style>
8
8
 
9
9
  <div class="post-menu">
10
- <div class="post-menu-title">Contents</div>
10
+ <div class="post-menu-title">TOC</div>
11
11
  <div class="post-menu-content"></div>
12
12
  </div>
13
13
 
14
14
  <script>
15
- var menu = document.querySelector(".post-menu .post-menu-content");
16
- var headings = document.querySelector(".post-content").querySelectorAll("h2, h3, h4, h5, h6");
15
+ function generateContent() {
16
+ var menu = document.querySelector(".post-menu");
17
+ var menuContent = menu.querySelector(".post-menu-content");
18
+ var headings = document.querySelector(".post-content").querySelectorAll("h2, h3, h4, h5, h6");
17
19
 
18
- // Generate post menu
19
- var menuHTML = '';
20
- headings.forEach(function (h) {
21
- menuHTML += (
22
- '<li class="h-' + h.tagName.toLowerCase() + '">'
23
- + '<a href="#h-' + h.getAttribute('id') + '">' + h.textContent + '</a></li>');
24
- });
20
+ // Hide menu when no headings
21
+ if (headings.length === 0) {
22
+ return menu.style.display = "none";
23
+ }
25
24
 
26
- menu.innerHTML = '<ul>' + menuHTML + '</ul>';
25
+ // Generate post menu
26
+ var menuHTML = '';
27
+ for (var i = 0; i < headings.length; i++) {
28
+ var h = headings[i];
29
+ menuHTML += (
30
+ '<li class="h-' + h.tagName.toLowerCase() + '">'
31
+ + '<a href="#h-' + h.getAttribute('id') + '">' + h.textContent + '</a></li>');
32
+ }
27
33
 
28
- // The anchor offsetHeight
29
- var headerHeight = 0;
30
- var header = document.querySelector('header');
31
- if (header) {
32
- offsetHeight = header.offsetHeight + 12;
33
- }
34
+ menuContent.innerHTML = '<ul>' + menuHTML + '</ul>';
34
35
 
35
- // Active the menu item
36
- window.addEventListener('scroll', function (event) {
37
- var lastActive = menu.querySelector('.active');
38
- var changed = true;
39
- for (var i = headings.length - 1; i >= 0; i--) {
40
- var h = headings[i];
41
- var clientRect = h.getBoundingClientRect();
42
- if (clientRect.top < offsetHeight) {
43
- var id = 'h-' + h.getAttribute('id');
44
- var curActive = menu.querySelector('a[href="#' + id + '"]');
45
- if (curActive) {
46
- curActive.classList.add('active');
47
- }
48
- if (lastActive == curActive) {
49
- changed = false;
36
+ // The header element
37
+ var header = document.querySelector('header.site-header');
38
+
39
+ // Active the menu item
40
+ window.addEventListener('scroll', function (event) {
41
+ var lastActive = menuContent.querySelector('.active');
42
+ var changed = true;
43
+ for (var i = headings.length - 1; i >= 0; i--) {
44
+ var h = headings[i];
45
+ var headingRect = h.getBoundingClientRect();
46
+ var headerRect = header.getBoundingClientRect();
47
+ var headerTop = Math.floor(headerRect.top);
48
+ var headerHeight = Math.floor(headerRect.height);
49
+ var headerHeight = headerTop + headerHeight + 20;
50
+ if (headingRect.top <= headerHeight) {
51
+ var id = 'h-' + h.getAttribute('id');
52
+ var a = menuContent.querySelector('a[href="#' + id + '"]');
53
+ var curActive = a.parentNode;
54
+ if (curActive) {
55
+ curActive.classList.add('active');
56
+ }
57
+ if (lastActive == curActive) {
58
+ changed = false;
59
+ }
60
+ break;
50
61
  }
51
- break;
52
62
  }
53
- }
54
- if (lastActive && changed) {
55
- lastActive.classList.remove('active');
56
- }
57
- event.preventDefault();
58
- });
63
+ if (lastActive && changed) {
64
+ lastActive.classList.remove('active');
65
+ }
66
+ event.preventDefault();
67
+ });
68
+ }
69
+ generateContent();
59
70
  </script>
@@ -6,6 +6,4 @@
6
6
 
7
7
  </div>
8
8
 
9
- <div>
10
-
11
9
  </article>
@@ -19,20 +19,9 @@
19
19
  {% assign subheading = return %}
20
20
 
21
21
  {% if banner %}
22
-
23
- {% assign auto_banner = true %}
24
- {% assign array = banner | split: '/' %}
25
- {% assign protocol = array[0] %}
26
-
27
- {% if array.size > 1 and (protocol == '' or protocol == 'http:' or protocol == 'https:') %}
28
- {% assign auto_banner = false %}
29
- {% endif %}
30
-
31
22
  <section class="page-banner">
32
23
  <div class="page-banner-img">
33
- {%- if auto_banner == false -%}
34
- <div style="background-image: url({{ banner }})"></div>
35
- {%- endif -%}
24
+ <div style="background-image: url({{ banner }})"></div>
36
25
  </div>
37
26
  <div class="wrapper">
38
27
  <div class="page-banner-inner">
@@ -44,37 +33,18 @@
44
33
 
45
34
  {%- else -%}
46
35
 
47
- <h1 class="page-banner-heading">
48
- {{ heading | default: page.title | escape }}
49
- </h1>
50
- <h3 class="page-banner-subheading">
51
- {{ subheading | default: page.subtitle | escape }}
52
- </h3>
36
+ <div class="page-banner-default">
37
+ <h1 class="page-banner-heading">
38
+ {{ heading | default: page.title | escape }}
39
+ </h1>
40
+ <h2 class="page-banner-subheading">
41
+ {{ subheading | default: page.subtitle | escape }}
42
+ </h2>
43
+ </div>
53
44
 
54
45
  {%- endif -%}
55
46
  </div>
56
47
  </div>
57
48
  </section>
58
-
59
- {%- if auto_banner -%}
60
-
61
- {%- assign selector = ".page-banner-img" -%}
62
-
63
- {%- if banner == "default" -%}
64
-
65
- {%- assign heading = page.heading | default: page.title | escape -%}
66
- {%- assign subheading = page.subheading | default: page.subtitle | escape -%}
67
- {%- assign seed = page.date | append: heading | append: subheading -%}
68
-
69
- {%- else -%}
70
-
71
- {%- assign seed = 'theme-' | append: banner -%}
72
-
73
- {%- endif -%}
74
-
75
- {%- include extensions/trianglify.html -%}
76
-
77
- {%- endif -%}
78
-
79
49
  {%- endif -%}
80
50
 
@@ -1,44 +1,94 @@
1
- <header class="site-header" role="banner">
1
+
2
+ {%- include functions.html func='log' level='debug' msg='Get banner value' -%}
3
+ {% assign name = 'banner' %}
4
+ {%- include functions.html func='get_value' -%}
5
+ {% assign banner = return %}
6
+
7
+ {%- include functions.html func='log' level='debug' msg='Get header_transparent value' -%}
8
+ {% assign name = 'header_transparent' %}
9
+ {%- include functions.html func='get_value' -%}
10
+ {% assign header_transparent = return | default: true %}
11
+
12
+ {%- if banner and header_transparent -%}
13
+ {%- assign header_transparent_class = "site-header-transparent" -%}
14
+ {%- endif -%}
15
+
16
+ <header class="site-header {{ header_transparent_class }}" role="banner">
2
17
 
3
18
  <div class="wrapper">
4
- {%- assign default_paths = site.pages | where: "dir", "/" | map: "path" -%}
5
- {%- assign page_paths = site.header_pages | default: default_paths -%}
6
-
7
- <span class="site-brand">
8
- {%- include views/site-brand.html -%}
9
- </span>
10
-
11
- {%- if page_paths -%}
12
- <nav class="site-nav">
13
- <input type="checkbox" id="nav-trigger" class="nav-trigger" />
14
- <label for="nav-trigger">
15
- <span class="menu-icon">
16
- <svg viewBox="0 0 18 15" width="18px" height="15px">
17
- <path d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.032C17.335,0,18,0.665,18,1.484L18,1.484z M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.032C17.335,6.031,18,6.696,18,7.516L18,7.516z M18,13.516C18,14.335,17.335,15,16.516,15H1.484 C0.665,15,0,14.335,0,13.516l0,0c0-0.82,0.665-1.483,1.484-1.483h15.032C17.335,12.031,18,12.695,18,13.516L18,13.516z"/>
18
- </svg>
19
- </span>
20
- </label>
21
-
22
- <div class="trigger">
23
- {%- for path in page_paths -%}
24
- {%- assign my_page = site.pages | where: "path", path | first -%}
25
- {%- if my_page.title -%}
26
- <a class="page-link" href="{{ my_page.url | relative_url }}">
27
- {{ my_page.title | upcase | escape }}
28
- </a>
29
- {%- endif -%}
30
- {%- endfor -%}
31
-
32
- {%- assign name = 'translate_langs' -%}
33
- {%- include functions.html func='get_value' -%}
34
- {%- assign translate_langs = return -%}
35
- {%- if translate_langs.size > 0 -%}
36
- <span class="page-link">
37
- {%- include extensions/google-translate.html -%}
19
+ <div class="site-header-inner">
20
+ {%- assign default_paths = site.pages | where: "dir", "/" | map: "path" -%}
21
+ {%- assign page_paths = site.header_pages | default: default_paths -%}
22
+
23
+ <span class="site-brand">
24
+ {%- include views/site-brand.html -%}
25
+ </span>
26
+
27
+ {%- if page_paths -%}
28
+ <nav class="site-nav">
29
+ <input type="checkbox" id="nav-trigger" class="nav-trigger" />
30
+ <label for="nav-trigger">
31
+ <span class="menu-icon">
32
+ <svg viewBox="0 0 18 15" width="18px" height="15px">
33
+ <path d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.032C17.335,0,18,0.665,18,1.484L18,1.484z M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.032C17.335,6.031,18,6.696,18,7.516L18,7.516z M18,13.516C18,14.335,17.335,15,16.516,15H1.484 C0.665,15,0,14.335,0,13.516l0,0c0-0.82,0.665-1.483,1.484-1.483h15.032C17.335,12.031,18,12.695,18,13.516L18,13.516z"/>
34
+ </svg>
38
35
  </span>
39
- {%- endif -%}
40
- </div>
41
- </nav>
42
- {%- endif -%}
36
+ </label>
37
+
38
+ <div class="trigger">
39
+ {%- for path in page_paths -%}
40
+ {%- assign my_page = site.pages | where: "path", path | first -%}
41
+ {%- if my_page.title -%}
42
+ <a class="page-link" href="{{ my_page.url | relative_url }}">{{ my_page.title | upcase | escape }}</a>
43
+ {%- endif -%}
44
+ {%- endfor -%}
45
+
46
+ {%- assign name = 'translate_langs' -%}
47
+ {%- include functions.html func='get_value' -%}
48
+ {%- assign translate_langs = return -%}
49
+ {%- if translate_langs.size > 0 -%}
50
+ <span class="page-link">
51
+ {%- include extensions/google-translate.html -%}
52
+ </span>
53
+ {%- endif -%}
54
+ </div>
55
+ </nav>
56
+ {%- endif -%}
57
+ </div>
43
58
  </div>
44
59
  </header>
60
+
61
+ <script>
62
+ (function() {
63
+ var lastScrollY = getScrollPos().y;
64
+ var documentElement = document.documentElement;
65
+
66
+ function storeScrollData() {
67
+ var y = getScrollPos().y;
68
+
69
+ {%- if banner and header_transparent -%}
70
+ documentElement.setAttribute("data-header-transparent", "");
71
+ {%- endif -%}
72
+
73
+ var scrollStatus = "";
74
+
75
+ if (y <= 0) {
76
+ scrollStatus = "top";
77
+ } else if ((window.innerHeight + y) >= document.body.offsetHeight) {
78
+ scrollStatus = "bottom";
79
+ } else {
80
+ var isScrollDown = (y - lastScrollY > 0) ? true : false;
81
+ scrollStatus = isScrollDown ? "down" : "up";
82
+ }
83
+
84
+ lastScrollY = y;
85
+ documentElement.setAttribute("data-scroll-status", scrollStatus);
86
+ }
87
+
88
+ window.addEventListener('scroll', function(e) {
89
+ storeScrollData();
90
+ });
91
+
92
+ storeScrollData();
93
+ })();
94
+ </script>