jekyll-theme-yat 1.2.0 → 1.2.1

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: 199b703930a9c7789ba8aa41c785b78c60297f4deb8ecae19a0931279a041a43
4
- data.tar.gz: 5bb14cf3155134a0adb196352f8fdf50b40e0867644979bd11423cb79f2c7eba
3
+ metadata.gz: 93dc2f7abbfa41173758255019dbe3a682aac9ec78650e0f215c262c1c8a7a0c
4
+ data.tar.gz: 591a837850ff6cbf79b66103e7a7aaba845a62d539fe198a2565142b7aa7c1a6
5
5
  SHA512:
6
- metadata.gz: '08e63a1440c99e39c40acede34c082b69c30fbf1aead084ed7054ec8359aa01bb0bd4e798242594c544872ac4febde68d5c3ca237f0dc618ef1fb7bfa0c5cece'
7
- data.tar.gz: 141aa0359967926e9dc208297e31cf1799ddb6dd2e676f46d8e2833758886722f54f33f820b53d8d652a8192ac7c3513c8608eeda78c9d1428e8c86d1eeae663
6
+ metadata.gz: 543fbfe705ba586521ea4899f1f3d20efc27ded17fb4fd23116bd129c80227429fcd9773d2327c8a8de783c0f0e5e419288cc757177a19fbc25898e4c138bc13
7
+ data.tar.gz: 75c1cf6c57f51b4d08c2eb2afe69187a4e6fccdefe1188bfcfa6dc246184951d33a257acdd54eef9280dbd668ce9b1780e7b26e2fcd56408be0b9f6bc6f98314
@@ -7,18 +7,21 @@
7
7
  return;
8
8
  }
9
9
 
10
- var header = document.querySelector('header');
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);
11
14
  var scrollPos = getScrollPos();
12
- var offsetY = element.offsetTop - (header.offsetTop + header.offsetHeight + 20);
15
+ var offsetY = element.offsetTop - (headerTop + headerHeight + 20);
13
16
 
14
- if (offsetY == scrollPos.y) {
17
+ if (offsetY == scrollPos.y) {
15
18
  return;
16
19
  }
17
20
 
18
- if (header.offsetTop == 0 && offsetY > scrollPos.y) {
19
- offsetY += header.offsetHeight;
20
- } else if (header.offsetTop < 0 && offsetY < scrollPos.y) {
21
- offsetY -= header.offsetHeight;
21
+ if (headerTop == 0 && offsetY > scrollPos.y) {
22
+ offsetY += headerHeight + 2;
23
+ } else if (headerTop < 0 && offsetY < scrollPos.y) {
24
+ offsetY -= headerHeight - 2;
22
25
  }
23
26
 
24
27
  smoothScrollTo(offsetY);
@@ -36,9 +36,12 @@
36
36
  var changed = true;
37
37
  for (var i = headings.length - 1; i >= 0; i--) {
38
38
  var h = headings[i];
39
- var clientRect = h.getBoundingClientRect();
40
- var headerHeight = header.offsetTop + header.offsetHeight + 20;
41
- if (clientRect.top <= headerHeight) {
39
+ var headingRect = h.getBoundingClientRect();
40
+ var headerRect = header.getBoundingClientRect();
41
+ var headerTop = Math.floor(headerRect.top);
42
+ var headerHeight = Math.floor(headerRect.height);
43
+ var headerHeight = headerTop + headerHeight + 20;
44
+ if (headingRect.top <= headerHeight) {
42
45
  var id = 'h-' + h.getAttribute('id');
43
46
  var curActive = menu.querySelector('a[href="#' + id + '"]');
44
47
  if (curActive) {
@@ -15,6 +15,8 @@
15
15
  }
16
16
 
17
17
  li {
18
+ border-bottom: solid 1px #fff;
19
+
18
20
  &:last-child {
19
21
  border-bottom: none;
20
22
  }
@@ -29,7 +31,7 @@
29
31
  transition: background 0.2s;
30
32
 
31
33
  &:hover {
32
- background: mix($theme-color, #fff, 20%);
34
+ background: mix($theme-color, #eaeaea, 20%);
33
35
  }
34
36
  }
35
37
 
data/_sass/yat.scss CHANGED
@@ -31,7 +31,7 @@ $footer-height: $header-height * 1.05 !default;
31
31
  $footer-text-color: rgba(lighten(invert($theme-color), 30%), 50%) !default;
32
32
  $footer-background-color: darken($theme-color, 5%) !default;
33
33
 
34
- $banner-height: 400px !default;
34
+ $banner-height: 420px !default;
35
35
  $banner-text-color: lighten($white-color, 0%) !default;
36
36
  $banner-background: darken(#333, 5%) !default;
37
37
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-yat
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - jeffreytse