cloudcommerce 0.26.7 → 0.28.0
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/.github/workflows/test-apps.yml +2 -2
- package/.gitmodules +0 -3
- package/.vscode/settings.json +3 -1
- package/CHANGELOG.md +51 -0
- package/action.yml +2 -2
- package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
- package/ecomplus-stores/barra-doce/functions/ssr/content/layout.json +13 -13
- package/ecomplus-stores/barra-doce/functions/ssr/content/pages/home.json +10 -10
- package/ecomplus-stores/barra-doce/functions/ssr/content/pages/products.json +17 -0
- package/ecomplus-stores/barra-doce/functions/ssr/content/settings.json +8 -8
- package/ecomplus-stores/barra-doce/functions/ssr/package.json +6 -6
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/AccountMenu.vue +11 -11
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopFooter.vue +24 -24
- package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageFooter.astro +4 -4
- package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barra-doce/package.json +2 -2
- package/ecomplus-stores/monocard/functions/many/package.json +3 -3
- package/ecomplus-stores/monocard/functions/ssr/content/layout.json +11 -11
- package/ecomplus-stores/monocard/functions/ssr/content/pages/home.json +16 -16
- package/ecomplus-stores/monocard/functions/ssr/content/pages/products.json +2 -4
- package/ecomplus-stores/monocard/functions/ssr/content/settings.json +11 -11
- package/ecomplus-stores/monocard/functions/ssr/package.json +6 -6
- package/ecomplus-stores/monocard/functions/ssr/src/components/AccountMenu.vue +1 -1
- package/ecomplus-stores/monocard/functions/ssr/src/components/DocDescription.vue +33 -0
- package/ecomplus-stores/monocard/functions/ssr/src/components/FeatureTabs.vue +3 -3
- package/ecomplus-stores/monocard/functions/ssr/src/components/ShopFooter.vue +3 -3
- package/ecomplus-stores/monocard/functions/ssr/src/components/ShopHeader.vue +5 -13
- package/ecomplus-stores/monocard/functions/ssr/src/layouts/PageFooter.astro +2 -2
- package/ecomplus-stores/monocard/functions/ssr/src/main/Home.astro +1 -1
- package/ecomplus-stores/monocard/functions/ssr/src/main/Sections.astro +1 -1
- package/ecomplus-stores/monocard/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/monocard/package.json +2 -2
- package/package.json +6 -6
- package/packages/api/package.json +1 -1
- package/packages/apps/affilate-program/package.json +2 -2
- package/packages/apps/correios/package.json +3 -4
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/package.json +3 -3
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/lib/functios-lib/utils.js +1 -1
- package/packages/apps/emails/lib/functios-lib/utils.js.map +1 -1
- package/packages/apps/emails/package.json +2 -2
- package/packages/apps/emails/src/functios-lib/utils.ts +1 -1
- package/packages/apps/fb-conversions/package.json +3 -3
- package/packages/apps/flash-courier/package.json +2 -2
- package/packages/apps/frenet/package.json +3 -3
- package/packages/apps/galaxpay/package.json +3 -3
- package/packages/apps/google-analytics/package.json +3 -3
- package/packages/apps/jadlog/package.json +2 -2
- package/packages/apps/loyalty-points/lib/functions-lib/cron-add-points.d.ts +2 -0
- package/packages/apps/loyalty-points/lib/functions-lib/cron-add-points.js +98 -0
- package/packages/apps/loyalty-points/lib/functions-lib/cron-add-points.js.map +1 -0
- package/packages/apps/loyalty-points/lib/functions-lib/handle-loyalty-points-event.js +59 -23
- package/packages/apps/loyalty-points/lib/functions-lib/handle-loyalty-points-event.js.map +1 -1
- package/packages/apps/loyalty-points/lib/loyalty-create-transaction.js +9 -4
- package/packages/apps/loyalty-points/lib/loyalty-create-transaction.js.map +1 -1
- package/packages/apps/loyalty-points/lib/loyalty-list-payments.js +7 -2
- package/packages/apps/loyalty-points/lib/loyalty-list-payments.js.map +1 -1
- package/packages/apps/loyalty-points/lib/loyalty-points-events.d.ts +3 -1
- package/packages/apps/loyalty-points/lib/loyalty-points-events.js +9 -0
- package/packages/apps/loyalty-points/lib/loyalty-points-events.js.map +1 -1
- package/packages/apps/loyalty-points/package.json +3 -2
- package/packages/apps/loyalty-points/src/functions-lib/cron-add-points.ts +104 -0
- package/packages/apps/loyalty-points/src/functions-lib/handle-loyalty-points-event.ts +67 -25
- package/packages/apps/loyalty-points/src/loyalty-create-transaction.ts +11 -4
- package/packages/apps/loyalty-points/src/loyalty-list-payments.ts +9 -2
- package/packages/apps/loyalty-points/src/loyalty-points-events.ts +12 -1
- package/packages/apps/melhor-envio/package.json +3 -3
- package/packages/apps/mercadopago/assets/onload-expression.js +5 -1
- package/packages/apps/mercadopago/assets/onload-expression.min.js +1 -1
- package/packages/apps/mercadopago/lib/mp-create-transaction.js +16 -6
- package/packages/apps/mercadopago/lib/mp-create-transaction.js.map +1 -1
- package/packages/apps/mercadopago/package.json +3 -3
- package/packages/apps/mercadopago/src/mp-create-transaction.ts +19 -7
- package/packages/apps/pagarme/package.json +3 -3
- package/packages/apps/paghiper/package.json +3 -3
- package/packages/apps/pix/package.json +3 -3
- package/packages/apps/tiny-erp/lib/integration/export-order-to-tiny.js +22 -0
- package/packages/apps/tiny-erp/lib/integration/export-order-to-tiny.js.map +1 -1
- package/packages/apps/tiny-erp/lib/integration/helpers/format-tiny-date.js +2 -2
- package/packages/apps/tiny-erp/lib/integration/helpers/format-tiny-date.js.map +1 -1
- package/packages/apps/tiny-erp/lib/integration/import-order-from-tiny.js +7 -1
- package/packages/apps/tiny-erp/lib/integration/import-order-from-tiny.js.map +1 -1
- package/packages/apps/tiny-erp/lib/integration/import-product-from-tiny.js +14 -5
- package/packages/apps/tiny-erp/lib/integration/import-product-from-tiny.js.map +1 -1
- package/packages/apps/tiny-erp/lib/integration/parsers/order-from-tiny.js +9 -1
- package/packages/apps/tiny-erp/lib/integration/parsers/order-from-tiny.js.map +1 -1
- package/packages/apps/tiny-erp/lib/integration/parsers/order-to-tiny.js +8 -6
- package/packages/apps/tiny-erp/lib/integration/parsers/order-to-tiny.js.map +1 -1
- package/packages/apps/tiny-erp/lib/integration/parsers/product-from-tiny.js +118 -38
- package/packages/apps/tiny-erp/lib/integration/parsers/product-from-tiny.js.map +1 -1
- package/packages/apps/tiny-erp/lib/integration/parsers/product-to-tiny.js +8 -0
- package/packages/apps/tiny-erp/lib/integration/parsers/product-to-tiny.js.map +1 -1
- package/packages/apps/tiny-erp/package.json +3 -3
- package/packages/apps/tiny-erp/src/integration/export-order-to-tiny.ts +24 -0
- package/packages/apps/tiny-erp/src/integration/helpers/format-tiny-date.ts +2 -2
- package/packages/apps/tiny-erp/src/integration/import-order-from-tiny.ts +8 -1
- package/packages/apps/tiny-erp/src/integration/import-product-from-tiny.ts +17 -5
- package/packages/apps/tiny-erp/src/integration/parsers/order-from-tiny.ts +13 -1
- package/packages/apps/tiny-erp/src/integration/parsers/order-to-tiny.ts +11 -6
- package/packages/apps/tiny-erp/src/integration/parsers/product-from-tiny.ts +144 -41
- package/packages/apps/tiny-erp/src/integration/parsers/product-to-tiny.ts +10 -0
- package/packages/apps/webhooks/package.json +3 -3
- package/packages/cli/package.json +1 -1
- package/packages/config/lib/config.js +2 -2
- package/packages/config/lib/config.js.map +1 -1
- package/packages/config/package.json +1 -1
- package/packages/config/src/config.ts +2 -2
- package/packages/emails/package.json +4 -4
- package/packages/eslint/base.eslintrc.cjs +3 -0
- package/packages/eslint/package.json +5 -4
- package/packages/eslint/storefront.eslintrc.cjs +8 -1
- package/packages/events/package.json +2 -2
- package/packages/feeds/package.json +1 -1
- package/packages/firebase/package.json +2 -2
- package/packages/i18n/package.json +1 -1
- package/packages/modules/package.json +3 -3
- package/packages/passport/package.json +2 -2
- package/packages/ssr/package.json +3 -3
- package/packages/storefront/.auto-imports.d.ts +65 -0
- package/packages/storefront/astro.config.mjs +24 -1
- package/packages/storefront/client.d.ts +1 -0
- package/packages/storefront/config/astro/context-directive.mjs +21 -0
- package/packages/storefront/config/astro/index.d.ts +8 -0
- package/packages/storefront/config/storefront.cms.js +2 -2
- package/packages/storefront/config/storefront.tailwind.cjs +0 -1
- package/packages/storefront/package.json +4 -3
- package/packages/storefront/server.d.ts +1 -1
- package/packages/storefront/src/lib/$storefront.d.ts +8 -8
- package/packages/storefront/src/lib/assets/base.css +5 -0
- package/packages/storefront/src/lib/components/Carousel.vue +93 -72
- package/packages/storefront/src/lib/components/CarouselControl.vue +13 -7
- package/packages/storefront/src/lib/components/ContentClearfix.vue +17 -0
- package/packages/storefront/src/lib/components/Drawer.vue +2 -2
- package/packages/storefront/src/lib/components/PaymentMethodFlag.vue +2 -2
- package/packages/storefront/src/lib/components/QuantitySelector.vue +4 -4
- package/packages/storefront/src/lib/components/QuantitySelectorControl.vue +2 -2
- package/packages/storefront/src/lib/components/ViewTransitions.astro +409 -0
- package/packages/storefront/src/lib/components/globals/AImg.vue +2 -1
- package/packages/storefront/src/lib/composables/use-pitch-bar.ts +2 -2
- package/packages/storefront/src/lib/content.d.ts +5 -5
- package/packages/storefront/src/lib/layouts/Base.astro +4 -4
- package/packages/storefront/src/lib/layouts/BaseBody.astro +0 -2
- package/packages/storefront/src/lib/layouts/BaseHead.astro +32 -14
- package/packages/storefront/src/lib/layouts/use-page-header.ts +9 -4
- package/packages/storefront/src/lib/layouts/use-page-main.ts +13 -33
- package/packages/test-base/package.json +1 -1
- package/packages/types/index.ts +14 -14
- package/packages/types/package.json +1 -1
- package/ecomplus-stores/iluminim/.devcontainer/devcontainer.json +0 -30
- package/ecomplus-stores/iluminim/.editorconfig +0 -13
- package/ecomplus-stores/iluminim/.eslintrc.cjs +0 -3
- package/ecomplus-stores/iluminim/.firebaserc +0 -5
- package/ecomplus-stores/iluminim/.github/renovate.json +0 -5
- package/ecomplus-stores/iluminim/.github/workflows/build-and-deploy.yml +0 -36
- package/ecomplus-stores/iluminim/.github/workflows/calibreapp-image-actions.yml +0 -23
- package/ecomplus-stores/iluminim/.gitpod.yml +0 -12
- package/ecomplus-stores/iluminim/.idx/dev.nix +0 -24
- package/ecomplus-stores/iluminim/.nvmrc +0 -1
- package/ecomplus-stores/iluminim/.vscode/extensions.json +0 -8
- package/ecomplus-stores/iluminim/.vscode/launch.json +0 -11
- package/ecomplus-stores/iluminim/.vscode/settings.json +0 -10
- package/ecomplus-stores/iluminim/README.md +0 -31
- package/ecomplus-stores/iluminim/SETUP.md +0 -117
- package/ecomplus-stores/iluminim/SETUP.pt-BR.md +0 -117
- package/ecomplus-stores/iluminim/functions/config.json +0 -3
- package/ecomplus-stores/iluminim/functions/example.env +0 -10
- package/ecomplus-stores/iluminim/functions/many/index.js +0 -14
- package/ecomplus-stores/iluminim/functions/many/package.json +0 -22
- package/ecomplus-stores/iluminim/functions/ssr/.eslintrc.cjs +0 -6
- package/ecomplus-stores/iluminim/functions/ssr/astro.config.mjs +0 -4
- package/ecomplus-stores/iluminim/functions/ssr/content/blog/.gitkeep +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/content/extra-pages/contato.json +0 -11
- package/ecomplus-stores/iluminim/functions/ssr/content/extra-pages/terms.json +0 -11
- package/ecomplus-stores/iluminim/functions/ssr/content/extra-pages/trocas.json +0 -11
- package/ecomplus-stores/iluminim/functions/ssr/content/layout.json +0 -57
- package/ecomplus-stores/iluminim/functions/ssr/content/pages/home.json +0 -70
- package/ecomplus-stores/iluminim/functions/ssr/content/settings.json +0 -65
- package/ecomplus-stores/iluminim/functions/ssr/index.js +0 -18
- package/ecomplus-stores/iluminim/functions/ssr/package.json +0 -31
- package/ecomplus-stores/iluminim/functions/ssr/public/admin/.gitkeep +0 -2
- package/ecomplus-stores/iluminim/functions/ssr/public/assets/cms-preview.css +0 -274
- package/ecomplus-stores/iluminim/functions/ssr/public/assets/cms.css +0 -114
- package/ecomplus-stores/iluminim/functions/ssr/public/assets/cvv.png +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/assets/img-placeholder.png +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/assets/payments.png +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/assets/ssl-safe.png +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/icon.png +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/large-icon.png +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/banner-chamada-desktop-9x81zmd91q.webp +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/banner2.webp +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/chamada-mobile-q1c6om6jx4.webp +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/ecom-icon.png +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/headphone.webp +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/logo.webp +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/og-image.png +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/passion.webp +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/rect8589.png +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/rect859.png +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/rect89.webp +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/public/robots.txt +0 -6
- package/ecomplus-stores/iluminim/functions/ssr/scripts/build.sh +0 -14
- package/ecomplus-stores/iluminim/functions/ssr/src/assets/style.css +0 -65
- package/ecomplus-stores/iluminim/functions/ssr/src/components/AccountMenu.vue +0 -95
- package/ecomplus-stores/iluminim/functions/ssr/src/components/Banner.vue +0 -57
- package/ecomplus-stores/iluminim/functions/ssr/src/components/BannersGrid.astro +0 -25
- package/ecomplus-stores/iluminim/functions/ssr/src/components/CartItem.vue +0 -64
- package/ecomplus-stores/iluminim/functions/ssr/src/components/CartSidebar.vue +0 -66
- package/ecomplus-stores/iluminim/functions/ssr/src/components/Countdown.vue +0 -79
- package/ecomplus-stores/iluminim/functions/ssr/src/components/HeroSlider.vue +0 -52
- package/ecomplus-stores/iluminim/functions/ssr/src/components/PitchBar.vue +0 -56
- package/ecomplus-stores/iluminim/functions/ssr/src/components/Prices.vue +0 -95
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ProductCard.vue +0 -117
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ProductShelf.vue +0 -57
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ProductsCountdown.vue +0 -20
- package/ecomplus-stores/iluminim/functions/ssr/src/components/SearchModal.vue +0 -6
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopFooter.vue +0 -149
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeader.vue +0 -158
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeaderMenu.vue +0 -58
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeaderSubmenu.vue +0 -88
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopSidenav.vue +0 -61
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopSidenavCategory.vue +0 -80
- package/ecomplus-stores/iluminim/functions/ssr/src/env.d.ts +0 -13
- package/ecomplus-stores/iluminim/functions/ssr/src/layouts/Base.astro +0 -16
- package/ecomplus-stores/iluminim/functions/ssr/src/layouts/Checkout.astro +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/layouts/PageFooter.astro +0 -68
- package/ecomplus-stores/iluminim/functions/ssr/src/layouts/PageHeader.astro +0 -42
- package/ecomplus-stores/iluminim/functions/ssr/src/main/Fallback.astro +0 -10
- package/ecomplus-stores/iluminim/functions/ssr/src/main/Home.astro +0 -49
- package/ecomplus-stores/iluminim/functions/ssr/src/main/Sections.astro +0 -42
- package/ecomplus-stores/iluminim/functions/ssr/src/main/Wildcard.astro +0 -18
- package/ecomplus-stores/iluminim/functions/ssr/src/pages/[...slug].astro +0 -40
- package/ecomplus-stores/iluminim/functions/ssr/src/pages/_vue.ts +0 -3
- package/ecomplus-stores/iluminim/functions/ssr/src/pages/app/account.astro +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/pages/app/index.astro +0 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/pages/index.astro +0 -37
- package/ecomplus-stores/iluminim/functions/ssr/src/pages/~fallback.astro +0 -25
- package/ecomplus-stores/iluminim/functions/ssr/src/scripts/InlineScripts.astro +0 -10
- package/ecomplus-stores/iluminim/functions/ssr/tailwind.config.cjs +0 -13
- package/ecomplus-stores/iluminim/functions/ssr/tsconfig.json +0 -12
- package/ecomplus-stores/iluminim/functions/ssr/uno.config.cjs +0 -5
- package/ecomplus-stores/iluminim/functions/with-apps/index.js +0 -12
- package/ecomplus-stores/iluminim/functions/with-apps/package.json +0 -22
- package/ecomplus-stores/iluminim/package.json +0 -31
- package/ecomplus-stores/iluminim/scripts/install.sh +0 -24
- package/ecomplus-stores/monocard/functions/ssr/src/components/DocDescription.astro +0 -30
- package/packages/storefront/src/lib/components/ContentClearfix.astro +0 -15
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
.loading {
|
|
2
|
-
position: fixed;
|
|
3
|
-
z-index: 9999;
|
|
4
|
-
height: 2em;
|
|
5
|
-
width: 2em;
|
|
6
|
-
overflow: show;
|
|
7
|
-
margin: auto;
|
|
8
|
-
top: 0;
|
|
9
|
-
left: 0;
|
|
10
|
-
bottom: 0;
|
|
11
|
-
right: 0;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.loading:before {
|
|
15
|
-
content: '';
|
|
16
|
-
display: block;
|
|
17
|
-
position: fixed;
|
|
18
|
-
top: 0;
|
|
19
|
-
left: 0;
|
|
20
|
-
width: 100%;
|
|
21
|
-
height: 100%;
|
|
22
|
-
background: radial-gradient(rgba(20, 20, 20,.8), rgba(0, 0, 0, .8));
|
|
23
|
-
background: -webkit-radial-gradient(rgba(20, 20, 20,.8), rgba(0, 0, 0,.8));
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.loading:not(:required) {
|
|
27
|
-
font: 0/0 a;
|
|
28
|
-
color: transparent;
|
|
29
|
-
text-shadow: none;
|
|
30
|
-
background-color: transparent;
|
|
31
|
-
border: 0;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.loading:not(:required):after {
|
|
35
|
-
content: '';
|
|
36
|
-
display: block;
|
|
37
|
-
font-size: 10px;
|
|
38
|
-
width: 1em;
|
|
39
|
-
height: 1em;
|
|
40
|
-
margin-top: -0.5em;
|
|
41
|
-
-webkit-animation: spinner 150ms infinite linear;
|
|
42
|
-
-moz-animation: spinner 150ms infinite linear;
|
|
43
|
-
-ms-animation: spinner 150ms infinite linear;
|
|
44
|
-
-o-animation: spinner 150ms infinite linear;
|
|
45
|
-
animation: spinner 150ms infinite linear;
|
|
46
|
-
border-radius: 0.5em;
|
|
47
|
-
-webkit-box-shadow: rgba(255,255,255, 0.75) 1.5em 0 0 0, rgba(255,255,255, 0.75) 1.1em 1.1em 0 0, rgba(255,255,255, 0.75) 0 1.5em 0 0, rgba(255,255,255, 0.75) -1.1em 1.1em 0 0, rgba(255,255,255, 0.75) -1.5em 0 0 0, rgba(255,255,255, 0.75) -1.1em -1.1em 0 0, rgba(255,255,255, 0.75) 0 -1.5em 0 0, rgba(255,255,255, 0.75) 1.1em -1.1em 0 0;
|
|
48
|
-
box-shadow: rgba(255,255,255, 0.75) 1.5em 0 0 0, rgba(255,255,255, 0.75) 1.1em 1.1em 0 0, rgba(255,255,255, 0.75) 0 1.5em 0 0, rgba(255,255,255, 0.75) -1.1em 1.1em 0 0, rgba(255,255,255, 0.75) -1.5em 0 0 0, rgba(255,255,255, 0.75) -1.1em -1.1em 0 0, rgba(255,255,255, 0.75) 0 -1.5em 0 0, rgba(255,255,255, 0.75) 1.1em -1.1em 0 0;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@-webkit-keyframes spinner {
|
|
52
|
-
0% {
|
|
53
|
-
-webkit-transform: rotate(0deg);
|
|
54
|
-
-moz-transform: rotate(0deg);
|
|
55
|
-
-ms-transform: rotate(0deg);
|
|
56
|
-
-o-transform: rotate(0deg);
|
|
57
|
-
transform: rotate(0deg);
|
|
58
|
-
}
|
|
59
|
-
100% {
|
|
60
|
-
-webkit-transform: rotate(360deg);
|
|
61
|
-
-moz-transform: rotate(360deg);
|
|
62
|
-
-ms-transform: rotate(360deg);
|
|
63
|
-
-o-transform: rotate(360deg);
|
|
64
|
-
transform: rotate(360deg);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
@-moz-keyframes spinner {
|
|
68
|
-
0% {
|
|
69
|
-
-webkit-transform: rotate(0deg);
|
|
70
|
-
-moz-transform: rotate(0deg);
|
|
71
|
-
-ms-transform: rotate(0deg);
|
|
72
|
-
-o-transform: rotate(0deg);
|
|
73
|
-
transform: rotate(0deg);
|
|
74
|
-
}
|
|
75
|
-
100% {
|
|
76
|
-
-webkit-transform: rotate(360deg);
|
|
77
|
-
-moz-transform: rotate(360deg);
|
|
78
|
-
-ms-transform: rotate(360deg);
|
|
79
|
-
-o-transform: rotate(360deg);
|
|
80
|
-
transform: rotate(360deg);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
@-o-keyframes spinner {
|
|
84
|
-
0% {
|
|
85
|
-
-webkit-transform: rotate(0deg);
|
|
86
|
-
-moz-transform: rotate(0deg);
|
|
87
|
-
-ms-transform: rotate(0deg);
|
|
88
|
-
-o-transform: rotate(0deg);
|
|
89
|
-
transform: rotate(0deg);
|
|
90
|
-
}
|
|
91
|
-
100% {
|
|
92
|
-
-webkit-transform: rotate(360deg);
|
|
93
|
-
-moz-transform: rotate(360deg);
|
|
94
|
-
-ms-transform: rotate(360deg);
|
|
95
|
-
-o-transform: rotate(360deg);
|
|
96
|
-
transform: rotate(360deg);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
@keyframes spinner {
|
|
100
|
-
0% {
|
|
101
|
-
-webkit-transform: rotate(0deg);
|
|
102
|
-
-moz-transform: rotate(0deg);
|
|
103
|
-
-ms-transform: rotate(0deg);
|
|
104
|
-
-o-transform: rotate(0deg);
|
|
105
|
-
transform: rotate(0deg);
|
|
106
|
-
}
|
|
107
|
-
100% {
|
|
108
|
-
-webkit-transform: rotate(360deg);
|
|
109
|
-
-moz-transform: rotate(360deg);
|
|
110
|
-
-ms-transform: rotate(360deg);
|
|
111
|
-
-o-transform: rotate(360deg);
|
|
112
|
-
transform: rotate(360deg);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/chamada-mobile-q1c6om6jx4.webp
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# workaround for cloudcommerce pnpm monorepo
|
|
4
|
-
filename="../../../packages/storefront/scripts/build-prod.sh"
|
|
5
|
-
if [[ -f $filename ]]; then
|
|
6
|
-
sh $filename
|
|
7
|
-
elif [[ -f "../$filename" ]]; then
|
|
8
|
-
sh "../$filename"
|
|
9
|
-
else
|
|
10
|
-
echo '> npx storefront build'
|
|
11
|
-
npx storefront build
|
|
12
|
-
fi
|
|
13
|
-
|
|
14
|
-
exit 0
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--custom-font-sans: "Heebo Variable";
|
|
3
|
-
}
|
|
4
|
-
html {
|
|
5
|
-
scroll-behavior: smooth;
|
|
6
|
-
}
|
|
7
|
-
body {
|
|
8
|
-
overflow-x: hidden;
|
|
9
|
-
}
|
|
10
|
-
a, button, button > * {
|
|
11
|
-
transition: background-color var(--transition),
|
|
12
|
-
color var(--transition), border-color var(--transition),
|
|
13
|
-
opacity var(--transition), transform var(--transition-fast);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.ui-link {
|
|
17
|
-
@apply not-prose font-semibold text-primary underline underline-offset-4
|
|
18
|
-
hover:text-primary-bold active:text-primary-subtle;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
[class*=ui-btn] {
|
|
22
|
-
@apply not-prose inline-block text-base font-medium px-4 py-2 rounded
|
|
23
|
-
border-2 border-transparent focus:ring-1 active:ring-2;
|
|
24
|
-
}
|
|
25
|
-
.ui-btn-sm {
|
|
26
|
-
@apply text-sm px-3 py-1.5 border-1;
|
|
27
|
-
}
|
|
28
|
-
.ui-btn-lg {
|
|
29
|
-
@apply font-bold px-6 py-2.5 active:ring-3;
|
|
30
|
-
}
|
|
31
|
-
.ui-btn-primary {
|
|
32
|
-
@apply primary border-primary hover:primary-bold ring-primary/30;
|
|
33
|
-
}
|
|
34
|
-
.ui-btn-secondary {
|
|
35
|
-
@apply bg-secondary-100/50 text-secondary border-secondary
|
|
36
|
-
hover:secondary ring-secondary/30;
|
|
37
|
-
}
|
|
38
|
-
.ui-btn-contrast {
|
|
39
|
-
@apply bg-white text-primary hover:bg-primary-100 ring-white/30;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.ui-text-brand, .ui-title {
|
|
43
|
-
@apply font-brand font-bold italic uppercase tracking-tight;
|
|
44
|
-
}
|
|
45
|
-
.ui-title {
|
|
46
|
-
@apply font-black not-prose text-3xl xl:text-5xl;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
[class*=ui-badge] {
|
|
50
|
-
@apply text-center px-2.5 py-0.5 rounded-md font-semibold
|
|
51
|
-
inline-block bg-secondary-200 text-secondary-900;
|
|
52
|
-
}
|
|
53
|
-
[class*=ui-badge-pill] {
|
|
54
|
-
@apply py-0 rounded-full;
|
|
55
|
-
}
|
|
56
|
-
.ui-badge-pill-sm {
|
|
57
|
-
@apply text-xs min-w-[1rem] px-0.5;
|
|
58
|
-
}
|
|
59
|
-
.ui-badge-pill-lg {
|
|
60
|
-
@apply text-lg min-w-[1.75rem] px-2;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.ui-section {
|
|
64
|
-
@apply container 2xl:max-w-7xl mx-auto px-4 sm:px-2 my-6 md:my-8;
|
|
65
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Menu
|
|
3
|
-
as="div"
|
|
4
|
-
class="relative text-center text-sm text-base-800"
|
|
5
|
-
v-slot="{ open }"
|
|
6
|
-
>
|
|
7
|
-
<div v-if="open">
|
|
8
|
-
<span v-once>{{ initializeFirebaseAuth() }}</span>
|
|
9
|
-
</div>
|
|
10
|
-
<MenuButton class="outline-none" :aria-label="$t.i19myAccount">
|
|
11
|
-
<slot name="button" v-bind="{ open }" />
|
|
12
|
-
</MenuButton>
|
|
13
|
-
<Fade>
|
|
14
|
-
<MenuItems class="absolute -right-8 mt-2 w-56
|
|
15
|
-
rounded shadow ring-1 ring-black/5 bg-white
|
|
16
|
-
divide-y divide-base-100 focus:outline-none">
|
|
17
|
-
<div class="p-3 text-base-600">
|
|
18
|
-
{{ `${$t.i19hello} ${customerName || $t.i19visitor}` }}
|
|
19
|
-
<AccountLink role="button" class="ui-btn-sm ui-btn-primary block my-1">
|
|
20
|
-
{{ $t.i19accessMyAccount }}
|
|
21
|
-
</AccountLink>
|
|
22
|
-
<AccountLink v-if="!isLogged" is-sign-up class="ui-link block">
|
|
23
|
-
{{ $t.i19createAnAccount }}
|
|
24
|
-
</AccountLink>
|
|
25
|
-
</div>
|
|
26
|
-
<ul class="list-none">
|
|
27
|
-
<MenuItem as="li" v-slot="{ active }">
|
|
28
|
-
<AccountLink
|
|
29
|
-
to="orders"
|
|
30
|
-
class="block p-2"
|
|
31
|
-
:class="active ? 'bg-base-100 text-primary' : null"
|
|
32
|
-
>
|
|
33
|
-
{{ $t.i19myOrders }}
|
|
34
|
-
</AccountLink>
|
|
35
|
-
</MenuItem>
|
|
36
|
-
<MenuItem as="li" v-slot="{ active }">
|
|
37
|
-
<AccountLink
|
|
38
|
-
to="favorites"
|
|
39
|
-
class="block p-2"
|
|
40
|
-
:class="active ? 'bg-base-100 text-primary' : null"
|
|
41
|
-
>
|
|
42
|
-
<i class="i-heart mr-1"></i>
|
|
43
|
-
{{ $t.i19myFavorites }}
|
|
44
|
-
</AccountLink>
|
|
45
|
-
</MenuItem>
|
|
46
|
-
<MenuItem
|
|
47
|
-
as="li"
|
|
48
|
-
v-slot="{ active }"
|
|
49
|
-
v-for="({ title, href }, i) in $settings.service_links"
|
|
50
|
-
:key="`s-${i}`"
|
|
51
|
-
>
|
|
52
|
-
<ALink
|
|
53
|
-
:href="href"
|
|
54
|
-
class="block p-2"
|
|
55
|
-
:class="active ? 'bg-base-100 text-primary' : null"
|
|
56
|
-
>
|
|
57
|
-
{{ title }}
|
|
58
|
-
</ALink>
|
|
59
|
-
</MenuItem>
|
|
60
|
-
<MenuItem as="li">
|
|
61
|
-
<div class="flex justify-center gap-2 p-2 text-base-500 text-base">
|
|
62
|
-
<span v-for="(href, network) in socialNetworks" :key="network">
|
|
63
|
-
<SocialNetworkLink :network="network" class="p-1 hover:text-primary" />
|
|
64
|
-
</span>
|
|
65
|
-
</div>
|
|
66
|
-
</MenuItem>
|
|
67
|
-
<MenuItem v-if="isLogged" as="li">
|
|
68
|
-
<button @click="logout" class="p-2 text-right text-base-800">
|
|
69
|
-
<span class="text-base-600">{{ $t.i19logout }}</span>
|
|
70
|
-
<i class="i-arrow-right-on-rectangle text-lg ml-1"></i>
|
|
71
|
-
</button>
|
|
72
|
-
</MenuItem>
|
|
73
|
-
</ul>
|
|
74
|
-
</MenuItems>
|
|
75
|
-
</Fade>
|
|
76
|
-
</Menu>
|
|
77
|
-
</template>
|
|
78
|
-
|
|
79
|
-
<script setup lang="ts">
|
|
80
|
-
import {
|
|
81
|
-
Menu,
|
|
82
|
-
MenuButton,
|
|
83
|
-
MenuItems,
|
|
84
|
-
MenuItem,
|
|
85
|
-
} from '@headlessui/vue';
|
|
86
|
-
import { socialNetworks } from '@@sf/sf-lib';
|
|
87
|
-
import {
|
|
88
|
-
customerName,
|
|
89
|
-
initializeFirebaseAuth,
|
|
90
|
-
isLogged,
|
|
91
|
-
logout,
|
|
92
|
-
} from '@@sf/state/customer-session';
|
|
93
|
-
import AccountLink from '@@sf/components/AccountLink.vue';
|
|
94
|
-
import SocialNetworkLink from '@@sf/components/SocialNetworkLink.vue';
|
|
95
|
-
</script>
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="mx-auto overflow-x-hidden"
|
|
4
|
-
:class="hasHeader ? 'grid grid-cols-1 md:grid-cols-2 items-center' : null"
|
|
5
|
-
>
|
|
6
|
-
<ALink
|
|
7
|
-
:href="href"
|
|
8
|
-
class="[&_img]:rounded-lg"
|
|
9
|
-
:class="hasHeader ? 'basis-1/2 grow-0 md:order-last' : '[&_img]:w-full'"
|
|
10
|
-
>
|
|
11
|
-
<slot name="picture" />
|
|
12
|
-
</ALink>
|
|
13
|
-
<div
|
|
14
|
-
v-if="hasHeader"
|
|
15
|
-
class="basis-1/2 grow-0 p-12 xl:ps-32 mb-3 md:mb-0"
|
|
16
|
-
>
|
|
17
|
-
<Component
|
|
18
|
-
v-if="parsedTitle"
|
|
19
|
-
:is="headingTag"
|
|
20
|
-
class="ui-title mt-1"
|
|
21
|
-
>
|
|
22
|
-
{{ parsedTitle }}
|
|
23
|
-
</Component>
|
|
24
|
-
<p v-if="parsedSubtitle" class="text-lg mt-4 md:mt-6">
|
|
25
|
-
{{ parsedSubtitle }}
|
|
26
|
-
</p>
|
|
27
|
-
<ALink
|
|
28
|
-
v-if="parsedButtonText"
|
|
29
|
-
:href="buttonLink"
|
|
30
|
-
class="ui-btn-lg ui-btn-contrast min-w-[150px] mt-7 md:mt-10"
|
|
31
|
-
>
|
|
32
|
-
{{ parsedButtonText }}
|
|
33
|
-
</ALink>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
</template>
|
|
37
|
-
|
|
38
|
-
<script setup lang="ts">
|
|
39
|
-
import {
|
|
40
|
-
type Props as UseBannerProps,
|
|
41
|
-
useBanner,
|
|
42
|
-
} from '@@sf/composables/use-banner';
|
|
43
|
-
|
|
44
|
-
export type Props = UseBannerProps & {
|
|
45
|
-
headingTag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
49
|
-
headingTag: 'h3',
|
|
50
|
-
});
|
|
51
|
-
const {
|
|
52
|
-
hasHeader,
|
|
53
|
-
parsedTitle,
|
|
54
|
-
parsedSubtitle,
|
|
55
|
-
parsedButtonText,
|
|
56
|
-
} = useBanner(props);
|
|
57
|
-
</script>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { Props as UseBannerProps } from '@@sf/composables/use-banner';
|
|
3
|
-
import BannerPictures from '@@sf/components/BannerPictures.astro';
|
|
4
|
-
import Banner from '~/components/Banner.vue';
|
|
5
|
-
|
|
6
|
-
export type Props = {
|
|
7
|
-
title?: string;
|
|
8
|
-
titleLink?: string;
|
|
9
|
-
banners: UseBannerProps[];
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const { banners } = Astro.props;
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
<section class="ui-section">
|
|
16
|
-
<ul class="flex flex-wrap lg:flex-nowrap gap-4">
|
|
17
|
-
{banners.map((banner) => (
|
|
18
|
-
<li class="lg:flex-1 [&_img]:w-full [&_img]:object-cover">
|
|
19
|
-
<Banner {...banner}>
|
|
20
|
-
<BannerPictures {...banner} slot="picture" />
|
|
21
|
-
</Banner>
|
|
22
|
-
</li>
|
|
23
|
-
))}
|
|
24
|
-
</ul>
|
|
25
|
-
</section>
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<article class="relative bg-white shadow-sm">
|
|
3
|
-
<ALink :href="link" class="flex items-center gap-5 p-4 group">
|
|
4
|
-
<AImg
|
|
5
|
-
v-if="image"
|
|
6
|
-
:picture="image"
|
|
7
|
-
:alt="title"
|
|
8
|
-
class="w-20 h-20 object-cover"
|
|
9
|
-
/>
|
|
10
|
-
<p class="py-2 flex-auto text-sm text-base-700
|
|
11
|
-
group-hover:text-base-900 group-hover:underline">
|
|
12
|
-
{{ title }}
|
|
13
|
-
</p>
|
|
14
|
-
</ALink>
|
|
15
|
-
<button
|
|
16
|
-
v-if="cartItem._id"
|
|
17
|
-
@click.stop="removeCartItem(cartItem._id)"
|
|
18
|
-
class="absolute top-0 right-0 p-2 opacity-70 hover:opacity-100"
|
|
19
|
-
:aria-label="$t.i19remove"
|
|
20
|
-
>
|
|
21
|
-
<span class="w-5 h-5 text-sm leading-none flex flex-col justify-center
|
|
22
|
-
rounded-full border-3 text-danger-800 border-danger-700/30">
|
|
23
|
-
<i class="i-close my-0 mx-auto"></i>
|
|
24
|
-
</span>
|
|
25
|
-
</button>
|
|
26
|
-
<div class="flex justify-between items-center border-t-2 border-base-100">
|
|
27
|
-
<div class="border-r-2 border-base-100">
|
|
28
|
-
<QuantitySelector
|
|
29
|
-
v-model="cartItem.quantity"
|
|
30
|
-
:min="cartItem.min_quantity"
|
|
31
|
-
:max="cartItem.max_quantity"
|
|
32
|
-
/>
|
|
33
|
-
</div>
|
|
34
|
-
<Prices
|
|
35
|
-
:base-price="cartItem.base_price"
|
|
36
|
-
:price="finalPrice"
|
|
37
|
-
:has-cashback="false"
|
|
38
|
-
:has-price-options="false"
|
|
39
|
-
class="px-4 py-2.5 text-[95%] text-right"
|
|
40
|
-
/>
|
|
41
|
-
</div>
|
|
42
|
-
</article>
|
|
43
|
-
</template>
|
|
44
|
-
|
|
45
|
-
<script setup lang="ts">
|
|
46
|
-
import { removeCartItem } from '@@sf/state/shopping-cart';
|
|
47
|
-
import {
|
|
48
|
-
type Props as UseCartItemProps,
|
|
49
|
-
useCartItem,
|
|
50
|
-
} from '@@sf/composables/use-cart-item';
|
|
51
|
-
import QuantitySelector from '@@sf/components/QuantitySelector.vue';
|
|
52
|
-
import Prices from '~/components/Prices.vue';
|
|
53
|
-
|
|
54
|
-
export type Props = UseCartItemProps;
|
|
55
|
-
|
|
56
|
-
const props = defineProps<Props>();
|
|
57
|
-
const {
|
|
58
|
-
cartItem,
|
|
59
|
-
title,
|
|
60
|
-
link,
|
|
61
|
-
image,
|
|
62
|
-
finalPrice,
|
|
63
|
-
} = useCartItem(props);
|
|
64
|
-
</script>
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<aside class="flex flex-col h-screen bg-white">
|
|
3
|
-
<header class="px-6 py-4 flex justify-end items-center gap-3
|
|
4
|
-
shadow ring-1 ring-black/5 z-10">
|
|
5
|
-
<span class="text-right text-base text-base-600 font-medium">
|
|
6
|
-
{{ $t.i19myShoppingCart }}
|
|
7
|
-
</span>
|
|
8
|
-
<span class="min-w-[3rem] text-right">
|
|
9
|
-
<span class="ui-badge-pill-lg">
|
|
10
|
-
{{ totalItems }}
|
|
11
|
-
</span>
|
|
12
|
-
</span>
|
|
13
|
-
</header>
|
|
14
|
-
<article class="grow overflow-y-auto bg-base-50">
|
|
15
|
-
<div v-if="freeShippingFromValue" class="text-sm text-center">
|
|
16
|
-
<div
|
|
17
|
-
v-if="freeShippingFromValue > shoppingCart.subtotal"
|
|
18
|
-
class="p-3 secondary-subtle"
|
|
19
|
-
>
|
|
20
|
-
{{ $t.i19add$1ToEarn.replace('$1',
|
|
21
|
-
$money(freeShippingFromValue - shoppingCart.subtotal)) }}
|
|
22
|
-
<strong class="lowercase">{{ $t.i19freeShipping }}</strong>
|
|
23
|
-
</div>
|
|
24
|
-
<div v-else class="p-3 bg-success-50 text-success-800">
|
|
25
|
-
<i class="text-success-900 i-check mr-1"></i>
|
|
26
|
-
{{ $t.i19freeShippingFrom }} {{ $money(freeShippingFromValue) }}
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
<ul class="px-4 pt-4 pb-2">
|
|
30
|
-
<li v-for="(item, i) in shoppingCart.items" :key="i">
|
|
31
|
-
<CartItem :item="item" class="mb-3" />
|
|
32
|
-
</li>
|
|
33
|
-
</ul>
|
|
34
|
-
</article>
|
|
35
|
-
<footer class="px-5 pt-4 pb-3 ring-2 ring-black/5 z-10">
|
|
36
|
-
<div class="grid grid-cols-5 gap-3 items-center text-right">
|
|
37
|
-
<div class="col-span-2">
|
|
38
|
-
{{ $t.i19subtotal }}
|
|
39
|
-
</div>
|
|
40
|
-
<Prices :price="shoppingCart.subtotal" class="col-span-3 text-lg" />
|
|
41
|
-
</div>
|
|
42
|
-
<CheckoutLink class="ui-btn-lg ui-btn-primary w-full text-right my-2.5">
|
|
43
|
-
<i class="i-check mr-2"></i>
|
|
44
|
-
{{ $t.i19checkout }}
|
|
45
|
-
</CheckoutLink>
|
|
46
|
-
<a
|
|
47
|
-
href="#"
|
|
48
|
-
@click.prevent="emit('close')"
|
|
49
|
-
class="ui-link text-base-500 hover:text-base-700 text-sm"
|
|
50
|
-
>
|
|
51
|
-
<i class="i-arrow-left mr-1"></i>
|
|
52
|
-
{{ $t.i19continueShopping }}
|
|
53
|
-
</a>
|
|
54
|
-
</footer>
|
|
55
|
-
</aside>
|
|
56
|
-
</template>
|
|
57
|
-
|
|
58
|
-
<script setup lang="ts">
|
|
59
|
-
import { freeShippingFromValue } from '@@sf/state/modules-info';
|
|
60
|
-
import { shoppingCart, totalItems } from '@@sf/state/shopping-cart';
|
|
61
|
-
import CheckoutLink from '@@sf/components/CheckoutLink.vue';
|
|
62
|
-
import Prices from '~/components/Prices.vue';
|
|
63
|
-
import CartItem from '~/components/CartItem.vue';
|
|
64
|
-
|
|
65
|
-
const emit = defineEmits(['close']);
|
|
66
|
-
</script>
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="flex w-[300px] justify-between">
|
|
3
|
-
<div>
|
|
4
|
-
<strong class="text-lg">{{ hours }}</strong>
|
|
5
|
-
<span>{{ $t.i19about }}</span>
|
|
6
|
-
</div>
|
|
7
|
-
<span>:</span>
|
|
8
|
-
<div>
|
|
9
|
-
{{ minutes }}
|
|
10
|
-
</div>
|
|
11
|
-
<span>:</span>
|
|
12
|
-
<div>
|
|
13
|
-
{{ seconds }}
|
|
14
|
-
</div>
|
|
15
|
-
<span>:</span>
|
|
16
|
-
<div>
|
|
17
|
-
{{ ms }}
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
</template>
|
|
21
|
-
|
|
22
|
-
<script setup lang="ts">
|
|
23
|
-
import {
|
|
24
|
-
ref,
|
|
25
|
-
computed,
|
|
26
|
-
watch,
|
|
27
|
-
watchEffect,
|
|
28
|
-
} from 'vue';
|
|
29
|
-
import { useIntervalFn } from '@vueuse/core';
|
|
30
|
-
|
|
31
|
-
export interface Props {
|
|
32
|
-
endsAt?: string;
|
|
33
|
-
maxHours?: number;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
37
|
-
maxHours: 8,
|
|
38
|
-
});
|
|
39
|
-
const endTimestamp = computed(() => {
|
|
40
|
-
if (props.endsAt) {
|
|
41
|
-
return new Date(props.endsAt).getTime();
|
|
42
|
-
}
|
|
43
|
-
return null;
|
|
44
|
-
});
|
|
45
|
-
const hours = ref<number | null>(null);
|
|
46
|
-
const minutes = ref<number>(59);
|
|
47
|
-
const seconds = ref<number>(59);
|
|
48
|
-
const ms = ref<number>(999);
|
|
49
|
-
watchEffect(() => {
|
|
50
|
-
if (endTimestamp.value) {
|
|
51
|
-
const timeDiff = endTimestamp.value - Date.now();
|
|
52
|
-
if (timeDiff > 0) {
|
|
53
|
-
const diffHours = Math.floor(timeDiff / (1000 * 60 * 60));
|
|
54
|
-
hours.value = Math.min(diffHours, props.maxHours);
|
|
55
|
-
}
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
hours.value = props.maxHours;
|
|
59
|
-
});
|
|
60
|
-
useIntervalFn(() => {
|
|
61
|
-
ms.value -= 1;
|
|
62
|
-
if (ms.value < 0) {
|
|
63
|
-
ms.value = 999;
|
|
64
|
-
}
|
|
65
|
-
}, 1);
|
|
66
|
-
watch([ms], () => {
|
|
67
|
-
if (ms.value === 0) {
|
|
68
|
-
seconds.value -= 1;
|
|
69
|
-
if (seconds.value < 0) {
|
|
70
|
-
seconds.value = 59;
|
|
71
|
-
minutes.value -= 1;
|
|
72
|
-
if (minutes.value < 0) {
|
|
73
|
-
minutes.value = 59;
|
|
74
|
-
hours.value = Math.min((hours.value as number) - 1, 0);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
</script>
|