diff --git a/public/index.html b/public/index.html index dd6b2b8..6c65024 100644 --- a/public/index.html +++ b/public/index.html @@ -211,11 +211,14 @@

Get started with a Widget

Customization Options (Optional):
+
Customization Options (O
Customization Options (Optional):
+
+
Customization Options (O
- -
Customization Options (O
- +
@@ -355,7 +360,7 @@
Customization Options (O
- +
diff --git a/src/TreeMap/App.svelte b/src/TreeMap/App.svelte index adc44eb..bcff005 100644 --- a/src/TreeMap/App.svelte +++ b/src/TreeMap/App.svelte @@ -17,6 +17,7 @@ import ptBRLocale from "./../../public/data/locales/pt-BR.json"; import { onMount } from "svelte"; import getTenantConfig from "../../utils/tenantsConfig"; + import TcBackground from '../common/themes/leniKlum/TcBackground.svelte'; let w; // Props that can be passed export let user; @@ -27,6 +28,8 @@ export let locale = "en"; export let refresh = "none"; export let tenantkey = "ten_I9TW3ncG"; + export let forestname; + $: primarycolor = primarycolor; $: counterbgcolor = circlebgcolor ? circlebgcolor @@ -84,7 +87,7 @@ // https://svelte.school/tutorials/introduction-to-actions const createMap = async (domNode) => { fetchTiles( - theme === "light" ? mapStyleLight : mapStyleDark, + theme === "light" || "forest" ? mapStyleLight : mapStyleDark, "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer" ).then((style) => { if (style) { @@ -202,10 +205,16 @@
640 ? "landscape" : "portrait"}`} bind:clientWidth={w} - style="--widgetWidth:{w};--primary-color: {primarycolor};--counter-background-color: {counterbgcolor}; --background-color: {theme === - 'light' - ? '#fff' - : '#2f3336'}; --link-color: {theme === 'light' ? '#6daff0' : '#fff'}" + style="--widgetWidth:{w};--primary-color: {primarycolor}; + --counter-background-color: {theme === 'forest' + ? 'transparent' + : counterbgcolor}; + --background-color: {theme === 'light' + ? '#fff' + : theme === 'dark' + ? '#2f3336' + : '#fff'}; + --link-color: {theme === 'light' || "forest" ? '#6daff0' : '#fff'}" > {#await promise} @@ -213,31 +222,46 @@
640 ? "w40" : "w100"}`}>
-
+ {#if theme === "forest"} +
+ +
+ {/if} +
+
+

+ {community === "true" + ? localizedAbbreviatedNumber( + locale, + data.score.personal + data.score.received, + 1 + ) + : localizedAbbreviatedNumber(locale, data.score.personal, 1)} +

+
+ {#if forestname}
-

- {community === "true" - ? localizedAbbreviatedNumber( - locale, - data.score.personal + data.score.received, - 1 - ) - : localizedAbbreviatedNumber(locale, data.score.personal, 1)} +

+ {language[locale].trees}.

- {language[locale].treesPlanted} + {language[locale].the} {forestname} {language[locale].forestGrows}

- {#if data.score.target != 0} -
-

- {localizedAbbreviatedNumber(locale, data.score.target, 1)} -

-

{language[locale].target}

-
- {/if} -
- + {:else} +
+

+ {language[locale].treesPlanted} +

+ {#if data.score.target != 0} +

+ {localizedAbbreviatedNumber(locale, data.score.target, 1)} +

+

{language[locale].target}

+ {/if} +
+ {/if} +
{#await promise} {:then data}
+ {#if theme === "forest"} +
+ +
+ {/if}

@@ -92,24 +103,30 @@ ) : localizedAbbreviatedNumber(locale, data.score.personal, 1)}

-

- {language[locale].treesPlanted} -

- {#if data.score.target != 0} + {#if forestname}
-

- {localizedAbbreviatedNumber( - locale, - Number(data.score.target), - 1 - )} +

+ {language[locale].trees}. +

+

+ {language[locale].the} {forestname} {language[locale].forestGrows}

-

{language[locale].target}

- {/if} + {:else} +
+

+ {language[locale].treesPlanted} +

+ {#if data.score.target != 0} +

+ {localizedAbbreviatedNumber(locale, data.score.target, 1)} +

+

{language[locale].target}

+ {/if} +
+ {/if}
- @@ -250,7 +267,7 @@ all: initial; } - .treecounter { + .treeProfile { width: 100%; max-width: 420px; border-radius: 10px; @@ -304,6 +321,12 @@ justify-content: center; align-items: center; text-align: center; + z-index: 1; + } + .customBackground { + width: 100%; + height: 100%; + position: absolute; } .treecount { font-size: 48px; @@ -320,6 +343,8 @@ color: white; margin: 0px; margin-top: 6px; + max-width: 195px; + word-wrap: break-word; } .primaryButton { color: white; diff --git a/src/TreeTenantCounter/App.svelte b/src/TreeTenantCounter/App.svelte index 176066b..6f2ae5d 100644 --- a/src/TreeTenantCounter/App.svelte +++ b/src/TreeTenantCounter/App.svelte @@ -75,40 +75,37 @@
{/if} - {#if forestname}

{localizedAbbreviatedNumber(locale, Number(data.total), 1)}

-

- {language[locale].trees}. -

-

- {language[locale].the} {forestname} {language[locale].forestGrows} -

-
- {:else} -
-
-

- {localizedAbbreviatedNumber(locale, Number(data.total), 1)} -

-

- {language[locale].treesPlanted} -

-
- {#if goal && goal != "" && goal != 0} + {#if forestname}
-

- {localizedAbbreviatedNumber(locale, Number(goal), 1)} +

+ {language[locale].trees}. +

+

+ {language[locale].the} {forestname} {language[locale].forestGrows}

-

{language[locale].target}

+
+ {:else} +
+

+ {language[locale].treesPlanted} +

+ {#if goal && goal != "" && goal != 0} +
+

+ {localizedAbbreviatedNumber(locale, Number(goal), 1)} +

+

{language[locale].target}

+
+ {/if}
{/if}
- {/if} {#if goal && goal != "" && goal != 0}