tecitheme 1.2.1 → 1.2.2

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.
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import { getColorStyles, makeIdString } from '../utils'
2
+ import { getColorStyles, makeIdString, getTeciImageURL } from '../utils'
3
3
  import Button from './Button.svelte'
4
4
  export let data = {};
5
5
  let id = makeIdString(data.name);
@@ -7,7 +7,7 @@
7
7
 
8
8
  <section {id} class="relative {getColorStyles('background', data.color)} print:hidden">
9
9
  <div class="h-56 sm:h-72 md:absolute md:left-0 md:h-full md:w-1/2">
10
- <img class="h-full w-full object-cover" src="https://files.thunderheadeng.com/www/images/{data.image}?w=608&fit=clip&auto=compress&auto=format" alt="Image for {data.preheading}">
10
+ <img class="h-full w-full object-cover" src={getTeciImageURL(data.image, data.site ? data.site : "www", 'w=608,fit=contain')} alt="Image for {data.preheading}">
11
11
  </div>
12
12
  <div class="relative mx-auto max-w-7xl py-12 px-6 lg:px-8 lg:py-16">
13
13
  <div class="md:ml-auto md:w-1/2 md:pl-10">
@@ -2,7 +2,7 @@
2
2
  import Button from './Button.svelte'
3
3
 
4
4
  //Allows icons from https://fonts.google.com/icons?selected=Material+Icons by name in the format 'icon-XXXX'.
5
- import { getColorStyles } from '../utils'
5
+ import { getColorStyles, getTeciImageURL } from '../utils'
6
6
  import Icon from "./Icon.svelte";
7
7
  export let data = {};
8
8
  export let halfHeight = undefined;
@@ -11,12 +11,9 @@ import Button from './Button.svelte'
11
11
 
12
12
  if (data.image) {
13
13
  if (data.image.includes("gif")) {
14
- backgroundImage = "https://files.thunderheadeng.com/www/images/" + data.image;
14
+ backgroundImage = getTeciImageURL(data.image, data.site ? data.site : "www", '');
15
15
  } else {
16
- backgroundImage =
17
- "https://files.thunderheadeng.com/www/images/" +
18
- data.image +
19
- "?w=698&h=392&fit=crop&auto=compress&auto=format";
16
+ backgroundImage = getTeciImageURL(data.image, data.site ? data.site : "www", 'w=698,h=392,fit=crop,scq=60,format=auto');
20
17
  }
21
18
  }
22
19
  </script>
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import { getColorStyles, makeIdString } from "../utils";
2
+ import { getColorStyles, makeIdString, getTeciImageURL } from "../utils";
3
3
 
4
4
  export let data;
5
5
  let { name, items } = data;
@@ -53,8 +53,8 @@
53
53
  <div id={`${makeIdString(name)}-item-${index}`} class="item snap-center flex flex-col sm:flex-row w-full items-center justify-center flex-shrink-0 p-2">
54
54
 
55
55
  <!-- Image -->
56
- <a class="flex-grow flex-shrink-0 flex justify-center {item.cta ? "w-1/2" : "w-full"}" href={item.url ? item.url : item.image} target="_blank">
57
- <img class="sm:h-72 lg:h-96 shadow" alt="" src={item.image} />
56
+ <a class="flex-grow flex-shrink-0 flex justify-center {item.cta ? "w-1/2" : "w-full"}" href={item.url ? item.url : getTeciImageURL(item.image, item.site ? item.site : "www", '')} target="_blank">
57
+ <img class="sm:h-72 lg:h-96 shadow" alt="" src={getTeciImageURL(item.image, item.site ? item.site : "www", '')} />
58
58
  </a>
59
59
 
60
60
  <!-- Caption -->
@@ -105,7 +105,7 @@
105
105
  <div class="flex items-center space-x-3">
106
106
  <img
107
107
  class="size-6 rounded-full"
