alembic-jekyll-theme 3.0.10 → 3.0.11

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
  SHA1:
3
- metadata.gz: 69c0580d6c8c6caa8af4d803e8eaf400233e0d36
4
- data.tar.gz: e9ce5c4d1deae8c4f12ed70769a8b8cc7e6c212a
3
+ metadata.gz: 96f8bf0b791d7e961bd4d3cd97e03d7ece509c68
4
+ data.tar.gz: 800d6d25ed3d39c5b9282c7ace66c81aeb354cd7
5
5
  SHA512:
6
- metadata.gz: 041cc9b6daec0b34bf9b8332c9a1912e9f41d425438b81d9b199f73abd174cfc7d5e4dfe88cdb7671b526047e412a046e8a1360d5bd8a944aaf870dd77c7b185
7
- data.tar.gz: ef0fc107e20d83468e07f8231621c33e5ba1db7716cac9f5c610afd20f55f4d4a0dd0296c421b715fd3183fe4f0c2c06b4a8ff1ecf7bd73a5e5bc5ceb1f309db
6
+ metadata.gz: 57d47b1836f1dc56f0068bef6141ac4d94c90a7ffe5efe9e27d37a6ae55fd3f01708e9db91d2421d2c3954cec5ef8a0e556f7f3c48e9f6d8018b0bc4c3d6a1ae
7
+ data.tar.gz: 3fb4420bd4c61c6938e4945d7ae66f3870b2e31314ee8b89757a380abbb9a6b03133d893bdb3e474bbfbf233f711e4c853c3b4ecf17a6c19c178bac1d0a7d9ce
@@ -14,41 +14,41 @@
14
14
  </li>
15
15
  {% endfor %}
16
16
  </ul>
17
+ <button class="button button--nav" aria-label="Menu toggle">
18
+ {% include icon.html id="nav" title="Menu" %}
19
+ </button>
17
20
  </nav>
18
21
  {% else %}
19
22
  {% include nav-default.html %}
20
23
  {% endif %}
21
24
 
22
- <template id="buttontoggle">
23
- <button class="button button--nav" aria-label="Menu toggle">
24
- {% include icon.html id="nav" title="Menu" %}
25
- </button>
26
- </template>
27
-
28
25
  <script type="text/javascript">
26
+ // Get list and button
27
+ const navList = document.querySelector('.header .list--nav')
28
+ const button = document.querySelector('.header .button--nav')
29
+
30
+ // Hide nav and apply toggle
31
+ const collapseNav = () => {
32
+ if (document.body.clientWidth < 640) {
33
+ navList.style.setProperty('--listHeight', `-${navList.offsetHeight}px`)
34
+ } else {
35
+ navList.removeAttribute('style')
36
+ }
29
37
 
30
- const nav = document.querySelector('.nav')
31
- const buttonTemplate = document.querySelector('#buttontoggle')
32
- const button = document.importNode(buttonTemplate.content, true)
33
- nav.appendChild(button)
34
-
35
- const applyToggle = (list, button, breakpoint) => {
36
- const navList = document.querySelector(list)
37
- if (document.body.clientWidth < breakpoint) {
38
- const navHeight = navList.clientHeight
39
- const navButton = document.querySelector(button)
40
- navList.style.maxHeight = '0px'
41
-
42
- navButton.onclick = () => {
43
- if (navList.style.maxHeight == '0px') {
44
- navList.style.maxHeight = `${navHeight}px`
38
+ button.onclick = () => {
39
+ navList.style.setProperty('transition', `margin .1s`)
40
+ if (navList.style.getPropertyValue('--listHeight')) {
41
+ navList.style.removeProperty('--listHeight')
45
42
  } else {
46
- navList.style.maxHeight = '0px'
43
+ navList.style.setProperty('--listHeight', `-${navList.offsetHeight}px`)
47
44
  }
48
45
  }
49
46
  }
50
- }
51
47
 
52
- applyToggle('.list--nav', '.button', 640)
48
+ collapseNav()
53
49
 
50
+ // Check on resize if to collapse nav
51
+ window.addEventListener('resize', () => {
52
+ collapseNav()
53
+ })
54
54
  </script>
@@ -39,6 +39,8 @@ body {
39
39
  display: flex;
40
40
  flex-direction: column-reverse;
41
41
  align-items: flex-end;
42
+ justify-content: flex-end;
43
+ overflow: hidden;
42
44
  }
43
45
 
44
46
  .feature {
@@ -175,7 +177,7 @@ body {
175
177
  list-style: none;
176
178
  &--nav {
177
179
  overflow: hidden;
178
- transition: .2s;
180
+ margin-bottom: var(--listHeight, 0);
179
181
  }
180
182
  .item--post,
181
183
  .item--result,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alembic-jekyll-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.10
4
+ version: 3.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Darnes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-18 00:00:00.000000000 Z
11
+ date: 2019-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll