tecitheme 0.15.3 → 0.15.5
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 { conditionalTransition, getColorStyles, makeIdString, triggerWhenVisible } from "../utils";
|
|
2
|
+
import { conditionalTransition, getColorStyles, getTeciImageURL, makeIdString, triggerWhenVisible } from "../utils";
|
|
3
3
|
import { onMount } from "svelte";
|
|
4
4
|
import { fly, fade } from "svelte/transition";
|
|
5
5
|
import Button from "./Button.svelte";
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
in:conditionalTransition={{ fn: fade, condition: animate, delay: 200, duration: 1250, easing:cubicInOut, x: textPosition == "left" ? '100%' : '-100%'}}
|
|
124
124
|
out:conditionalTransition={{fn: fade, condition: animate, delay: 200, duration: 1250, easing:cubicInOut, x: textPosition == "left" ? '100%' : '-100%'}}
|
|
125
125
|
>
|
|
126
|
-
<img
|
|
126
|
+
<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}>
|
|
127
127
|
</div>
|
|
128
128
|
{:else if animate}
|
|
129
129
|
<div
|
|
@@ -1,33 +1,21 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
|
|
2
|
+
import { getTeciImageURL, makeIdString } from "../utils";
|
|
3
3
|
|
|
4
4
|
export let image = undefined;
|
|
5
5
|
export let title = undefined;
|
|
6
6
|
export let caption = undefined;
|
|
7
7
|
export let link = undefined;
|
|
8
|
+
export let site = undefined;
|
|
8
9
|
|
|
9
|
-
let figureImage;
|
|
10
|
-
let figureLink;
|
|
10
|
+
let figureImage = getTeciImageURL(image, site);
|
|
11
|
+
let figureLink = link ? link : figureImage;
|
|
11
12
|
let id = makeIdString(title);
|
|
12
|
-
|
|
13
|
-
if (image.startsWith("http")) {
|
|
14
|
-
figureImage = image;
|
|
15
|
-
figureLink = link ? link : image;
|
|
16
|
-
} else if (image.includes("gif")) {
|
|
17
|
-
figureImage = "https://files.thunderheadeng.com/www/images/" + image;
|
|
18
|
-
figureLink = link ? link : "https://files.thunderheadeng.com/www/images/" + image;
|
|
19
|
-
} else {
|
|
20
|
-
figureImage = "https://files.thunderheadeng.com/www/images/" +
|
|
21
|
-
image +
|
|
22
|
-
"?auto=compress&auto=format";
|
|
23
|
-
figureLink = link ? link : "https://files.thunderheadeng.com/www/images/" + image;
|
|
24
|
-
}
|
|
25
13
|
</script>
|
|
26
14
|
|
|
27
15
|
{#if image}
|
|
28
16
|
<section {id} class="not-prose mb-8 flex justify-center">
|
|
29
17
|
<figure class="mx-auto w-auto border border-slate-100 p-2 shadow-lg">
|
|
30
|
-
<a class="inline-block w-full bg-slate-200 p-1" href={figureLink}>
|
|
18
|
+
<a class="inline-block w-full bg-slate-200 p-1" href={figureLink} rel="external">
|
|
31
19
|
<img class="mx-auto w-auto" src={figureImage} alt={title} {title} />
|
|
32
20
|
</a>
|
|
33
21
|
{#if caption}
|
|
@@ -6,6 +6,7 @@ export default class Figure extends SvelteComponent<{
|
|
|
6
6
|
link?: any;
|
|
7
7
|
title?: any;
|
|
8
8
|
image?: any;
|
|
9
|
+
site?: any;
|
|
9
10
|
}, {
|
|
10
11
|
[evt: string]: CustomEvent<any>;
|
|
11
12
|
}, {}> {
|
|
@@ -20,6 +21,7 @@ declare const __propDef: {
|
|
|
20
21
|
link?: any;
|
|
21
22
|
title?: any;
|
|
22
23
|
image?: any;
|
|
24
|
+
site?: any;
|
|
23
25
|
};
|
|
24
26
|
events: {
|
|
25
27
|
[evt: string]: CustomEvent<any>;
|
package/dist/utils.js
CHANGED
|
@@ -457,7 +457,7 @@ export function makeIdString(text) {
|
|
|
457
457
|
* @param {*} site ('www' or 'support') TECi image folder to pull from
|
|
458
458
|
*/
|
|
459
459
|
export function getTeciImageURL(imageSrc, site = "www") {
|
|
460
|
-
return imageSrc.startsWith("http") ? imageSrc : `https://files.thunderheadeng.com/${site}/images/${imageSrc}
|
|
460
|
+
return imageSrc.startsWith("http") ? imageSrc : `https://files.thunderheadeng.com/${site}/images/${imageSrc}`
|
|
461
461
|
}
|
|
462
462
|
|
|
463
463
|
/**
|