jekyll-theme-isabelline 0.1.24 → 0.1.25

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: ea565258d13997a195b8c5d642002dbf07188c06dedf583ad7a95899e3018f94
4
- data.tar.gz: dd6a9df6f05dd6828fd0921fbdb2edb815cde30d9efa62f09ad70dacd15bc53f
3
+ metadata.gz: 3e2e7dd1653a5f7ce624d83b84515962ec583817b8fb7a68812bf6ecd09dec5c
4
+ data.tar.gz: 9c1e5ac6ab4ea5566c81047f83237a7d51e8759c4308e38db21c6f377349fd1c
5
5
  SHA512:
6
- metadata.gz: 42ba4ccace4d9fac5bc79365f754095b9d2499244fc4e8858acbe8050c474129a98c44b42022a1e7145e74749074c84e6c7af2af68e4e64db16bdf259f46a306
7
- data.tar.gz: a33102edb079e45b3c3b1d6943ec9147257580cc44d57fc000d446e94c7bda028e339f7d16a19c471ad9a074339e9a368d1eeec9da1b812adc6e9c5a2f406f89
6
+ metadata.gz: 81e07b530504bce8bdd10817bcb9718270637a053fd2263ccbf7fbefd136c18e4836cc59e791db12a8cbc11044507c285368bbf51d5ff24b3f4b404023cbd3a0
7
+ data.tar.gz: 470e2850d46cb6618bd88ece1a1c1b58547ee65ead00215a4276ddc8acf2c1770f5d19a2247006c005258c567ccc38df07f3fd229727cdea88bb8c05b9ce5324
@@ -2,26 +2,78 @@
2
2
 
3
3
  {% assign gallery_prefix = page.id | prepend: "/assets" | append: "/" | append: gallery_name %}
4
4
 
5
- {% assign sorted_static_files = site.static_files | map: "path" | sort %}
6
5
 
7
- {% assign valid_image_extensions = "jpg,jpeg,png,gif" | split: "," %}
6
+ {% assign valid_image_extensions = ".jpg,.jpeg,.png,.gif" | split: "," %}
7
+ {% assign valid_image_sizes = "-300,-700" | split: "," %}
8
+
9
+ {% assign sorted_static_files = site.static_files | map: "path" | sort | join: "|" | append: gallery_prefix | append: "/dummy-700.jpg" | split: "|" %}
10
+
11
+ {% assign img_sizes = "(max-width: 500px) 300px, 700px" %}
12
+
13
+ {% assign prev_same_image_path = "-" %}
8
14
 
9
15
  <div class="gallery" id="gallery-{{ gallery_name }}">
10
16
  {% assign image_index = 0 %}
11
17
  {% assign gallery_nav = "" %}
18
+ {% assign image_srcset = "" %}
12
19
  <div class="images">
13
20
  {% for image_path in sorted_static_files %}
14
- {% assign image_ext = image_path | split: "." | last %}
21
+ {% assign image_ext = image_path | split: "." | last | prepend: "." %}
15
22
  {% if valid_image_extensions contains image_ext %}
23
+
16
24
  {% if image_path contains gallery_prefix %}
17
- {% assign image_index = image_index | plus: 1 %}
18
- <img id="{{ gallery_name }}-{{ image_index }}" src="{{ site.baseurl }}{{ image_path }}" />
25
+
26
+ {% assign same_image_path = "" %}
27
+ {% assign srcset = "" %}
28
+
29
+ {% for dash_size in valid_image_sizes %}
30
+ {% if image_path contains dash_size %}
31
+ {% assign same_image_path = image_path | split: dash_size | first %}
32
+
33
+ {% assign size = dash_size | remove: "-" %}
34
+ {% assign srcset = image_path | prepend: site.baseurl | append: " " | append: size | append: "w" %}
35
+ <!-- <li>srcset1={{ srcset }}</li> -->
36
+ {% endif %}
37
+ <!-- <li>srcset2={{ srcset }}</li> -->
38
+ {% endfor %}
39
+
40
+
41
+ {% if same_image_path == blank %}
42
+ {% assign src = image_path %}
43
+ {% endif %}
44
+
45
+ {% if srcset != blank %}
46
+ <!-- <li>srcset3={{ srcset }}</li> -->
47
+ <!-- <li>prev_same_image_path={{ prev_same_image_path }}</li> -->
48
+ <!-- <li>same_image_path={{ same_image_path }}</li> -->
49
+ {% if same_image_path == prev_same_image_path && true %}
50
+ {% if image_srcset != blank %}
51
+ {% assign image_srcset = image_srcset | append: "," %}
52
+ {% endif %}
53
+ {% assign image_srcset = image_srcset | append: srcset %}
54
+ {% else %}
55
+ {% if prev_same_image_path == "-" %}
56
+ {% assign prev_same_image_path = same_image_path %}
57
+ {% assign image_srcset = srcset %}
58
+ {% else %}
59
+ {% assign image_index = image_index | plus: 1 %}
60
+ <img id="{{ gallery_name}}-{{ image_index }}" srcset="{{ image_srcset }}" sizes="{{ img_sizes }}" src="{{ site.baseurl }}{{ src }}" />
61
+ {% assign prev_same_image_path = same_image_path %}
62
+ {% assign image_srcset = "" %}
63
+
64
+ {% endif %}
65
+ {% endif %}
66
+ {% endif %}
19
67
  {% endif %}
