@ppg_pl/tinting 0.0.4 → 0.0.7
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.
- package/dist/cjs/{index-0a139db0.js → index-b6962659.js} +51 -4
- package/dist/cjs/index-b6962659.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/modal-header_9.cjs.entry.js +198 -60
- package/dist/cjs/modal-header_9.cjs.entry.js.map +1 -1
- package/dist/cjs/tinting.cjs.js +2 -2
- package/dist/collection/components/colorinfo/index.js +135 -1
- package/dist/collection/components/colorinfo/index.js.map +1 -1
- package/dist/collection/components/component/index.js +64 -1
- package/dist/collection/components/component/index.js.map +1 -1
- package/dist/collection/components/modal/index.css +176 -1
- package/dist/collection/components/modal/index.js +120 -33
- package/dist/collection/components/modal/index.js.map +1 -1
- package/dist/collection/components/slider/index.css +24 -6
- package/dist/collection/components/slider/index.js +32 -21
- package/dist/collection/components/slider/index.js.map +1 -1
- package/dist/collection/types.js.map +1 -1
- package/dist/components/index10.js +82 -36
- package/dist/components/index10.js.map +1 -1
- package/dist/components/index8.js +80 -2
- package/dist/components/index8.js.map +1 -1
- package/dist/components/index9.js +34 -23
- package/dist/components/index9.js.map +1 -1
- package/dist/components/my-component.js +13 -2
- package/dist/components/my-component.js.map +1 -1
- package/dist/esm/{index-f3be6531.js → index-cb79645d.js} +51 -4
- package/dist/esm/index-cb79645d.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/modal-header_9.entry.js +198 -60
- package/dist/esm/modal-header_9.entry.js.map +1 -1
- package/dist/esm/tinting.js +3 -3
- package/dist/tinting/p-4ec5261b.entry.js +15 -0
- package/dist/tinting/p-4ec5261b.entry.js.map +1 -0
- package/dist/tinting/p-5b9dc044.js +3 -0
- package/dist/tinting/p-5b9dc044.js.map +1 -0
- package/dist/tinting/tinting.esm.js +1 -1
- package/dist/tinting/tinting.esm.js.map +1 -1
- package/dist/types/components/colorinfo/index.d.ts +17 -1
- package/dist/types/components/component/index.d.ts +8 -0
- package/dist/types/components/modal/index.d.ts +6 -1
- package/dist/types/components.d.ts +16 -2
- package/dist/types/types.d.ts +4 -0
- package/package.json +3 -2
- package/www/build/p-4ec5261b.entry.js +15 -0
- package/www/build/p-4ec5261b.entry.js.map +1 -0
- package/www/build/p-5b9dc044.js +3 -0
- package/www/build/p-5b9dc044.js.map +1 -0
- package/www/build/tinting.esm.js +1 -1
- package/www/build/tinting.esm.js.map +1 -1
- package/www/index.html +76 -12
- package/dist/cjs/index-0a139db0.js.map +0 -1
- package/dist/esm/index-f3be6531.js.map +0 -1
- package/dist/tinting/p-b135c76f.js +0 -3
- package/dist/tinting/p-b135c76f.js.map +0 -1
- package/dist/tinting/p-d9e19fea.entry.js +0 -15
- package/dist/tinting/p-d9e19fea.entry.js.map +0 -1
- package/www/build/p-b135c76f.js +0 -3
- package/www/build/p-b135c76f.js.map +0 -1
- package/www/build/p-d9e19fea.entry.js +0 -15
- package/www/build/p-d9e19fea.entry.js.map +0 -1
|
@@ -3470,7 +3470,7 @@ Object.assign(chroma, {
|
|
|
3470
3470
|
valid
|
|
3471
3471
|
});
|
|
3472
3472
|
|
|
3473
|
-
const indexCss = "@import url(\"https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap\"); .tinting-wrapper *{font-family:\"Poppins\", sans-serif}.my-modal{box-shadow:1px 1px 1px #ccc;background-color:#fff;position:fixed;top:20px;left:50%;transform:translateX(-50%);max-width:1555px;width:90%;z-index:1000;text-align:center;padding:60px 40px;max-height:calc(100vh - 100px);overflow-y:auto;min-height:50vh}@media (max-width: 1024px){.my-modal{padding:40px 20px 20px}}.my-modal::-webkit-scrollbar{display:none}.my-modal .loader{display:flex;flex-direction:column;align-items:center;justify-content:center;height:300px}.my-modal__see-more{font-size:16px;display:flex;justify-content:left;align-items:center;font-weight:300;color:#575757;margin-top:12px;margin-bottom:0px}@media (max-width: 1024px){.my-modal__see-more{font-size:18px}}.my-modal__see-more img{width:45px;height:45px}@media (max-width: 1024px){.my-modal__see-more img{display:none}}.my-modal__see-more.big{font-size:20px;margin-bottom:8px}.my-modal__wrapper{display:flex;flex-direction:column;position:relative}.my-modal__wrapper .not-found{padding:100px 0px}.my-modal__wrapper .boxes{display:flex;flex-direction:column;flex-wrap:wrap}.my-modal__wrapper .boxes__list{display:flex;flex-wrap:wrap;gap:5px 5px}@media (max-width: 1024px){.my-modal__wrapper .boxes__list{justify-content:center}}.my-modal__wrapper .boxes__box-content{width:100%;margin-bottom:5px;height:500px;text-align:left;display:flex;flex-direction:row;justify-content:space-between;position:relative}.my-modal__wrapper .boxes__box-content .closebtn{position:absolute;right:10px;top:10px;width:53px;height:53px;cursor:pointer;object-fit:cover;z-index:9999}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content{flex-direction:column-reverse;height:auto}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content{margin:0 auto}}.my-modal__wrapper .boxes__box-content__info{width:40%;padding:50px 40px;position:relative}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info{width:100%;padding:15px;min-height:100px}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info{min-height:auto}}.my-modal__wrapper .boxes__box-content__info h2{font-size:35px;font-weight:normal;margin-bottom:30px;color:#232323}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info h2{font-size:16px;text-align:center;margin-bottom:15px;margin-top:5px}}.my-modal__wrapper .boxes__box-content__info h4{margin-top:0px;margin-bottom:15px;font-size:16px;color:#4c4c4c}.my-modal__wrapper .boxes__box-content__info .divider{border:1px solid #4c4c4c;opacity:0.2;margin-bottom:20px}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info .divider{margin:10px 0px;display:none}}.my-modal__wrapper .boxes__box-content__info__value{display:flex;flex-direction:row;justify-content:flex-start}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value{justify-content:flex-start}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value{flex-direction:column}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-image{margin:0 auto;margin-bottom:10px}}.my-modal__wrapper .boxes__box-content__info__value-image img{width:114px;object-fit:cover}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-image img{width:75px}}.my-modal__wrapper .boxes__box-content__info__value-product{color:#232323;margin-left:10px}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product h2{font-size:26px;margin:0;margin-right:10px}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product h2{font-size:16px}}.my-modal__wrapper .boxes__box-content__info__value-product p{font-size:20px;margin-top:0px;margin-bottom:0px}.my-modal__wrapper .boxes__box-content__info__value-product p:last-of-type{margin-bottom:20px}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product p:last-of-type{margin-bottom:0}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product p{font-size:10px}}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product>div{display:flex;justify-content:flex-start;align-items:center}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product>div{flex-direction:column}}.my-modal__wrapper .boxes__box-content__slider{width:60%;min-width:60%;max-width:60%;position:relative}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__slider{width:100%;display:block;min-width:100%;max-width:100%}}.my-modal__wrapper .boxes__box-content__slider .color-big-image{width:100%;height:100%;object-fit:cover}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__slider .color-big-image{height:300px}}.my-modal__wrapper .boxes__box-content__white *{color:#fff}.my-modal__wrapper .boxes__box-content__white h2{color:#fff}.my-modal__wrapper .pagination{margin:10px 0px;font-size:16px;display:flex;flex-direction:row;align-items:center;justify-content:center}.my-modal__wrapper .pagination>span{margin:0 3px;cursor:pointer;min-width:20px;padding:5px;box-shadow:1px 1px 1px #ccc}.my-modal__wrapper .pagination .current{background-color:wheat}.my-modal .categories{padding-bottom:20px;margin-bottom:20px;border-bottom:1px solid #dfdfdf;display:flex;flex-direction:column;align-items:flex-start}.my-modal .categories__container{display:flex;flex-wrap:nowrap;gap:5px 5px;overflow-x:auto;width:100%}@media (max-width: 1024px){.my-modal .categories__container{padding-bottom:5px}}.my-modal .categories__slide-information{display:flex;flex-direction:row;align-items:center;justify-content:space-between}.my-modal .categories__slide-information span{color:#4c4c4c;font-size:16px;font-weight:normal}.my-modal .categories__slide-information span:first-of-type{margin-left:7px}.my-modal .categories__slide-information span:last-of-type{margin-right:7px}.my-modal .button,.my-modal a{background-color:#fff;font-size:16px;box-shadow:0px 10px 20px rgba(0, 0, 0, 0.1);border-radius:22px;padding:10px 35px;color:#232323;text-decoration:none;display:block;text-align:center;transition:all 0.7s ease-in-out;border:none;cursor:pointer}.my-modal .button:hover,.my-modal a:hover{color:#fff;background-color:#232323}.my-modal .button.brown,.my-modal a.brown{background-color:#3c2114;color:#fff}.my-modal .button.brown:hover,.my-modal a.brown:hover{color:#fff;background-color:#232323}.my-modal .button.inverse,.my-modal a.inverse{background-color:#232323;color:#fff}.my-modal .button.inverse:hover,.my-modal a.inverse:hover{color:#232323;background-color:#fff}@media (max-width: 1024px){.my-modal .button,.my-modal a{max-width:150px;font-size:13px;padding:12px 25px}}@media (max-width: 768px){.my-modal .button,.my-modal a{margin:0 auto}}.my-modal>.button{margin:10px auto}";
|
|
3473
|
+
const indexCss = "@import url(\"https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap\"); .tinting-wrapper *{font-family:\"Poppins\", sans-serif}.my-modal{box-shadow:1px 1px 1px #ccc;background-color:#fff;position:fixed;top:20px;left:50%;transform:translateX(-50%);max-width:1555px;width:90%;z-index:1000;text-align:center;padding:60px 40px;max-height:calc(100vh - 100px);overflow-y:auto;min-height:50vh}@media (max-width: 1024px){.my-modal{padding:40px 20px 20px}}.my-modal::-webkit-scrollbar{display:none}.my-modal .loader{display:flex;flex-direction:column;align-items:center;justify-content:center;height:300px}.my-modal__see-more{font-size:16px;display:flex;justify-content:left;align-items:center;font-weight:300;color:#575757;margin-top:12px;margin-bottom:0px}@media (max-width: 1024px){.my-modal__see-more{font-size:18px}}.my-modal__see-more img{width:45px;height:45px}@media (max-width: 1024px){.my-modal__see-more img{display:none}}.my-modal__see-more.big{font-size:20px;margin-bottom:8px}.my-modal__wrapper{display:flex;flex-direction:column;position:relative}.my-modal__wrapper .not-found{padding:100px 0px}.my-modal__wrapper .boxes{display:flex;flex-direction:column;flex-wrap:wrap}.my-modal__wrapper .boxes__list{display:flex;flex-wrap:wrap;gap:5px 5px}@media (max-width: 1024px){.my-modal__wrapper .boxes__list{justify-content:center}}.my-modal__wrapper .boxes__box-content{width:100%;margin-bottom:5px;height:500px;text-align:left;display:flex;flex-direction:row;justify-content:space-between;position:relative}.my-modal__wrapper .boxes__box-content .closebtn{position:absolute;right:10px;top:10px;width:53px;height:53px;cursor:pointer;object-fit:cover;z-index:9999}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content{flex-direction:column-reverse;height:auto}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content{margin:0 auto}}.my-modal__wrapper .boxes__box-content__info{width:40%;padding:50px 40px;position:relative}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info{width:100%;padding:15px;min-height:100px}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info{min-height:auto}}.my-modal__wrapper .boxes__box-content__info h2{font-size:35px;font-weight:normal;margin-bottom:30px;color:#232323}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info h2{font-size:16px;text-align:center;margin-bottom:15px;margin-top:5px}}.my-modal__wrapper .boxes__box-content__info h4{margin-top:0px;margin-bottom:15px;font-size:16px;color:#4c4c4c}.my-modal__wrapper .boxes__box-content__info .divider{border:1px solid #4c4c4c;opacity:0.2;margin-bottom:20px}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info .divider{margin:10px 0px;display:none}}.my-modal__wrapper .boxes__box-content__info__value{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;gap:20px}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value{justify-content:flex-start;margin-top:30px}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value{flex-direction:column}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-image{margin:0 auto;margin-bottom:10px}}.my-modal__wrapper .boxes__box-content__info__value-image img{width:114px;object-fit:cover}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-image img{width:75px}}.my-modal__wrapper .boxes__box-content__info__value-product{color:#232323;margin-left:10px}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product h2{font-size:26px;margin:0;margin-right:10px}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product h2{font-size:16px}}.my-modal__wrapper .boxes__box-content__info__value-product p{font-size:20px;margin-top:0px;margin-bottom:0px}.my-modal__wrapper .boxes__box-content__info__value-product p:last-of-type{margin-bottom:20px}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product p:last-of-type{margin-bottom:0}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product p{font-size:10px}}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product>div{display:flex;justify-content:flex-start;align-items:center}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product>div{flex-direction:column}}.my-modal__wrapper .boxes__box-content__info__tester{display:flex;flex-direction:column;gap:15px;width:100%}.my-modal__wrapper .boxes__box-content__info__tester .tester-text h2{margin:0 0 10px;font-size:18px;font-weight:700}.my-modal__wrapper .boxes__box-content__info__tester .tester-text p{margin:0;font-size:14px}.my-modal__wrapper .boxes__box-content__info__tester .tester-buy{display:flex;align-items:center;gap:15px;width:100%;flex-wrap:nowrap;min-width:0}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__tester .tester-buy{flex-direction:column;align-items:flex-start}}.my-modal__wrapper .boxes__box-content__info .price{font-size:20px;font-weight:600}.my-modal__wrapper .boxes__box-content__slider{width:60%;min-width:60%;max-width:60%;position:relative}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__slider{width:100%;display:block;min-width:100%;max-width:100%}}.my-modal__wrapper .boxes__box-content__slider .color-big-image{width:100%;height:100%;object-fit:cover}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__slider .color-big-image{height:300px}}.my-modal__wrapper .boxes__box-content__white *{color:#fff}.my-modal__wrapper .boxes__box-content__white h2{color:#fff}.my-modal__wrapper .pagination{margin:10px 0px;font-size:16px;display:flex;flex-direction:row;align-items:center;justify-content:center}.my-modal__wrapper .pagination>span{margin:0 3px;cursor:pointer;min-width:20px;padding:5px;box-shadow:1px 1px 1px #ccc}.my-modal__wrapper .pagination .current{background-color:wheat}.my-modal .categories{padding-bottom:20px;margin-bottom:20px;border-bottom:1px solid #dfdfdf;display:flex;flex-direction:column;align-items:flex-start}.my-modal .categories__container{display:flex;flex-wrap:nowrap;gap:5px 5px;overflow-x:auto;width:100%}@media (max-width: 1024px){.my-modal .categories__container{padding-bottom:5px}}.my-modal .categories__slide-information{display:flex;flex-direction:row;align-items:center;justify-content:space-between}.my-modal .categories__slide-information span{color:#4c4c4c;font-size:16px;font-weight:normal}.my-modal .categories__slide-information span:first-of-type{margin-left:7px}.my-modal .categories__slide-information span:last-of-type{margin-right:7px}.my-modal .button,.my-modal a{background-color:#fff;font-size:16px;box-shadow:0px 10px 20px rgba(0, 0, 0, 0.1);border-radius:22px;padding:10px 35px;color:#232323;text-decoration:none;display:block;text-align:center;transition:all 0.7s ease-in-out;border:none;cursor:pointer;display:flex;align-items:center;gap:5px}.my-modal .button .shape-icon,.my-modal a .shape-icon{display:inline-flex}.my-modal .button .shape-icon svg,.my-modal a .shape-icon svg{display:block}.my-modal .button .shape-icon path,.my-modal .button .shape-icon .shape-icon__path,.my-modal a .shape-icon path,.my-modal a .shape-icon .shape-icon__path{fill:currentColor;transition:fill 0.7s ease-in-out}.my-modal .button.fit,.my-modal a.fit{padding:10px 15px}.my-modal .button:hover,.my-modal a:hover{color:#fff;background-color:#232323}.my-modal .button.brown,.my-modal a.brown{background-color:#3c2114;color:#fff}.my-modal .button.brown:hover,.my-modal a.brown:hover{color:#fff;background-color:#232323}.my-modal .button.inverse,.my-modal a.inverse{background-color:#232323;color:#fff}.my-modal .button.inverse:hover,.my-modal a.inverse:hover{color:#232323;background-color:#fff}.my-modal .button.inverse svg path,.my-modal a.inverse svg path{fill:#fff}.my-modal .button:disabled,.my-modal .button.disabled,.my-modal a:disabled,.my-modal a.disabled{cursor:not-allowed;opacity:0.5}.my-modal .button.is-loading,.my-modal a.is-loading{position:relative;cursor:wait}.my-modal .button.is-loading:hover,.my-modal a.is-loading:hover{background-color:inherit;color:inherit}.my-modal .button.is-loading .button-content,.my-modal a.is-loading .button-content{visibility:hidden}.my-modal .button.is-loading .spinner,.my-modal a.is-loading .spinner{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;animation:basket-spin 0.9s linear infinite;color:currentColor}.my-modal .button.is-loading .spinner svg,.my-modal a.is-loading .spinner svg{display:block}.my-modal .button .button-content,.my-modal a .button-content{display:inline-flex;align-items:center;gap:5px}@media (max-width: 1024px){.my-modal .button,.my-modal a{max-width:150px;font-size:13px;padding:12px 25px}}@media (max-width: 768px){.my-modal .button,.my-modal a{margin:0 auto}}.my-modal>.button{margin:10px auto}.my-modal .basket-status{cursor:default;pointer-events:none;max-width:100%;min-width:0}.my-modal .basket-status--success{display:inline-flex;align-items:center;gap:10px;padding:12px 18px;background-color:#fff;color:#232323;border-radius:28px 28px 28px 0;box-shadow:0px 10px 20px rgba(0, 0, 0, 0.1);font-size:14px;white-space:nowrap;animation:basket-success-in 0.25s ease-out;max-width:100%;min-width:0;flex:1 1 auto}.my-modal .basket-status--success>span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis}.my-modal .basket-status--success .check-icon{display:inline-flex;color:#2bb673}.my-modal .basket-status--success .check-icon svg{display:block;width:20px;height:20px}.my-modal .basket-status--success strong{font-weight:700}.my-modal .basket-status--success.inverse{background-color:#232323;color:#fff}.my-modal .basket-status--success.brown{background-color:#3c2114;color:#fff}@media (max-width: 1024px){.my-modal .basket-status--success{font-size:13px;padding:12px 22px;border-radius:22px 22px 22px 0;white-space:normal;width:100%;justify-content:center}}@keyframes basket-spin{to{transform:rotate(360deg)}}@keyframes basket-success-in{from{opacity:0;transform:translateX(-8px)}to{opacity:1;transform:translateX(0)}}";
|
|
3474
3474
|
|
|
3475
3475
|
const Modal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
3476
3476
|
constructor() {
|
|
@@ -3539,6 +3539,8 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
3539
3539
|
this.shop = undefined;
|
|
3540
3540
|
this.product = undefined;
|
|
3541
3541
|
this.baselink = undefined;
|
|
3542
|
+
this.available_testers = undefined;
|
|
3543
|
+
this.price = undefined;
|
|
3542
3544
|
this.selectedcolor = undefined;
|
|
3543
3545
|
this.arrowDown = 'arrow_down.png';
|
|
3544
3546
|
this.chunksNum = 12;
|
|
@@ -3593,6 +3595,9 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
3593
3595
|
handleEmitColor(event) {
|
|
3594
3596
|
this.onSelectedColorEmit.emit(event.detail);
|
|
3595
3597
|
}
|
|
3598
|
+
addToBasketHandler(event) {
|
|
3599
|
+
return event.detail.id;
|
|
3600
|
+
}
|
|
3596
3601
|
handleResize() {
|
|
3597
3602
|
this.calculateBoxCount();
|
|
3598
3603
|
this.displayForMobile();
|
|
@@ -3610,10 +3615,20 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
3610
3615
|
let mostSimilarIndex = 0;
|
|
3611
3616
|
let minDistance = Infinity;
|
|
3612
3617
|
remainingColors.forEach((color, index) => {
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3618
|
+
try {
|
|
3619
|
+
// Validate hex colors before calculating distance
|
|
3620
|
+
if (!color.hex || !lastColor.hex) {
|
|
3621
|
+
return;
|
|
3622
|
+
}
|
|
3623
|
+
const distance = chroma.distance(lastColor.hex, color.hex, 'lab');
|
|
3624
|
+
if (distance < minDistance) {
|
|
3625
|
+
minDistance = distance;
|
|
3626
|
+
mostSimilarIndex = index;
|
|
3627
|
+
}
|
|
3628
|
+
}
|
|
3629
|
+
catch (error) {
|
|
3630
|
+
console.warn(`Error calculating color distance for ${color.hex}:`, error);
|
|
3631
|
+
// Skip this color if it causes an error
|
|
3617
3632
|
}
|
|
3618
3633
|
});
|
|
3619
3634
|
// Move the most similar color to sortedColors
|
|
@@ -3622,36 +3637,65 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
3622
3637
|
return sortedColors;
|
|
3623
3638
|
}
|
|
3624
3639
|
getColorHueGroup(hex) {
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
return '
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3640
|
+
try {
|
|
3641
|
+
// Validate hex format and handle invalid colors
|
|
3642
|
+
if (!hex || typeof hex !== 'string') {
|
|
3643
|
+
return 'other';
|
|
3644
|
+
}
|
|
3645
|
+
// Basic hex validation
|
|
3646
|
+
const cleanHex = hex.startsWith('#') ? hex : `#${hex}`;
|
|
3647
|
+
if (!/^#[0-9A-Fa-f]{6}$/.test(cleanHex)) {
|
|
3648
|
+
console.warn(`Invalid hex color format: ${hex}`);
|
|
3649
|
+
return 'other';
|
|
3650
|
+
}
|
|
3651
|
+
const color = chroma(cleanHex);
|
|
3652
|
+
const hue = color.get('hsl.h');
|
|
3653
|
+
const saturation = color.get('hsl.s');
|
|
3654
|
+
const lightness = color.get('hsl.l');
|
|
3655
|
+
// Handle grayscale colors
|
|
3656
|
+
if (saturation < 0.1) {
|
|
3657
|
+
if (lightness < 0.2)
|
|
3658
|
+
return 'black';
|
|
3659
|
+
if (lightness > 0.8)
|
|
3660
|
+
return 'white';
|
|
3661
|
+
return 'gray';
|
|
3662
|
+
}
|
|
3663
|
+
// Group colors by hue ranges
|
|
3664
|
+
if (hue >= 330 || hue < 30)
|
|
3665
|
+
return 'red';
|
|
3666
|
+
if (hue >= 30 && hue < 90)
|
|
3667
|
+
return 'yellow';
|
|
3668
|
+
if (hue >= 90 && hue < 150)
|
|
3669
|
+
return 'green';
|
|
3670
|
+
if (hue >= 150 && hue < 210)
|
|
3671
|
+
return 'cyan';
|
|
3672
|
+
if (hue >= 210 && hue < 270)
|
|
3673
|
+
return 'blue';
|
|
3674
|
+
if (hue >= 270 && hue < 330)
|
|
3675
|
+
return 'magenta';
|
|
3676
|
+
return 'other';
|
|
3677
|
+
}
|
|
3678
|
+
catch (error) {
|
|
3679
|
+
console.warn(`Error parsing color "${hex}":`, error);
|
|
3680
|
+
return 'other';
|
|
3681
|
+
}
|
|
3651
3682
|
}
|
|
3652
3683
|
sortColorsByHueAndSimilarity(colors) {
|
|
3653
3684
|
if ((colors === null || colors === void 0 ? void 0 : colors.length) <= 1)
|
|
3654
3685
|
return colors;
|
|
3686
|
+
// Filter out colors with invalid hex values
|
|
3687
|
+
const validColors = colors.filter(color => {
|
|
3688
|
+
if (!color.hex || typeof color.hex !== 'string') {
|
|
3689
|
+
console.warn(`Color missing hex value:`, color);
|
|
3690
|
+
return false;
|
|
3691
|
+
}
|
|
3692
|
+
const cleanHex = color.hex.startsWith('#') ? color.hex : `#${color.hex}`;
|
|
3693
|
+
const isValid = /^#[0-9A-Fa-f]{6}$/.test(cleanHex);
|
|
3694
|
+
if (!isValid) {
|
|
3695
|
+
console.warn(`Invalid hex color format: ${color.hex} for color:`, color);
|
|
3696
|
+
}
|
|
3697
|
+
return isValid;
|
|
3698
|
+
});
|
|
3655
3699
|
// Group valid colors by their hue family
|
|
3656
3700
|
const colorGroups = {
|
|
3657
3701
|
red: [],
|
|
@@ -3665,7 +3709,7 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
3665
3709
|
white: [],
|
|
3666
3710
|
other: [],
|
|
3667
3711
|
};
|
|
3668
|
-
|
|
3712
|
+
validColors.forEach(color => {
|
|
3669
3713
|
const group = this.getColorHueGroup(color.hex);
|
|
3670
3714
|
colorGroups[group].push(color);
|
|
3671
3715
|
});
|
|
@@ -3677,7 +3721,7 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
3677
3721
|
sortedGroups.push(this.sortColorsBySimilarity(colorGroups[groupName]));
|
|
3678
3722
|
}
|
|
3679
3723
|
});
|
|
3680
|
-
// Combine all sorted groups
|
|
3724
|
+
// Combine all sorted groups
|
|
3681
3725
|
return sortedGroups.flat();
|
|
3682
3726
|
}
|
|
3683
3727
|
async fetchColorsData({ reset = false } = {}) {
|
|
@@ -3834,7 +3878,7 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
3834
3878
|
var _a;
|
|
3835
3879
|
return (h("div", { class: `my-modal`, onMouseEnter: () => this.handleReadyToClose(false), onMouseLeave: () => this.handleReadyToClose(true) }, this.preloader && (h("div", { class: 'loader' }, h("my-loader", null))), !this.preloader && this.data && (h("modal-header", { modalName: this.data.modalName, modalLogo: this.data.modalLogo ? `${APIURL}/assets/${this.data.modalLogo}?access_token=${accessToken}` : null, modalDescription: this.data.modalDescription, shop: this.shop, productName: this.data.name, productSamples: this.data.productSamples, selectedColorFamily: this.filters.colorFamily, isMobile: this.isMobile, onCloseModal: () => this.closeModalHandler(), onSampleSelected: event => this.handleSampleSelect(event.detail), onOnLogoClick: () => this.resetAllFilters(), onOnResetCategory: () => this.resetSelectedCategory() })), h("div", { class: 'my-modal__wrapper' }, !this.preloader && (h("div", { class: 'container_boxes' }, !this.loading && this.colorsList.length === 0 && (h("div", { class: "not-found" }, h("p", null, "Nie zaleziono wynik\u00F3w wyszukiwania pod danym has\u0142em."), h("p", null, " Wpisz inn\u0105 nazw\u0119 b\u0105d\u017A numer koloru lub skorzystaj z kolekcji kolorystycznych."))), ((_a = this.colorsList) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
3836
3880
|
this.chunks(this.colorsList).map((color, index) => {
|
|
3837
|
-
var _a;
|
|
3881
|
+
var _a, _b;
|
|
3838
3882
|
return (h("div", { key: index, class: "boxes" }, h("div", { class: "boxes__list" }, color.map((c) => {
|
|
3839
3883
|
var _a;
|
|
3840
3884
|
return (h("my-colorbox", { key: c.id, onClick: () => {
|
|
@@ -3857,7 +3901,7 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
3857
3901
|
isImageInsteadHex: c.imageInsteadHex,
|
|
3858
3902
|
bigImage: c.bigImage,
|
|
3859
3903
|
} }));
|
|
3860
|
-
})), ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.id) && index === this.currentIndex && (h("my-colorinfo", { currentColor: this.currentColor, shop: this.shop, product: this.product, data: this.data, isMobile: this.isMobile, infoBoxWidth: this.infoBoxWidth, baselink: this.baselink }))));
|
|
3904
|
+
})), ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.id) && index === this.currentIndex && (h("my-colorinfo", { currentColor: this.currentColor, shop: this.shop, product: this.product, data: this.data, isMobile: this.isMobile, infoBoxWidth: this.infoBoxWidth, baselink: this.baselink, availableTesters: (_b = this.available_testers) === null || _b === void 0 ? void 0 : _b.find((tester) => { var _a, _b, _c; return ((_a = tester.color_name) === null || _a === void 0 ? void 0 : _a.trim().toLowerCase()) === ((_c = (_b = this.currentColor) === null || _b === void 0 ? void 0 : _b.name) === null || _c === void 0 ? void 0 : _c.trim().toLowerCase()); }), price: this.price }))));
|
|
3861
3905
|
}))), this.loading && h("my-loader", null)), !this.preloader && this.isMobile && (h("button", { class: "button", onClick: () => this.closeModalHandler() }, "Zamknij"))));
|
|
3862
3906
|
}
|
|
3863
3907
|
static get assetsDirs() { return ["assets"]; }
|
|
@@ -3871,6 +3915,8 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
3871
3915
|
"shop": [1],
|
|
3872
3916
|
"product": [1],
|
|
3873
3917
|
"baselink": [1],
|
|
3918
|
+
"available_testers": [16],
|
|
3919
|
+
"price": [2],
|
|
3874
3920
|
"selectedcolor": [1],
|
|
3875
3921
|
"arrowDown": [1, "arrow-down"],
|
|
3876
3922
|
"chunksNum": [32],
|
|
@@ -3892,7 +3938,7 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
3892
3938
|
"hasMore": [32],
|
|
3893
3939
|
"filters": [32],
|
|
3894
3940
|
"open": [64]
|
|
3895
|
-
}, [[0, "closeInfoBox", "closeInfoBoxHandler"], [0, "onCurrentColor", "handleEmitColor"], [9, "resize", "handleResize"], [0, "colorFamilySelected", "handleColorFamilySelected"], [0, "searchColors", "searchColorsHandler"]]]);
|
|
3941
|
+
}, [[0, "closeInfoBox", "closeInfoBoxHandler"], [0, "onCurrentColor", "handleEmitColor"], [0, "addToBasket", "addToBasketHandler"], [9, "resize", "handleResize"], [0, "colorFamilySelected", "handleColorFamilySelected"], [0, "searchColors", "searchColorsHandler"]]]);
|
|
3896
3942
|
function defineCustomElement() {
|
|
3897
3943
|
if (typeof customElements === "undefined") {
|
|
3898
3944
|
return;
|