tecitheme 0.0.12 → 0.0.15

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.
@@ -4,7 +4,7 @@
4
4
  export let caption;
5
5
  </script>
6
6
 
7
- <section class="flex justify-center not-prose">
7
+ <section class="flex justify-center not-prose mb-8">
8
8
  <figure class="bg-white w-auto mx-auto shadow-lg border border-slate-100 p-2">
9
9
  <img class="w-full" src={image} alt={title} title={title}>
10
10
  {#if caption}
@@ -21,7 +21,7 @@
21
21
  }
22
22
  </script>
23
23
 
24
- <footer class="bg-gray-800" aria-labelledby="footerHeading">
24
+ <footer id="bottom" class="bg-gray-800" aria-labelledby="footerHeading">
25
25
  <h2 id="footerHeading" class="sr-only">Footer</h2>
26
26
  <div class="max-w-7xl mx-auto py-12 px-4 sm:px-6 lg:py-16 lg:px-8">
27
27
  <div class="xl:grid xl:grid-cols-3 xl:gap-8">
@@ -1,18 +1,13 @@
1
1
  <script>
2
2
  import Icon from "./Icon.svelte";
3
- import { scale } from 'svelte/transition';
4
3
  import { slide } from 'svelte/transition';
5
- import { cubicIn, cubicOut } from 'svelte/easing';
4
+ import { cubicIn, cubicOut, bounceIn, bounceOut } from 'svelte/easing';
6
5
 
7
- let mobileOpen = false;
8
- let productsOpen = false;
9
- let supportOpen = false;
10
- let eventsOpen = false;
11
- let companyOpen = false;
6
+ let openMenu = '';
12
7
 
