From cd1e0b336fdeff7fe5ab7e617c915e81c6f21145 Mon Sep 17 00:00:00 2001 From: b-uwe <61052367+b-uwe@users.noreply.github.com> Date: Wed, 20 Mar 2024 19:52:21 +0100 Subject: [PATCH] Distributors (#31966) * Introducing regions for distributors in CSS and JS * Using regions for Green * Using regions for Yellow * Using regions for SkyConnect * Sorting Asia and America correctly * Distributor Updates * Fix CSS issue --- sass/custom/_landingpage.scss | 12 + source/green/index.html | 689 +++++++++++++++++--------------- source/green/script.js | 15 + source/skyconnect/index.html | 719 +++++++++++++++++++--------------- source/yellow/index.html | 346 +++++++++------- 5 files changed, 1006 insertions(+), 775 deletions(-) diff --git a/sass/custom/_landingpage.scss b/sass/custom/_landingpage.scss index 1d15ac7a700..387a933e319 100644 --- a/sass/custom/_landingpage.scss +++ b/sass/custom/_landingpage.scss @@ -831,6 +831,18 @@ $ha__primary_color: #03a9f4; } .distributors { + details { + width: 100%; + justify-content: space-between; + padding: 16px 24px; + color: #222222; + margin: auto; + + summary.region { + display: list-item; + } + } + a { text-decoration: none; diff --git a/source/green/index.html b/source/green/index.html index 6c7745bd104..595498a5abc 100644 --- a/source/green/index.html +++ b/source/green/index.html @@ -2308,339 +2308,408 @@ frontpage_image: /images/frontpage/green-frontpage.png
+
+ Shipping to America +
+ +
+
+
πŸ‡ΊπŸ‡Έ
+
ameriDroid
+
Shipping from US
+
+ + + +
+
- -
-
-
πŸ‡¨πŸ‡Ώ
-
Alza.cz
-
Shipping from the Czech Republic
-
- - - -
-
+ +
+
+
πŸ‡ΊπŸ‡Έ
+
CloudFree
+
Shipping from US
+
+ + + +
+
- -
-
-
πŸ‡ΊπŸ‡Έ
-
ameriDroid
-
Shipping from US
-
- - - -
-
+ +
+
+
πŸ‡¨πŸ‡³
+
Seeed Studio
+
Shipping from China, US and Germany
+
+ + + +
+
- -
-
-
πŸ‡΅πŸ‡±
-
Botland
-
Shipping from Poland
-
- - -
-
+
+
+ Shipping to Asia +
+ +
+
+
πŸ‡¨πŸ‡³
+
Seeed Studio
+
Shipping from China, US and Germany
+
+ + + +
+
- -
-
-
πŸ‡ΊπŸ‡Έ
-
CloudFree
-
Shipping from US
-
- - -
-
+
+
+ Shipping to Australia +
+ +
+
+
πŸ‡¦πŸ‡Ί
+
Oz Smart Things
+
Shipping from Australia
+
+ + + +
+
- -
-
-
πŸ‡¬πŸ‡§
-
Everything Smart Technology
-
Shipping from the United Kingdom
-
- - - -
-
+ +
+
+
πŸ‡¦πŸ‡Ί
+
Smart Guys
+
Shipping from Australia
+
+ + + +
+
- -
-
-
πŸ‡­πŸ‡Ί
-
eWeLink device store
-
Shipping from Hungary
-
- - -
-
+
+
+ Shipping to Europe +
+ +
+
+
πŸ‡¨πŸ‡Ώ
+
Alza.cz
+
Shipping from the Czech Republic
+
+ + + +
+
- -
-
-
πŸ‡΅πŸ‡Ή
-
Mauser
-
Shipping from Portugal
-
- - - -
-
+ +
+
+
πŸ‡΅πŸ‡±
+
Botland
+
Shipping from Poland
+
+ + + +
+
- -
-
-
πŸ‡©πŸ‡ͺ
-
mediarath
-
Shipping from Germany
-
- - - -
-
+ +
+
+
πŸ‡«πŸ‡·
+
Domadoo
+
Shipping from France
+
+ + + +
+
- -
-
-
πŸ‡ΈπŸ‡ͺ
-
m.nu
-
Shipping from Sweden
-
- - - -
-
+ +
+
+
πŸ‡¬πŸ‡§
+
Everything Smart Technology
+
Shipping from the United Kingdom
+
+ + + +
+
- -
-
-
πŸ‡­πŸ‡Ί
-
OkosOtthon Bolt
-
Shipping from Hungary
-
- - - -
-
+ +
+
+
πŸ‡­πŸ‡Ί
+
eWeLink device store
+
Shipping from Hungary
+
+ + + +
+
- -
-
-
πŸ‡¦πŸ‡Ί
-
Oz Smart Things
-
Shipping from Australia
-
- - - -
-
+ +
+
+
πŸ‡΅πŸ‡Ή
+
Mauser
+
Shipping from Portugal
+
+ + + +
+
- -
-
-
πŸ‡¨πŸ‡­
-
Pi-Shop.ch
-
Shipping from Switzerland
-
- - - -
-
+ +
+
+
πŸ‡©πŸ‡ͺ
+
mediarath
+
Shipping from Germany
+
+ + + +
+
- -
-
-
πŸ‡©πŸ‡°
-
RaspberryPi.dk
-
Shipping from Denmark
-
- - - -
-
+ +
+
+
πŸ‡ΈπŸ‡ͺ
+
m.nu
+
Shipping from Sweden
+
+ + + +
+
- -
-
-
πŸ‡¨πŸ‡³
-
Seeed Studio
-
Shipping from China, US and Germany
-
- - - -
-
+ +
+
+
πŸ‡­πŸ‡Ί
+
OkosOtthon Bolt
+
Shipping from Hungary
+
+ + + +
+
- -
-
-
πŸ‡ΈπŸ‡°
-
SmarterHOME
-
Shipping from Slovakia
-
- - - -
-
+ +
+
+
πŸ‡¨πŸ‡­
+
Pi-Shop.ch
+
Shipping from Switzerland
+
+ + + +
+
- -
-
-
πŸ‡¦πŸ‡Ί
-
Smart Guys
-
Shipping from Australia
-
- - - -
-
+ +
+
+
πŸ‡©πŸ‡°
+
RaspberryPi.dk
+
Shipping from Denmark
+
+ + + +
+
- -
-
-
πŸ‡¨πŸ‡­
-
Swiss-Domotique
-
Shipping from Switzerland
-
- - - -
-
+ +
+
+
πŸ‡¨πŸ‡³
+
Seeed Studio
+
Shipping from China, US and Germany
+
+ + + +
+
- -
-
-
πŸ‡¬πŸ‡§
-
The Pi Hut
-
Shipping from the United Kingdom
-
- - - -
-
+ +
+
+
πŸ‡ΈπŸ‡°
+
SmarterHOME
+
Shipping from Slovakia
+
+ + + +
+
- - - +
diff --git a/source/green/script.js b/source/green/script.js index 5c2b3cb8b5f..e880f83bbb9 100644 --- a/source/green/script.js +++ b/source/green/script.js @@ -23,6 +23,19 @@ function handleIntersect(entries, _observer) { }); } +const expandRegion = () => { + try { + const tz = Intl.DateTimeFormat().resolvedOptions().timeZone; + const continent = tz.replace( /^(Asia|America|Australia|Europe)\/.*$/, '$1' ); + + if ( continent != tz ) { + document.querySelector( `#dist_${continent.toLowerCase()}` ).open = true; + } + } catch ( ev ) { + // Ignore... + } +}; + window.addEventListener( "load", () => { @@ -67,6 +80,8 @@ window.addEventListener( }, { passive: true } ); + + expandRegion(); }, false ); diff --git a/source/skyconnect/index.html b/source/skyconnect/index.html index 266194cb507..ec9420ad765 100644 --- a/source/skyconnect/index.html +++ b/source/skyconnect/index.html @@ -229,353 +229,413 @@ frontpage_image: /images/skyconnect/skyconnect-cover.png
- -
-
-
πŸ‡¨πŸ‡Ώ
-
ALZA
-
Shipping from the Czech Republic
-
- - - -
-
+
+ Shipping to America +
- -
-
-
πŸ‡ΊπŸ‡Έ
-
ameriDroid
-
Shipping from US
-
- - - -
-
+ +
+
+
πŸ‡ΊπŸ‡Έ
+
ameriDroid
+
Shipping from US
+
+ + + +
+
- -
-
-
πŸ‡΅πŸ‡±
-
Botland
-
Shipping from Poland
-
- - - -
-
+ +
+
+
πŸ‡ΊπŸ‡Έ
+
CloudFree
+
Shipping from US
+
+ + + +
+
- -
-
-
πŸ‡ΊπŸ‡Έ
-
CloudFree
-
Shipping from US
-
- - - -
-
+ +
+
+
πŸ‡¨πŸ‡³
+
Seeed Studio
+
Shipping from China, US and Germany
+
+ + + +
+
- -
-
-
πŸ‡«πŸ‡·
-
Domadoo
-
Shipping from France
-
- - -
-
+
+
+ Shipping to Asia +
- -
-
-
πŸ‡¬πŸ‡§
-
Everything Smart Technology
-
Shipping from the United Kingdom
-
- - - -
-
+ +
+
+
πŸ‡¨πŸ‡³
+
Seeed Studio
+
Shipping from China, US and Germany
+
+ + + +
+
- -
-
-
πŸ‡­πŸ‡Ί
-
eWeLink device store
-
Shipping from Hungary
-
- - -
-
+
+
+ Shipping to Australia +
- -
-
-
πŸ‡³πŸ‡±
-
HAshop
-
Shipping from the Netherlands
-
- - - -
-
+ +
+
+
πŸ‡¦πŸ‡Ί
+
Smart Guys
+
Shipping from Australia
+
+ + + +
+
- -
-
-
πŸ‡΅πŸ‡Ή
-
Mauser
-
Shipping from Portugal
-
- - -
-
+
+
+ Shipping to Europe +
- -
-
-
πŸ‡©πŸ‡ͺ
-
mediarath
-
Shipping from Germany
-
- - - -
-
+ +
+
+
πŸ‡¨πŸ‡Ώ
+
ALZA
+
Shipping from the Czech Republic
+
+ + + +
+
- -
-
-
πŸ‡ΈπŸ‡ͺ
-
m.nu
-
Shipping from Sweden
-
- - - -
-
+ +
+
+
πŸ‡΅πŸ‡±
+
Botland
+
Shipping from Poland
+
+ + + +
+
- -
-
-
πŸ‡­πŸ‡Ί
-
OkosOtthon Bolt
-
Shipping from Hungary
-
- - - -
-
+ +
+
+
πŸ‡«πŸ‡·
+
Domadoo
+
Shipping from France
+
+ + + +
+
- -
-
-
πŸ‡©πŸ‡°
-
RaspberryPi.dk
-
Shipping from Denmark
-
- - - -
-
+ +
+
+
πŸ‡¬πŸ‡§
+
Everything Smart Technology
+
Shipping from the United Kingdom
+
+ + + +
+
- -
-
-
πŸ‡³πŸ‡±
-
Robbshop
-
Shipping from the Netherlands
-
- - - -
-
+ +
+
+
πŸ‡­πŸ‡Ί
+
eWeLink device store
+
Shipping from Hungary
+
+ + + +
+
- -
-
-
πŸ‡¨πŸ‡³
-
Seeed Studio
-
Shipping from China, US and Germany
-
- - - -
-
+ +
+
+
πŸ‡³πŸ‡±
+
HAshop
+
Shipping from the Netherlands
+
+ + + +
+
- -
-
-
πŸ‡ΈπŸ‡°
-
SmarterHOME
-
Shipping from Slovakia
-
- - - -
-
+ +
+
+
πŸ‡΅πŸ‡Ή
+
Mauser
+
Shipping from Portugal
+
+ + + +
+
- -
-
-
πŸ‡¦πŸ‡Ί
-
Smart Guys
-
Shipping from Australia
-
- - - -
-
+ +
+
+
πŸ‡©πŸ‡ͺ
+
mediarath
+
Shipping from Germany
+
+ + + +
+
- -
-
-
πŸ‡¨πŸ‡­
-
Swiss-Domotique
-
Shipping from Switzerland
-
- - - -
-
+ +
+
+
πŸ‡ΈπŸ‡ͺ
+
m.nu
+
Shipping from Sweden
+
+ + + +
+
- -
-
-
πŸ‡¬πŸ‡§
-
The Pi Hut
-
Shipping from the United Kingdom
-
- - - -
-
+ +
+
+
πŸ‡­πŸ‡Ί
+
OkosOtthon Bolt
+
Shipping from Hungary
+
+ + + +
+
- - - +
@@ -617,4 +677,15 @@ frontpage_image: /images/skyconnect/skyconnect-cover.png if (document.location.search === "?order") { showBuyDialog(); } + + try { + const tz = Intl.DateTimeFormat().resolvedOptions().timeZone; + const continent = tz.replace( /^(Asia|America|Australia|Europe)\/.*$/, '$1' ); + + if ( continent != tz ) { + document.querySelector( `#dist_${continent.toLowerCase()}` ).open = true; + } + } catch ( ev ) { + // Ignore... + } diff --git a/source/yellow/index.html b/source/yellow/index.html index c4b362f484c..c2bff3222b7 100644 --- a/source/yellow/index.html +++ b/source/yellow/index.html @@ -349,159 +349,212 @@ frontpage_image: /images/frontpage/yellow-frontpage.jpg
+
+ Shipping to America +
- -
-
-
πŸ‡ΊπŸ‡Έ
-
ameriDroid
-
Shipping from US. Yellow Kit versions only. Also sells CM4 modules.
-
- - - -
-
+ +
+
+
πŸ‡ΊπŸ‡Έ
+
ameriDroid
+
Shipping from US. Yellow Kit versions only. Also sells CM4 modules.
+
+ + + +
+
- -
-
-
πŸ‡ΊπŸ‡Έ
-
CloudFree
-
Shipping from US. Yellow Kit versions only. Also sells CM4 modules.
-
- - - -
-
+ +
+
+
πŸ‡ΊπŸ‡Έ
+
CloudFree
+
Shipping from US. Yellow Kit versions only. Also sells CM4 modules.
+
+ + + +
+
- -
-
-
πŸ‡ΊπŸ‡Έ
-
Crowd Supply
-
Shipping from US. Yellow Kit versions only.
-
- - - -
-
+ +
+
+
πŸ‡ΊπŸ‡Έ
+
Crowd Supply
+
Shipping from US. Yellow Kit versions only.
+
+ + + +
+
- + +
+
+
πŸ‡¨πŸ‡³
+
Seeed Studio
+
Shipping from China, US and Germany. Also sells CM4 modules.
+
+ + + +
+
- -
-
-
πŸ‡΅πŸ‡Ή
-
Mauser
-
Shipping from Portugal. Yellow Kit versions only. Also sells CM4 modules.
-
- - -
-
+
+
+ Shipping to Asia +
- -
-
-
πŸ‡¨πŸ‡­
-
Pi-Shop.ch
-
Shipping from Switzerland. Also sells CM4 modules.
-
- - - -
-
+ +
+
+
πŸ‡¨πŸ‡³
+
Seeed Studio
+
Shipping from China, US and Germany. Also sells CM4 modules.
+
+ + + +
+
- -
-
-
πŸ‡©πŸ‡°
-
RaspberryPi.dk
-
Shipping from Denmark. Also sells CM4 modules.
-
- - -
-
+
+
+ Shipping to Europe +
- -
-
-
πŸ‡¨πŸ‡³
-
Seeed Studio
-
Shipping from China, US and Germany. Also sells CM4 modules.
-
- - - -
-
+ - - - +
@@ -543,4 +596,15 @@ frontpage_image: /images/frontpage/yellow-frontpage.jpg if (document.location.search === "?order") { showBuyDialog(); } + + try { + const tz = Intl.DateTimeFormat().resolvedOptions().timeZone; + const continent = tz.replace( /^(Asia|America|Australia|Europe)\/.*$/, '$1' ); + + if ( continent != tz ) { + document.querySelector( `#dist_${continent.toLowerCase()}` ).open = true; + } + } catch ( ev ) { + // Ignore... + } \ No newline at end of file