diff --git a/.gitignore b/.gitignore index a21d8f9c..dbfce239 100644 --- a/.gitignore +++ b/.gitignore @@ -84,6 +84,7 @@ dist sw.* assets/img/guides/ +assets/img/widgets/ assets/img/products/ assets/img/brands assets/img/brandproducts @@ -91,9 +92,13 @@ assets/img/sellers assets/img/regions assets/img/links assets/img/widgets +assets/img/collections static/guides/ config/products.json config/guides.json +config/widgets.json config/guide-*.json config/widgets.json assets/img/tmp/ + +*Zone.Identifier diff --git a/assets/css/global.css b/assets/css/global.css index 0bd26e8c..61e59091 100644 --- a/assets/css/global.css +++ b/assets/css/global.css @@ -15,7 +15,7 @@ html { } body { - font-family: Roboto, "Helvetica Neue", Arial, sans-serif; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; overflow-x: hidden; background-color: white; } @@ -32,6 +32,10 @@ body { } } +strong, b { + font-weight: 600 +} + *, *:before, *:after { box-sizing: border-box; margin: 0; diff --git a/assets/img/app.jpg b/assets/img/app.jpg new file mode 100644 index 00000000..d28e0619 Binary files /dev/null and b/assets/img/app.jpg differ diff --git a/assets/img/app2.png b/assets/img/app2.png new file mode 100644 index 00000000..a9bd9ea5 Binary files /dev/null and b/assets/img/app2.png differ diff --git a/assets/img/app_controller.png b/assets/img/app_controller.png new file mode 100644 index 00000000..30f25c4c Binary files /dev/null and b/assets/img/app_controller.png differ diff --git a/assets/img/appicons/alerts.png b/assets/img/appicons/alerts.png new file mode 100644 index 00000000..bb4d2bdd Binary files /dev/null and b/assets/img/appicons/alerts.png differ diff --git a/assets/img/appicons/life.png b/assets/img/appicons/life.png new file mode 100644 index 00000000..ef8045e6 Binary files /dev/null and b/assets/img/appicons/life.png differ diff --git a/assets/img/appicons/light.png b/assets/img/appicons/light.png new file mode 100644 index 00000000..8fcfd427 Binary files /dev/null and b/assets/img/appicons/light.png differ diff --git a/assets/img/appicons/log.png b/assets/img/appicons/log.png new file mode 100644 index 00000000..0b02598b Binary files /dev/null and b/assets/img/appicons/log.png differ diff --git a/assets/img/appicons/measure.png b/assets/img/appicons/measure.png new file mode 100644 index 00000000..44889e47 Binary files /dev/null and b/assets/img/appicons/measure.png differ diff --git a/assets/img/appicons/nutrients.png b/assets/img/appicons/nutrients.png new file mode 100644 index 00000000..2b757471 Binary files /dev/null and b/assets/img/appicons/nutrients.png differ diff --git a/assets/img/appicons/remote.png b/assets/img/appicons/remote.png new file mode 100644 index 00000000..8fca4ad0 Binary files /dev/null and b/assets/img/appicons/remote.png differ diff --git a/assets/img/appicons/schedule.png b/assets/img/appicons/schedule.png new file mode 100644 index 00000000..f7bc5c05 Binary files /dev/null and b/assets/img/appicons/schedule.png differ diff --git a/assets/img/appicons/timelapse.png b/assets/img/appicons/timelapse.png new file mode 100644 index 00000000..df84fd24 Binary files /dev/null and b/assets/img/appicons/timelapse.png differ diff --git a/assets/img/appicons/training.png b/assets/img/appicons/training.png new file mode 100644 index 00000000..5e9b7ee4 Binary files /dev/null and b/assets/img/appicons/training.png differ diff --git a/assets/img/appicons/ventilation.png b/assets/img/appicons/ventilation.png new file mode 100644 index 00000000..ab8f39c6 Binary files /dev/null and b/assets/img/appicons/ventilation.png differ diff --git a/assets/img/appicons/watering.png b/assets/img/appicons/watering.png new file mode 100644 index 00000000..4b3550d4 Binary files /dev/null and b/assets/img/appicons/watering.png differ diff --git a/assets/img/appstore2.png b/assets/img/appstore2.png new file mode 100644 index 00000000..0b525b86 Binary files /dev/null and b/assets/img/appstore2.png differ diff --git a/assets/img/blower_sensor.png b/assets/img/blower_sensor.png new file mode 100644 index 00000000..69a09a84 Binary files /dev/null and b/assets/img/blower_sensor.png differ diff --git a/assets/img/discord-logo.jpg b/assets/img/discord-logo.jpg new file mode 100644 index 00000000..8c67c1b7 Binary files /dev/null and b/assets/img/discord-logo.jpg differ diff --git a/assets/img/discord.jpg b/assets/img/discord.jpg new file mode 100644 index 00000000..86daacc7 Binary files /dev/null and b/assets/img/discord.jpg differ diff --git a/assets/img/emojis/3d-printing.png b/assets/img/emojis/3d-printing.png new file mode 100644 index 00000000..0e84d316 Binary files /dev/null and b/assets/img/emojis/3d-printing.png differ diff --git a/assets/img/emojis/autoflowers.png b/assets/img/emojis/autoflowers.png new file mode 100644 index 00000000..f7e4b775 Binary files /dev/null and b/assets/img/emojis/autoflowers.png differ diff --git a/assets/img/emojis/breeding.png b/assets/img/emojis/breeding.png new file mode 100644 index 00000000..08b36232 Binary files /dev/null and b/assets/img/emojis/breeding.png differ diff --git a/assets/img/emojis/carbon-filter-builds.png b/assets/img/emojis/carbon-filter-builds.png new file mode 100644 index 00000000..1efad2cd Binary files /dev/null and b/assets/img/emojis/carbon-filter-builds.png differ diff --git a/assets/img/emojis/deals.png b/assets/img/emojis/deals.png new file mode 100644 index 00000000..dc29306a Binary files /dev/null and b/assets/img/emojis/deals.png differ diff --git a/assets/img/emojis/edibles.png b/assets/img/emojis/edibles.png new file mode 100644 index 00000000..71724370 Binary files /dev/null and b/assets/img/emojis/edibles.png differ diff --git a/assets/img/emojis/feature-polling.png b/assets/img/emojis/feature-polling.png new file mode 100644 index 00000000..0e84d316 Binary files /dev/null and b/assets/img/emojis/feature-polling.png differ diff --git a/assets/img/emojis/gaming.png b/assets/img/emojis/gaming.png new file mode 100644 index 00000000..7495dce4 Binary files /dev/null and b/assets/img/emojis/gaming.png differ diff --git a/assets/img/emojis/grow-box-builds.png b/assets/img/emojis/grow-box-builds.png new file mode 100644 index 00000000..ed3a1488 Binary files /dev/null and b/assets/img/emojis/grow-box-builds.png differ diff --git a/assets/img/emojis/growers-discussion.png b/assets/img/emojis/growers-discussion.png new file mode 100644 index 00000000..de3098c7 Binary files /dev/null and b/assets/img/emojis/growers-discussion.png differ diff --git a/assets/img/emojis/harvesting-curing.png b/assets/img/emojis/harvesting-curing.png new file mode 100644 index 00000000..d9bf6e8b Binary files /dev/null and b/assets/img/emojis/harvesting-curing.png differ diff --git a/assets/img/emojis/is-my-plant-ok.png b/assets/img/emojis/is-my-plant-ok.png new file mode 100644 index 00000000..e013bad7 Binary files /dev/null and b/assets/img/emojis/is-my-plant-ok.png differ diff --git a/assets/img/emojis/nutrients.png b/assets/img/emojis/nutrients.png new file mode 100644 index 00000000..7a660cde Binary files /dev/null and b/assets/img/emojis/nutrients.png differ diff --git a/assets/img/emojis/plant-training.png b/assets/img/emojis/plant-training.png new file mode 100644 index 00000000..0a3d3fcd Binary files /dev/null and b/assets/img/emojis/plant-training.png differ diff --git a/assets/img/emojis/puff-puff-pass.png b/assets/img/emojis/puff-puff-pass.png new file mode 100644 index 00000000..ef93b181 Binary files /dev/null and b/assets/img/emojis/puff-puff-pass.png differ diff --git a/assets/img/emojis/seeds-germination.png b/assets/img/emojis/seeds-germination.png new file mode 100644 index 00000000..ad562136 Binary files /dev/null and b/assets/img/emojis/seeds-germination.png differ diff --git a/assets/img/emojis/tech-support.png b/assets/img/emojis/tech-support.png new file mode 100644 index 00000000..d916e21d Binary files /dev/null and b/assets/img/emojis/tech-support.png differ diff --git a/assets/img/emojis/timelapse.png b/assets/img/emojis/timelapse.png new file mode 100644 index 00000000..a9b47e67 Binary files /dev/null and b/assets/img/emojis/timelapse.png differ diff --git a/assets/img/icon-veg.svg b/assets/img/icon-veg.svg new file mode 100644 index 00000000..e3c28fda --- /dev/null +++ b/assets/img/icon-veg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/img/icon_clear.svg b/assets/img/icon_clear.svg new file mode 100644 index 00000000..1fa8444f --- /dev/null +++ b/assets/img/icon_clear.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/icon_search.svg b/assets/img/icon_search.svg new file mode 100644 index 00000000..8ef5b331 --- /dev/null +++ b/assets/img/icon_search.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/img/icon_seeds.svg b/assets/img/icon_seeds.svg new file mode 100644 index 00000000..5fec1540 --- /dev/null +++ b/assets/img/icon_seeds.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/assets/img/ledpanel.png b/assets/img/ledpanel.png new file mode 100644 index 00000000..674a1379 Binary files /dev/null and b/assets/img/ledpanel.png differ diff --git a/assets/img/logo.svg b/assets/img/logo.svg new file mode 100644 index 00000000..80b9fc0b --- /dev/null +++ b/assets/img/logo.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/assets/img/playstore2.png b/assets/img/playstore2.png new file mode 100644 index 00000000..a196abc7 Binary files /dev/null and b/assets/img/playstore2.png differ diff --git a/assets/img/searchlogo.png b/assets/img/searchlogo.png new file mode 100644 index 00000000..72e18516 Binary files /dev/null and b/assets/img/searchlogo.png differ diff --git a/assets/img/shopicon.png b/assets/img/shopicon.png new file mode 100644 index 00000000..7c629ba9 Binary files /dev/null and b/assets/img/shopicon.png differ diff --git a/assets/img/shopicon.svg b/assets/img/shopicon.svg new file mode 100644 index 00000000..82a317c9 --- /dev/null +++ b/assets/img/shopicon.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/towelieG.png b/assets/img/towelieG.png new file mode 100644 index 00000000..20af1ca3 Binary files /dev/null and b/assets/img/towelieG.png differ diff --git a/assets/img/widgets/att4nspCMtwZ2Meue.jpg b/assets/img/widgets/att4nspCMtwZ2Meue.jpg deleted file mode 100644 index c66f53a8..00000000 Binary files a/assets/img/widgets/att4nspCMtwZ2Meue.jpg and /dev/null differ diff --git a/assets/img/widgets/att4nspCMtwZ2Meue_full.jpg b/assets/img/widgets/att4nspCMtwZ2Meue_full.jpg deleted file mode 100644 index 2ebaf6ae..00000000 Binary files a/assets/img/widgets/att4nspCMtwZ2Meue_full.jpg and /dev/null differ diff --git a/assets/img/widgets/att4nspCMtwZ2Meue_small.jpg b/assets/img/widgets/att4nspCMtwZ2Meue_small.jpg deleted file mode 100644 index 9e8423aa..00000000 Binary files a/assets/img/widgets/att4nspCMtwZ2Meue_small.jpg and /dev/null differ diff --git a/assets/img/widgets/att51co5LLphZKrg4.jpg b/assets/img/widgets/att51co5LLphZKrg4.jpg deleted file mode 100644 index c66f53a8..00000000 Binary files a/assets/img/widgets/att51co5LLphZKrg4.jpg and /dev/null differ diff --git a/assets/img/widgets/att51co5LLphZKrg4_full.jpg b/assets/img/widgets/att51co5LLphZKrg4_full.jpg deleted file mode 100644 index 2ebaf6ae..00000000 Binary files a/assets/img/widgets/att51co5LLphZKrg4_full.jpg and /dev/null differ diff --git a/assets/img/widgets/att51co5LLphZKrg4_small.jpg b/assets/img/widgets/att51co5LLphZKrg4_small.jpg deleted file mode 100644 index 9e8423aa..00000000 Binary files a/assets/img/widgets/att51co5LLphZKrg4_small.jpg and /dev/null differ diff --git a/assets/img/widgets/attEPIZ9OJUBZ8pRW.jpg b/assets/img/widgets/attEPIZ9OJUBZ8pRW.jpg deleted file mode 100644 index 664da6cd..00000000 Binary files a/assets/img/widgets/attEPIZ9OJUBZ8pRW.jpg and /dev/null differ diff --git a/assets/img/widgets/attEPIZ9OJUBZ8pRW_full.jpg b/assets/img/widgets/attEPIZ9OJUBZ8pRW_full.jpg deleted file mode 100644 index 31290411..00000000 Binary files a/assets/img/widgets/attEPIZ9OJUBZ8pRW_full.jpg and /dev/null differ diff --git a/assets/img/widgets/attEPIZ9OJUBZ8pRW_small.jpg b/assets/img/widgets/attEPIZ9OJUBZ8pRW_small.jpg deleted file mode 100644 index 6ac0b715..00000000 Binary files a/assets/img/widgets/attEPIZ9OJUBZ8pRW_small.jpg and /dev/null differ diff --git a/assets/img/widgets/attEgzXqDW4T2BM76.jpg b/assets/img/widgets/attEgzXqDW4T2BM76.jpg deleted file mode 100644 index 7b942655..00000000 Binary files a/assets/img/widgets/attEgzXqDW4T2BM76.jpg and /dev/null differ diff --git a/assets/img/widgets/attEgzXqDW4T2BM76_full.jpg b/assets/img/widgets/attEgzXqDW4T2BM76_full.jpg deleted file mode 100644 index bc095215..00000000 Binary files a/assets/img/widgets/attEgzXqDW4T2BM76_full.jpg and /dev/null differ diff --git a/assets/img/widgets/attEgzXqDW4T2BM76_small.jpg b/assets/img/widgets/attEgzXqDW4T2BM76_small.jpg deleted file mode 100644 index 64a5d68c..00000000 Binary files a/assets/img/widgets/attEgzXqDW4T2BM76_small.jpg and /dev/null differ diff --git a/assets/img/widgets/attUG4UBTcqsp3FzS.jpg b/assets/img/widgets/attUG4UBTcqsp3FzS.jpg deleted file mode 100644 index c66f53a8..00000000 Binary files a/assets/img/widgets/attUG4UBTcqsp3FzS.jpg and /dev/null differ diff --git a/assets/img/widgets/attUG4UBTcqsp3FzS_full.jpg b/assets/img/widgets/attUG4UBTcqsp3FzS_full.jpg deleted file mode 100644 index 2ebaf6ae..00000000 Binary files a/assets/img/widgets/attUG4UBTcqsp3FzS_full.jpg and /dev/null differ diff --git a/assets/img/widgets/attUG4UBTcqsp3FzS_small.jpg b/assets/img/widgets/attUG4UBTcqsp3FzS_small.jpg deleted file mode 100644 index 9e8423aa..00000000 Binary files a/assets/img/widgets/attUG4UBTcqsp3FzS_small.jpg and /dev/null differ diff --git a/assets/img/widgets/attUK6IHBDDGwuMVp.jpg b/assets/img/widgets/attUK6IHBDDGwuMVp.jpg deleted file mode 100644 index 664da6cd..00000000 Binary files a/assets/img/widgets/attUK6IHBDDGwuMVp.jpg and /dev/null differ diff --git a/assets/img/widgets/attUK6IHBDDGwuMVp_full.jpg b/assets/img/widgets/attUK6IHBDDGwuMVp_full.jpg deleted file mode 100644 index 31290411..00000000 Binary files a/assets/img/widgets/attUK6IHBDDGwuMVp_full.jpg and /dev/null differ diff --git a/assets/img/widgets/attUK6IHBDDGwuMVp_small.jpg b/assets/img/widgets/attUK6IHBDDGwuMVp_small.jpg deleted file mode 100644 index 6ac0b715..00000000 Binary files a/assets/img/widgets/attUK6IHBDDGwuMVp_small.jpg and /dev/null differ diff --git a/assets/img/widgets/attYYBV3RewPDoBbL.jpg b/assets/img/widgets/attYYBV3RewPDoBbL.jpg deleted file mode 100644 index c66f53a8..00000000 Binary files a/assets/img/widgets/attYYBV3RewPDoBbL.jpg and /dev/null differ diff --git a/assets/img/widgets/attYYBV3RewPDoBbL_full.jpg b/assets/img/widgets/attYYBV3RewPDoBbL_full.jpg deleted file mode 100644 index 2ebaf6ae..00000000 Binary files a/assets/img/widgets/attYYBV3RewPDoBbL_full.jpg and /dev/null differ diff --git a/assets/img/widgets/attYYBV3RewPDoBbL_small.jpg b/assets/img/widgets/attYYBV3RewPDoBbL_small.jpg deleted file mode 100644 index 9e8423aa..00000000 Binary files a/assets/img/widgets/attYYBV3RewPDoBbL_small.jpg and /dev/null differ diff --git a/assets/img/widgets/attiTUH9YuoqQta7i.jpg b/assets/img/widgets/attiTUH9YuoqQta7i.jpg deleted file mode 100644 index adddbef7..00000000 Binary files a/assets/img/widgets/attiTUH9YuoqQta7i.jpg and /dev/null differ diff --git a/assets/img/widgets/attiTUH9YuoqQta7i_full.jpg b/assets/img/widgets/attiTUH9YuoqQta7i_full.jpg deleted file mode 100644 index 6b3519f8..00000000 Binary files a/assets/img/widgets/attiTUH9YuoqQta7i_full.jpg and /dev/null differ diff --git a/assets/img/widgets/attiTUH9YuoqQta7i_small.jpg b/assets/img/widgets/attiTUH9YuoqQta7i_small.jpg deleted file mode 100644 index e096a1ce..00000000 Binary files a/assets/img/widgets/attiTUH9YuoqQta7i_small.jpg and /dev/null differ diff --git a/assets/img/widgets/attkxtLS5NusjH8Y6.jpg b/assets/img/widgets/attkxtLS5NusjH8Y6.jpg deleted file mode 100644 index c66f53a8..00000000 Binary files a/assets/img/widgets/attkxtLS5NusjH8Y6.jpg and /dev/null differ diff --git a/assets/img/widgets/attkxtLS5NusjH8Y6_full.jpg b/assets/img/widgets/attkxtLS5NusjH8Y6_full.jpg deleted file mode 100644 index 2ebaf6ae..00000000 Binary files a/assets/img/widgets/attkxtLS5NusjH8Y6_full.jpg and /dev/null differ diff --git a/assets/img/widgets/attkxtLS5NusjH8Y6_small.jpg b/assets/img/widgets/attkxtLS5NusjH8Y6_small.jpg deleted file mode 100644 index 9e8423aa..00000000 Binary files a/assets/img/widgets/attkxtLS5NusjH8Y6_small.jpg and /dev/null differ diff --git a/assets/img/widgets/attl5owfYlvDREyXs.mp4 b/assets/img/widgets/attl5owfYlvDREyXs.mp4 deleted file mode 100644 index 95853383..00000000 Binary files a/assets/img/widgets/attl5owfYlvDREyXs.mp4 and /dev/null differ diff --git a/assets/img/widgets/attmB89CXKWYJwVMd.jpg b/assets/img/widgets/attmB89CXKWYJwVMd.jpg deleted file mode 100644 index c66f53a8..00000000 Binary files a/assets/img/widgets/attmB89CXKWYJwVMd.jpg and /dev/null differ diff --git a/assets/img/widgets/attmB89CXKWYJwVMd_full.jpg b/assets/img/widgets/attmB89CXKWYJwVMd_full.jpg deleted file mode 100644 index 2ebaf6ae..00000000 Binary files a/assets/img/widgets/attmB89CXKWYJwVMd_full.jpg and /dev/null differ diff --git a/assets/img/widgets/attmB89CXKWYJwVMd_small.jpg b/assets/img/widgets/attmB89CXKWYJwVMd_small.jpg deleted file mode 100644 index 9e8423aa..00000000 Binary files a/assets/img/widgets/attmB89CXKWYJwVMd_small.jpg and /dev/null differ diff --git a/assets/img/widgets/attoppHL1B6Z4Uy6q.mp4 b/assets/img/widgets/attoppHL1B6Z4Uy6q.mp4 deleted file mode 100644 index 95853383..00000000 Binary files a/assets/img/widgets/attoppHL1B6Z4Uy6q.mp4 and /dev/null differ diff --git a/assets/img/widgets/attrTlEbF7v6pI9gF.jpg b/assets/img/widgets/attrTlEbF7v6pI9gF.jpg deleted file mode 100644 index da6c27fc..00000000 Binary files a/assets/img/widgets/attrTlEbF7v6pI9gF.jpg and /dev/null differ diff --git a/assets/img/widgets/attrTlEbF7v6pI9gF_full.jpg b/assets/img/widgets/attrTlEbF7v6pI9gF_full.jpg deleted file mode 100644 index a0103f48..00000000 Binary files a/assets/img/widgets/attrTlEbF7v6pI9gF_full.jpg and /dev/null differ diff --git a/assets/img/widgets/attrTlEbF7v6pI9gF_small.jpg b/assets/img/widgets/attrTlEbF7v6pI9gF_small.jpg deleted file mode 100644 index a2d54701..00000000 Binary files a/assets/img/widgets/attrTlEbF7v6pI9gF_small.jpg and /dev/null differ diff --git a/assets/img/widgets/attzmKXbnQfmllPe0.jpg b/assets/img/widgets/attzmKXbnQfmllPe0.jpg deleted file mode 100644 index c66f53a8..00000000 Binary files a/assets/img/widgets/attzmKXbnQfmllPe0.jpg and /dev/null differ diff --git a/assets/img/widgets/attzmKXbnQfmllPe0_full.jpg b/assets/img/widgets/attzmKXbnQfmllPe0_full.jpg deleted file mode 100644 index 2ebaf6ae..00000000 Binary files a/assets/img/widgets/attzmKXbnQfmllPe0_full.jpg and /dev/null differ diff --git a/assets/img/widgets/attzmKXbnQfmllPe0_small.jpg b/assets/img/widgets/attzmKXbnQfmllPe0_small.jpg deleted file mode 100644 index 9e8423aa..00000000 Binary files a/assets/img/widgets/attzmKXbnQfmllPe0_small.jpg and /dev/null differ diff --git a/bin/fetch_db/fetch_db.js b/bin/fetch_db/fetch_db.js index dd3e8271..cc41713a 100755 --- a/bin/fetch_db/fetch_db.js +++ b/bin/fetch_db/fetch_db.js @@ -2,10 +2,12 @@ const { fetchProducts } = require('./products.js') const { fetchGuides } = require('./guides.js') +const { fetchWidgets } = require('./widgets.js') try { fetchProducts() fetchGuides() + fetchWidgets() } catch(e) { console.log(e) } diff --git a/bin/fetch_db/products.js b/bin/fetch_db/products.js index c659756f..69b820f8 100644 --- a/bin/fetch_db/products.js +++ b/bin/fetch_db/products.js @@ -6,6 +6,7 @@ const { fetchTable, fetchAttachement, jsonOrYaml, emptyAssetsDir, mkAssetsDir, n module.exports.fetchProducts = async () => { await mkAssetsDir('tmp') await mkAssetsDir('products') + await mkAssetsDir('collections') await mkAssetsDir('sellers') await mkAssetsDir('brandproducts') await mkAssetsDir('brands') @@ -14,12 +15,14 @@ module.exports.fetchProducts = async () => { //await emptyAssetsDir('tmp') let products = (await fetchTable('Products', ['slug', 'name', 'tagline', 'pics', 'description', 'bulletpoints', 'SellingPoints', 'type', 'ready', 'links'])).filter(p => p.ready) - let sellingPoints = (await fetchTable('SellingPoints', ['slug', 'url', 'regions', 'Product', 'Seller', 'price', 'currency', 'outofstock', 'canorder', 'params', 'BrandProduct', 'ready', 'offer', 'offertext'])).filter(sp => sp.ready) + let sellingPoints = (await fetchTable('SellingPoints', ['slug', 'url', 'region', 'Product', 'Seller', 'price', 'currency', 'outofstock', 'canorder', 'params', 'BrandProduct', 'ready', 'offer', 'offertext', 'inctax', 'nopromo', 'freeshipping'])).filter(sp => sp.ready) + sellingPoints.sort((sp1, sp2) => sp1.price - sp2.price) let sellers = await fetchTable('Sellers', ['slug', 'name', 'logo', 'description', 'url', 'regions', 'type', 'params']) let brandProducts = (await fetchTable('BrandProducts', ['slug', 'name', 'tagline', 'description', 'bulletpoints', 'pics', 'url', 'Brand', 'specs', 'variantOf', 'ready'])).filter(bp => bp.ready) let brands = await fetchTable('Brands', ['slug', 'name', 'description', 'logo', 'url']) - let regions = await fetchTable('Regions', ['code', 'name', 'flag', 'level', 'in']) - let collections = await fetchTable('Collections', ['slug', 'Product', 'order']) + let regions = await fetchTable('Regions', ['code', 'name', 'flag', 'level', 'in', 'currency', 'vat']) + let collectionProducts = await fetchTable('CollectionProducts', ['slug', 'Product', 'order']) + let collections = await fetchTable('Collections', ['slug', 'name','picture', 'CollectionProducts', 'description']) let relatedProducts = await fetchTable('RelatedProducts', ['slug', 'to', 'product', 'order', 'text']) let bookmarks = await fetchTable('Bookmarks', ['slug', 'title', 'description', 'icon', 'url']) @@ -107,9 +110,9 @@ module.exports.fetchProducts = async () => { bp.pics = variantOf.pics return bp }) - sellingPoints = sellingPoints.filter(sp => sp.regions).map(sp => { + sellingPoints = sellingPoints.map(sp => { sp.params = jsonOrYaml(sp.params || '{}') - sp.regions = regionTree(regions.find(r => r.id == sp.regions[0])) + sp.region = regionTree(regions.find(r => r.id == sp.region)) return sp }) products = products.filter(p => p.SellingPoints).map(p => { @@ -145,6 +148,21 @@ module.exports.fetchProducts = async () => { } return p }) + + collections = collections.map(c => { + c.CollectionProducts = collectionProducts.filter(u => c.CollectionProducts.indexOf(u.id) != -1) + c.picture = (c.picture || []).map(a => { + try { + const { p, data } = fetchAttachement(picPromise, a, 'collections') + picPromise = p + return data + } catch(e) { + return noPic + } + }) + return c + }) + await picPromise const productsJSON = JSON.stringify({ diff --git a/bin/fetch_db/utils.js b/bin/fetch_db/utils.js index 64389c0c..d3222512 100644 --- a/bin/fetch_db/utils.js +++ b/bin/fetch_db/utils.js @@ -31,7 +31,8 @@ const fetchFile = async (url, dst, path=assetsPath) => { module.exports.noPic = { fileLarge: 'nopic.svg', fileSmall: 'nopic.svg', - fileFull: 'nopic.svg' + fileFull: 'nopic.svg', + fileRaw: 'nopic.svg', } const emptyAssetsDir = async (dir) => { @@ -56,33 +57,42 @@ module.exports.mkStaticDir = async (dir) => { await fs.mkdir(dir) } catch(e) {} } -module.exports.fetchAttachement = (p, attachement, dir) => { +module.exports.fetchAttachement = (p, attachement, dir, keepRaw=false) => { if (attachement.type.indexOf('image/') == 0) { let ext = attachement.type.split('/')[1].toLowerCase() if (ext == 'svg+xml') ext = 'png' const thumbnails = attachement.thumbnails || { small: {url: attachement.url}, large: {url: attachement.url}, - full: {url: attachement.url} + full: {url: attachement.url}, + raw: {url: attachement.url}, } const fileLarge = `${attachement.id}.${ext}`, fileSmall = `${attachement.id}_small.${ext}`, fileFull = `${attachement.id}_full.${ext}`, + fileRaw = `${attachement.id}_raw.${ext}`, finalFileLarge = `${attachement.id}.jpg`, finalFileSmall = `${attachement.id}_small.jpg`, - finalFileFull = `${attachement.id}_full.jpg` + finalFileFull = `${attachement.id}_full.jpg`, + finalFileRaw = `${attachement.id}_raw.jpg` p = p.then(async () => { await fetchFile(thumbnails.small.url, `tmp/${fileSmall}`) await fetchFile(thumbnails.large.url, `tmp/${fileLarge}`) await fetchFile(thumbnails.full.url, `tmp/${fileFull}`) + if (keepRaw) { + await fetchFile(thumbnails.full.url, `tmp/${fileRaw}`) + } console.log(`resizing:\n${dir}/${fileSmall} ${dir}/${fileLarge} ${dir}/${fileFull}`) - await sharp(`${assetsPath}/tmp/${fileSmall}`).resize(100, 100, {fit: 'inside', withoutEnlargement: true}).flatten( { background: '#ffffff' } ).jpeg().toFile(`${assetsPath}/${dir}/${finalFileSmall}`) - await sharp(`${assetsPath}/tmp/${fileLarge}`).resize(400, 400, {fit: 'inside', withoutEnlargement: true}).flatten( { background: '#ffffff' } ).jpeg().toFile(`${assetsPath}/${dir}/${finalFileLarge}`) - await sharp(`${assetsPath}/tmp/${fileFull}`).resize(600, 600, {fit: 'inside', withoutEnlargement: true}).flatten( { background: '#ffffff' } ).jpeg().toFile(`${assetsPath}/${dir}/${finalFileFull}`) + await sharp(`${assetsPath}/tmp/${fileSmall}`).resize(200, 200, {fit: 'inside', withoutEnlargement: true}).flatten( { background: '#ffffff' } ).jpeg().toFile(`${assetsPath}/${dir}/${finalFileSmall}`) + await sharp(`${assetsPath}/tmp/${fileLarge}`).resize(600, 600, {fit: 'inside', withoutEnlargement: true}).flatten( { background: '#ffffff' } ).jpeg().toFile(`${assetsPath}/${dir}/${finalFileLarge}`) + await sharp(`${assetsPath}/tmp/${fileFull}`).resize(1400, 1400, {fit: 'inside', withoutEnlargement: true}).flatten( { background: '#ffffff' } ).jpeg().toFile(`${assetsPath}/${dir}/${finalFileFull}`) + if (keepRaw) { + await sharp(`${assetsPath}/tmp/${fileRaw}`).flatten( { background: '#ffffff' } ).jpeg().toFile(`${assetsPath}/${dir}/${finalFileRaw}`) + } }) - return { p, attachement, data: { fileLarge: `${dir}/${finalFileLarge}`, fileSmall: `${dir}/${finalFileSmall}`, fileFull: `${dir}/${finalFileFull}`, type: attachement.type } } + return { p, attachement, data: { fileLarge: `${dir}/${finalFileLarge}`, fileSmall: `${dir}/${finalFileSmall}`, fileFull: `${dir}/${finalFileFull}`, fileRaw: `${dir}/${finalFileRaw}`, type: attachement.type } } } else if (attachement.type.indexOf('video/') == 0) { const ext = attachement.type.split('/')[1].toLowerCase() const filePath = `${dir}/${attachement.id}.${ext}` diff --git a/bin/fetch_db/widgets.js b/bin/fetch_db/widgets.js new file mode 100644 index 00000000..02a54c65 --- /dev/null +++ b/bin/fetch_db/widgets.js @@ -0,0 +1,45 @@ +const fs = require('fs/promises') + +const { fetchTable, fetchAttachement, emptyAssetsDir, mkAssetsDir, mkStaticDir, noPic } = require('./utils.js') + +const { FETCH_DEV_GUIDES } = process.env + +module.exports.fetchWidgets = async () => { + await mkAssetsDir('widgets') + let widgets = await fetchTable('Widgets', ['slug', 'component', 'title', 'description', 'collections', 'picture', 'linktext', 'link', 'products', 'producttypes', 'plantid', 'guide','date', 'expiration',]) + let shop = await fetchTable('Shop', ['slug', 'menu', 'title', 'description', 'picture', 'location', 'component', 'widgets', 'order', 'test', 'nomargin',]) + + let picPromise = Promise.resolve() + widgets = widgets.map(w => { + w.title = (w.title || "").trim() + w.description = (w.description || "").trim() + w.linktext = (w.linktext || "").trim() + w.picture = (w.picture || []).map(a => { + try { + const { p, data } = fetchAttachement(picPromise, a, 'widgets', w.component == 'Banner') + picPromise = p + return data + } catch(e) { + return noPic + } + }) + return w + }) + + shop = shop.map(s => { + s.title = (s.title || "").trim() + s.description = (s.description || "").trim() + s.picture = (s.picture || []).map(a => { + try { + const { p, data } = fetchAttachement(picPromise, a, 'widgets') + picPromise = p + return data + } catch(e) { + return noPic + } + }) + return s + }) + + await fs.writeFile(`config/widgets.json`, JSON.stringify({ widgets, shop })) +} diff --git a/components/bundle/bundle.vue b/components/bundle/bundle.vue index d8633d27..80cef018 100644 --- a/components/bundle/bundle.vue +++ b/components/bundle/bundle.vue @@ -26,11 +26,19 @@
-
+
+
+ +
+
+
+ + +

This product can be used with:

@@ -38,7 +46,7 @@
{{ rp.brandProduct.name }}
{{ rp.text }}
- {{ rp.price }} + {{ rp.price.strTotal }}
@@ -56,7 +64,6 @@
-
@@ -64,7 +71,6 @@ LEARN MORE
-
@@ -73,13 +79,13 @@
-

Description

- + +
@@ -91,13 +97,16 @@ import Items from '~/components/bundle/items.vue' import OutOfStock from '~/components/products/outofstock.vue' import AddToCart from '~/components/products/addtocart.vue' import Pics from '~/components/products/pics.vue' +import Region from '~/components/products/region.vue' + +import { relatedProducts, brandProduct, product, } from '~/lib/json_db.js' export default { - components: {Items, Price, OutOfStock, AddToCart, Pics,}, + components: {Items, Price, OutOfStock, AddToCart, Pics, Region,}, props: ['bundle', 'nobottom', 'addtocart', 'noframe', 'showdescription', 'right', 'showRelatedProducts',], data() { return { - addedToCart: false + addedToCart: false, } }, methods: { @@ -110,11 +119,11 @@ export default { }, computed: { relatedProducts() { - return this.$store.getters['eshop/relatedProducts'](this.bundle.id).map(rp => { + return relatedProducts(this.bundle.id).map(rp => { rp = Object.assign({}, rp) rp.sellingPoint = this.$store.getters['eshop/sellingPointForProduct'](rp.product[0]) - rp.brandProduct = this.$store.getters['eshop/brandProduct'](rp.sellingPoint.BrandProduct[0]) - rp.product = this.$store.getters['eshop/product'](rp.sellingPoint.Product[0]) + rp.brandProduct = brandProduct(rp.sellingPoint.BrandProduct[0]) + rp.product = product(rp.sellingPoint.Product[0]) rp.price = this.$store.getters['checkout/lineItemsPrice']([{n: 1, sellingPoint: rp.sellingPoint}]) return rp }) @@ -151,6 +160,7 @@ export default { font-size: 1.8em #title + font-family: Roboto color: #5D5D5D @media only screen and (max-width: 600px) font-size: 0.85em @@ -179,7 +189,11 @@ export default { @media only screen and (max-width: 600px) width: 100% height: 300pt - margin: 20pt 0pt 20pt 0pt + margin: 20pt 0pt 20pt 0pt + +#region + display: flex + margin-bottom: 10pt #description display: flex @@ -238,7 +252,8 @@ export default { font-weight: bold #relatedProducts h4 - margin: 5pt 5pt + font-family: Roboto + margin: 10pt 5pt .relatedProduct display: flex @@ -266,7 +281,7 @@ export default { .relatedProductText flex: 1 -#bottom +#bottom display: flex justify-content: flex-end padding: 10pt 0 @@ -349,6 +364,9 @@ export default { @media only screen and (max-width: 600px) padding: 10pt 10pt 40pt 10pt +#text h1 + font-family: Roboto + #text p margin: 10pt 0 @@ -366,13 +384,16 @@ export default { flex-direction: column #links h4 - margin: 5pt 5pt + font-family: Roboto + margin: 10pt 5pt .link display: flex color: #454545 text-decoration: none padding: 2pt 5pt + font-size: 0.9em + margin: 5pt 0 .link:hover text-decoration: underline @@ -380,6 +401,9 @@ export default { .linktext flex: 1 +.linktext > b + font-family: Roboto + .linktext small color: #787878 text-decoration: underline diff --git a/components/bundle/guide.vue b/components/bundle/guide.vue index e6ba41f6..24abbf4d 100644 --- a/components/bundle/guide.vue +++ b/components/bundle/guide.vue @@ -44,6 +44,7 @@ export default { diff --git a/components/home/appfeaturecard.vue b/components/home/appfeaturecard.vue new file mode 100644 index 00000000..2d590166 --- /dev/null +++ b/components/home/appfeaturecard.vue @@ -0,0 +1,174 @@ + + + + + + + diff --git a/components/home/blockapp.vue b/components/home/blockapp.vue new file mode 100644 index 00000000..52ab0fae --- /dev/null +++ b/components/home/blockapp.vue @@ -0,0 +1,227 @@ + + + + + + + + diff --git a/components/home/blockbundle.vue b/components/home/blockbundle.vue new file mode 100644 index 00000000..40814ae8 --- /dev/null +++ b/components/home/blockbundle.vue @@ -0,0 +1,243 @@ + + + + + + + + diff --git a/components/home/blockdiscord.vue b/components/home/blockdiscord.vue new file mode 100644 index 00000000..1384b394 --- /dev/null +++ b/components/home/blockdiscord.vue @@ -0,0 +1,180 @@ + + + + + + + + diff --git a/components/home/blockexamples.vue b/components/home/blockexamples.vue new file mode 100644 index 00000000..15d9cacc --- /dev/null +++ b/components/home/blockexamples.vue @@ -0,0 +1,176 @@ + + + + + + + + diff --git a/components/home/blockguide.vue b/components/home/blockguide.vue new file mode 100644 index 00000000..48be84a4 --- /dev/null +++ b/components/home/blockguide.vue @@ -0,0 +1,183 @@ + + + + + + + + diff --git a/components/home/blockshop.vue b/components/home/blockshop.vue new file mode 100644 index 00000000..82735c2b --- /dev/null +++ b/components/home/blockshop.vue @@ -0,0 +1,186 @@ + + + + + + + + diff --git a/components/home/blockstep.vue b/components/home/blockstep.vue new file mode 100644 index 00000000..ca2f85e2 --- /dev/null +++ b/components/home/blockstep.vue @@ -0,0 +1,160 @@ + + + + + + + + diff --git a/components/home/continuous-supply.vue b/components/home/continuous-supply.vue index 0cc0c9c1..4e7f1c8c 100644 --- a/components/home/continuous-supply.vue +++ b/components/home/continuous-supply.vue @@ -30,7 +30,7 @@ Your browser does not support the video tag.
- You don't have to wait until harvest to start the next plant! Harvest twice as fast with continuous supply.
+ You don't have to wait until harvest to start the next plant! Harvest twice as fast with continuous supply. The Controller can control up to 3 spaces with different schedules to do vegging and blooming at the same time.
@@ -76,6 +76,11 @@ export default { #text color: #515151 text-align: center + margin: 0 70pt + @media only screen and (min-width: 600px) and (max-width: 900px) + margin: 0 40pt + @media only screen and (max-width: 600px) + margin: 0 5pt #text > b color: #3bb30b diff --git a/components/home/discord.vue b/components/home/discord.vue new file mode 100644 index 00000000..eb7bab8d --- /dev/null +++ b/components/home/discord.vue @@ -0,0 +1,77 @@ + + + + + + + + diff --git a/components/home/discordcard.vue b/components/home/discordcard.vue new file mode 100644 index 00000000..ff60f071 --- /dev/null +++ b/components/home/discordcard.vue @@ -0,0 +1,148 @@ + + + + + + + diff --git a/components/home/examples.vue b/components/home/examples.vue index d8d2f209..e72f5040 100644 --- a/components/home/examples.vue +++ b/components/home/examples.vue @@ -18,20 +18,13 @@ + + diff --git a/components/products/outofstock.vue b/components/products/outofstock.vue index 1c1c3ead..98c58278 100644 --- a/components/products/outofstock.vue +++ b/components/products/outofstock.vue @@ -18,7 +18,7 @@ @@ -30,9 +30,9 @@ export default {} diff --git a/components/products/price.vue b/components/products/price.vue index dea31190..2772571a 100644 --- a/components/products/price.vue +++ b/components/products/price.vue @@ -18,37 +18,27 @@