20
68
  {% endif %}
21
69
  {% endfor %}
22
70
  </div>
23
71
  <nav>
24
- <div class="play">
72
+ <!-- <div class="preview">
73
+ <div class="vg"></div>
74
+ <div class="hg"></div>
75
+ </div>
76
+ --> <div class="play">
25
77
  <input type="checkbox" checked="false" id="{{ gallery_name }}-play" />
26
78
  <label for="{{ gallery_name }}-play"></label>
27
79
  </div>
@@ -17,7 +17,7 @@
17
17
  <ul class="index">
18
18
  {% for post in pinned_posts %}
19
19
  <li>
20
- <a href="{{ post.url | relative_url }}">{{ post.title }}</a>
20
+ <a href="{{ post.url | relative_url }}">{{ post.title | markdownify }}</a>
21
21
  <span class="posted">{{ post.date | date: "%b %-d, %Y" }}</span>
22
22
  {% if jekyll.environment == "local" %}
23
23
  {% if post.collection == 'private' %}
@@ -47,7 +47,7 @@
47
47
  {% endif %}
48
48
 
49
49
  <li>
50
- <a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
50
+ <a href="{{ site.baseurl }}{{ post.url }}">{{ post.title | markdownify }}</a>
51
51
  <span class="posted">{{ post.date | date: "%b %-d" }}</span>
52
52
  {% if jekyll.environment == "local" %}
53
53
  {% if post.collection == 'private' %}
@@ -255,6 +255,12 @@ main {
255
255
  img.right { left: 100% !important; }
256
256
  img.center { left: 0 !important; }
257
257
 
258
+ img.thumbnail {
259
+ margin: 10px;
260
+ float: left;
261
+ position: static;
262
+ }
263
+
258
264
  img {
259
265
  cursor: pointer;
260
266
  border-radius: 6px;
@@ -317,6 +323,32 @@ main {
317
323
  }
318
324
  }
319
325
  }
326
+
327
+ .preview {
328
+ position: relative;
329
+ cursor: pointer;
330
+ float: right;
331
+ margin: .5rem;
332
+ width: 14px;
333
+ height: 14px;
334
+ background-color: hsl($hue,50,40);
335
+ .vg, .hg {
336
+ border: 1px solid $body-background-color;
337
+ position: absolute;
338
+ }
339
+ .vg {
340
+ top: -1px;
341
+ left:4px;
342
+ width: 4px;
343
+ height: 100%;
344
+ }
345
+ .hg {
346
+ left: -1px;
347
+ top:4px;
348
+ height: 4px;
349
+ width: 100%;
350
+ }
351
+ }
320
352
  }
321
353
  }
322
354
 