13
8
  export function clickOutside(node) {
14
9
  const handleClick = (event) => {
15
- if (!node.contains(event.target)) {
10
+ if ((!node.contains(event.target)) && (event.target.innerText.toLowerCase() != node.parentElement.id)) {
16
11
  node.dispatchEvent(new CustomEvent("outclick"));
17
12
  }
18
13
  };
@@ -26,11 +21,7 @@
26
21
 
27
22
  function handleEscape({key}) {
28
23
  if (key === 'Escape') {
29
- mobileOpen = false;
30
- productsOpen = false;
31
- supportOpen = false;
32
- eventsOpen = false;
33
- companyOpen = false;
24
+ openMenu = '';
34
25
  }
35
26
  }
36
27
  </script>
@@ -52,18 +43,14 @@
52
43
  <div class="hidden md:flex-1 md:flex md:items-center md:justify-between">
53
44
  <nav class="flex md:space-x-6 lg:space-x-10">
54
45
  <!-- Products -->
55
- <div use:clickOutside on:outclick={() => (productsOpen = false)}>
56
- <!-- Item active: "text-gray-900", Item inactive: "text-gray-500" -->
57
- <button type="button" on:click={() => productsOpen = !productsOpen}
46
+ <div id="products">
47
+
48
+ <button type="button" on:click={() => ( openMenu == 'products' ? openMenu = '' : openMenu = 'products' )}
58
49
  class="text-gray-500 group bg-white inline-flex items-center text-base font-medium hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-teci-blue-light"
59
- aria-expanded="false">
60
- <span>Products</span>
61
- <!--
62
- Heroicon name: solid/chevron-down
63
-
64
- Item active: "text-gray-600", Item inactive: "text-gray-400"
65
- -->
66
- <svg class="text-gray-400 ml-2 h-5 w-5 group-hover:text-gray-500"
50
+ aria-expanded="{openMenu == 'products'}">
51
+ <span class:text-gray-900="{openMenu == 'products'}">Products</span>
52
+ <!-- Heroicon name: solid/chevron-down -->
53
+ <svg class="ml-2 h-5 w-5 group-hover:text-gray-900 {openMenu === 'products' ? 'text-gray-900 rotate-180' : 'text-gray-400'}"
67
54
  xmlns="http://www.w3.org/2000/svg"
68
55
  viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
69
56
  <path fill-rule="evenodd"
@@ -73,10 +60,11 @@
73
60
  </button>
74
61
 
75
62
  <!-- Flyout menu -->
76
- {#if productsOpen}
77
- <div class="absolute z-10 top-full inset-x-0 transform shadow-lg bg-white"
78
- in:slide={{ duration: 500, easing: cubicOut }}
79
- out:slide={{ duration: 300, easing: cubicIn }}
63
+ {#if openMenu == 'products'}
64
+ <div class="absolute z-10 top-full inset-x-0 transform shadow-lg bg-white"
65
+ use:clickOutside on:outclick={() => (openMenu = '')}
66
+ in:slide={{ duration: 250, easing: cubicOut }}
67
+ out:slide={{ duration: 150, easing: cubicIn }}
80
68
  >
81
69
  <div class="max-w-7xl mx-auto grid gap-y-8 px-4 py-8 sm:grid-cols-2 sm:gap-8 sm:px-6 lg:grid-cols-3 lg:px-8">
82
70
  <a href="https://www.thunderheadeng.com/pyrosim/" class="-m-3 p-3 flex flex-col justify-between hover:bg-gray-50">
@@ -141,32 +129,6 @@
141
129
  </div>
142
130
  </div>
143
131
  </a>
144
- <!--
145
- <a href="#" class="-m-3 p-3 flex flex-col justify-between hover:bg-gray-50">
146
- <div class="flex md:h-full lg:flex-col">
147
- <div class="flex-shrink-0">
148
- <span
149
- class="inline-flex items-center justify-center h-10 w-10 bg-teci-blue-light text-white sm:h-12 sm:w-12">
150
- <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
151
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4.871 4A17.926 17.926 0 003 12c0 2.874.673 5.59 1.871 8m14.13 0a17.926 17.926 0 001.87-8c0-2.874-.673-5.59-1.87-8M9 9h1.246a1 1 0 01.961.725l1.586 5.55a1 1 0 00.961.725H15m1-7h-.08a2 2 0 00-1.519.698L9.6 15.302A2 2 0 018.08 16H8" />
152
- </svg>
153
- </span>
154
- </div>
155
- <div class="ml-4 md:flex-1 md:flex md:flex-col md:justify-between lg:ml-0 lg:mt-4">
156
- <div>
157
- <p class="text-base font-medium text-gray-900">
158
- Other Tools
159
- </p>
160
- <p class="mt-1 text-sm text-gray-500">
161
- Useful tools and resources distrubuted by Thunderhead.
162
- </p>
163
- </div>
164
- <p class="mt-2 text-sm font-medium text-teci-blue-light lg:mt-4">Learn more <span
165
- aria-hidden="true">&rarr;</span></p>
166
- </div>
167
- </div>
168
- </a>
169
- -->
170
132
  </div>
171
133
 
172
134
  <!-- Action Buttons -->
@@ -217,18 +179,14 @@
217
179
  </div>
218
180
 
219
181
  <!-- Support -->
220
- <div class="relative" use:clickOutside on:outclick={() => (supportOpen = false)}>
221
- <!-- Item active: "text-gray-900", Item inactive: "text-gray-500" -->
222
- <button type="button" on:click={() => supportOpen = !supportOpen}
182
+ <div id="support" class="relative">
183
+
184
+ <button type="button" on:click={() => ( openMenu == 'support' ? openMenu = '' : openMenu = 'support' )}
223
185
  class="text-gray-500 group bg-white inline-flex items-center text-base font-medium hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-teci-blue-light"
224
- aria-expanded="false">
225
- <span>Support</span>
226
- <!--
227
- Heroicon name: solid/chevron-down
228
-
229
- Item active: "text-gray-600", Item inactive: "text-gray-400"
230
- -->
231
- <svg class="text-gray-400 ml-2 h-5 w-5 group-hover:text-gray-500"
186
+ aria-expanded="{openMenu == 'support'}">
187
+ <span class:text-gray-900="{openMenu == 'support'}">Support</span>
188
+ <!-- Heroicon name: solid/chevron-down -->
189
+ <svg class="ml-2 h-5 w-5 group-hover:text-gray-900 {openMenu === 'support' ? 'text-gray-900 rotate-180' : 'text-gray-400'}"
232
190
  xmlns="http://www.w3.org/2000/svg"
233
191
  viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
234
192
  <path fill-rule="evenodd"
@@ -236,10 +194,12 @@
236
194
  clip-rule="evenodd" />
237
195
  </svg>
238
196
  </button>
239
- {#if supportOpen}
197
+
198
+ {#if openMenu == 'support'}
240
199
  <div class="absolute z-40 left-1/2 transform -translate-x-1/2 mt-3 px-2 w-screen max-w-md sm:px-0 shadow-lg ring-1 ring-black ring-opacity-5 overflow-hidden"
241
- in:slide={{ duration: 500, easing: cubicOut }}
242
- out:slide={{ duration: 300, easing: cubicIn }}
200
+ use:clickOutside on:outclick={() => (openMenu = '')}
201
+ in:slide={{ duration: 250, easing: cubicOut }}
202
+ out:slide={{ duration: 150, easing: cubicIn }}
243
203
  >
244
204
  <div class="relative grid gap-6 bg-white px-5 py-6 sm:gap-8 sm:p-8">
245
205
  <a href="https://support.thunderheadeng.com/docs/"
@@ -347,18 +307,14 @@
347
307
  </div>
348
308
 
349
309
  <!-- Events -->
350
- <div class="relative" use:clickOutside on:outclick={() => (eventsOpen = false)}>
351
- <!-- Item active: "text-gray-900", Item inactive: "text-gray-500" -->
352
- <button type="button" on:click={() => eventsOpen = !eventsOpen}
310
+ <div id="events" class="relative">
311
+
312
+ <button type="button" on:click={() => ( openMenu == 'events' ? openMenu = '' : openMenu = 'events' )}
353
313
  class="text-gray-500 group bg-white inline-flex items-center text-base font-medium hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-teci-blue-light"
354
- aria-expanded="false">
355
- <span>Events</span>
356
- <!--
357
- Heroicon name: solid/chevron-down
358
-
359
- Item active: "text-gray-600", Item inactive: "text-gray-400"
360
- -->
361
- <svg class="text-gray-400 ml-2 h-5 w-5 group-hover:text-gray-500"
314
+ aria-expanded="{openMenu == 'events'}">
315
+ <span class:text-gray-900="{openMenu == 'events'}">Events</span>
316
+ <!-- Heroicon name: solid/chevron-down -->
317
+ <svg class="text-gray-400 ml-2 h-5 w-5 group-hover:text-gray-900 {openMenu === 'events' ? 'text-gray-900 rotate-180' : 'text-gray-400'}"
362
318
  xmlns="http://www.w3.org/2000/svg"
363
319
  viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
364
320
  <path fill-rule="evenodd"
@@ -366,10 +322,12 @@
366
322
  clip-rule="evenodd" />
367
323
  </svg>
368
324
  </button>
369
- {#if eventsOpen}
325
+
326
+ {#if openMenu == 'events'}
370
327
  <div class="absolute z-40 left-1/2 transform -translate-x-1/2 mt-3 px-2 w-screen max-w-md sm:px-0 shadow-lg ring-1 ring-black ring-opacity-5 overflow-hidden"
371
- in:slide={{ duration: 500, easing: cubicOut }}
372
- out:slide={{ duration: 300, easing: cubicIn }}
328
+ use:clickOutside on:outclick={() => (openMenu = '')}
329
+ in:slide={{ duration: 250, easing: cubicOut }}
330
+ out:slide={{ duration: 150, easing: cubicIn }}
373
331
  >
374
332
  <div class="relative grid gap-6 bg-white px-5 py-6 sm:gap-8 sm:p-8">
375
333
  <a href="https://www.thunderheadeng.com/training/"
@@ -459,18 +417,14 @@
459
417
  </div>
460
418
 
461
419
  <!-- Company -->
462
- <div class="relative" use:clickOutside on:outclick={() => (companyOpen = false)}>
463
- <!-- Item active: "text-gray-900", Item inactive: "text-gray-500" -->
464
- <button type="button" on:click={() => companyOpen = !companyOpen}
420
+ <div id="company" class="relative">
421
+
422
+ <button type="button" on:click={() => ( openMenu == 'company' ? openMenu = '' : openMenu = 'company' )}
465
423
  class="text-gray-500 group bg-white inline-flex items-center text-base font-medium hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-teci-blue-light"
466
- aria-expanded="false">
467
- <span>Company</span>
468
- <!--
469
- Heroicon name: solid/chevron-down
470
-
471
- Item active: "text-gray-600", Item inactive: "text-gray-400"
472
- -->
473
- <svg class="text-gray-400 ml-2 h-5 w-5 group-hover:text-gray-500"
424
+ aria-expanded="{openMenu == 'company'}">
425
+ <span class:text-gray-900="{openMenu == 'company'}">Company</span>
426
+ <!-- Heroicon name: solid/chevron-down -->
427
+ <svg class="ml-2 h-5 w-5 group-hover:text-gray-900 {openMenu === 'company' ? 'text-gray-900 rotate-180' : 'text-gray-400'}"
474
428
  xmlns="http://www.w3.org/2000/svg"
475
429
  viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
476
430
  <path fill-rule="evenodd"
@@ -478,10 +432,12 @@
478
432
  clip-rule="evenodd" />
479
433
  </svg>
480
434
  </button>
481
- {#if companyOpen}
435
+
436
+ {#if openMenu == 'company'}
482
437
  <div class="absolute z-40 left-1/2 transform -translate-x-1/2 mt-3 px-2 w-screen max-w-md sm:px-0 shadow-lg ring-1 ring-black ring-opacity-5 overflow-hidden"
483
- in:slide={{ duration: 500, easing: cubicOut }}
484
- out:slide={{ duration: 300, easing: cubicIn }}
438
+ use:clickOutside on:outclick={() => (openMenu = '')}
439
+ in:slide={{ duration: 250, easing: cubicOut }}
440
+ out:slide={{ duration: 150, easing: cubicIn }}
485
441
  >
486
442
  <div class="relative grid gap-6 bg-white px-5 py-6 sm:gap-8 sm:p-8">
487
443
  <a href="https://www.thunderheadeng.com/about/"
@@ -611,10 +567,10 @@
611
567
 
612
568
  <!-- Mobile Menu Button-->
613
569
  <div class="md:hidden">
614
- <button type="button" on:click={() => mobileOpen = !mobileOpen}
570
+ <button type="button" on:click={() => openMenu = 'mobile'}
615
571
  class="bg-white p-2 inline-flex items-center justify-center text-gray-400 hover:text-gray-500 hover:bg-gray-100 border border-gray-200 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-teci-blue-light"
616
- aria-expanded="false">
617
- <span class="sr-only">Open menu</span>
572
+ aria-expanded="{openMenu == 'mobile'}">
573
+ <span class="sr-only">Open mobile menu</span>
618
574
  <!-- Heroicon name: outline/menu -->
619
575
  <svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"
620
576
  aria-hidden="true">
@@ -625,22 +581,20 @@
625
581
  </div>
626
582
 
627
583
  <!-- Mobile menu, show/hide based on mobile menu state.-->
628
- {#if mobileOpen}
629
- <div use:clickOutside on:outclick={() => (mobileOpen = false)}
630
- in:slide={{ duration: 500, easing: cubicOut }}
631
- out:slide={{ duration: 300, easing: cubicIn }}
632
- class="absolute z-30 top-0 inset-x-0 md:hidden shadow-lg ring-1 ring-black ring-opacity-5 bg-white divide-y-2 divide-gray-50"
584
+ {#if openMenu == 'mobile'}
585
+ <div class="absolute z-30 top-0 inset-x-0 md:hidden shadow-lg ring-1 ring-black ring-opacity-5 bg-white divide-y-2 divide-gray-50"
586
+ use:clickOutside on:outclick={() => (openMenu = '')}
587
+ in:slide={{ duration: 250, easing: cubicOut }}
588
+ out:slide={{ duration: 150, easing: cubicIn }}
633
589
  >
634
590
  <div class="pt-5 pb-6 px-4 sm:pb-8">
635
591
  <div class="flex items-center justify-between">
636
- <div on:click={() => mobileOpen = !mobileOpen}>
637
- <a href="https://www.thunderheadeng.com">
638
- <img class="h-10 w-auto" src="https://files.thunderheadeng.com/support/images/te_logo.svg"
639
- alt="Thunderhead Engineering" />
640
- </a>
641
- </div>
592
+ <a class="block" href="https://www.thunderheadeng.com">
593
+ <img class="h-10 w-auto" src="https://files.thunderheadeng.com/support/images/te_logo.svg"
594
+ alt="Thunderhead Engineering" />
595
+ </a>
642
596
 
643
- <button type="button" on:click={() => mobileOpen = false}
597
+ <button type="button" on:click={() => openMenu = ''}
644
598
  class="bg-white p-2 inline-flex items-center justify-center text-gray-400 hover:text-gray-500 hover:bg-gray-100 border border-gray-200 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-teci-blue-light">
645
599
  <span class="sr-only">Close menu</span>
646
600
  <!-- Heroicon name: outline/x -->
@@ -650,7 +604,7 @@
650
604
  </svg>
651
605
  </button>
652
606
  </div>
653
- <div on:click={() => mobileOpen = !mobileOpen} class="mt-6 sm:mt-8">
607
+ <div on:click={() => openMenu = ''} class="mt-6 sm:mt-8">
654
608
  <nav>
655
609
  <div class="grid gap-7 sm:grid-cols-2 sm:gap-y-8 sm:gap-x-4">
656
610
  <a href="/product" class="-m-3 flex items-center p-3 hover:bg-gray-50">
@@ -713,7 +667,7 @@
713
667
  </nav>
714
668
  </div>
715
669
  </div>
716
- <div on:click={() => mobileOpen = !mobileOpen} class="py-6 px-5">
670
+ <div on:click={() => openMenu = ''} class="py-6 px-5">
717
671
  <div class="grid grid-cols-2 gap-4">
718
672
  <a href="https://www.thunderheadeng.com/news/" class="text-base font-medium text-gray-900 hover:text-gray-700">
719
673
  News
@@ -4,33 +4,55 @@
4
4
  export let classes;
5
5
  </script>
6
6
 
7
- <div>
8
7
  {#if icon == 'pyrosim'}
9
- <img
10
- class={classes}
11
- src="https://files.thunderheadeng.com/www/images/pyrosim_icon.svg"
12
- alt="PyroSim"
13
- title="PyroSim Icon"
14
- />
8
+ <span class="not-prose">
9
+ <img
10
+ class={classes}
11
+ src="https://files.thunderheadeng.com/www/images/pyrosim_icon.svg"
12
+ alt="PyroSim"
13
+ title="PyroSim Icon"
14
+ />
15
+ </span>
16
+ {:else if icon == 'pyrosim-results'}
17
+ <span class="not-prose">
18
+ <img
19
+ class={classes}
20
+ src="https://files.thunderheadeng.com/www/images/pyrosim-results_icon.svg"
21
+ alt="PyroSim Results"
22
+ title="PyroSim Results Icon"
23
+ />
24
+ </span>
15
25
  {:else if icon == 'pathfinder'}
16
- <img
17
- class={classes}
18
- src="https://files.thunderheadeng.com/www/images/pathfinder_icon.svg"
19
- alt="Pathfinder"
20
- title="Pathfinder Icon"
21
- />
26
+ <span class="not-prose">
27
+ <img
28
+ class={classes}
29
+ src="https://files.thunderheadeng.com/www/images/pathfinder_icon.svg"
30
+ alt="Pathfinder"
31
+ title="Pathfinder Icon"
32
+ />
33
+ </span>
34
+ {:else if icon == 'pathfinder-results'}
35
+ <span class="not-prose">
36
+ <img
37
+ class={classes}
38
+ src="https://files.thunderheadeng.com/www/images/pathfinder-results_icon.svg"
39
+ alt="Pathfinder Results"
40
+ title="Pathfinder Results Icon"
41
+ />
42
+ </span>
22
43
  {:else if icon == 'petrasim'}
44
+ <span class="not-prose">
23
45
  <img
24
46
  class={classes}
25
47
  src="https://files.thunderheadeng.com/www/images/petrasim_icon.svg"
26
48
  alt="PetraSim"
27
- title="PetraSim Icon"
49
+ title="PetraSim Icon"
28
50
  />
51
+ </span>
29
52
  {:else if icon?.startsWith("icon-")}
30
- <div class="{classes} w-12 bg-teci-blue-dark flex flex-col justify-center items-center">
31
- <span class="material-icons block text-4xl text-white">{icon?.slice(5)}</span>
32
- </div>
53
+ <span class="material-icons-outlined {classes}">{icon?.slice(5)}</span>
33
54
  {:else}
55
+ <span class="not-prose">
34
56
  <svg class={classes} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 250 250">
35
57
  <path
36
58
  style="fill:#0c3879;fill-rule:evenodd;stroke:none"
@@ -48,5 +70,5 @@
48
70
  transform="matrix(2.5596 0 0 2.5596 -225.533 -564.483)"
49
71
  />
50
72
  </svg>
51
- {/if}
52
- </div>
73
+ </span>
74
+ {/if}
@@ -16,7 +16,7 @@
16
16
  }} />
17
17
 
18
18
  {#if shown}
19
- <div class="fixed inset-0 bg-gray-900 bg-opacity-50 overflow-y-auto h-full w-full">
19
+ <div class="z-50 fixed inset-0 bg-gray-900 bg-opacity-50 overflow-y-auto h-full w-full">
20
20
  <div class="relative top-20 mx-auto p-5 border w-96 shadow-lg bg-white">
21
21
  <button type="button" on:click={hide} class="absolute top-0 right-0 bg-white p-1 mr-2 mt-2 inline-flex items-center justify-center text-teci-blue-light hover:text-white hover:bg-teci-blue-dark focus:outline-none focus:ring-2 focus:ring-inset focus:ring-teci-blue-dark">
22
22
  <span class="sr-only">Close menu</span>
@@ -1,4 +1,5 @@
1
1
  <script>
2
+ import { DateTime } from "luxon";
2
3
  export let data;
3
4
  export let posts;
4
5
  </script>
@@ -35,7 +36,7 @@
35
36
  {#each posts as post}
36
37
  <div>
37
38
  <p class="text-sm text-gray-500">
38
- <time datetime={post.meta.date}>{post.meta.date}</time>
39
+ <time datetime={post.meta.date}>{DateTime.fromISO(post.meta.date).toLocaleString()}</time>
39
40
  </p>
40
41
  <a href={post.path} class="mt-2 block">
41
42
  <p class="text-xl font-semibold text-gray-900">
@@ -1,53 +1,59 @@
1
1
  <script>
2
2
  import { onMount } from "svelte";
3
- export let data;
3
+ import { buildToC } from "../utils.js";
4
+ import { DateTime } from "luxon";
4
5
 
5
- let tocMoved = false;
6
+ export let data;
7
+ export let title;
8
+ export let date;
9
+ export let lastmod;
6
10
 
7
- onMount(() => {
8
- function moveTOC() {
9
- console.log("Moving TOC");
10
- var oldParent = document.getElementsByClassName('page-toc')[0];
11
- if (oldParent && oldParent.nodeType == 1){
12
- var newParent = document.getElementById('sidebar-nav');
13
- var loader = document.getElementById('loader');
14
- var classes = oldParent.classList;
15
- newParent.insertAdjacentElement('beforeend', oldParent)
16
- loader.remove();
17
- classes.remove("hidden");
18
- tocMoved = true;
19
- console.log("TOC Moved")
20
- } else {
21
- console.log(tocMoved, oldParent);
22
- if(!tocMoved && oldParent == undefined){
23
- console.log("Reloading");
24
- window.location.reload();
25
- } else {
26
- console.log("Leave it alone.")
27
- tocMoved = true;
28
- }
29
- }
30
- };
11
+ let formattedDate = (date != undefined ? DateTime.fromISO(date).toLocaleString() : undefined)
12
+ let formattedLastModDate = (lastmod != undefined ? DateTime.fromISO(lastmod).toLocaleString() : undefined)
13
+ let tocOpen = false;
14
+ let tocBuilt = false;
15
+ let w;
16
+
17
+ $: if (w > 702 && tocOpen == false) {tocOpen = true}
31
18
 
32
- if (tocMoved == false && data.sidebar) {
33
- moveTOC();
19
+ onMount( async () => {
20
+ if (data.toc) {
21
+ tocBuilt = buildToC();
34
22
  };
35
23
  });
36
24
  </script>
37
25
 
38
- <section class="w-auto mx-auto flex flex-col lg:flex-row items-start lg:space-x-8">
39
- {#if data.sidebar}
40
- <div id="sidebar-nav" class="pr-4 lg:text-right font-medium mb-4 w-auto lg:max-w-xs lg:mb-0 lg:w-60 lg:sticky lg:top-8 shrink-0 lg:border-r lg:border-r-gray-400">
41
- <div id="loader">
42
- <svg role="status" class="inline-block mr-2 w-6 h-6 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
43
- <path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"/>
44
- <path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"/>
45
- </svg>
46
- <span class="inline-block">Loading...</span>
47
- </div>
48
- </div>
49
- {/if}
50
- <div id="text" class="w-full prose max-w-none lg:max-w-prose">
26
+ <section bind:clientWidth={w} class="relative flex flex-row { data.fullWidth ? 'mx-0' : 'mx-auto'} {(data.toc || data.rightRail) ? 'md:space-x-8' : 'space-x-0'}">
27
+
28
+ <div id="content" class="prose w-full { data.fullWidth ? 'max-w-none' : 'max-w-prose'}">
29
+ <h1>{title}</h1>
30
+ <p>Published: {formattedDate}{#if (formattedLastModDate != formattedDate && formattedLastModDate)}, Updated: {formattedLastModDate}{/if}</p>
51
31
  <slot />
52
32
  </div>
33
+ <aside class="relative w-0 {(data.toc || data.rightRail) ? 'md:w-60' : 'hidden'}">
34
+ {#if data.toc}
35
+ <div class="sticky top-8 shrink-0 flex flex-col">
36
+ <button on:click={() => {tocOpen = !tocOpen;}}
37
+ class="md:hidden absolute -left-10 w-10 h-10 flex items-center justify-center border border-teci-blue-light text-teci-blue-light bg-white
38
+ {tocOpen ? 'border-opacity-100 bg-opacity-100 text-opacity-100' : 'border-opacity-20 bg-opacity-20 text-opacity-20'}"
39
+ title="Table of Contents Toggle" alt="Table of Contents Toggle"
40
+ >
41
+ <span class="material-icons-outlined">menu_open</span>
42
+ </button>
43
+ {#if tocBuilt == false}
44
+ <svg role="status" class="inline-block m-2 w-6 h-6 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
45
+ <path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"/>
46
+ <path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"/>
47
+ </svg>
48
+ {/if}
49
+ <div id="ToC" class="absolute md:relative -left-[282px] border shadow-md bg-white md:left-0 font-medium text-right md:text-left p-2 {tocOpen ? 'block w-60 mb-4' : 'hidden'}">
50
+ </div>
51
+ </div>
52
+ {/if}
53
+ {#if data.rightRail}
54
+ <div class="hidden md:block p-2 bg-gray-200 {(data.toc || data.rightRail) ? 'md:w-60' : 'w-0'}">
55
+ Dynamic Stuff
56
+ </div>
57
+ {/if}
58
+ </aside>
53
59
  </section>
@@ -3,6 +3,9 @@
3
3
  /** @typedef {typeof __propDef.slots} SidebarContentSlots */
4
4
  export default class SidebarContent extends SvelteComponentTyped<{
5
5
  data: any;
6
+ title: any;
7
+ date: any;
8
+ lastmod: any;
6
9
  }, {
7
10
  [evt: string]: CustomEvent<any>;
8
11
  }, {
@@ -16,6 +19,9 @@ import { SvelteComponentTyped } from "svelte";
16
19
  declare const __propDef: {
17
20
  props: {
18
21
  data: any;
22
+ title: any;
23
+ date: any;
24
+ lastmod: any;
19
25
  };
20
26
  events: {
21
27
  [evt: string]: CustomEvent<any>;
@@ -11,6 +11,7 @@
11
11
  export let data = [
12
12
  {
13
13
  icon: 'pyrosim',
14
+ classes: 'h-12 w-12',
14
15
  image: 'https://www.thunderheadeng.com/wp-content/uploads/2013/09/company_pyrosim.jpg',
15
16
  heading: 'Product 1',
16
17
  subheading: 'Nutshell',
@@ -19,6 +20,7 @@
19
20
  },
20
21
  {
21
22
  icon: '',
23
+ classes: '',
22
24
  image: 'https://www.thunderheadeng.com/wp-content/uploads/2013/08/company_pathfinder.png',
23
25
  heading: 'Product 2',
24
26
  subheading: 'No Icon',
@@ -28,6 +30,7 @@
28
30
  {
29
31
  icon: 'icon-auto_stories',
30
32
  image: 'https://www.thunderheadeng.com/wp-content/uploads/2013/08/company_petrasim.png',
33
+ classes: 'bg-teci-blue-dark text-white text-4xl grid place-items-center h-12 w-12',
31
34
  heading: 'Google Icon, No Subtitle or Text',
32
35
  subheading: '',
33
36
  text: '',
@@ -51,7 +54,9 @@
51
54
  {/if}
52
55
  <div class="flex flex-row items-start space-x-4">
53
56
  {#if col.icon}
54
- <Icon classes="h-12 w-auto" icon={col.icon} />
57
+ <div class="grid place-items-center">
58
+ <Icon classes={col.classes} icon={col.icon} />
59
+ </div>
55
60
  {/if}
56
61
  <div class="leading-none font-medium flex flex-col">
57
62
  <h3 class="text-2xl leading-none">{col.heading}</h3>
@@ -4,6 +4,7 @@
4
4
  export default class ThreeColumn extends SvelteComponentTyped<{
5
5
  data?: {
6
6
  icon: string;
7
+ classes: string;
7
8
  image: string;
8
9
  heading: string;
9
10
  subheading: string;
@@ -23,6 +24,7 @@ declare const __propDef: {
23
24
  props: {
24
25
  data?: {
25
26
  icon: string;
27
+ classes: string;
26
28
  image: string;
27
29
  heading: string;
28
30
  subheading: string;
@@ -6,14 +6,19 @@
6
6
  import CTA from '../components/CTA.svelte';
7
7
  import SidebarContent from '../components/SidebarContent.svelte';
8
8
  import MediaFeature from '../components/MediaFeature.svelte';
9
+ import TrialForm from '../components/TrialForm.svelte';
9
10
 
10
11
  export let title
12
+ export let date
13
+ export let lastmod
11
14
  export let page_sections
12
15
  export let posts
16
+ export let summary
13
17
  </script>
14
18
 
15
19
  <svelte:head>
16
20
  <title>{title} | Thunderhead Engineering</title>
21
+ <meta name="description" content={summary}>
17
22
  </svelte:head>
18
23
 
19
24
  <article class="flex flex-col space-y-12">
@@ -29,11 +34,13 @@
29
34
  {:else if section.fieldGroup == "cta-center"}
30
35
  <CTA bind:data={section} />
31
36
  {:else if section.fieldGroup == "sidebar-content"}
32
- <SidebarContent bind:data={section}>
37
+ <SidebarContent bind:data={section} {title} {date} {lastmod} {summary}>
33
38
  <slot/>
34
39
  </SidebarContent>
35
40
  {:else if section.fieldGroup == "media-feature"}
36
41
  <MediaFeature bind:data={section} />
42
+ {:else if section.fieldGroup == "trial"}
43
+ <TrialForm />
37
44
  {:else if section.fieldGroup == "content"}
38
45
  <div class="content prose"><slot/></div>
39
46
  {/if}
@@ -3,8 +3,11 @@
3
3
  /** @typedef {typeof __propDef.slots} BlocksSlots */
4
4
  export default class Blocks extends SvelteComponentTyped<{
5
5
  title: any;
6
+ date: any;
7
+ lastmod: any;
6
8
  page_sections: any;
7
9
  posts: any;
10
+ summary: any;
8
11
  }, {
9
12
  [evt: string]: CustomEvent<any>;
10
13
  }, {
@@ -18,8 +21,11 @@ import { SvelteComponentTyped } from "svelte";
18
21
  declare const __propDef: {
19
22
  props: {
20
23
  title: any;
24
+ date: any;
25
+ lastmod: any;
21
26
  page_sections: any;
22
27
  posts: any;
28
+ summary: any;
23
29
  };
24
30
  events: {
25
31
  [evt: string]: CustomEvent<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tecitheme",
3
- "version": "0.0.12",
3
+ "version": "0.0.15",
4
4
  "svelte": true,
5
5
  "devDependencies": {
6
6
  "@jsdevtools/rehype-toc": "^3.0.2",
@@ -18,6 +18,7 @@
18
18
  "eslint": "^7.32.0",
19
19
  "eslint-config-prettier": "^8.3.0",
20
20
  "eslint-plugin-svelte3": "^3.4.0",
21
+ "luxon": "^2.3.1",
21
22
  "mdsvex": "^0.10.5",
22
23
  "postcss": "^8.4.6",
23
24
  "prettier": "^2.5.1",
@@ -35,7 +36,8 @@
35
36
  "three": "^0.137.5",
36
37
  "tslib": "^2.3.1",
37
38
  "typescript": "^4.5.5",
38
- "vite": "^2.8.3"
39
+ "vite": "^2.8.3",
40
+ "vite-plugin-autoimport": "^1.4.3"
39
41
  },
40
42
  "type": "module",
41
43
  "dependencies": {
@@ -64,7 +66,6 @@
64
66
  "./components/TrialForm.svelte": "./components/TrialForm.svelte",
65
67
  "./components/YT.svelte": "./components/YT.svelte",
66
68
  "./layouts/blocks.svelte": "./layouts/blocks.svelte",
67
- "./layouts/news.svelte": "./layouts/news.svelte",
68
69
  "./req_utils": "./req_utils.js",
69
70
  "./utils": "./utils.js",
70
71
  "./variables": "./variables.js"
package/utils.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export function scrollTo(anchor: any): void;
2
2
  export function validateEmail(email: any): boolean;
3
+ export function buildToC(): boolean;
3
4
  export function slugFromPath(path: any): any;
package/utils.js CHANGED
@@ -9,4 +9,67 @@ export function validateEmail(email) {
9
9
  return re.test(String(email).toLowerCase());
10
10
  }
11
11
 
12
- export const slugFromPath = (path) => path.match(/([\w-]+)\.(svelte\.md|md|svx)/i)?.[1] ?? null;
12
+ export const slugFromPath = (path) => path.match(/([\w-]+)\.(svelte\.md|md|svx)/i)?.[1] ?? null;
13
+
14
+ export function buildToC() {
15
+ // Based on https://projectcodeed.blogspot.com/2020/04/an-automatic-table-of-contents.html
16
+
17
+ // Get ToC div
18
+ let toc = document.getElementById("ToC");
19
+
20
+ //Add a header
21
+ var tocHeader = document.createElement("a");
22
+ tocHeader.classList.add("mb-2", "inline-block", "w-auto", "text-center", "bg-gray-50", "hover:bg-gray-100", "py-1", "px-2", "border")
23
+ tocHeader.innerHTML = "<span class='material-icons-outlined text-sm font-bold text-gray-500 align-text-bottom'>vertical_align_top</span>";
24
+ tocHeader.setAttribute("href","#top");
25
+ tocHeader.setAttribute("title","To Top of Page");
26
+ toc.appendChild(tocHeader);
27
+
28
+ // Create a list for the ToC entries
29
+ let tocList = document.createElement("ul");
30
+
31
+ // Find the primary content section
32
+ let content = document.getElementById("content")
33
+
34
+ // Get the h2 tags - ToC entries
35
+ let headers = content.getElementsByTagName("h2");
36
+
37
+ if (headers.length == 0) {
38
+ console.log("There are not any H2 elements in the document.");
39
+ } else {
40
+ // For each h2
41
+ for (let i = 0; i < headers.length; i++){
42
+
43
+ // Get Heading ID
44
+ let name = headers[i].id
45
+
46
+ // list item for the entry
47
+ let tocListItem = document.createElement("li");
48
+ tocListItem.classList.add("text-teci-blue-light", "hover:text-teci-blue-dark", "text-sm", "truncate");
49
+
50
+ // link for the h2
51
+ let tocEntry = document.createElement("a");
52
+ tocEntry.setAttribute("href","#"+name);
53
+ tocEntry.innerText=headers[i].innerText;
54
+
55
+ // add link to list item list
56
+ tocListItem.appendChild(tocEntry);
57
+
58
+ // add list item to list
59
+ tocList.appendChild(tocListItem);
60
+ }
61
+
62
+ // add list to toc element
63
+ toc.appendChild(tocList);
64
+
65
+ //Add a footer
66
+ //var tocFooter = document.createElement("a");
67
+ //tocFooter.classList.add("mt-2", "inline-block", "w-auto", "text-center", "bg-gray-50", "hover:bg-gray-100", "py-1", "px-2", "border")
68
+ //tocFooter.innerHTML="<span class='material-icons-outlined text-sm font-bold text-gray-500 align-text-bottom'>vertical_align_bottom</span>";
69
+ //tocFooter.setAttribute("href","#bottom");
70
+ //tocFooter.setAttribute("title","To Bottom of Page");
71
+ //toc.appendChild(tocFooter);
72
+
73
+ return true;
74
+ }
75
+ }
@@ -1,14 +0,0 @@
1
- <script>
2
- export let title;
3
- export let date;
4
- </script>
5
-
6
- <svelte:head>
7
- <title>{title} | Thunderhead Engineering</title>
8
- </svelte:head>
9
-
10
- <div class="prose lg:prose-lg">
11
- <h1>{title}</h1>
12
- <p>Published on {date}</p>
13
- <slot/>
14
- </div>
@@ -1,29 +0,0 @@
1
- /** @typedef {typeof __propDef.props} NewsProps */
2
- /** @typedef {typeof __propDef.events} NewsEvents */
3
- /** @typedef {typeof __propDef.slots} NewsSlots */
4
- export default class News extends SvelteComponentTyped<{
5
- title: any;
6
- date: any;
7
- }, {
8
- [evt: string]: CustomEvent<any>;
9
- }, {
10
- default: {};
11
- }> {
12
- }
13
- export type NewsProps = typeof __propDef.props;
14
- export type NewsEvents = typeof __propDef.events;
15
- export type NewsSlots = typeof __propDef.slots;
16
- import { SvelteComponentTyped } from "svelte";
17
- declare const __propDef: {
18
- props: {
19
- title: any;
20
- date: any;
21
- };
22
- events: {
23
- [evt: string]: CustomEvent<any>;
24
- };
25
- slots: {
26
- default: {};
27
- };
28
- };
29
- export {};