jekyll-theme-noesya 1.0.5 → 1.0.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70358ce650e075bb0c4afe695d5b4ce0aa644cd3c9a678bebd9e33897a0d9f95
4
- data.tar.gz: 41b58e2f8069384d13ed07c507e4aa280c46210ea2dcdb1d5e28d57152602372
3
+ metadata.gz: f831149364194c2e5d83bbf03d312eca41a1d8468c1a06e668c5b7f4b382bce7
4
+ data.tar.gz: 534753743b687e307adc85401d504ccd99f9654ec9d9a4d985c99de12691d784
5
5
  SHA512:
6
- metadata.gz: 4ef5c804912f86abbc094f25a7740881894985f9b3be16fd4bd2a7031396810f4396a69da62799771e7001d505ba8b7417f856384d4854b1f660bb88efcc3e71
7
- data.tar.gz: be464d32a3d140773ef28a73aef9f1114625cba0d0af8796e50bec547837fc94b68ce1d4cf45779a6bb6e1264bf12302c9da07c695c0ba7346151a831b3d8605
6
+ metadata.gz: '0791801ee0a812d6f3b1193bb205685ce1800c6e29381c13228e28690c6f1f7f68b5fb882fd7e13b576cc93d2c206517a9c9ae643ae16d605bb219004b76c325'
7
+ data.tar.gz: 87033e7b9cca30fdba920cb6afd5dd5e3beaf30af3f0f1b936a858a1e3be8f0fb7ef1c661c7185df32d39bcfbe92f266593c1e5d90fadb55380a7957a77d7818
@@ -0,0 +1,32 @@
1
+ window.hoverLinks = {
2
+ timeout: null,
3
+ init: function () {
4
+ 'use strict';
5
+ var i = 0,
6
+ links = document.querySelectorAll('[data-link-delay]');
7
+
8
+ for (i = 0; i < links.length; i += 1) {
9
+ this.bind(links[i]);
10
+ }
11
+ },
12
+ bind: function (link) {
13
+ 'use strict';
14
+ var a = link.querySelector('a'),
15
+ delay = link.getAttribute('data-link-delay');
16
+
17
+ link.addEventListener('mouseenter', function () {
18
+ this.timeout = setTimeout(this.click.bind(this, a), delay * 1000);
19
+ }.bind(this));
20
+
21
+ link.addEventListener('mouseleave', function () {
22
+ clearTimeout(this.timeout);
23
+ }.bind(this));
24
+ },
25
+ click: function (element) {
26
+ 'use strict';
27
+ var event = new MouseEvent('click');
28
+ element.dispatchEvent(event);
29
+ }
30
+ };
31
+
32
+ window.hoverLinks.init();
File without changes
@@ -0,0 +1,188 @@
1
+ window.notes = window.notes || {};
2
+ window.notes.Item = window.notes.Item || {};
3
+ window.notes.manager = window.notes.manager || {};
4
+
5
+ window.notes.Item = function (dom, previous) {
6
+ 'use strict';
7
+ this.dom = dom;
8
+ this.parent = dom.parentNode;
9
+ this.y = 0;
10
+ this.previous = previous || null;
11
+ this.anchor = document.querySelector('a[href="#' + dom.id + '"]');
12
+ this.isVisible = false;
13
+ this.verticalOffset = 6;
14
+ setTimeout(function () {
15
+ this.dom.classList.add('is-handled');
16
+ }.bind(this), 1);
17
+ this.replace();
18
+ this.ready();
19
+ };
20
+ window.notes.Item.prototype.ready = function () {
21
+ 'use strict';
22
+ this.anchor.addEventListener('mouseenter', function () {
23
+ this.dom.classList.add('is-hovered');
24
+ }.bind(this));
25
+ this.anchor.addEventListener('mouseleave', function () {
26
+ this.dom.classList.remove('is-hovered');
27
+ }.bind(this));
28
+ };
29
+
30
+ window.notes.Item.prototype.replace = function () {
31
+ 'use strict';
32
+
33
+ if (window.notes.manager.isFixed) {
34
+ this.dom.classList.add('is-fixed');
35
+ this.dom.style.top = '';
36
+ } else {
37
+ this.dom.classList.remove('is-fixed');
38
+ this.updatePosition();
39
+ }
40
+
41
+ this.updateVisibility();
42
+ };
43
+
44
+ window.notes.Item.prototype.updateVisibility = function () {
45
+ 'use strict';
46
+ var anchorTop = this.anchor.getBoundingClientRect().top,
47
+ offset = window.innerHeight * 0.5;
48
+
49
+ this.isVisible = anchorTop > 0 && anchorTop < offset;
50
+ };
51
+
52
+ window.notes.Item.prototype.updatePosition = function () {
53
+ 'use strict';
54
+ this.y = this.getTop(this.anchor) - this.getTop(this.parent);
55
+
56
+ if (this.previous) {
57
+ this.preventOverlap();
58
+ }
59
+
60
+ this.preventTitleOverlap();
61
+
62
+ this.y += this.verticalOffset;
63
+
64
+ this.dom.style.top = this.y + 'px';
65
+ };
66
+
67
+ window.notes.Item.prototype.preventOverlap = function () {
68
+ 'use strict';
69
+ var distance = this.previous.bottom() - this.y;
70
+ this.y = Math.max(this.y, this.y + distance);
71
+ };
72
+
73
+ window.notes.Item.prototype.preventTitleOverlap = function () {
74
+ 'use strict';
75
+ var titles = document.querySelectorAll('h2'),
76
+ i;
77
+
78
+ for (i = 0; i < titles.length; i += 1) {
79
+ this.testTitleOverlap(titles[i]);
80
+ }
81
+ };
82
+
83
+ window.notes.Item.prototype.testTitleOverlap = function (title) {
84
+ 'use strict';
85
+ var top = this.getTop(title) - this.getTop(this.parent),
86
+ safer = 10,
87
+ bottom = top + title.offsetHeight,
88
+ offset = Math.max(bottom - this.y, window.notes.manager.lineHeight);
89
+
90
+ if (this.y >= top - safer && this.y <= bottom + safer) {
91
+ this.y += offset;
92
+ }
93
+ };
94
+
95
+ window.notes.Item.prototype.getTop = function (element) {
96
+ 'use strict';
97
+ return element.getBoundingClientRect().top + window.scrollY;
98
+ };
99
+
100
+ window.notes.Item.prototype.bottom = function () {
101
+ 'use strict';
102
+ return this.y + this.dom.offsetHeight;
103
+ };
104
+
105
+ window.notes.manager = {
106
+ breakpoint: 768,
107
+ isFixed: false,
108
+ pool: [],
109
+ nearest: null,
110
+ lineHeight: 45,
111
+ init: function () {
112
+ 'use strict';
113
+ var i,
114
+ elements = document.querySelectorAll('.js-note');
115
+
116
+ if (elements.length === 0) {
117
+ return;
118
+ }
119
+
120
+ this.setMode();
121
+
122
+ for (i = 0; i < elements.length; i += 1) {
123
+ this.generate(elements[i], i);
124
+ }
125
+
126
+ this.resize();
127
+ this.listen();
128
+
129
+ setTimeout(this.resize.bind(this), 100);
130
+ },
131
+
132
+ generate: function (element, i) {
133
+ 'use strict';
134
+ var previous = this.pool[i - 1] || null;
135
+ this.pool.push(new window.notes.Item(element, previous));
136
+ },
137
+
138
+ listen: function () {
139
+ 'use strict';
140
+ window.addEventListener('scroll', this.scroll.bind(this));
141
+ window.addEventListener('resize', this.resize.bind(this));
142
+ window.addEventListener('load', this.resize.bind(this));
143
+ window.addEventListener('DOMContentLoaded', this.resize.bind(this));
144
+ },
145
+
146
+ resize: function () {
147
+ 'use strict';
148
+ this.lineHeight = getComputedStyle(document.querySelector('section > p')).lineHeight;
149
+ this.lineHeight = parseInt(this.lineHeight.replace('px', ''), 10);
150
+ this.setMode();
151
+ this.update();
152
+ },
153
+
154
+ setMode: function () {
155
+ 'use strict';
156
+ var isFixed = window.innerWidth < this.breakpoint;
157
+ this.isFixed = isFixed;
158
+ },
159
+
160
+ scroll: function () {
161
+ 'use strict';
162
+ var nearest = null,
163
+ i;
164
+
165
+ if (this.isFixed) {
166
+ this.update();
167
+ }
168
+
169
+ for (i = this.pool.length - 1; i >= 0; i -= 1) {
170
+ if (this.pool[i].isVisible && (!nearest || !this.isFixed)) {
171
+ nearest = this.pool[i];
172
+ nearest.dom.classList.add('is-visible');
173
+ } else {
174
+ this.pool[i].dom.classList.remove('is-visible');
175
+ }
176
+ }
177
+ },
178
+
179
+ update: function () {
180
+ 'use strict';
181
+ var i;
182
+ for (i = 0; i < this.pool.length; i += 1) {
183
+ this.pool[i].replace();
184
+ }
185
+ }
186
+ };
187
+
188
+ window.notes.manager.init();
@@ -0,0 +1,12 @@
1
+ (function () {
2
+ 'use strict';
3
+ var paragraphs = document.querySelectorAll('.js-p-index > p'),
4
+ i,
5
+ index;
6
+
7
+ for (i = 0; i < paragraphs.length; i += 1) {
8
+ index = document.createElement('small');
9
+ index.innerText = '§' + (i + 1);
10
+ paragraphs[i].prepend(index);
11
+ }
12
+ }());
@@ -0,0 +1,18 @@
1
+ {% if page.nav %}
2
+ <nav>
3
+ <ul>
4
+ <li data-link-delay="3">
5
+ <a href="{{page.nav.previous.url}}">
6
+ <span>{{page.nav.previous.title}}</span><br>
7
+ {{- page.nav.previous.text -}}
8
+ </a>
9
+ </li>
10
+ <li data-link-delay="3">
11
+ <a href="{{page.nav.next.url}}">
12
+ <span>{{page.nav.next.title}}</span><br>
13
+ {{- page.nav.next.text -}}
14
+ </a>
15
+ </li>
16
+ </ul>
17
+ </nav>
18
+ {% endif %}
@@ -0,0 +1,15 @@
1
+
2
+ {% capture index %}
3
+ {{ note_index }}.
4
+ {% endcapture %}
5
+
6
+ {% capture note_content %}
7
+ {{index}} Voir {% if note.url %}<a href="{{ note.url }}" target="_blank" rel="noreferrer">{% endif %}{{ note.title }}{% if note.url %}</a>{% endif %}
8
+ {% endcapture %}
9
+
10
+ <aside class="js-note" id="note-{{ note_index }}">
11
+ {% if note.image %}
12
+ {% picture note "{{ note.image }}" --img alt="{{ note.title }}" title="{{ note.title }}" loading="lazy" %}
13
+ {% endif %}
14
+ {{ note_content | markdownify | correct_punctuation }}
15
+ </aside>
@@ -0,0 +1,16 @@
1
+ <section {% if page.layout == "member" %} class="js-p-index" {% endif %}>
2
+ {% for section in page.sections %}
3
+ {% if section.title %}
4
+ <h2>{{section.title}}</h2>
5
+ {% endif %}
6
+ {{section.content | markdownify | correct_punctuation}}
7
+ {% endfor %}
8
+
9
+ {% assign note_index = 0 %}
10
+ {% for section in page.sections %}
11
+ {% for note in section.notes %}
12
+ {% assign note_index = note_index | plus: 1 %}
13
+ {% include note.html note=note index=note_index %}
14
+ {% endfor %}
15
+ {% endfor %}
16
+ </section>
@@ -20,6 +20,9 @@
20
20
  {{ content }}