108
- src="https://files.thunderheadeng.com/www/images/{testimonial.image}?w=320&fit=facearea,crop&facepad=3&monochrome=9B9B9B&auto=compress&auto=format"
108
+ src={getTeciImageURL(testimonial.image, testimonial.site ? testimonial.site : "www", 'w=320,fit=crop,gravity=face,zoom=1,saturation=0,scq=60,format=auto')}
109
109
  alt="Image of {testimonial.name}"
110
110
  title="{testimonial.name}"
111
111
  />
@@ -127,7 +127,8 @@
127
127
  in:conditionalTransition={{ fn: fade, condition: animate, delay: 200, duration: 1250, easing:cubicInOut, x: textPosition == "left" ? '100%' : '-100%'}}
128
128
  out:conditionalTransition={{fn: fade, condition: animate, delay: 200, duration: 1250, easing:cubicInOut, x: textPosition == "left" ? '100%' : '-100%'}}
129
129
  >
130
- <img class="w-full shadow-xl ring-1 ring-black/5 lg:absolute {textPosition == "left" ? "lg:left-0" : "right-0"} lg:h-full lg:w-auto lg:max-w-none" src={getTeciImageURL(image.url, image.site ? image.site : "www")} alt={image.alt}>
130
+ <img class="w-full shadow-xl ring-1 ring-black/5 lg:absolute {textPosition == "left" ? "lg:left-0" : "right-0"} lg:h-full lg:w-auto lg:max-w-none"
131
+ src={getTeciImageURL(image.url, image.site ? image.site : "www", 'w=760,fit=crop,scq=60,format=auto')} alt={image.alt}>
131
132
  </div>
132
133
  {:else if animate}
133
134
  <div
@@ -1,9 +1,10 @@
1
1
  <script>
2
- import {PUBLIC_BUILD_MODE} from '$env/static/public';
2
+ import { PUBLIC_BUILD_MODE } from '$env/static/public';
3
3
  import Icon from "./Icon.svelte";
4
4
  import SearchBar from './Search/SearchBar.svelte';
5
5
  import { fade, slide } from "svelte/transition";
6
6
  import { cubicIn, cubicOut } from "svelte/easing";
7
+ import { getTeciImageURL } from '../utils'
7
8
 
8
9
  let openMenu = "";
9
10
 
@@ -590,7 +591,7 @@
590
591
  >
591
592
  <img
592
593
  class="h-10 w-auto"
593
- src="https://files.thunderheadeng.com/www/images/teci_logo.svg"
594
+ src={getTeciImageURL("teci_logo.svg", "www", '')}
594
595
  alt="Thunderhead Engineering"
595
596
  />
596
597
  </a>
@@ -1,7 +1,7 @@
1
1
  <script>
2
2
  import Icon from './Icon.svelte'
3
3
 
4
- import { getColorStyles, makeIdString } from '../utils'
4
+ import { getColorStyles, makeIdString, getTeciImageURL } from '../utils'
5
5
  export let data = {};
6
6
  let id = makeIdString(data.name);
7
7
  </script>
@@ -65,11 +65,11 @@ import Icon from './Icon.svelte'
65
65
  </div>
66
66
  <div class="relative hidden md:block md:col-span-4 lg:col-span-5 xl:col-span-6">
