askclass-course-theme 0.7.2 → 0.8.0

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: 931e7b78af4da413dd772ab9be96c3907897d6126b718c55b8bff803c12cd585
4
- data.tar.gz: 0f2bdb0a504597c0544e7fcd47c718d2ebbfa304a07fccf84507c0ca54459906
3
+ metadata.gz: e6c46afa6955c6f82e89e3501d5234a4244e8c8fea8c825e70f2a5333be950b7
4
+ data.tar.gz: f9b9df41cf7a721cca1e36f09f7151c930da3e1db2a6d201605c1a85df178b64
5
5
  SHA512:
6
- metadata.gz: 0d7f2e0664a268bbc889194aa7850f72c5c536bc1e07dcc5bdbee09de7bcb1923d2095177a5a1409747cdb1a92c8aca2842c3ead8591d6af67abba617743b69c
7
- data.tar.gz: e4d498fe7d9c509cfda6b3c74a3fcdb9bab1fe6fc177a63e833c701cc5236343579a9ffcf42a308cb986507481614d6d307eb7b9a5d0ef6745c5da6e7e16bdfc
6
+ metadata.gz: 8713996cf7c49fdc97344c02b9ede1ca72aef28befd3bd200cc7b3cb0c1632e04e8b675deea1f57e41d1f9ebc8bdc36128965b4687ccc6ae97029726e5bba133
7
+ data.tar.gz: 47b18f5d36486cc9fc7d885cb7e83b89dfb053e675c2fdc04ad0fd6cbc250a18e91c474af0585379b8ebf848f93eb3ba389c2de567ffa2064f422c94cfc9564b
data/_config.yml CHANGED
@@ -22,10 +22,10 @@ acc:
22
22
  alt_image: "logo.svg"
23
23
  alt_size: 200
24
24
  sizes: [ 48, 96, 144, 192, 300, 512 ]
25
- shortcut:
26
- name: Syllabus
27
- url: https://acc.askclass.com/session/session-01
28
- desc: Class syllabus and contact information
25
+ shortcuts:
26
+ - name: Syllabus
27
+ url: https://acc.askclass.com/session/session-01
28
+ desc: Class syllabus and contact information
29
29
  meta:
30
30
  apple_icon: "logo-300.png"
31
31
  og_image: "logo-square-512.png"
@@ -63,18 +63,19 @@
63
63
  <script defer>
64
64
  const due = document.querySelectorAll('.due');
65
65
  const rocket = document.querySelectorAll('.rocket');
66
- due.forEach( el => {
67
- const d = new Date(el.dataset.date.split('-')).getTime();
68
- if (d < Date.now()) {
69
- el.classList.add('past');
70
- }
71
- });
72
- rocket.forEach( el => {
73
- if (el.dataset.date) {
74
- const d = new Date(el.dataset.date.split('-')).getTime();
75
- if (d < Date.now()) {
76
- el.innerText = 'rocket';
77
- }
78
- }
79
- });
66
+ const ymd2ms = d => {
67
+ const ymd = d.split('-');
68
+ ymd[1]--;
69
+ return new Date(...ymd).getTime();
70
+ };
71
+ due.forEach( el =>
72
+ ymd2ms(el.dataset.date) < Date.now() &&
73
+ el.classList.add('past')
74
+ );
75
+
76
+ rocket.forEach( el =>
77
+ el.dataset.date &&
78
+ ymd2ms(el.dataset.date) < Date.now() &&
79
+ (el.innerText = 'rocket')
80
+ );
80
81
  </script>
@@ -49,10 +49,13 @@
49
49
 
50
50
  <script defer>
51
51
  const due = document.querySelectorAll('.alarm');
52
- due.forEach( el => {
53
- const d = new Date(el.dataset.date.split('-')).getTime();
54
- if (d < Date.now()) {
55
- el.parentNode.removeChild(el);
56
- }
57
- });
52
+ const ymd2ms = d => {
53
+ const ymd = d.split('-');
54
+ ymd[1]--;
55
+ return new Date(...ymd).getTime();
56
+ };
57
+ due.forEach( el =>
58
+ ymd2ms(el.dataset.date) < Date.now() &&
59
+ el.parentNode.removeChild(el)
60
+ );
58
61
  </script>
