From 8dd5c8d63d39f36dc7ab29158088a9883c50bfcc Mon Sep 17 00:00:00 2001 From: Ben <36240171+benkyd@users.noreply.github.com> Date: Sat, 23 Apr 2022 00:17:19 +0100 Subject: [PATCH] More joining Former-commit-id: 690f0bf7b00ecfb89043bbcea77616e8d9913bc4 --- client/public/about/index.html | 43 -------- client/public/components/basket-popout.mjs | 5 +- client/public/components/compact-listing.mjs | 14 +++ client/public/components/product-list.mjs | 99 ++++++++---------- client/public/components/search.mjs | 2 +- client/public/components/storefront.mjs | 6 +- .../components/super-compact-listing.mjs | 48 ++++++++- client/public/res/technic.png | Bin 0 -> 581318 bytes src/controllers/bigram.js | 2 + src/controllers/brick-controller.js | 1 + src/controllers/controller-master.js | 2 +- src/controllers/set-controller.js | 31 +++++- src/database/database.js | 10 +- src/routes/cdn.js | 3 + 14 files changed, 150 insertions(+), 116 deletions(-) delete mode 100644 client/public/about/index.html create mode 100644 client/public/res/technic.png create mode 100644 src/controllers/bigram.js diff --git a/client/public/about/index.html b/client/public/about/index.html deleted file mode 100644 index eb72cf4..0000000 --- a/client/public/about/index.html +++ /dev/null @@ -1,43 +0,0 @@ - - - LegoLog: About - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/client/public/components/basket-popout.mjs b/client/public/components/basket-popout.mjs index bda359b..b46c4e8 100644 --- a/client/public/components/basket-popout.mjs +++ b/client/public/components/basket-popout.mjs @@ -139,7 +139,8 @@ class BasketPopout extends Component { + quantity="${item.quantity}" + modifier="${key.split('~')[1] || ''}"> `; @@ -224,6 +225,7 @@ class BasketPopout extends Component { } .popup-content-item { + background-color: #F5F6F6; display: flex; flex-direction: row; flex-wrap: nowrap; @@ -237,6 +239,7 @@ class BasketPopout extends Component { } .sc-listing { + flex-basis: 100%; flex-grow: 3; } diff --git a/client/public/components/compact-listing.mjs b/client/public/components/compact-listing.mjs index 873e3e5..4d3a0f2 100644 --- a/client/public/components/compact-listing.mjs +++ b/client/public/components/compact-listing.mjs @@ -7,6 +7,17 @@ class CompactProductListing extends Component { super(CompactProductListing); } + OnMount() { + console.log(this.state); + if (this.state.tags) { + const tags = JSON.parse(this.state.tags); + this.setState({ + ...this.getState, + tags, + }, false); + } + } + Render() { return { template: /* html */` @@ -20,6 +31,9 @@ class CompactProductListing extends Component {
{this.state.name} {this.state.id}
+ ${this.state.tags + ? this.state.tags.map(tag => ``).join('') + : ''} ${this.state.discount ? `£${parseFloat(this.state.price).toFixed(2)}£${parseFloat(this.state.discount).toFixed(2)}` : `£${parseFloat(this.state.price).toFixed(2)}`} diff --git a/client/public/components/product-list.mjs b/client/public/components/product-list.mjs index b2d717c..23e75df 100644 --- a/client/public/components/product-list.mjs +++ b/client/public/components/product-list.mjs @@ -38,9 +38,12 @@ class ProductList extends Component { this.keepLoading = true; this.loadingBar = ` -
- -
+
+
+
+ Loading... +
+
`; } @@ -55,6 +58,7 @@ class ProductList extends Component { listing="${product.listing}" price="${product.price}" type="${product.type}" + tags="${JSON.stringify(product.tags).replace(/"/g, '"')}" discount="${product.discount || ''}"> `; }).join('')} @@ -86,66 +90,49 @@ class ProductList extends Component { border: none; } - .product-list-loader { + .product-list-loader-container-container { display: flex; justify-content: center; } - .lds-ellipsis { - display: inline-block; - position: relative; - width: 80px; - height: 80px; - z-index: 0; + @keyframes grow-shrink { + 0% { + transform: scale(1); + } + 50% { + transform: scale(1.4); + } + 100% { + transform: scale(1); + } } - .lds-ellipsis div { - position: absolute; - top: 33px; - width: 13px; - height: 13px; + + @keyframes shrink-grow { + 0% { + transform: scale(1.4); + } + 50% { + transform: scale(0.9); + } + 100% { + transform: scale(1.4); + } + } + + .product-list-loader-container { + display: flex; + justify-content: center; + width: 100px; border-radius: 50%; - background: #7F5CFF; - animation-timing-function: cubic-bezier(0, 1, 1, 0); + background-color: #D7C2FF; + /* grow and shrink sine wave */ + animation-timing-function: ease-in-out; + animation: grow-shrink 1s infinite; } - .lds-ellipsis div:nth-child(1) { - left: 8px; - animation: lds-ellipsis1 0.6s infinite; - } - .lds-ellipsis div:nth-child(2) { - left: 8px; - animation: lds-ellipsis2 0.6s infinite; - } - .lds-ellipsis div:nth-child(3) { - left: 32px; - animation: lds-ellipsis2 0.6s infinite; - } - .lds-ellipsis div:nth-child(4) { - left: 56px; - animation: lds-ellipsis3 0.6s infinite; - } - @keyframes lds-ellipsis1 { - 0% { - transform: scale(0); - } - 100% { - transform: scale(1); - } - } - @keyframes lds-ellipsis3 { - 0% { - transform: scale(1); - } - 100% { - transform: scale(0); - } - } - @keyframes lds-ellipsis2 { - 0% { - transform: translate(0, 0); - } - 100% { - transform: translate(24px, 0); - } + + .product-list-loader { + animation-timing-function: ease-in-out; + animation: shrink-grow 1s infinite; } @media (pointer:none), (pointer:coarse), screen and (max-width: 900px) { diff --git a/client/public/components/search.mjs b/client/public/components/search.mjs index 7ea3839..c885dc5 100644 --- a/client/public/components/search.mjs +++ b/client/public/components/search.mjs @@ -103,7 +103,7 @@ class Search extends Component { const res = /* html */` diff --git a/client/public/components/storefront.mjs b/client/public/components/storefront.mjs index 0f16b2f..32c7e2b 100644 --- a/client/public/components/storefront.mjs +++ b/client/public/components/storefront.mjs @@ -19,10 +19,10 @@ class StoreFront extends Component {