data/assets/js/gallery.js CHANGED
@@ -1,7 +1,4 @@
1
1
  (function () {
2
- var hidden = function () {
3
- return document.hidden || document.msHidden || document.webkitHidden;
4
- }
5
2
 
6
3
  // "hydrate" div.gallery with play/pause and nav behaviors
7
4
  var process_gallery = function (g) {
@@ -19,6 +16,10 @@
19
16
  // container for nav buttons
20
17
  gallery_nav = g.querySelector('nav'),
21
18
 
19
+ // show all images
20
+ // computed below
21
+ preview_nav,
22
+
22
23
  // clickable buttons, one per image
23
24
  // computed below
24
25
  navs = [],
@@ -31,7 +32,9 @@
31
32
  play_checkbox,
32
33
 
33
34
  // handle to setInterval
34
- play_interval;
35
+ play_interval,
36
+
37
+ play_suspended = false;
35
38
 
36
39
  /*
37
40
  +--------+--------+--------+
@@ -40,10 +43,66 @@
40
43
  +--------+--------+--------+
41
44
  */
42
45
 
46
+ var suspended = function () {
47
+ return play_suspended || document.hidden || document.msHidden || document.webkitHidden;
48
+ }
49
+
43
50
  var adjust_height = function (index) {
44
51
  images_container.style.height = images[index].offsetHeight + 'px';
45
52
  }
46
53
 
54
+ /*
55
+ +----------------------------------------+
56
+ | +----------+ +----------+ +----------+ |
57
+ | | | | | | | |
58
+ | | | | | | | |
59
+ | | | | | | | |
60
+ | | | | | | | |
61
+ | | | | | | | |
62
+ | +----------+ +----------+ +----------+ |
63
+ | |
64
+ | +----------+ +----------+ +----------+ |
65
+ | | | | | | | |
66
+ | | | | | | | |
67
+ | | | | | | | |
68
+ | | | | | | | |
69
+ | | | | | | | |
70
+ | +----------+ +----------+ +----------+ |
71
+ | |
72
+ | +----------+ +----------+ +----------+ |
73
+ | | | | | | | |
74
+ | | | | | | | |
75
+ | | | | | | | |
76
+ | | | | | | | |
77
+ | | | | | | | |
78
+ | +----------+ +----------+ +----------+ |
79
+ | |
80
+ | +----------+ +----------+ |
81
+ | | | | | |
82
+ | | | | | |
83
+ | | | | | |
84
+ | | | | | |
85
+ | | | | | |
86
+ | +----------+ +----------+ |
87
+ +----------------------------------------+
88
+ */
89
+
90
+
91
+ var show_preview = function () {
92
+ var thumb_size = (images_container.offsetWidth - 6*10) / 3;
93
+ for (var i=0; i<images.length; ++i) {
94
+ var image = images[i];
95
+ if (image.offsetHeight > image.offsetWidth) {
96
+ console.log('showing tall preview', thumb_size, image.offsetWidth, 'x', image.offsetHeight)
97
+ image.style.width = thumb_size + 'px';
98
+ } else {
99
+ console.log('showing wide preview', thumb_size, image.offsetWidth, 'x', image.offsetHeight)
100
+ image.style.height = thumb_size + 'px';
101
+ }
102
+ image.classList.add('thumbnail');
103
+ }
104
+ }
105
+
47
106
  // show image at index
48
107
  // update nav controls accordingly
49
108
  var select_image = function (index) {
@@ -58,7 +117,7 @@
58
117
  selected_index = index;
59
118
  }
60
119
 
61
- if (hidden()) return;
120
+ if (suspended()) return;
62
121
  images[selected_index].addEventListener('transitionend', slide, {once: true});
63
122
 
64
123
  navs[index].classList.add('selected');
@@ -102,7 +161,7 @@
102
161
 
103
162
  // show next image
104
163
  var next_image = function () {
105
- if (hidden()) return;
164
+ if (suspended()) return;
106
165
  if (selected_index >= images.length-1) {
107
166
  select_image(0);
108
167
  } else {
@@ -145,6 +204,14 @@
145
204
  play_checkbox = g.querySelector('.play input[type=checkbox]');
146
205
  play_checkbox.addEventListener('change', toggle_play);
147
206
 
207
+ // g.querySelector('.preview').addEventListener('click', function () {
208
+ // show_preview();
209
+ // });
210
+
211
+ window.addEventListener('resize', function () {
212
+ adjust_height(selected_index);
213
+ });
214
+
148
215
  // resize image container when initial image loads
149
216
  if (images[selected_index].complete) {
150
217
  adjust_height(selected_index);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-isabelline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.24
4
+ version: 0.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rouslan Zenetl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-10 00:00:00.000000000 Z
11
+ date: 2021-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  - !ruby/object:Gem::Version
142
142
  version: '0'
143
143
  requirements: []
144
- rubygems_version: 3.1.4
144
+ rubygems_version: 3.2.2
145
145
  signing_key:
146
146
  specification_version: 4
147
147
  summary: Simple clean mobile-friendly theme for long form note taking. Works for blogging