21
21
  </main>
22
22
  {% include footer.html %}
23
- <script src="/assets/js/main.js" async defer></script>
23
+
24
+ {% unless site.options.no_js %}
25
+ <script src="/assets/js/main.js" async defer></script>
26
+ {% endunless %}
24
27
  </body>
25
28
  </html>
@@ -1,8 +1,9 @@
1
- $theme-colors: ("link-blank": "\e900", "link": "\e901", "download": "\e902", "download": "\e902", "document": "\e903", "ecologique-thin": "\e905", "economique-thin": "\e907", "ethique-thin": "\e908", "juridique-thin": "\e906", "strategique-thin": "\e904", "ecologique": "\e909", "economique": "\e90a", "ethique": "\e90b", "juridique": "\e90c", "strategique": "\e90d")
1
+ $icons: ("link-blank": "\e90a", "link": "\e90b", "download": "\e90c", "document": "\e90d", "ecologique-thin": "\e900", "economique-thin": "\e902", "ethique-thin": "\e904", "juridique-thin": "\e906", "strategique-thin": "\e908", "ecologique": "\e901", "economique": "\e903", "ethique": "\e905", "juridique": "\e907", "strategique": "\e909")
2
2
 
3
3
  @mixin icon
4
4
  -moz-osx-font-smoothing: grayscale
5
5
  -webkit-font-smoothing: antialiased
6
+ content: ''
6
7
  display: inline-block
7
8
  font-family: 'icons' !important
8
9
  font-style: normal
@@ -12,10 +13,8 @@ $theme-colors: ("link-blank": "\e900", "link": "\e901", "download": "\e902", "do
12
13
  speak: never
13
14
  text-transform: none
14
15
 
15
- @each $icon in $icons
16
- .icon--#{$icon}
16
+ @each $name, $glyph in $icons
17
+ .icon--#{$name}
17
18
  &::before
18
- content: #{$icon}
19
-
20
- .icon::before
21
- @include icon
19
+ @include icon
20
+ content: $glyph
@@ -38,7 +38,7 @@
38
38
  left: 15px
39
39
  position: absolute
40
40
  transform-origin: center
41
- transition: transform 0.38s 0.3s $easeInOutQuad
41
+ transition: transform 0.28s 0.2s $easeInOutQuad
42
42
  width: 20px
43
43
  &::after
44
44
  transform: translateY(-9px)
@@ -52,7 +52,7 @@
52
52
  left: 15px
53
53
  position: absolute
54
54
  transform-origin: center
55
- transition: transform 0.38s $easeInOutQuad
55
+ transition: transform 0.28s $easeInOutQuad
56
56
  width: 20px
57
57
  &::after
58
58
  transform: rotate(-45deg) scaleX(0)
@@ -60,11 +60,11 @@
60
60
  transform: rotate(45deg) scaleX(0)
61
61
  &:hover
62
62
  &::after
63
- animation: 0.5s 0.2s menu-hovered $easeInOutQuad
63
+ animation: 0.3s 0.14s menu-hovered $easeInOutQuad
64
64
  i
65
- animation: 0.5s 0.1s menu-hovered $easeInOutQuad
65
+ animation: 0.3s 0.07s menu-hovered $easeInOutQuad
66
66
  &::before
67
- animation: 0.5s 0s menu-hovered $easeInOutQuad
67
+ animation: 0.3s 0s menu-hovered $easeInOutQuad
68
68
 
69
69
  .menu
70
70
  backface-visibility: hidden
@@ -114,14 +114,14 @@
114
114
  span
115
115
  &::after
116
116
  transform: rotate(-45deg) scaleX(1)
117
- transition-delay: 0.25s
117
+ transition-delay: 0.15s
118
118
  &::before
119
119
  transform: rotate(45deg) scaleX(1)
120
- transition-delay: 0.35s
120
+ transition-delay: 0.25s
121
121
 
122
122
  &::before
123
123
  transform: translateY(9px) scaleX(0)
124
- transition-delay: 0.2s
124
+ transition-delay: 0.15s
125
125
  i
126
126
  transform: scaleX(0)
127
127
  transition-delay: 0s
@@ -0,0 +1,63 @@
1
+ main > nav
2
+ background-color: $bg-secondary-color
3
+ overflow-x: hidden
4
+ ul
5
+ li
6
+ @include media-breakpoint-down(md)
7
+ @include container
8
+ &:first-child
9
+ border-bottom: 1px solid $border-color
10
+ a
11
+ @extend h2
12
+ display: block
13
+ font-family: $font-family-sans-serif
14
+ margin-bottom: 0
15
+ padding-bottom: $grid-gutter * 2
16
+ padding-top: $grid-gutter * 2
17
+ text-decoration: none
18
+ span
19
+ color: $secondary-on-gray
20
+
21
+ @include media-breakpoint-up(md)
22
+ transition: background .3s ease
23
+ .is-menu-opened &
24
+ background-color: $bg-secondary-color-reverse
25
+ ul
26
+ @include container
27
+ @include grid(2)
28
+ > li
29
+ border-bottom: none
30
+ a
31
+ padding-bottom: $grid-gutter * 4
32
+ padding-top: $grid-gutter * 4
33
+ position: relative
34
+ z-index: 1
35
+ span
36
+ transition: color .3s ease
37
+ .is-menu-opened &
38
+ color: $secondary-reverse
39
+ li
40
+ position: relative
41
+ &::before
42
+ background: $white
43
+ content: ''
44
+ cursor: pointer
45
+ height: 100%
46
+ left: calc((max(50vw, #{$grid-width/2}) - #{$grid-width / 2 - $grid-gutter * 2}) * -1)
47
+ mix-blend-mode: exclusion
48
+ position: absolute
49
+ top: 0
50
+ transition: width 0.35s $easeInOutQuad
51
+ width: 0
52
+ z-index: 2
53
+ &:hover
54
+ &::before
55
+ transition: width 3s $easeInOutQuad
56
+ width: 50vw
57
+ li + li
58
+ @include border-line
59
+ left: -#{$grid-gutter}
60
+ padding-left: $grid-gutter
61
+ &::before
62
+ left: -$grid-gutter
63
+ right: auto
@@ -0,0 +1,61 @@
1
+ aside
2
+ grid-column: 5/13
3
+ padding-bottom: $grid-gutter
4
+ &:hover
5
+ z-index: 2
6
+ img
7
+ border: 1px solid rgba(0, 0, 0, 0.05)
8
+ display: block
9
+ margin: $grid-gutter/2 0
10
+ max-width: 124px
11
+ p
12
+ margin-bottom: 0
13
+ &.is-fixed
14
+ background: $bg-secondary-color
15
+ bottom: 0
16
+ left: 0
17
+ padding: 5px 15px 10px 10px
18
+ padding-bottom: env(safe-area-inset-bottom, 10px)
19
+ position: fixed
20
+ transform: translateY(100%)
21
+ width: 100%
22
+ z-index: 3
23
+ &.is-handled
24
+ transition: 0.25s $easeInOutQuad
25
+ img
26
+ transition: 0.33s $easeInOutQuad
27
+
28
+ &.is-visible
29
+ &, img
30
+ transform: translateY(0)
31
+ img
32
+ bottom: 12px
33
+ margin: 0
34
+ max-width: 100px
35
+ position: absolute
36
+ right: 12px
37
+ transform: translateY(100%)
38
+ picture + p
39
+ padding-right: 120px
40
+
41
+ &.is-handled:not(.is-fixed)
42
+ display: flex
43
+ flex-direction: column-reverse
44
+ grid-column: 1/5
45
+ padding-bottom: 0
46
+ position: absolute
47
+ img
48
+ filter: grayscale(1)
49
+ margin-bottom: $grid-gutter/2
50
+ opacity: 0.9
51
+ transition: 0.33s $easeInOutQuad
52
+ &:hover, &.is-hovered
53
+ img
54
+ filter: grayscale(0)
55
+ opacity: 1
56
+ &:hover, &.is-hovered
57
+ a
58
+ text-decoration-color: black
59
+ img
60
+ filter: grayscale(0)
61
+ opacity: 1
data/assets/js/main.js CHANGED
@@ -2,4 +2,20 @@
2
2
  layout:
3
3
  ---
4
4
 
5
- {% include js/menu.js %}
5
+ {%- if site.options.menu_burger -%}
6
+ {% include js/menu-burger.js %}
7
+ {%- endif -%}
8
+
9
+ {%- if site.options.notes -%}
10
+ {% include js/notes.js %}
11
+ {%- endif -%}
12
+
13
+ {%- if site.options.paragraphs_index -%}
14
+ {% include js/paragraphs-index.js %}
15
+ {%- endif -%}
16
+
17
+ {%- if site.options.hover_navigation_links -%}
18
+ {% include js/hover-navigation-links.js %}
19
+ {%- endif -%}
20
+
21
+
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-noesya
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sébastien Moulène
8
8
  - Arnaud Levy
9
+ - Alexis BENOIT
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2021-11-03 00:00:00.000000000 Z
13
+ date: 2021-11-04 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: jekyll
@@ -85,6 +86,7 @@ description:
85
86
  email:
86
87
  - sebousan@gmail.com
87
88
  - contact@arnaudlevy.com
89
+ - alexis.benoit@noesya.coop
88
90
  executables: []
89
91
  extensions: []
90
92
  extra_rdoc_files: []
@@ -93,11 +95,17 @@ files:
93
95
  - README.md
94
96
  - _includes/footer.html
95
97
  - _includes/header.html
96
- - _includes/js/menu.js
98
+ - _includes/js/hover-navigation-links.js
99
+ - _includes/js/menu-burger.js
100
+ - _includes/js/notes.js
101
+ - _includes/js/paragraphs-index.js
97
102
  - _includes/nav/contacts.html
98
103
  - _includes/nav/ecosystem.html
99
104
  - _includes/nav/legal.html
100
105
  - _includes/nav/primary.html
106
+ - _includes/navigation-between-pages.html
107
+ - _includes/note.html
108
+ - _includes/sections-with-notes.html
101
109
  - _includes/seo.html
102
110
  - _layouts/default.html
103
111
  - _layouts/page.html
@@ -112,6 +120,8 @@ files:
112
120
  - _sass/commons/typography.sass
113
121
  - _sass/components/header.sass
114
122
  - _sass/components/menu.sass
123
+ - _sass/components/nav-between.sass
124
+ - _sass/components/notes.sass
115
125
  - _sass/layouts/legal.sass
116
126
  - _sass/layouts/page.sass
117
127
  - _sass/main.sass
@@ -146,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
156
  - !ruby/object:Gem::Version
147
157
  version: '0'
148
158
  requirements: []
149
- rubygems_version: 3.1.6
159
+ rubygems_version: 3.1.4
150
160
  signing_key:
151
161
  specification_version: 4
152
162
  summary: Noesya theme for Jekyll.