67
67
  {#if data.video}
68
- <video src="https://files.thunderheadeng.com/www/videos/{data.video}" autoplay="true" loop muted
68
+ <video src="https://media.thunderheadeng.net/www/videos/{data.video}" autoplay="true" loop muted
69
69
  class="absolute object-cover h-full w-full">
70
70
  </video>
71
71
  {:else if data.image}
72
- <img src="https://files.thunderheadeng.com/www/images/{data.image}?fmt=auto" alt={data.heading}
72
+ <img src={getTeciImageURL(data.image, data.site ? data.site : "www", '')} alt={data.heading}
73
73
  class="absolute object-cover h-full w-full"
74
74
  >
75
75
  {/if}
@@ -1,9 +1,9 @@
1
1
  <script>
2
- import { makeIdString } from "../utils";
2
+ import { makeIdString, getTeciImageURL } from "../utils";
3
3
 
4
4
  // Allows icons from https://fonts.google.com/icons?selected=Material+Icons by name in the format 'icon-XXXX'.
5
- export let icon = undefined;
6
- export let classes = undefined;
5
+ export let icon = "";
6
+ export let classes = "";
7
7
 
8
8
  let id = makeIdString(icon);
9
9
  </script>
@@ -12,7 +12,7 @@
12
12
  <span {id} class="not-prose">
13
13
  <img
14
14
  class={classes}
15
- src="https://files.thunderheadeng.com/www/images/pyrosim_icon.svg"
15
+ src={getTeciImageURL("pyrosim_icon.svg", "www", '')}
16
16
  alt="PyroSim"
17
17
  title="PyroSim Icon"
18
18
  />
@@ -21,7 +21,7 @@
21
21
  <span {id} class="not-prose">
22
22
  <img
23
23
  class={classes}
24
- src="https://files.thunderheadeng.com/www/images/pyrosim-results_icon.svg"
24
+ src={getTeciImageURL("pyrosim-results_icon.svg", "www", '')}
25
25
  alt="PyroSim Results"
26
26
  title="PyroSim Results Icon"
27
27
  />
@@ -30,7 +30,7 @@
30
30
  <span {id} class="not-prose">
31
31
  <img
32
32
  class={classes}
33
- src="https://files.thunderheadeng.com/www/images/pyrosim_logo.svg"
33
+ src={getTeciImageURL("pyrosim_logo.svg", "www", '')}
34
34
  alt="PyroSim Logo"
35
35
  title="PyroSim Logo"
36
36
  />
@@ -39,7 +39,7 @@
39
39
  <span {id} class="not-prose">
40
40
  <img
41
41
  class={classes}
42
- src="https://files.thunderheadeng.com/www/images/pathfinder_icon.svg"
42
+ src={getTeciImageURL("pathfinder_icon.svg", "www", '')}
43
43
  alt="Pathfinder"
44
44
  title="Pathfinder Icon"
45
45
  />
@@ -48,7 +48,7 @@
48
48
  <span {id} class="not-prose">
49
49
  <img
50
50
  class={classes}
51
- src="https://files.thunderheadeng.com/www/images/pathfinder-results_icon.svg"
51
+ src={getTeciImageURL("pathfinder-results_icon.svg", "www", '')}
52
52
  alt="Pathfinder Results"
53
53
  title="Pathfinder Results Icon"
54
54
  />
@@ -57,7 +57,7 @@
57
57
  <span {id} class="not-prose">
58
58
  <img
59
59
  class={classes}
60
- src="https://files.thunderheadeng.com/www/images/pathfinder_logo.svg"
60
+ src={getTeciImageURL("pathfinder_logo.svg", "www", '')}
61
61
  alt="Pathfinder Logo"
62
62
  title="Pathfinder Logo"
63
63
  />
@@ -66,7 +66,7 @@
66
66
  <span {id} class="not-prose">
67
67
  <img
68
68
  class={classes}
69
- src="https://files.thunderheadeng.com/www/images/ventus_icon.svg"
69
+ src={getTeciImageURL("ventus_icon.svg", "www", '')}
70
70
  alt="Ventus"
71
71
  title="Ventus Icon"
72
72
  />
@@ -75,7 +75,7 @@
75
75
  <span {id} class="not-prose">
76
76
  <img
77
77
  class={classes}
78
- src="https://files.thunderheadeng.com/www/images/ventus_logo.svg"
78
+ src={getTeciImageURL("ventus_logo.svg", "www", '')}
79
79
  alt="Ventus Logo"
80
80
  title="Ventus Logo"
81
81
  />
@@ -84,7 +84,7 @@
84
84
  <span {id} class="not-prose">
85
85
  <img
86
86
  class={classes}
87
- src="https://files.thunderheadeng.com/www/images/petrasim_icon.svg"
87
+ src={getTeciImageURL("petrasim_icon.svg", "www", '')}
88
88
  alt="PetraSim"
89
89
  title="PetraSim Icon"
90
90
  />
@@ -93,7 +93,7 @@
93
93
  <span {id} class="not-prose">
94
94
  <img
95
95
  class={classes}
96
- src="https://files.thunderheadeng.com/www/images/petrasim_logo.svg"
96
+ src={getTeciImageURL("petrasim_logo.svg", "www", '')}
97
97
  alt="PetraSim Logo"
98
98
  title="PetraSim Logo"
99
99
  />
@@ -102,7 +102,7 @@
102
102
  <span {id} class="not-prose">
103
103
  <img
104
104
  class={classes}
105
- src="https://files.thunderheadeng.com/www/images/teci_logo.svg"
105
+ src={getTeciImageURL("teci_logo.svg", "www", '')}
106
106
  alt="Thunderhead Logo"
107
107
  title="Thunderhead Logo"
108
108
  />
@@ -2,8 +2,8 @@
2
2
  /** @typedef {typeof __propDef.events} IconEvents */
3
3
  /** @typedef {typeof __propDef.slots} IconSlots */
4
4
  export default class Icon extends SvelteComponent<{
5
- icon?: any;
6
- classes?: any;
5
+ icon?: string;
6
+ classes?: string;
7
7
  }, {
8
8
  [evt: string]: CustomEvent<any>;
9
9
  }, {}> {
@@ -14,8 +14,8 @@ export type IconSlots = typeof __propDef.slots;
14
14
  import { SvelteComponent } from "svelte";
15
15
  declare const __propDef: {
16
16
  props: {
17
- icon?: any;
18
- classes?: any;
17
+ icon?: string;
18
+ classes?: string;
19
19
  };
20
20
  events: {
21
21
  [evt: string]: CustomEvent<any>;
@@ -1,7 +1,7 @@
1
1
  <script>
2
2
  import Video from './Video.svelte'
3
3
 
4
- import { getColorStyles, makeIdString } from '../utils'
4
+ import { getColorStyles, makeIdString, getTeciImageURL } from '../utils'
5
5
  export let data = {};
6
6
 
7
7
  let figureImage;
@@ -13,18 +13,15 @@ import Video from './Video.svelte'
13
13
  figureImage = data.image;
14
14
  figureLink = data.link ? data.link : data.image;
15
15
  } else if (data.image.includes("gif")) {
16
- figureImage = "https://files.thunderheadeng.com/www/images/" + data.image;
16
+ figureImage = getTeciImageURL(data.image, data.site ? data.site : "www", '');
17
17
  figureLink = data.link
18
18
  ? data.link
19
- : "https://files.thunderheadeng.com/www/images/" + data.image;
19
+ : getTeciImageURL(data.image, data.site ? data.site : "www", '');
20
20
  } else {
21
- figureImage =
22
- "https://files.thunderheadeng.com/www/images/" +
23
- data.image +
24
- "?w=576&ar=16:9&fit=crop&auto=compress&auto=format";
21
+ figureImage = getTeciImageURL(data.image, data.site ? data.site : "www", 'w=576,h=324,fit=crop,scq=60,format=auto');
25
22
  figureLink = data.link
26
23
  ? data.link
27
- : "https://files.thunderheadeng.com/www/images/" + data.image;
24
+ : getTeciImageURL(data.image, data.site ? data.site : "www", '');
28
25
  }
29
26
  }
30
27
  </script>
@@ -82,7 +82,6 @@
82
82
  ? 'border-opacity-100 bg-opacity-100 text-opacity-100'
83
83
  : 'border-opacity-60 bg-opacity-20 text-opacity-60 hover:border-opacity-100 hover:bg-opacity-100 hover:text-opacity-100'}"
84
84
  title="Table of Contents Toggle"
85
- alt="Table of Contents Toggle"
86
85
  >
87
86
  <span class="material-icons-outlined">menu_open</span>
88
87
  </button>
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import { getColorStyles, getGridSizeStyles, makeIdString } from '../utils'
2
+ import { getColorStyles, getGridSizeStyles, makeIdString, getTeciImageURL } from '../utils'
3
3
  export let data = {};
4
4
 
5
5
  let {
@@ -55,7 +55,7 @@
55
55
  <!-- Image -->
56
56
  {#if image}
57
57
  <figure>
58
- <img class="w-full" alt="{(imageAltText ? imageAltText : heading)}" src="https://files.thunderheadeng.com/www/images/{image}?w=1152&fit=crop&auto=compress&auto=format">
58
+ <img class="w-full" alt={imageAltText ? imageAltText : heading} src={getTeciImageURL(image, "www", 'w=1152,fit=crop,scq=60,format=auto')}>
59
59
  </figure>
60
60
  {/if}
61
61
  </div>
@@ -2,7 +2,7 @@
2
2
  import Button from './Button.svelte'
3
3
  import Icon from './Icon.svelte'
4
4
 
5
- import { getColorStyles, makeIdString } from '../utils'
5
+ import { getColorStyles, makeIdString, getTeciImageURL } from '../utils'
6
6
  import { slide } from 'svelte/transition';
7
7
  import { quintInOut } from 'svelte/easing';
8
8
  import { onMount } from 'svelte'
@@ -85,7 +85,7 @@ import Icon from './Icon.svelte'
85
85
  <div class="hidden lg:block lg:flex-shrink-0">
86
86
  <img
87
87
  class="h-64 w-64 rounded-full xl:h-80 xl:w-80"
88
- src="https://files.thunderheadeng.com/www/images/{quote.image}?w=320&fit=facearea,crop&facepad=3&monochrome=9B9B9B&auto=compress&auto=format"
88
+ src={getTeciImageURL(quote.image, quote.site ? quote.site : "www", 'w=320,h=320,fit=crop,gravity=face,zoom=0.5,saturation=0,scq=60,format=auto')}
89
89
  alt="Image of {quote.fullname}"
90
90
  title="{quote.fullname}"
91
91
  />
@@ -125,7 +125,7 @@ import Icon from './Icon.svelte'
125
125
  <div class="flex-shrink-0 lg:hidden">
126
126
  <img
127
127
  class="h-12 w-12 rounded-full"
128
- src="https://files.thunderheadeng.com/www/images/{quote.image}?w=48&fit=clip&monochrome=9B9B9B&auto=compress&auto=format"
128
+ src={getTeciImageURL(quote.image, quote.site ? quote.site : "www", 'w=48,h=48,fit=crop,gravity=face,zoom=0.7,saturation=0,scq=60,format=auto')}
129
129
  alt="Thumbnail Image of {quote.fullname}"
130
130
  />
131
131
  </div>
@@ -1,5 +1,6 @@
1
1
  <script>
2
2
  import { onMount } from 'svelte'
3
+ import { getTeciImageURL } from '../utils'
3
4
 
4
5
  export let data={};
5
6
  export let v = undefined;
@@ -47,7 +48,7 @@
47
48
  if (v) {
48
49
  if (v.includes("mp4")) {
49
50
  youtube = false;
50
- videoURL = `https://files.thunderheadeng.com/www/videos/${v}`;
51
+ videoURL = `https://media.thunderheadeng.net/www/videos/${v}`;
51
52
  } else {
52
53
  youtube = true;
53
54
  videoID = v;
@@ -55,7 +56,7 @@
55
56
  } else if (data.v) {
56
57
  if (data.v.includes("mp4")) {
57
58
  youtube = false;
58
- videoURL = `https://files.thunderheadeng.com/www/videos/${data.v}`;
59
+ videoURL = `https://media.thunderheadeng.net/www/videos/${data.v}`;
59
60
  } else {
60
61
  youtube = true;
61
62
  videoID = data.v;
@@ -66,13 +67,11 @@
66
67
  };
67
68
 
68
69
  if (thumbnail) {
69
- thumb = `https://files.thunderheadeng.com/www/images/${thumbnail}?w=1214&fit=clip&auto=compress&auto=format`;
70
+ thumb = getTeciImageURL(thumbnail, "www", 'w=1214,fit=crop,scq=60,format=auto');
70
71
  } else if (data.thumbnail) {
71
- thumb = `https://files.thunderheadeng.com/www/images/${data.thumbnail}?w=1214&fit=clip&auto=compress&auto=format`;
72
+ thumb = getTeciImageURL(data.thumbnail, "www", 'w=1214,fit=crop,scq=60,format=auto');
72
73
  } else if (videoID) {
73
- if (youtube) {
74
- thumb = `https://i.ytimg.com/vi/${videoID}/maxresdefault.jpg`;
75
- }
74
+ if (youtube) { thumb = `https://i.ytimg.com/vi/${videoID}/maxresdefault.jpg`; }
76
75
  }
77
76
  </script>
78
77
 
@@ -25,7 +25,9 @@
25
25
  import PartnersList from "../components/PartnersList.svelte";
26
26
  import DescriptionList from "../components/DescriptionList.svelte";
27
27
  import Carousel from "../components/Carousel.svelte";
28
- import { setContext } from "svelte";
28
+
29
+ import { setContext } from "svelte";
30
+ import { getTeciImageURL } from '../utils'
29
31
 
30
32
  let blocks = [
31
33
  { ref: "accordion", component: Accordion },
@@ -71,9 +73,9 @@
71
73
  let featuredImage;
72
74
 
73
75
  if (image) {
74
- featuredImage = "https://files.thunderheadeng.com/www/images/" + image + "?w=1200&h=627&fit=crop&auto=compress&auto=format";
76
+ featuredImage = getTeciImageURL(image, "www", 'w=1200,h=627,fit=crop,scq=60,format=auto');
75
77
  } else {
76
- featuredImage = "https://files.thunderheadeng.com/www/images/teci_icon_250.png";
78
+ featuredImage = getTeciImageURL("teci_icon_250.png", "www", 'format=auto');
77
79
  }
78
80
 
79
81
  let pageNav = page_sections ? page_sections.filter(sect => sect.fieldGroup === "pageNav")[0] : undefined;
package/dist/utils.d.ts CHANGED
@@ -47,7 +47,7 @@ export function makeIdString(text: any): string;
47
47
  * @param {*} imageSrc The image source string
48
48
  * @param {*} site ('www' or 'support') TECi image folder to pull from
49
49
  */
50
- export function getTeciImageURL(imageSrc: any, site?: any): any;
50
+ export function getTeciImageURL(imageSrc: any, site: any, params: any): any;
51
51
  /**
52
52
  * Convenience function that sets the state of a Svelte Store to true when an element is visible on the screen. Useful for triggering animations.
53
53
  *
package/dist/utils.js CHANGED
@@ -527,10 +527,11 @@ export function makeIdString(text) {
527
527
  * @param {*} imageSrc The image source string
528
528
  * @param {*} site ('www' or 'support') TECi image folder to pull from
529
529
  */
530
- export function getTeciImageURL(imageSrc, site = "www") {
531
- return imageSrc.startsWith("http") ? imageSrc : `https://files.thunderheadeng.com/${site}/images/${imageSrc}`
530
+ export function getTeciImageURL(imageSrc, site = "www", params) {
531
+ return imageSrc.startsWith("http") ? imageSrc : `https://media.thunderheadeng.net/cdn-cgi/image/${params??''}/${site}/images/${imageSrc}`
532
532
  }
533
533
 
534
+
534
535
  /**
535
536
  * Convenience function that sets the state of a Svelte Store to true when an element is visible on the screen. Useful for triggering animations.
536
537
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tecitheme",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "dev": "vite dev",