@@ -1,5 +1,6 @@
1
1
  {%- if session_data.points or session_data.due -%}
2
- <table style="width: max-content">
2
+ <table style="width: max-content; table-layout: auto; white-space: nowrap">
3
+ <tbody>
3
4
  {%- if session_data.points -%}
4
5
  <tr>
5
6
  <td>Points</td>
@@ -12,5 +13,6 @@
12
13
  <td>{{ session_data.due | date: '%B %d, %Y' }}</td>
13
14
  </tr>
14
15
  {%- endif -%}
16
+ </tbody>
15
17
  </table>
16
18
  {%- endif -%}
@@ -1,53 +1,44 @@
1
1
  ---
2
2
  ---
3
+ {%- assign acc = site.acc -%}
3
4
  {
4
- "background_color": "{{ site.acc.color.bg }}",
5
- "theme_color": "{{ site.acc.color.theme }}",
5
+ "background_color": "{{ acc.color.bg }}",
6
+ "theme_color": "{{ acc.color.theme }}",
6
7
  "name": "{{ site.title }}",
7
- "short_name": "{{ site.acc.short_name }}",
8
- "categories": [ "{{ site.acc.categories | join: '","' }}" ],
8
+ "short_name": "{{ acc.short_name }}",
9
+ "categories": [ "{{ acc.categories | join: '","' }}" ],
9
10
  "display": "standalone",
10
11
  "scope": "/",
11
12
  "start_url": "/",
12
13
  "description": "{{ site.description | strip_newlines }}",
13
14
  "orientation": "portrait-primary",
15
+ "lang": "en",
14
16
  "dir": "auto",
15
- "icons": [
16
- {
17
- "src": "logo-48.png",
18
- "sizes": "48x48",
19
- "type": "image/png",
20
- "purpose": "maskable"
21
- },
22
- {
23
- "src": "logo-96.png",
24
- "sizes": "96x96",
25
- "type": "image/png",
26
- "purpose": "maskable"
27
- },
17
+ {%- if acc.shortcuts %}
18
+ "shortcuts": [
19
+ {%- for sc in acc.shortcuts %}
28
20
  {
29
- "src": "logo-144.png",
30
- "sizes": "144x144",
31
- "type": "image/png",
32
- "purpose": "maskable"
33
- },
21
+ "name": "{{ sc.name }}",
22
+ "url": "{{ sc.url }}",
23
+ "description": "{{ sc.desc }}"
24
+ }{%- if forloop.index != forloop.length %},{%- endif %}
25
+ {%- endfor %}
26
+ ],
27
+ {%- endif %}
28
+ "icons": [
29
+ {%- for px in acc.logo.sizes %}
34
30
  {
35
- "src": "logo-192.png",
36
- "sizes": "192x192",
31
+ "src": "logo-{{px}}.png",
32
+ "sizes": "{{px}}x{{px}}",
37
33
  "type": "image/png",
38
34
  "purpose": "maskable"
39
35
  },
36
+ {%- endfor %}
40
37
  {
41
38
  "src": "logo-300.png",
42
39
  "type": "image/png",
43
40
  "sizes": "300x300"
44
41
  },
45
- {
46
- "src": "logo-512.png",
47
- "sizes": "512x512",
48
- "type": "image/png",
49
- "purpose": "maskable"
50
- },
51
42
  {
52
43
  "src": "logo-icon.svg",
53
44
  "type": "image/svg+xml",
@@ -55,19 +46,8 @@
55
46
  "purpose": "any"
56
47
  }
57
48
  ],
58
- "lang": "en",
59
49
  "display_override": [
60
50
  "standalone",
61
51
  "fullscreen"
62
- ],
63
- "shortcuts": [
64
- {
65
- icons: [
66
- "src": "/assets/logo-96.png"
67
- ],
68
- "name": "{{ site.acc.shortcut.name }}",
69
- "url": "{{ site.acc.shortcut.url }}",
70
- "description": "{{ site.acc.shortcut.desc }}"
71
- }
72
52
  ]
73
53
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: askclass-course-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AskClass
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-10 00:00:00.000000000 Z
11
+ date: 2022-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll