@salla.sa/twilight-components 2.14.393 → 2.14.394
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/{filepond-D7RVR_w_.js → filepond-C_gLbAbF.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-DTuZK2ot.js → filepond-plugin-file-poster-DXWo2FUU.js} +2 -2
- package/dist/cjs/{filepond-plugin-file-validate-size-DHc6pF_j.js → filepond-plugin-file-validate-size-fBXMP7ez.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-DnkcvJVc.js → filepond-plugin-file-validate-type-DEo7juC7.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-vrZ1s7kw.js → filepond-plugin-image-edit-4j4e1VEp.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-Bn5JSzQK.js → filepond-plugin-image-exif-orientation-DWqiXxv1.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-8qWUFe9n.js → filepond-plugin-image-preview-emT_teia.js} +1 -1
- package/dist/cjs/{index-C5VeFDQ0.js → index-B03mYCWz.js} +547 -780
- package/dist/cjs/{index-CwD81m7i.js → index-Y-2uyQDK.js} +1 -1
- package/dist/cjs/loader.cjs.js +3 -4
- package/dist/cjs/salla-accordion-body_2.cjs.entry.js +5 -5
- package/dist/cjs/salla-accordion_6.cjs.entry.js +15 -19
- package/dist/cjs/salla-add-product-button_4.cjs.entry.js +10 -12
- package/dist/cjs/salla-advertisement.cjs.entry.js +3 -3
- package/dist/cjs/salla-alert_2.cjs.entry.js +5 -5
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +3 -3
- package/dist/cjs/salla-apps-icons.cjs.entry.js +3 -3
- package/dist/cjs/salla-booking-field_7.cjs.entry.js +23 -25
- package/dist/cjs/salla-bullet-delivery.cjs.entry.js +3 -3
- package/dist/cjs/salla-cart-coupons.cjs.entry.js +3 -3
- package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +5 -5
- package/dist/cjs/salla-comment-form_8.cjs.entry.js +17 -17
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +3 -3
- package/dist/cjs/salla-contacts.cjs.entry.js +3 -3
- package/dist/cjs/salla-cookies-bar.cjs.entry.js +3 -3
- package/dist/cjs/salla-count-down.cjs.entry.js +3 -3
- package/dist/cjs/salla-custom-fields.cjs.entry.js +3 -3
- package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +3 -3
- package/dist/cjs/salla-filters.cjs.entry.js +3 -3
- package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
- package/dist/cjs/salla-gifting.cjs.entry.js +3 -3
- package/dist/cjs/salla-hook.cjs.entry.js +2 -5
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +3 -3
- package/dist/cjs/salla-installment.cjs.entry.js +3 -3
- package/dist/cjs/salla-list-tile.cjs.entry.js +3 -3
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
- package/dist/cjs/salla-loyalty.cjs.entry.js +3 -3
- package/dist/cjs/salla-maintenance-alert.cjs.entry.js +3 -3
- package/dist/cjs/salla-map.cjs.entry.js +3 -3
- package/dist/cjs/salla-menu.cjs.entry.js +3 -3
- package/dist/cjs/salla-metadata.cjs.entry.js +3 -3
- package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +5 -5
- package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +6 -8
- package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +4 -6
- package/dist/cjs/salla-notification-item.cjs.entry.js +3 -3
- package/dist/cjs/salla-notifications.cjs.entry.js +3 -3
- package/dist/cjs/salla-offer-modal.cjs.entry.js +3 -3
- package/dist/cjs/salla-offer.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-details-options.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-details.cjs.entry.js +4 -6
- package/dist/cjs/salla-order-edit-item.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-edit.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-summary.cjs.entry.js +3 -3
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +4 -6
- package/dist/cjs/salla-orders.cjs.entry.js +3 -3
- package/dist/cjs/salla-payments.cjs.entry.js +3 -3
- package/dist/cjs/salla-placeholder.cjs.entry.js +3 -3
- package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
- package/dist/cjs/salla-product-card.cjs.entry.js +3 -3
- package/dist/cjs/salla-product-size-guide.cjs.entry.js +3 -3
- package/dist/cjs/salla-products-list.cjs.entry.js +3 -3
- package/dist/cjs/salla-products-slider.cjs.entry.js +3 -3
- package/dist/cjs/salla-progress-bar.cjs.entry.js +3 -3
- package/dist/cjs/salla-quick-order.cjs.entry.js +3 -3
- package/dist/cjs/salla-rating-modal.cjs.entry.js +3 -3
- package/dist/cjs/salla-scopes.cjs.entry.js +3 -3
- package/dist/cjs/salla-search.cjs.entry.js +4 -6
- package/dist/cjs/salla-skeleton.cjs.entry.js +3 -3
- package/dist/cjs/salla-slider.cjs.entry.js +3 -3
- package/dist/cjs/salla-social-share.cjs.entry.js +3 -3
- package/dist/cjs/salla-social.cjs.entry.js +3 -3
- package/dist/cjs/salla-tab-content_3.cjs.entry.js +7 -7
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +3 -3
- package/dist/cjs/salla-tooltip.cjs.entry.js +3 -3
- package/dist/cjs/salla-trust-badges.cjs.entry.js +3 -3
- package/dist/cjs/salla-user-menu.cjs.entry.js +3 -3
- package/dist/cjs/salla-user-profile.cjs.entry.js +3 -3
- package/dist/cjs/salla-user-settings.cjs.entry.js +3 -3
- package/dist/cjs/salla-verify.cjs.entry.js +3 -3
- package/dist/cjs/salla-wallet.cjs.entry.js +3 -3
- package/dist/cjs/twilight.cjs.js +4 -5
- package/dist/cjs/{vanilla-picker-yKERbLpx.js → vanilla-picker-CKZvBtHS.js} +1 -1
- package/dist/collection/collection-manifest.json +2 -3
- package/dist/collection/components/salla-accordion/salla-accordion-head.js +2 -2
- package/dist/collection/components/salla-accordion/salla-accordion.js +4 -4
- package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +19 -19
- package/dist/collection/components/salla-alert/salla-alert.js +5 -5
- package/dist/collection/components/salla-apps-icons/salla-apps-icons.js +6 -6
- package/dist/collection/components/salla-booking-field/salla-booking-field.js +4 -4
- package/dist/collection/components/salla-bottom-alert/salla-bottom-alert.js +9 -9
- package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +3 -6
- package/dist/collection/components/salla-button/salla-button.js +11 -11
- package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.js +1 -2
- package/dist/collection/components/salla-cart-item-offers/salla-cart-item-offers.js +8 -8
- package/dist/collection/components/salla-cart-summary/salla-cart-summary.js +2 -2
- package/dist/collection/components/salla-color-picker/salla-color-picker.js +14 -20
- package/dist/collection/components/salla-comment-form/salla-comment-form.js +6 -6
- package/dist/collection/components/salla-comments/salla-comment-item.js +3 -2
- package/dist/collection/components/salla-comments/salla-comments.js +17 -18
- package/dist/collection/components/salla-contacts/salla-contacts.js +10 -10
- package/dist/collection/components/salla-count-down/salla-count-down.js +34 -34
- package/dist/collection/components/salla-custom-fields/salla-custom-fields.js +7 -9
- package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +65 -69
- package/dist/collection/components/salla-drawer/salla-drawer.js +11 -11
- package/dist/collection/components/salla-file-upload/salla-file-upload.js +84 -85
- package/dist/collection/components/salla-filters/salla-filters.js +2 -2
- package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +5 -4
- package/dist/collection/components/salla-gifting/salla-gifting.js +11 -11
- package/dist/collection/components/salla-hook/salla-hook.js +2 -2
- package/dist/collection/components/salla-infinite-scroll/salla-infinite-scroll.js +6 -6
- package/dist/collection/components/salla-installment/salla-installment.js +5 -5
- package/dist/collection/components/salla-list-tile/salla-list-tile.js +2 -2
- package/dist/collection/components/salla-loading/salla-loading.js +4 -4
- package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +5 -5
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +14 -14
- package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.js +3 -4
- package/dist/collection/components/salla-loyalty/salla-loyalty.js +12 -13
- package/dist/collection/components/salla-map/salla-map.js +14 -14
- package/dist/collection/components/salla-menu/salla-menu.js +9 -10
- package/dist/collection/components/salla-metadata/salla-metadata.js +3 -3
- package/dist/collection/components/salla-modal/salla-modal.js +11 -11
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.js +2 -2
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +2 -2
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +2 -4
- package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +7 -8
- package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.js +2 -2
- package/dist/collection/components/salla-notifications/salla-notification-item.js +2 -2
- package/dist/collection/components/salla-notifications/salla-notifications.js +3 -3
- package/dist/collection/components/salla-offer/salla-offer.js +1 -1
- package/dist/collection/components/salla-order-details/salla-order-details-multiple-bundle-product.js +5 -5
- package/dist/collection/components/salla-order-details/salla-order-details-options.js +5 -6
- package/dist/collection/components/salla-order-details/salla-order-details.js +3 -4
- package/dist/collection/components/salla-order-edit/salla-order-edit-item.js +4 -4
- package/dist/collection/components/salla-order-edit/salla-order-edit.js +4 -4
- package/dist/collection/components/salla-order-summary/salla-order-summary.js +2 -2
- package/dist/collection/components/salla-order-totals-card/salla-order-totals-card.js +3 -4
- package/dist/collection/components/salla-orders/salla-orders.js +4 -4
- package/dist/collection/components/salla-payments/salla-payments.js +1 -0
- package/dist/collection/components/salla-placeholder/salla-placeholder.js +3 -3
- package/dist/collection/components/salla-price-range/salla-price-range.js +8 -8
- package/dist/collection/components/salla-product-availability/salla-product-availability.js +6 -6
- package/dist/collection/components/salla-product-card/salla-product-card.js +18 -18
- package/dist/collection/components/salla-product-options/salla-product-options.js +13 -15
- package/dist/collection/components/salla-products-list/salla-products-list.js +21 -20
- package/dist/collection/components/salla-products-slider/salla-products-slider.js +23 -22
- package/dist/collection/components/salla-progress-bar/salla-progress-bar.js +20 -21
- package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +2 -2
- package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +17 -16
- package/dist/collection/components/salla-quick-order/salla-quick-order.js +11 -11
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +2 -2
- package/dist/collection/components/salla-rating-stars/salla-rating-stars.js +8 -8
- package/dist/collection/components/salla-review-card/salla-review-card.js +3 -3
- package/dist/collection/components/salla-reviews/salla-reviews.js +13 -16
- package/dist/collection/components/salla-reviews-summary/salla-reviews-summary.js +2 -2
- package/dist/collection/components/salla-scopes/salla-scopes.js +2 -2
- package/dist/collection/components/salla-search/salla-search.js +6 -6
- package/dist/collection/components/salla-skeleton/salla-skeleton.js +3 -3
- package/dist/collection/components/salla-slider/salla-slider.js +25 -25
- package/dist/collection/components/salla-social-share/salla-social-share.js +3 -3
- package/dist/collection/components/salla-tabs/salla-tab-content.js +2 -2
- package/dist/collection/components/salla-tabs/salla-tab-header.js +5 -5
- package/dist/collection/components/salla-tabs/salla-tabs.js +2 -2
- package/dist/collection/components/salla-tel-input/salla-tel-input.js +8 -9
- package/dist/collection/components/salla-tooltip/salla-tooltip.js +5 -5
- package/dist/collection/components/salla-trust-badges/salla-trust-badges.js +1 -1
- package/dist/collection/components/salla-user-menu/salla-user-menu.js +5 -5
- package/dist/collection/components/salla-user-profile/salla-user-profile.js +1 -1
- package/dist/collection/components/salla-verify/salla-verify.js +4 -4
- package/dist/components/Helper.js +432 -1
- package/dist/components/_commonjsHelpers.js +7 -1
- package/dist/components/anime.es.js +1310 -1
- package/dist/components/arrow-left.js +8 -1
- package/dist/components/axios.js +4240 -2
- package/dist/components/bell-ring.js +8 -1
- package/dist/components/camera.js +8 -1
- package/dist/components/cancel.js +8 -1
- package/dist/components/cart.js +8 -1
- package/dist/components/check-circle2.js +15 -1
- package/dist/components/check.js +8 -1
- package/dist/components/facebook.js +10 -1
- package/dist/components/filepond-plugin-file-poster.js +662 -2
- package/dist/components/filepond-plugin-file-validate-size.js +204 -2
- package/dist/components/filepond-plugin-file-validate-type.js +262 -2
- package/dist/components/filepond-plugin-image-edit.js +487 -2
- package/dist/components/filepond-plugin-image-exif-orientation.js +214 -2
- package/dist/components/filepond-plugin-image-preview.js +2237 -2
- package/dist/components/filepond.js +11286 -2
- package/dist/components/gift.js +8 -1
- package/dist/components/image.js +8 -1
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.js +8220 -1
- package/dist/components/index2.js +1709 -1
- package/dist/components/index3.js +2550 -1
- package/dist/components/interfaces.js +12 -1
- package/dist/components/isObject.js +292 -1
- package/dist/components/keyboard_arrow_down.js +8 -1
- package/dist/components/keyboard_arrow_right.js +15 -1
- package/dist/components/location.js +11 -1
- package/dist/components/mail.js +8 -1
- package/dist/components/minus.js +15 -1
- package/dist/components/salla-accordion-body.js +6 -1
- package/dist/components/salla-accordion-body2.js +30 -1
- package/dist/components/salla-accordion-head.js +6 -1
- package/dist/components/salla-accordion-head2.js +63 -1
- package/dist/components/salla-accordion.js +6 -1
- package/dist/components/salla-accordion2.js +68 -1
- package/dist/components/salla-add-product-button.js +6 -1
- package/dist/components/salla-add-product-button2.js +306 -1
- package/dist/components/salla-advertisement.js +155 -1
- package/dist/components/salla-alert.js +59 -1
- package/dist/components/salla-app-install-alert.js +91 -1
- package/dist/components/salla-apps-icons.js +63 -1
- package/dist/components/salla-booking-field.js +6 -1
- package/dist/components/salla-booking-field2.js +221 -1
- package/dist/components/salla-bottom-alert.js +214 -1
- package/dist/components/salla-breadcrumb.js +226 -1
- package/dist/components/salla-bullet-delivery.js +2114 -1
- package/dist/components/salla-button.js +6 -1
- package/dist/components/salla-button2.js +174 -1
- package/dist/components/salla-cart-coupons.js +284 -1
- package/dist/components/salla-cart-item-offers.js +143 -1
- package/dist/components/salla-cart-summary.js +136 -1
- package/dist/components/salla-color-picker.js +6 -1
- package/dist/components/salla-color-picker2.js +260 -1
- package/dist/components/salla-comment-form.js +6 -1
- package/dist/components/salla-comment-form2.js +64 -1
- package/dist/components/salla-comment-item.js +6 -1
- package/dist/components/salla-comment-item2.js +217 -1
- package/dist/components/salla-comments.js +395 -1
- package/dist/components/salla-conditional-fields.js +6 -1
- package/dist/components/salla-conditional-fields2.js +137 -1
- package/dist/components/salla-conditional-offer.js +194 -1
- package/dist/components/salla-contacts.js +125 -1
- package/dist/components/salla-cookies-bar.js +107 -1
- package/dist/components/salla-count-down.js +6 -1
- package/dist/components/salla-count-down2.js +271 -1
- package/dist/components/salla-custom-fields.js +175 -1
- package/dist/components/salla-datetime-picker.js +6 -1
- package/dist/components/salla-datetime-picker2.js +342 -1
- package/dist/components/salla-delivery-promise.js +263 -1
- package/dist/components/salla-drawer.js +6 -1
- package/dist/components/salla-drawer2.js +214 -1
- package/dist/components/salla-file-upload.js +6 -1
- package/dist/components/salla-file-upload2.js +583 -1
- package/dist/components/salla-filters-widget.js +6 -1
- package/dist/components/salla-filters-widget2.js +245 -1
- package/dist/components/salla-filters.js +253 -1
- package/dist/components/salla-fulfillment-methods.js +61 -1
- package/dist/components/salla-gifting.js +732 -1
- package/dist/components/salla-hook.js +47 -1
- package/dist/components/salla-infinite-scroll.js +112 -1
- package/dist/components/salla-installment.js +306 -1
- package/dist/components/salla-list-tile.js +6 -1
- package/dist/components/salla-list-tile2.js +47 -1
- package/dist/components/salla-loading.js +6 -1
- package/dist/components/salla-loading2.js +51 -1
- package/dist/components/salla-localization-modal.js +296 -1
- package/dist/components/salla-login-modal.js +6 -1
- package/dist/components/salla-login-modal2.js +359 -1
- package/dist/components/salla-loyalty-prize-item.js +39 -1
- package/dist/components/salla-loyalty-program.js +115 -1
- package/dist/components/salla-loyalty.js +304 -1
- package/dist/components/salla-maintenance-alert.js +57 -1
- package/dist/components/salla-map.js +6 -1
- package/dist/components/salla-map2.js +766 -1
- package/dist/components/salla-menu.js +165 -1
- package/dist/components/salla-metadata.js +97 -1
- package/dist/components/salla-modal.js +6 -1
- package/dist/components/salla-modal2.js +215 -1
- package/dist/components/salla-multiple-bundle-product-cart.js +6 -1
- package/dist/components/salla-multiple-bundle-product-cart2.js +151 -1
- package/dist/components/salla-multiple-bundle-product-details.js +6 -1
- package/dist/components/salla-multiple-bundle-product-details2.js +296 -1
- package/dist/components/salla-multiple-bundle-product-options-modal.js +6 -1
- package/dist/components/salla-multiple-bundle-product-options-modal2.js +598 -1
- package/dist/components/salla-multiple-bundle-product-slider.js +6 -1
- package/dist/components/salla-multiple-bundle-product-slider2.js +136 -1
- package/dist/components/salla-multiple-bundle-product.js +207 -1
- package/dist/components/salla-notification-item.js +6 -1
- package/dist/components/salla-notification-item2.js +32 -1
- package/dist/components/salla-notifications.js +190 -1
- package/dist/components/salla-offer-modal.js +328 -1
- package/dist/components/salla-offer.js +478 -1
- package/dist/components/salla-order-details-multiple-bundle-product.js +6 -1
- package/dist/components/salla-order-details-multiple-bundle-product2.js +122 -1
- package/dist/components/salla-order-details-options.js +6 -1
- package/dist/components/salla-order-details-options2.js +140 -1
- package/dist/components/salla-order-details.js +122 -1
- package/dist/components/salla-order-edit-item.js +6 -1
- package/dist/components/salla-order-edit-item2.js +181 -1
- package/dist/components/salla-order-edit.js +288 -1
- package/dist/components/salla-order-summary.js +132 -1
- package/dist/components/salla-order-totals-card.js +87 -1
- package/dist/components/salla-orders.js +271 -1
- package/dist/components/salla-payments.js +76 -1
- package/dist/components/salla-placeholder.js +6 -1
- package/dist/components/salla-placeholder2.js +66 -1
- package/dist/components/salla-price-range.js +6 -1
- package/dist/components/salla-price-range2.js +204 -1
- package/dist/components/salla-product-availability.js +6 -1
- package/dist/components/salla-product-availability2.js +206 -1
- package/dist/components/salla-product-card.js +6 -1
- package/dist/components/salla-product-card2.js +241 -1
- package/dist/components/salla-product-options.js +6 -1
- package/dist/components/salla-product-options2.js +962 -1
- package/dist/components/salla-product-size-guide.js +130 -1
- package/dist/components/salla-products-list.js +6 -1
- package/dist/components/salla-products-list2.js +812 -1
- package/dist/components/salla-products-slider.js +6 -1
- package/dist/components/salla-products-slider2.js +215 -1
- package/dist/components/salla-progress-bar.js +6 -1
- package/dist/components/salla-progress-bar2.js +94 -1
- package/dist/components/salla-quantity-input.js +6 -1
- package/dist/components/salla-quantity-input2.js +127 -1
- package/dist/components/salla-quick-buy.js +6 -1
- package/dist/components/salla-quick-buy2.js +1181 -1
- package/dist/components/salla-quick-order.js +299 -1
- package/dist/components/salla-rating-modal.js +530 -1
- package/dist/components/salla-rating-stars.js +6 -1
- package/dist/components/salla-rating-stars2.js +162 -1
- package/dist/components/salla-review-card.js +6 -1
- package/dist/components/salla-review-card2.js +198 -1
- package/dist/components/salla-reviews-page.js +726 -1
- package/dist/components/salla-reviews-summary.js +6 -1
- package/dist/components/salla-reviews-summary2.js +132 -1
- package/dist/components/salla-reviews.js +143 -1
- package/dist/components/salla-scopes.js +249 -1
- package/dist/components/salla-search.js +213 -1
- package/dist/components/salla-skeleton.js +6 -1
- package/dist/components/salla-skeleton2.js +50 -1
- package/dist/components/salla-slider.js +6 -1
- package/dist/components/salla-slider2.js +10489 -1
- package/dist/components/salla-social-share.js +194 -1
- package/dist/components/salla-social.js +89 -1
- package/dist/components/salla-tab-content.js +6 -1
- package/dist/components/salla-tab-content2.js +55 -1
- package/dist/components/salla-tab-header.js +6 -1
- package/dist/components/salla-tab-header2.js +85 -1
- package/dist/components/salla-tabs.js +6 -1
- package/dist/components/salla-tabs2.js +75 -1
- package/dist/components/salla-tel-input.js +6 -1
- package/dist/components/salla-tel-input2.js +168 -1
- package/dist/components/salla-tiered-offer.js +366 -1
- package/dist/components/salla-tooltip.js +6 -1
- package/dist/components/salla-tooltip2.js +57 -1
- package/dist/components/salla-trust-badges.js +90 -1
- package/dist/components/salla-user-menu.js +344 -1
- package/dist/components/salla-user-profile.js +203 -1
- package/dist/components/salla-user-settings.js +139 -1
- package/dist/components/salla-verify.js +303 -1
- package/dist/components/salla-wallet.js +114 -1
- package/dist/components/search.js +8 -1
- package/dist/components/shopping-bag.js +8 -1
- package/dist/components/special-discount.js +8 -1
- package/dist/components/star.js +8 -1
- package/dist/components/star2.js +8 -1
- package/dist/components/vanilla-picker.js +1034 -2
- package/dist/components/whatsapp2.js +8 -1
- package/dist/esm/{filepond-DlGaLh8N.js → filepond-Be7JObSq.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-BTVFYcQx.js → filepond-plugin-file-poster-DF0NWKCQ.js} +2 -2
- package/dist/esm/{filepond-plugin-file-validate-size-DGryLmWv.js → filepond-plugin-file-validate-size-DJFlJHtE.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-DxKfCD0V.js → filepond-plugin-file-validate-type-DykpLW1Z.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-2W7pu9hn.js → filepond-plugin-image-edit-CyIHxrnW.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-OQu-IvPH.js → filepond-plugin-image-exif-orientation-DbCOAhSu.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-DEW_tSNR.js → filepond-plugin-image-preview-CGRGZcft.js} +1 -1
- package/dist/esm/{index-DYB20YqN.js → index-Cz6cYzxG.js} +547 -780
- package/dist/esm/{index-BDqMkCqE.js → index-_kPnZdm0.js} +1 -1
- package/dist/esm/loader.js +3 -4
- package/dist/esm/salla-accordion-body_2.entry.js +5 -5
- package/dist/esm/salla-accordion_6.entry.js +15 -19
- package/dist/esm/salla-add-product-button_4.entry.js +10 -12
- package/dist/esm/salla-advertisement.entry.js +3 -3
- package/dist/esm/salla-alert_2.entry.js +5 -5
- package/dist/esm/salla-app-install-alert.entry.js +3 -3
- package/dist/esm/salla-apps-icons.entry.js +3 -3
- package/dist/esm/salla-booking-field_7.entry.js +23 -25
- package/dist/esm/salla-bullet-delivery.entry.js +3 -3
- package/dist/esm/salla-cart-coupons.entry.js +3 -3
- package/dist/esm/salla-cart-item-offers_2.entry.js +5 -5
- package/dist/esm/salla-comment-form_8.entry.js +17 -17
- package/dist/esm/salla-conditional-offer.entry.js +3 -3
- package/dist/esm/salla-contacts.entry.js +3 -3
- package/dist/esm/salla-cookies-bar.entry.js +3 -3
- package/dist/esm/salla-count-down.entry.js +3 -3
- package/dist/esm/salla-custom-fields.entry.js +3 -3
- package/dist/esm/salla-delivery-promise.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +3 -3
- package/dist/esm/salla-filters.entry.js +3 -3
- package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
- package/dist/esm/salla-gifting.entry.js +3 -3
- package/dist/esm/salla-hook.entry.js +2 -5
- package/dist/esm/salla-infinite-scroll.entry.js +3 -3
- package/dist/esm/salla-installment.entry.js +3 -3
- package/dist/esm/salla-list-tile.entry.js +3 -3
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +3 -3
- package/dist/esm/salla-loyalty-prize-item.entry.js +3 -3
- package/dist/esm/salla-loyalty-program.entry.js +3 -3
- package/dist/esm/salla-loyalty.entry.js +3 -3
- package/dist/esm/salla-maintenance-alert.entry.js +3 -3
- package/dist/esm/salla-map.entry.js +3 -3
- package/dist/esm/salla-menu.entry.js +3 -3
- package/dist/esm/salla-metadata.entry.js +3 -3
- package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +5 -5
- package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +6 -8
- package/dist/esm/salla-multiple-bundle-product.entry.js +4 -6
- package/dist/esm/salla-notification-item.entry.js +3 -3
- package/dist/esm/salla-notifications.entry.js +3 -3
- package/dist/esm/salla-offer-modal.entry.js +3 -3
- package/dist/esm/salla-offer.entry.js +3 -3
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +3 -3
- package/dist/esm/salla-order-details-options.entry.js +3 -3
- package/dist/esm/salla-order-details.entry.js +4 -6
- package/dist/esm/salla-order-edit-item.entry.js +3 -3
- package/dist/esm/salla-order-edit.entry.js +3 -3
- package/dist/esm/salla-order-summary.entry.js +3 -3
- package/dist/esm/salla-order-totals-card.entry.js +4 -6
- package/dist/esm/salla-orders.entry.js +3 -3
- package/dist/esm/salla-payments.entry.js +3 -3
- package/dist/esm/salla-placeholder.entry.js +3 -3
- package/dist/esm/salla-price-range.entry.js +3 -3
- package/dist/esm/salla-product-card.entry.js +3 -3
- package/dist/esm/salla-product-size-guide.entry.js +3 -3
- package/dist/esm/salla-products-list.entry.js +3 -3
- package/dist/esm/salla-products-slider.entry.js +3 -3
- package/dist/esm/salla-progress-bar.entry.js +3 -3
- package/dist/esm/salla-quick-order.entry.js +3 -3
- package/dist/esm/salla-rating-modal.entry.js +3 -3
- package/dist/esm/salla-scopes.entry.js +3 -3
- package/dist/esm/salla-search.entry.js +4 -6
- package/dist/esm/salla-skeleton.entry.js +3 -3
- package/dist/esm/salla-slider.entry.js +3 -3
- package/dist/esm/salla-social-share.entry.js +3 -3
- package/dist/esm/salla-social.entry.js +3 -3
- package/dist/esm/salla-tab-content_3.entry.js +7 -7
- package/dist/esm/salla-tiered-offer.entry.js +3 -3
- package/dist/esm/salla-tooltip.entry.js +3 -3
- package/dist/esm/salla-trust-badges.entry.js +3 -3
- package/dist/esm/salla-user-menu.entry.js +3 -3
- package/dist/esm/salla-user-profile.entry.js +3 -3
- package/dist/esm/salla-user-settings.entry.js +3 -3
- package/dist/esm/salla-verify.entry.js +3 -3
- package/dist/esm/salla-wallet.entry.js +3 -3
- package/dist/esm/twilight.js +4 -5
- package/dist/esm/{vanilla-picker-Dt9vZPZF.js → vanilla-picker-C_YV5LtA.js} +1 -1
- package/dist/twilight/{p-33779828.entry.js → p-0200cddd.entry.js} +1 -1
- package/dist/twilight/p-04dc0b71.entry.js +4 -0
- package/dist/twilight/{p-105b1dab.entry.js → p-0bac200e.entry.js} +1 -1
- package/dist/twilight/{p-ccfe5308.entry.js → p-0ef99df1.entry.js} +1 -1
- package/dist/twilight/{p-647b6d76.entry.js → p-1087f0dd.entry.js} +1 -1
- package/dist/twilight/{p-1875537e.entry.js → p-17dd8b68.entry.js} +1 -1
- package/dist/twilight/{p-aa7c5de0.entry.js → p-25a9bf1b.entry.js} +1 -1
- package/dist/twilight/{p-34b670fc.entry.js → p-2602927d.entry.js} +1 -1
- package/dist/twilight/p-268695ff.entry.js +4 -0
- package/dist/twilight/{p-aaa0c743.entry.js → p-34920aac.entry.js} +1 -1
- package/dist/twilight/{p-817b8ba5.entry.js → p-3656b48d.entry.js} +1 -1
- package/dist/twilight/{p-4932857d.entry.js → p-3857beb4.entry.js} +1 -1
- package/dist/twilight/{p-af3c74f4.entry.js → p-39c601e3.entry.js} +1 -1
- package/dist/twilight/{p-b598c0f7.entry.js → p-3c810881.entry.js} +1 -1
- package/dist/twilight/{p-d371d450.entry.js → p-3cf5c61f.entry.js} +1 -1
- package/dist/twilight/{p-3ccc532d.entry.js → p-413a7236.entry.js} +1 -1
- package/dist/twilight/{p-f176d41d.entry.js → p-42778349.entry.js} +1 -1
- package/dist/twilight/{p-b17d055d.entry.js → p-45e4f6f4.entry.js} +1 -1
- package/dist/twilight/{p-2abaa633.entry.js → p-4680956b.entry.js} +1 -1
- package/dist/twilight/{p-96a20515.entry.js → p-468b999f.entry.js} +1 -1
- package/dist/twilight/{p-df6853b5.entry.js → p-46d1823f.entry.js} +1 -1
- package/dist/twilight/{p-c87951a2.entry.js → p-49db497f.entry.js} +1 -1
- package/dist/twilight/{p-18bb0181.entry.js → p-4b033276.entry.js} +1 -1
- package/dist/twilight/{p-296d2dd0.entry.js → p-4f7bc9c3.entry.js} +1 -1
- package/dist/twilight/{p-4fa4547a.entry.js → p-543ee624.entry.js} +1 -1
- package/dist/twilight/{p-2fe01e44.entry.js → p-5957f774.entry.js} +1 -1
- package/dist/twilight/{p-96e78428.entry.js → p-5a4f0b99.entry.js} +1 -1
- package/dist/twilight/{p-87c0ca91.entry.js → p-5a8c0fd2.entry.js} +1 -1
- package/dist/twilight/{p-e28c0773.entry.js → p-5ab7a295.entry.js} +1 -1
- package/dist/twilight/{p-542d3277.entry.js → p-5e496aaa.entry.js} +1 -1
- package/dist/twilight/{p-c3ffb88a.entry.js → p-5f440956.entry.js} +1 -1
- package/dist/twilight/{p-94dbc1e9.entry.js → p-60fafcd9.entry.js} +1 -1
- package/dist/twilight/{p-1ef2602d.entry.js → p-708f02db.entry.js} +1 -1
- package/dist/twilight/{p-b64f3155.entry.js → p-7829ea8a.entry.js} +1 -1
- package/dist/twilight/{p-7093a427.entry.js → p-7d3e592a.entry.js} +1 -1
- package/dist/twilight/{p-96d03a28.entry.js → p-81876026.entry.js} +1 -1
- package/dist/twilight/{p-d9f5a8cd.entry.js → p-8306ef5e.entry.js} +1 -1
- package/dist/twilight/{p-d4a242f8.entry.js → p-8403cd93.entry.js} +1 -1
- package/dist/twilight/{p-7abddca8.entry.js → p-8474c4f6.entry.js} +1 -1
- package/dist/twilight/p-8552160a.entry.js +4 -0
- package/dist/twilight/p-8c9b0e2a.entry.js +4 -0
- package/dist/twilight/{p-2881bb33.entry.js → p-8f2dfc57.entry.js} +1 -1
- package/dist/twilight/{p-c091e2dc.entry.js → p-94b1a2ae.entry.js} +1 -1
- package/dist/twilight/{p-ede67a08.entry.js → p-95dad1af.entry.js} +1 -1
- package/dist/twilight/{p-eac718cd.entry.js → p-964b7db9.entry.js} +1 -1
- package/dist/twilight/{p-e3b8e0e1.entry.js → p-99735748.entry.js} +1 -1
- package/dist/twilight/{p-X6Yi3bYP.js → p-BZKDQg1s.js} +1 -1
- package/dist/twilight/{p-Cw3UBzjl.js → p-B_sN7OnY.js} +1 -1
- package/dist/twilight/{p-8r0S6BcZ.js → p-Bpi0aG1F.js} +1 -1
- package/dist/twilight/{p-BkClxrC4.js → p-CP8rFQ5n.js} +1 -1
- package/dist/twilight/{p-bNzv71Xl.js → p-CfmIbM8B.js} +1 -1
- package/dist/twilight/{p-bScl0xMh.js → p-CpO1SrBd.js} +1 -1
- package/dist/twilight/p-Cz6cYzxG.js +5 -0
- package/dist/twilight/p-Do4hSOGo.js +9 -0
- package/dist/twilight/{p-Ck4zxCil.js → p-JJmlh-ji.js} +1 -1
- package/dist/twilight/{p-dd2bd5dc.entry.js → p-a4aedcfe.entry.js} +1 -1
- package/dist/twilight/{p-06fa7327.entry.js → p-b0d01f9f.entry.js} +1 -1
- package/dist/twilight/p-b8404cfb.entry.js +4 -0
- package/dist/twilight/{p-108d8c8b.entry.js → p-b8e3e180.entry.js} +1 -1
- package/dist/twilight/{p-ad07f67a.entry.js → p-bd687cd0.entry.js} +1 -1
- package/dist/twilight/{p-44fa7521.entry.js → p-c0037fac.entry.js} +1 -1
- package/dist/twilight/{p-293c6cf3.entry.js → p-c121f8e4.entry.js} +1 -1
- package/dist/twilight/{p-a01f1992.entry.js → p-c29907df.entry.js} +1 -1
- package/dist/twilight/p-c39675ef.entry.js +4 -0
- package/dist/twilight/{p-bff4c7b3.entry.js → p-cb7a985e.entry.js} +1 -1
- package/dist/twilight/p-cbe620c4.entry.js +4 -0
- package/dist/twilight/{p-6f36541a.entry.js → p-d2fd79b4.entry.js} +1 -1
- package/dist/twilight/{p-d337c399.entry.js → p-d6cf0ffd.entry.js} +1 -1
- package/dist/twilight/{p-748df7e6.entry.js → p-d8f60f2f.entry.js} +1 -1
- package/dist/twilight/p-d99610f9.entry.js +4 -0
- package/dist/twilight/{p-e6bbf50d.entry.js → p-dc897bdd.entry.js} +1 -1
- package/dist/twilight/{p-f7999a6d.entry.js → p-dca46236.entry.js} +1 -1
- package/dist/twilight/{p-e94f217b.entry.js → p-e48853c9.entry.js} +1 -1
- package/dist/twilight/{p-09d39785.entry.js → p-e4fdb206.entry.js} +1 -1
- package/dist/twilight/p-ed913ae7.entry.js +4 -0
- package/dist/twilight/p-f067fcd6.entry.js +4 -0
- package/dist/twilight/{p-57ff1f25.entry.js → p-f2cd6975.entry.js} +1 -1
- package/dist/twilight/{p-ad041ab5.entry.js → p-f2ffbfbb.entry.js} +1 -1
- package/dist/twilight/{p-f5d15e71.entry.js → p-f3166e60.entry.js} +1 -1
- package/dist/twilight/{p-59ae82bd.entry.js → p-f8fcc8f4.entry.js} +1 -1
- package/dist/twilight/{p-c1fd45b1.entry.js → p-f9e52fd9.entry.js} +1 -1
- package/dist/twilight/p-fcddbfc3.entry.js +4 -0
- package/dist/twilight/{p-41c733c2.entry.js → p-fe7ac9bb.entry.js} +1 -1
- package/dist/twilight/{p-0add06f9.entry.js → p-ff14dca3.entry.js} +1 -1
- package/dist/twilight/{p-BZnoSB1s.js → p-mlFGjxcj.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components.d.ts +177 -763
- package/dist/types/stencil-public-runtime.d.ts +11 -169
- package/package.json +5 -5
- package/dist/cjs/app-globals-oehrC7QI.js +0 -39
- package/dist/esm/app-globals-BFryt7-C.js +0 -37
- package/dist/twilight/p-1daeed6e.entry.js +0 -4
- package/dist/twilight/p-2ddb3fce.entry.js +0 -4
- package/dist/twilight/p-34968e31.entry.js +0 -4
- package/dist/twilight/p-665189b4.entry.js +0 -4
- package/dist/twilight/p-776c9d33.entry.js +0 -4
- package/dist/twilight/p-7b8313ef.entry.js +0 -4
- package/dist/twilight/p-7bd0ede5.entry.js +0 -4
- package/dist/twilight/p-8e8d9d7d.entry.js +0 -4
- package/dist/twilight/p-D1vqXXNX.js +0 -9
- package/dist/twilight/p-DYB20YqN.js +0 -5
- package/dist/twilight/p-Vl6qpttb.js +0 -4
- package/dist/twilight/p-af60e72a.entry.js +0 -4
- package/dist/twilight/p-e679884a.entry.js +0 -4
- package/dist/twilight/p-efab88c5.entry.js +0 -4
|
@@ -1,4 +1,1313 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
var n={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},r={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},t=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],e={CSS:{},springs:{}};function u(n,r,t){return Math.min(Math.max(n,r),t)}function a(n,r){return n.indexOf(r)>-1}function o(n,r){return n.apply(null,r)}var i={arr:function(n){return Array.isArray(n)},obj:function(n){return a(Object.prototype.toString.call(n),"Object")},pth:function(n){return i.obj(n)&&n.hasOwnProperty("totalLength")},svg:function(n){return n instanceof SVGElement},inp:function(n){return n instanceof HTMLInputElement},dom:function(n){return n.nodeType||i.svg(n)},str:function(n){return"string"==typeof n},fnc:function(n){return"function"==typeof n},und:function(n){return void 0===n},nil:function(n){return i.und(n)||null===n},hex:function(n){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(n)},rgb:function(n){return/^rgb/.test(n)},hsl:function(n){return/^hsl/.test(n)},col:function(n){return i.hex(n)||i.rgb(n)||i.hsl(n)},key:function(t){return!n.hasOwnProperty(t)&&!r.hasOwnProperty(t)&&"targets"!==t&&"keyframes"!==t}};function c(n){var r=/\(([^)]+)\)/.exec(n);return r?r[1].split(",").map((function(n){return parseFloat(n)})):[]}function f(n,r){var t=c(n),a=u(i.und(t[0])?1:t[0],.1,100),o=u(i.und(t[1])?100:t[1],.1,100),f=u(i.und(t[2])?10:t[2],.1,100),v=u(i.und(t[3])?0:t[3],.1,100),s=Math.sqrt(o/a),l=f/(2*Math.sqrt(o*a)),d=l<1?s*Math.sqrt(1-l*l):0,h=l<1?(l*s-v)/d:-v+s;function p(n){var t=r?r*n/1e3:n;return t=l<1?Math.exp(-t*l*s)*(1*Math.cos(d*t)+h*Math.sin(d*t)):(1+h*t)*Math.exp(-t*s),0===n||1===n?n:1-t}return r?p:function(){var r=e.springs[n];if(r)return r;for(var t=1/6,u=0,a=0;;)if(1===p(u+=t)){if(++a>=16)break}else a=0;var o=u*t*1e3;return e.springs[n]=o,o}}function v(n){return void 0===n&&(n=10),function(r){return Math.ceil(u(r,1e-6,1)*n)*(1/n)}}var s,l,d=function(){var n=.1;function r(n,r){return 1-3*r+3*n}function t(n,r){return 3*r-6*n}function e(n){return 3*n}function u(n,u,a){return((r(u,a)*n+t(u,a))*n+e(u))*n}function a(n,u,a){return 3*r(u,a)*n*n+2*t(u,a)*n+e(u)}return function(r,t,e,o){if(0<=r&&r<=1&&0<=e&&e<=1){var i=new Float32Array(11);if(r!==t||e!==o)for(var c=0;c<11;++c)i[c]=u(c*n,r,e);return function(c){return r===t&&e===o||0===c||1===c?c:u(function(t){for(var o=0,c=1;10!==c&&i[c]<=t;++c)o+=n;--c;var f=o+(t-i[c])/(i[c+1]-i[c])*n,v=a(f,r,e);return v>=.001?function(n,r,t,e){for(var o=0;o<4;++o){var i=a(r,t,e);if(0===i)return r;r-=(u(r,t,e)-n)/i}return r}(t,f,r,e):0===v?f:function(n,r,t,e,a){var o,i,c=0;do{(o=u(i=r+(t-r)/2,e,a)-n)>0?t=i:r=i}while(Math.abs(o)>1e-7&&++c<10);return i}(t,o,o+n,r,e)}(c),t,o)}}}}(),h=(s={linear:function(){return function(n){return n}}},l={Sine:function(){return function(n){return 1-Math.cos(n*Math.PI/2)}},Expo:function(){return function(n){return n?Math.pow(2,10*n-10):0}},Circ:function(){return function(n){return 1-Math.sqrt(1-n*n)}},Back:function(){return function(n){return n*n*(3*n-2)}},Bounce:function(){return function(n){for(var r,t=4;n<((r=Math.pow(2,--t))-1)/11;);return 1/Math.pow(4,3-t)-7.5625*Math.pow((3*r-2)/22-n,2)}},Elastic:function(n,r){void 0===n&&(n=1),void 0===r&&(r=.5);var t=u(n,1,10),e=u(r,.1,2);return function(n){return 0===n||1===n?n:-t*Math.pow(2,10*(n-1))*Math.sin((n-1-e/(2*Math.PI)*Math.asin(1/t))*(2*Math.PI)/e)}}},["Quad","Cubic","Quart","Quint"].forEach((function(n,r){l[n]=function(){return function(n){return Math.pow(n,r+2)}}})),Object.keys(l).forEach((function(n){var r=l[n];s["easeIn"+n]=r,s["easeOut"+n]=function(n,t){return function(e){return 1-r(n,t)(1-e)}},s["easeInOut"+n]=function(n,t){return function(e){return e<.5?r(n,t)(2*e)/2:1-r(n,t)(-2*e+2)/2}},s["easeOutIn"+n]=function(n,t){return function(e){return e<.5?(1-r(n,t)(1-2*e))/2:(r(n,t)(2*e-1)+1)/2}}})),s);function p(n,r){if(i.fnc(n))return n;var t=n.split("(")[0],e=h[t],u=c(n);switch(t){case"spring":return f(n,r);case"cubicBezier":return o(d,u);case"steps":return o(v,u);default:return o(e,u)}}function m(n){try{return document.querySelectorAll(n)}catch(n){return}}function M(n,r){for(var t=n.length,e=arguments.length>=2?arguments[1]:void 0,u=[],a=0;a<t;a++)if(a in n){var o=n[a];r.call(e,o,a,n)&&u.push(o)}return u}function g(n){return n.reduce((function(n,r){return n.concat(i.arr(r)?g(r):r)}),[])}function y(n){return i.arr(n)?n:(i.str(n)&&(n=m(n)||n),n instanceof NodeList||n instanceof HTMLCollection?[].slice.call(n):[n])}function b(n,r){return n.some((function(n){return n===r}))}function w(n){var r={};for(var t in n)r[t]=n[t];return r}function x(n,r){var t=w(n);for(var e in n)t[e]=r.hasOwnProperty(e)?r[e]:n[e];return t}function F(n,r){var t=w(n);for(var e in r)t[e]=i.und(n[e])?r[e]:n[e];return t}function C(n){var r=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(n);if(r)return r[1]}function I(n,r){return i.fnc(n)?n(r.target,r.id,r.total):n}function k(n,r){return n.getAttribute(r)}function B(n,r,t){if(b([t,"deg","rad","turn"],C(r)))return r;var u=e.CSS[r+t];if(!i.und(u))return u;var a=document.createElement(n.tagName),o=n.parentNode&&n.parentNode!==document?n.parentNode:document.body;o.appendChild(a),a.style.position="absolute",a.style.width=100+t;var c=100/a.offsetWidth;o.removeChild(a);var f=c*parseFloat(r);return e.CSS[r+t]=f,f}function O(n,r,t){if(r in n.style){var e=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),u=n.style[r]||getComputedStyle(n).getPropertyValue(e)||"0";return t?B(n,u,t):u}}function A(n,r){return i.dom(n)&&!i.inp(n)&&(!i.nil(k(n,r))||i.svg(n)&&n[r])?"attribute":i.dom(n)&&b(t,r)?"transform":i.dom(n)&&"transform"!==r&&O(n,r)?"css":null!=n[r]?"object":void 0}function j(n){if(i.dom(n)){for(var r,t=n.style.transform||"",e=/(\w+)\(([^)]*)\)/g,u=new Map;r=e.exec(t);)u.set(r[1],r[2]);return u}}function E(n,r,t,e){switch(A(n,r)){case"transform":return function(n,r,t,e){var u=a(r,"scale")?1:0+function(n){return a(n,"translate")||"perspective"===n?"px":a(n,"rotate")||a(n,"skew")?"deg":void 0}(r),o=j(n).get(r)||u;return t&&(t.transforms.list.set(r,o),t.transforms.last=r),e?B(n,o,e):o}(n,r,e,t);case"css":return O(n,r,t);case"attribute":return k(n,r);default:return n[r]||0}}function $(n,r){var t=/^(\*=|\+=|-=)/.exec(n);if(!t)return n;var e=C(n)||0,u=parseFloat(r),a=parseFloat(n.replace(t[0],""));switch(t[0][0]){case"+":return u+a+e;case"-":return u-a+e;case"*":return u*a+e}}function N(n,r){if(i.col(n))return function(n){return i.rgb(n)?(t=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(r=n))?"rgba("+t[1]+",1)":r:i.hex(n)?function(n){var r=n.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(n,r,t,e){return r+r+t+t+e+e})),t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);return"rgba("+parseInt(t[1],16)+","+parseInt(t[2],16)+","+parseInt(t[3],16)+",1)"}(n):i.hsl(n)?function(n){var r,t,e,u=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(n)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(n),a=parseInt(u[1],10)/360,o=parseInt(u[2],10)/100,i=parseInt(u[3],10)/100,c=u[4]||1;function f(n,r,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+6*(r-n)*t:t<.5?r:t<2/3?n+(r-n)*(2/3-t)*6:n}if(0==o)r=t=e=i;else{var v=i<.5?i*(1+o):i+o-i*o,s=2*i-v;r=f(s,v,a+1/3),t=f(s,v,a),e=f(s,v,a-1/3)}return"rgba("+255*r+","+255*t+","+255*e+","+c+")"}(n):void 0;var r,t}(n);if(/\s/g.test(n))return n;var t=C(n),e=t?n.substr(0,n.length-t.length):n;return r?e+r:e}function L(n,r){return Math.sqrt(Math.pow(r.x-n.x,2)+Math.pow(r.y-n.y,2))}function S(n){for(var r,t=n.points,e=0,u=0;u<t.numberOfItems;u++){var a=t.getItem(u);u>0&&(e+=L(r,a)),r=a}return e}function X(n){if(n.getTotalLength)return n.getTotalLength();switch(n.tagName.toLowerCase()){case"circle":return function(n){return 2*Math.PI*k(n,"r")}(n);case"rect":return function(n){return 2*k(n,"width")+2*k(n,"height")}(n);case"line":return function(n){return L({x:k(n,"x1"),y:k(n,"y1")},{x:k(n,"x2"),y:k(n,"y2")})}(n);case"polyline":return S(n);case"polygon":return function(n){var r=n.points;return S(n)+L(r.getItem(r.numberOfItems-1),r.getItem(0))}(n)}}function Y(n,r){var t=r||{},e=t.el||function(n){for(var r=n.parentNode;i.svg(r)&&i.svg(r.parentNode);)r=r.parentNode;return r}(n),u=e.getBoundingClientRect(),a=k(e,"viewBox"),o=u.width,c=u.height,f=t.viewBox||(a?a.split(" "):[0,0,o,c]);return{el:e,viewBox:f,x:f[0]/1,y:f[1]/1,w:o,h:c,vW:f[2],vH:f[3]}}function Z(n,r,t){function e(t){return void 0===t&&(t=0),n.el.getPointAtLength(r+t>=1?r+t:0)}var u=Y(n.el,n.svg),a=e(),o=e(-1),i=e(1),c=t?1:u.w/u.vW,f=t?1:u.h/u.vH;switch(n.property){case"x":return(a.x-u.x)*c;case"y":return(a.y-u.y)*f;case"angle":return 180*Math.atan2(i.y-o.y,i.x-o.x)/Math.PI}}function D(n,r){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,e=N(i.pth(n)?n.totalLength:n,r)+"";return{original:e,numbers:e.match(t)?e.match(t).map(Number):[0],strings:i.str(n)||r?e.split(t):[]}}function H(n){return M(n?g(i.arr(n)?n.map(y):y(n)):[],(function(n,r,t){return t.indexOf(n)===r}))}function Q(n){var r=H(n);return r.map((function(n,t){return{target:n,id:t,total:r.length,transforms:{list:j(n)}}}))}function q(n,r){var t=w(r);if(/^spring/.test(t.easing)&&(t.duration=f(t.easing)),i.arr(n)){var e=n.length;2!==e||i.obj(n[0])?i.fnc(r.duration)||(t.duration=r.duration/e):n={value:n}}var u=i.arr(n)?n:[n];return u.map((function(n,t){var e=i.obj(n)&&!i.pth(n)?n:{value:n};return i.und(e.delay)&&(e.delay=t?0:r.delay),i.und(e.endDelay)&&(e.endDelay=t===u.length-1?r.endDelay:0),e})).map((function(n){return F(n,t)}))}var z={css:function(n,r,t){return n.style[r]=t},attribute:function(n,r,t){return n.setAttribute(r,t)},object:function(n,r,t){return n[r]=t},transform:function(n,r,t,e,u){if(e.list.set(r,t),r===e.last||u){var a="";e.list.forEach((function(n,r){a+=r+"("+n+") "})),n.style.transform=a}}};function P(n,r){Q(n).forEach((function(n){for(var t in r){var e=I(r[t],n),u=n.target,a=C(e),o=E(u,t,a,n),i=$(N(e,a||C(o)),o),c=A(u,t);z[c](u,t,i,n.transforms,!0)}}))}function T(n,r){return M(g(n.map((function(n){return r.map((function(r){return function(n,r){var t=A(n.target,r.name);if(t){var e=function(n,r){var t;return n.tweens.map((function(e){var u=function(n,r){var t={};for(var e in n){var u=I(n[e],r);i.arr(u)&&1===(u=u.map((function(n){return I(n,r)}))).length&&(u=u[0]),t[e]=u}return t.duration=parseFloat(t.duration),t.delay=parseFloat(t.delay),t}(e,r),a=u.value,o=i.arr(a)?a[1]:a,c=C(o),f=E(r.target,n.name,c,r),v=t?t.to.original:f,s=i.arr(a)?a[0]:v,l=C(s)||C(f),d=c||l;return i.und(o)&&(o=v),u.from=D(s,d),u.to=D($(o,s),d),u.start=t?t.end:0,u.end=u.start+u.delay+u.duration+u.endDelay,u.easing=p(u.easing,u.duration),u.isPath=i.pth(a),u.isPathTargetInsideSVG=u.isPath&&i.svg(r.target),u.isColor=i.col(u.from.original),u.isColor&&(u.round=1),t=u,u}))}(r,n),u=e[e.length-1];return{type:t,property:r.name,animatable:n,tweens:e,duration:u.end,delay:e[0].delay,endDelay:u.endDelay}}}(n,r)}))}))),(function(n){return!i.und(n)}))}function G(n,r){var t=n.length,e=function(n){return n.timelineOffset?n.timelineOffset:0},u={};return u.duration=t?Math.max.apply(Math,n.map((function(n){return e(n)+n.duration}))):r.duration,u.delay=t?Math.min.apply(Math,n.map((function(n){return e(n)+n.delay}))):r.delay,u.endDelay=t?u.duration-Math.max.apply(Math,n.map((function(n){return e(n)+n.duration-n.endDelay}))):r.endDelay,u}var V=0,W=[],J=function(){var n;function r(t){for(var e=W.length,u=0;u<e;){var a=W[u];a.paused?(W.splice(u,1),e--):(a.tick(t),u++)}n=u>0?requestAnimationFrame(r):void 0}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",(function(){R.suspendWhenDocumentHidden&&(K()?n=cancelAnimationFrame(n):(W.forEach((function(n){return n._onDocumentVisibility()})),J()))})),function(){n||K()&&R.suspendWhenDocumentHidden||!(W.length>0)||(n=requestAnimationFrame(r))}}();function K(){return!!document&&document.hidden}function R(t){void 0===t&&(t={});var e,a=0,o=0,c=0,f=0,v=null;function s(n){var r=window.Promise&&new Promise((function(n){return v=n}));return n.finished=r,r}var l=function(t){var e=x(n,t),u=x(r,t),a=function(n,r){var t=[],e=r.keyframes;for(var u in e&&(r=F(function(n){for(var r=M(g(n.map((function(n){return Object.keys(n)}))),(function(n){return i.key(n)})).reduce((function(n,r){return n.indexOf(r)<0&&n.push(r),n}),[]),t={},e=function(e){var u=r[e];t[u]=n.map((function(n){var r={};for(var t in n)i.key(t)?t==u&&(r.value=n[t]):r[t]=n[t];return r}))},u=0;u<r.length;u++)e(u);return t}(e),r)),r)i.key(u)&&t.push({name:u,tweens:q(r[u],n)});return t}(u,t),o=Q(t.targets),c=T(o,a),f=G(c,u),v=V;return V++,F(e,{id:v,children:[],animatables:o,animations:c,duration:f.duration,delay:f.delay,endDelay:f.endDelay})}(t);function d(){var n=l.direction;"alternate"!==n&&(l.direction="normal"!==n?"normal":"reverse"),l.reversed=!l.reversed,e.forEach((function(n){return n.reversed=l.reversed}))}function h(n){return l.reversed?l.duration-n:n}function p(){a=0,o=h(l.currentTime)*(1/R.speed)}function m(n,r){r&&r.seek(n-r.timelineOffset)}function y(n){for(var r=0,t=l.animations,e=t.length;r<e;){var a=t[r],o=a.animatable,i=a.tweens,c=i.length-1,f=i[c];c&&(f=M(i,(function(r){return n<r.end}))[0]||f);for(var v=u(n-f.start-f.delay,0,f.duration)/f.duration,s=isNaN(v)?1:f.easing(v),d=f.to.strings,h=f.round,p=[],m=f.to.numbers.length,g=void 0,y=0;y<m;y++){var b=void 0,w=f.to.numbers[y],x=f.from.numbers[y]||0;b=f.isPath?Z(f.value,s*w,f.isPathTargetInsideSVG):x+s*(w-x),h&&(f.isColor&&y>2||(b=Math.round(b*h)/h)),p.push(b)}var F=d.length;if(F){g=d[0];for(var C=0;C<F;C++){var I=d[C+1],k=p[C];isNaN(k)||(g+=I?k+I:k+" ")}}else g=p[0];z[a.type](o.target,a.property,g,o.transforms),a.currentValue=g,r++}}function b(n){l[n]&&!l.passThrough&&l[n](l)}function w(n){var r=l.duration,t=l.delay,i=r-l.endDelay,p=h(n);l.progress=u(p/r*100,0,100),l.reversePlayback=p<l.currentTime,e&&function(n){if(l.reversePlayback)for(var r=f;r--;)m(n,e[r]);else for(var t=0;t<f;t++)m(n,e[t])}(p),!l.began&&l.currentTime>0&&(l.began=!0,b("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,b("loopBegin")),p<=t&&0!==l.currentTime&&y(0),(p>=i&&l.currentTime!==r||!r)&&y(r),p>t&&p<i?(l.changeBegan||(l.changeBegan=!0,l.changeCompleted=!1,b("changeBegin")),b("change"),y(p)):l.changeBegan&&(l.changeCompleted=!0,l.changeBegan=!1,b("changeComplete")),l.currentTime=u(p,0,r),l.began&&b("update"),n>=r&&(o=0,l.remaining&&!0!==l.remaining&&l.remaining--,l.remaining?(a=c,b("loopComplete"),l.loopBegan=!1,"alternate"===l.direction&&d()):(l.paused=!0,l.completed||(l.completed=!0,b("loopComplete"),b("complete"),!l.passThrough&&"Promise"in window&&(v(),s(l)))))}return s(l),l.reset=function(){var n=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed="reverse"===n,l.remaining=l.loop;for(var r=f=(e=l.children).length;r--;)l.children[r].reset();(l.reversed&&!0!==l.loop||"alternate"===n&&1===l.loop)&&l.remaining++,y(l.reversed?l.duration:0)},l._onDocumentVisibility=p,l.set=function(n,r){return P(n,r),l},l.tick=function(n){c=n,a||(a=c),w((c+(o-a))*R.speed)},l.seek=function(n){w(h(n))},l.pause=function(){l.paused=!0,p()},l.play=function(){l.paused&&(l.completed&&l.reset(),l.paused=!1,W.push(l),p(),J())},l.reverse=function(){d(),l.completed=!l.reversed,p()},l.restart=function(){l.reset(),l.play()},l.remove=function(n){_(H(n),l)},l.reset(),l.autoplay&&l.play(),l}function U(n,r){for(var t=r.length;t--;)b(n,r[t].animatable.target)&&r.splice(t,1)}function _(n,r){var t=r.animations,e=r.children;U(n,t);for(var u=e.length;u--;){var a=e[u],o=a.animations;U(n,o),o.length||a.children.length||e.splice(u,1)}t.length||e.length||r.pause()}R.version="3.2.1",R.speed=1,R.suspendWhenDocumentHidden=!0,R.running=W,R.remove=function(n){for(var r=H(n),t=W.length;t--;)_(r,W[t])},R.get=E,R.set=P,R.convertPx=B,R.path=function(n,r){var t=i.str(n)?m(n)[0]:n,e=r||100;return function(n){return{property:n,el:t,svg:Y(t),totalLength:X(t)*(e/100)}}},R.setDashoffset=function(n){var r=X(n);return n.setAttribute("stroke-dasharray",r),r},R.stagger=function(n,r){void 0===r&&(r={});var t=r.direction||"normal",e=r.easing?p(r.easing):null,u=r.grid,a=r.axis,o=r.from||0,c="first"===o,f="center"===o,v="last"===o,s=i.arr(n),l=s?parseFloat(n[0]):parseFloat(n),d=s?parseFloat(n[1]):0,h=C(s?n[1]:n)||0,m=r.start||0+(s?l:0),M=[],g=0;return function(n,r,i){if(c&&(o=0),f&&(o=(i-1)/2),v&&(o=i-1),!M.length){for(var p=0;p<i;p++){if(u){var y=f?(u[0]-1)/2:o%u[0],b=f?(u[1]-1)/2:Math.floor(o/u[0]),w=y-p%u[0],x=b-Math.floor(p/u[0]),F=Math.sqrt(w*w+x*x);"x"===a&&(F=-w),"y"===a&&(F=-x),M.push(F)}else M.push(Math.abs(o-p));g=Math.max.apply(Math,M)}e&&(M=M.map((function(n){return e(n/g)*g}))),"reverse"===t&&(M=M.map((function(n){return a?n<0?-1*n:-n:Math.abs(g-n)})))}return m+(s?(d-l)/g:l)*(Math.round(100*M[r])/100)+h}},R.timeline=function(n){void 0===n&&(n={});var t=R(n);return t.duration=0,t.add=function(e,u){var a=W.indexOf(t),o=t.children;function c(n){n.passThrough=!0}a>-1&&W.splice(a,1);for(var f=0;f<o.length;f++)c(o[f]);var v=F(e,x(r,n));v.targets=v.targets||n.targets;var s=t.duration;v.autoplay=!1,v.direction=t.direction,v.timelineOffset=i.und(u)?s:$(u,s),c(t),t.seek(v.timelineOffset);var l=R(v);c(l),o.push(l);var d=G(o,n);return t.delay=d.delay,t.endDelay=d.endDelay,t.duration=d.duration,t.seek(0),t.reset(),t.autoplay&&t.play(),t},t},R.easing=p,R.penner=h,R.random=function(n,r){return Math.floor(Math.random()*(r-n+1))+n};export{R as a}
|
|
4
|
+
/*
|
|
5
|
+
* anime.js v3.2.2
|
|
6
|
+
* (c) 2023 Julian Garnier
|
|
7
|
+
* Released under the MIT license
|
|
8
|
+
* animejs.com
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// Defaults
|
|
12
|
+
|
|
13
|
+
var defaultInstanceSettings = {
|
|
14
|
+
update: null,
|
|
15
|
+
begin: null,
|
|
16
|
+
loopBegin: null,
|
|
17
|
+
changeBegin: null,
|
|
18
|
+
change: null,
|
|
19
|
+
changeComplete: null,
|
|
20
|
+
loopComplete: null,
|
|
21
|
+
complete: null,
|
|
22
|
+
loop: 1,
|
|
23
|
+
direction: 'normal',
|
|
24
|
+
autoplay: true,
|
|
25
|
+
timelineOffset: 0
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
var defaultTweenSettings = {
|
|
29
|
+
duration: 1000,
|
|
30
|
+
delay: 0,
|
|
31
|
+
endDelay: 0,
|
|
32
|
+
easing: 'easeOutElastic(1, .5)',
|
|
33
|
+
round: 0
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
var validTransforms = ['translateX', 'translateY', 'translateZ', 'rotate', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'perspective', 'matrix', 'matrix3d'];
|
|
37
|
+
|
|
38
|
+
// Caching
|
|
39
|
+
|
|
40
|
+
var cache = {
|
|
41
|
+
CSS: {},
|
|
42
|
+
springs: {}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// Utils
|
|
46
|
+
|
|
47
|
+
function minMax(val, min, max) {
|
|
48
|
+
return Math.min(Math.max(val, min), max);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function stringContains(str, text) {
|
|
52
|
+
return str.indexOf(text) > -1;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function applyArguments(func, args) {
|
|
56
|
+
return func.apply(null, args);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
var is = {
|
|
60
|
+
arr: function (a) { return Array.isArray(a); },
|
|
61
|
+
obj: function (a) { return stringContains(Object.prototype.toString.call(a), 'Object'); },
|
|
62
|
+
pth: function (a) { return is.obj(a) && a.hasOwnProperty('totalLength'); },
|
|
63
|
+
svg: function (a) { return a instanceof SVGElement; },
|
|
64
|
+
inp: function (a) { return a instanceof HTMLInputElement; },
|
|
65
|
+
dom: function (a) { return a.nodeType || is.svg(a); },
|
|
66
|
+
str: function (a) { return typeof a === 'string'; },
|
|
67
|
+
fnc: function (a) { return typeof a === 'function'; },
|
|
68
|
+
und: function (a) { return typeof a === 'undefined'; },
|
|
69
|
+
nil: function (a) { return is.und(a) || a === null; },
|
|
70
|
+
hex: function (a) { return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(a); },
|
|
71
|
+
rgb: function (a) { return /^rgb/.test(a); },
|
|
72
|
+
hsl: function (a) { return /^hsl/.test(a); },
|
|
73
|
+
col: function (a) { return (is.hex(a) || is.rgb(a) || is.hsl(a)); },
|
|
74
|
+
key: function (a) { return !defaultInstanceSettings.hasOwnProperty(a) && !defaultTweenSettings.hasOwnProperty(a) && a !== 'targets' && a !== 'keyframes'; },
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// Easings
|
|
78
|
+
|
|
79
|
+
function parseEasingParameters(string) {
|
|
80
|
+
var match = /\(([^)]+)\)/.exec(string);
|
|
81
|
+
return match ? match[1].split(',').map(function (p) { return parseFloat(p); }) : [];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Spring solver inspired by Webkit Copyright © 2016 Apple Inc. All rights reserved. https://webkit.org/demos/spring/spring.js
|
|
85
|
+
|
|
86
|
+
function spring(string, duration) {
|
|
87
|
+
|
|
88
|
+
var params = parseEasingParameters(string);
|
|
89
|
+
var mass = minMax(is.und(params[0]) ? 1 : params[0], .1, 100);
|
|
90
|
+
var stiffness = minMax(is.und(params[1]) ? 100 : params[1], .1, 100);
|
|
91
|
+
var damping = minMax(is.und(params[2]) ? 10 : params[2], .1, 100);
|
|
92
|
+
var velocity = minMax(is.und(params[3]) ? 0 : params[3], .1, 100);
|
|
93
|
+
var w0 = Math.sqrt(stiffness / mass);
|
|
94
|
+
var zeta = damping / (2 * Math.sqrt(stiffness * mass));
|
|
95
|
+
var wd = zeta < 1 ? w0 * Math.sqrt(1 - zeta * zeta) : 0;
|
|
96
|
+
var a = 1;
|
|
97
|
+
var b = zeta < 1 ? (zeta * w0 + -velocity) / wd : -velocity + w0;
|
|
98
|
+
|
|
99
|
+
function solver(t) {
|
|
100
|
+
var progress = duration ? (duration * t) / 1000 : t;
|
|
101
|
+
if (zeta < 1) {
|
|
102
|
+
progress = Math.exp(-progress * zeta * w0) * (a * Math.cos(wd * progress) + b * Math.sin(wd * progress));
|
|
103
|
+
} else {
|
|
104
|
+
progress = (a + b * progress) * Math.exp(-progress * w0);
|
|
105
|
+
}
|
|
106
|
+
if (t === 0 || t === 1) { return t; }
|
|
107
|
+
return 1 - progress;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function getDuration() {
|
|
111
|
+
var cached = cache.springs[string];
|
|
112
|
+
if (cached) { return cached; }
|
|
113
|
+
var frame = 1/6;
|
|
114
|
+
var elapsed = 0;
|
|
115
|
+
var rest = 0;
|
|
116
|
+
while(true) {
|
|
117
|
+
elapsed += frame;
|
|
118
|
+
if (solver(elapsed) === 1) {
|
|
119
|
+
rest++;
|
|
120
|
+
if (rest >= 16) { break; }
|
|
121
|
+
} else {
|
|
122
|
+
rest = 0;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
var duration = elapsed * frame * 1000;
|
|
126
|
+
cache.springs[string] = duration;
|
|
127
|
+
return duration;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return duration ? solver : getDuration;
|
|
131
|
+
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Basic steps easing implementation https://developer.mozilla.org/fr/docs/Web/CSS/transition-timing-function
|
|
135
|
+
|
|
136
|
+
function steps(steps) {
|
|
137
|
+
if ( steps === void 0 ) steps = 10;
|
|
138
|
+
|
|
139
|
+
return function (t) { return Math.ceil((minMax(t, 0.000001, 1)) * steps) * (1 / steps); };
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// BezierEasing https://github.com/gre/bezier-easing
|
|
143
|
+
|
|
144
|
+
var bezier = (function () {
|
|
145
|
+
|
|
146
|
+
var kSplineTableSize = 11;
|
|
147
|
+
var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
|
|
148
|
+
|
|
149
|
+
function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1 }
|
|
150
|
+
function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1 }
|
|
151
|
+
function C(aA1) { return 3.0 * aA1 }
|
|
152
|
+
|
|
153
|
+
function calcBezier(aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT }
|
|
154
|
+
function getSlope(aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1) }
|
|
155
|
+
|
|
156
|
+
function binarySubdivide(aX, aA, aB, mX1, mX2) {
|
|
157
|
+
var currentX, currentT, i = 0;
|
|
158
|
+
do {
|
|
159
|
+
currentT = aA + (aB - aA) / 2.0;
|
|
160
|
+
currentX = calcBezier(currentT, mX1, mX2) - aX;
|
|
161
|
+
if (currentX > 0.0) { aB = currentT; } else { aA = currentT; }
|
|
162
|
+
} while (Math.abs(currentX) > 0.0000001 && ++i < 10);
|
|
163
|
+
return currentT;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
|
|
167
|
+
for (var i = 0; i < 4; ++i) {
|
|
168
|
+
var currentSlope = getSlope(aGuessT, mX1, mX2);
|
|
169
|
+
if (currentSlope === 0.0) { return aGuessT; }
|
|
170
|
+
var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
|
|
171
|
+
aGuessT -= currentX / currentSlope;
|
|
172
|
+
}
|
|
173
|
+
return aGuessT;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function bezier(mX1, mY1, mX2, mY2) {
|
|
177
|
+
|
|
178
|
+
if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) { return; }
|
|
179
|
+
var sampleValues = new Float32Array(kSplineTableSize);
|
|
180
|
+
|
|
181
|
+
if (mX1 !== mY1 || mX2 !== mY2) {
|
|
182
|
+
for (var i = 0; i < kSplineTableSize; ++i) {
|
|
183
|
+
sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function getTForX(aX) {
|
|
188
|
+
|
|
189
|
+
var intervalStart = 0;
|
|
190
|
+
var currentSample = 1;
|
|
191
|
+
var lastSample = kSplineTableSize - 1;
|
|
192
|
+
|
|
193
|
+
for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
|
|
194
|
+
intervalStart += kSampleStepSize;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
--currentSample;
|
|
198
|
+
|
|
199
|
+
var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
|
|
200
|
+
var guessForT = intervalStart + dist * kSampleStepSize;
|
|
201
|
+
var initialSlope = getSlope(guessForT, mX1, mX2);
|
|
202
|
+
|
|
203
|
+
if (initialSlope >= 0.001) {
|
|
204
|
+
return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
|
|
205
|
+
} else if (initialSlope === 0.0) {
|
|
206
|
+
return guessForT;
|
|
207
|
+
} else {
|
|
208
|
+
return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return function (x) {
|
|
214
|
+
if (mX1 === mY1 && mX2 === mY2) { return x; }
|
|
215
|
+
if (x === 0 || x === 1) { return x; }
|
|
216
|
+
return calcBezier(getTForX(x), mY1, mY2);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return bezier;
|
|
222
|
+
|
|
223
|
+
})();
|
|
224
|
+
|
|
225
|
+
var penner = (function () {
|
|
226
|
+
|
|
227
|
+
// Based on jQuery UI's implemenation of easing equations from Robert Penner (http://www.robertpenner.com/easing)
|
|
228
|
+
|
|
229
|
+
var eases = { linear: function () { return function (t) { return t; }; } };
|
|
230
|
+
|
|
231
|
+
var functionEasings = {
|
|
232
|
+
Sine: function () { return function (t) { return 1 - Math.cos(t * Math.PI / 2); }; },
|
|
233
|
+
Expo: function () { return function (t) { return t ? Math.pow(2, 10 * t - 10) : 0; }; },
|
|
234
|
+
Circ: function () { return function (t) { return 1 - Math.sqrt(1 - t * t); }; },
|
|
235
|
+
Back: function () { return function (t) { return t * t * (3 * t - 2); }; },
|
|
236
|
+
Bounce: function () { return function (t) {
|
|
237
|
+
var pow2, b = 4;
|
|
238
|
+
while (t < (( pow2 = Math.pow(2, --b)) - 1) / 11) {}
|
|
239
|
+
return 1 / Math.pow(4, 3 - b) - 7.5625 * Math.pow(( pow2 * 3 - 2 ) / 22 - t, 2)
|
|
240
|
+
}; },
|
|
241
|
+
Elastic: function (amplitude, period) {
|
|
242
|
+
if ( amplitude === void 0 ) amplitude = 1;
|
|
243
|
+
if ( period === void 0 ) period = .5;
|
|
244
|
+
|
|
245
|
+
var a = minMax(amplitude, 1, 10);
|
|
246
|
+
var p = minMax(period, .1, 2);
|
|
247
|
+
return function (t) {
|
|
248
|
+
return (t === 0 || t === 1) ? t :
|
|
249
|
+
-a * Math.pow(2, 10 * (t - 1)) * Math.sin((((t - 1) - (p / (Math.PI * 2) * Math.asin(1 / a))) * (Math.PI * 2)) / p);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
var baseEasings = ['Quad', 'Cubic', 'Quart', 'Quint'];
|
|
255
|
+
|
|
256
|
+
baseEasings.forEach(function (name, i) {
|
|
257
|
+
functionEasings[name] = function () { return function (t) { return Math.pow(t, i + 2); }; };
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
Object.keys(functionEasings).forEach(function (name) {
|
|
261
|
+
var easeIn = functionEasings[name];
|
|
262
|
+
eases['easeIn' + name] = easeIn;
|
|
263
|
+
eases['easeOut' + name] = function (a, b) { return function (t) { return 1 - easeIn(a, b)(1 - t); }; };
|
|
264
|
+
eases['easeInOut' + name] = function (a, b) { return function (t) { return t < 0.5 ? easeIn(a, b)(t * 2) / 2 :
|
|
265
|
+
1 - easeIn(a, b)(t * -2 + 2) / 2; }; };
|
|
266
|
+
eases['easeOutIn' + name] = function (a, b) { return function (t) { return t < 0.5 ? (1 - easeIn(a, b)(1 - t * 2)) / 2 :
|
|
267
|
+
(easeIn(a, b)(t * 2 - 1) + 1) / 2; }; };
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
return eases;
|
|
271
|
+
|
|
272
|
+
})();
|
|
273
|
+
|
|
274
|
+
function parseEasings(easing, duration) {
|
|
275
|
+
if (is.fnc(easing)) { return easing; }
|
|
276
|
+
var name = easing.split('(')[0];
|
|
277
|
+
var ease = penner[name];
|
|
278
|
+
var args = parseEasingParameters(easing);
|
|
279
|
+
switch (name) {
|
|
280
|
+
case 'spring' : return spring(easing, duration);
|
|
281
|
+
case 'cubicBezier' : return applyArguments(bezier, args);
|
|
282
|
+
case 'steps' : return applyArguments(steps, args);
|
|
283
|
+
default : return applyArguments(ease, args);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// Strings
|
|
288
|
+
|
|
289
|
+
function selectString(str) {
|
|
290
|
+
try {
|
|
291
|
+
var nodes = document.querySelectorAll(str);
|
|
292
|
+
return nodes;
|
|
293
|
+
} catch(e) {
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// Arrays
|
|
299
|
+
|
|
300
|
+
function filterArray(arr, callback) {
|
|
301
|
+
var len = arr.length;
|
|
302
|
+
var thisArg = arguments.length >= 2 ? arguments[1] : void 0;
|
|
303
|
+
var result = [];
|
|
304
|
+
for (var i = 0; i < len; i++) {
|
|
305
|
+
if (i in arr) {
|
|
306
|
+
var val = arr[i];
|
|
307
|
+
if (callback.call(thisArg, val, i, arr)) {
|
|
308
|
+
result.push(val);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
return result;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
function flattenArray(arr) {
|
|
316
|
+
return arr.reduce(function (a, b) { return a.concat(is.arr(b) ? flattenArray(b) : b); }, []);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
function toArray(o) {
|
|
320
|
+
if (is.arr(o)) { return o; }
|
|
321
|
+
if (is.str(o)) { o = selectString(o) || o; }
|
|
322
|
+
if (o instanceof NodeList || o instanceof HTMLCollection) { return [].slice.call(o); }
|
|
323
|
+
return [o];
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
function arrayContains(arr, val) {
|
|
327
|
+
return arr.some(function (a) { return a === val; });
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// Objects
|
|
331
|
+
|
|
332
|
+
function cloneObject(o) {
|
|
333
|
+
var clone = {};
|
|
334
|
+
for (var p in o) { clone[p] = o[p]; }
|
|
335
|
+
return clone;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
function replaceObjectProps(o1, o2) {
|
|
339
|
+
var o = cloneObject(o1);
|
|
340
|
+
for (var p in o1) { o[p] = o2.hasOwnProperty(p) ? o2[p] : o1[p]; }
|
|
341
|
+
return o;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
function mergeObjects(o1, o2) {
|
|
345
|
+
var o = cloneObject(o1);
|
|
346
|
+
for (var p in o2) { o[p] = is.und(o1[p]) ? o2[p] : o1[p]; }
|
|
347
|
+
return o;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// Colors
|
|
351
|
+
|
|
352
|
+
function rgbToRgba(rgbValue) {
|
|
353
|
+
var rgb = /rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(rgbValue);
|
|
354
|
+
return rgb ? ("rgba(" + (rgb[1]) + ",1)") : rgbValue;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
function hexToRgba(hexValue) {
|
|
358
|
+
var rgx = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
359
|
+
var hex = hexValue.replace(rgx, function (m, r, g, b) { return r + r + g + g + b + b; } );
|
|
360
|
+
var rgb = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
361
|
+
var r = parseInt(rgb[1], 16);
|
|
362
|
+
var g = parseInt(rgb[2], 16);
|
|
363
|
+
var b = parseInt(rgb[3], 16);
|
|
364
|
+
return ("rgba(" + r + "," + g + "," + b + ",1)");
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
function hslToRgba(hslValue) {
|
|
368
|
+
var hsl = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(hslValue) || /hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(hslValue);
|
|
369
|
+
var h = parseInt(hsl[1], 10) / 360;
|
|
370
|
+
var s = parseInt(hsl[2], 10) / 100;
|
|
371
|
+
var l = parseInt(hsl[3], 10) / 100;
|
|
372
|
+
var a = hsl[4] || 1;
|
|
373
|
+
function hue2rgb(p, q, t) {
|
|
374
|
+
if (t < 0) { t += 1; }
|
|
375
|
+
if (t > 1) { t -= 1; }
|
|
376
|
+
if (t < 1/6) { return p + (q - p) * 6 * t; }
|
|
377
|
+
if (t < 1/2) { return q; }
|
|
378
|
+
if (t < 2/3) { return p + (q - p) * (2/3 - t) * 6; }
|
|
379
|
+
return p;
|
|
380
|
+
}
|
|
381
|
+
var r, g, b;
|
|
382
|
+
if (s == 0) {
|
|
383
|
+
r = g = b = l;
|
|
384
|
+
} else {
|
|
385
|
+
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
386
|
+
var p = 2 * l - q;
|
|
387
|
+
r = hue2rgb(p, q, h + 1/3);
|
|
388
|
+
g = hue2rgb(p, q, h);
|
|
389
|
+
b = hue2rgb(p, q, h - 1/3);
|
|
390
|
+
}
|
|
391
|
+
return ("rgba(" + (r * 255) + "," + (g * 255) + "," + (b * 255) + "," + a + ")");
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
function colorToRgb(val) {
|
|
395
|
+
if (is.rgb(val)) { return rgbToRgba(val); }
|
|
396
|
+
if (is.hex(val)) { return hexToRgba(val); }
|
|
397
|
+
if (is.hsl(val)) { return hslToRgba(val); }
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
// Units
|
|
401
|
+
|
|
402
|
+
function getUnit(val) {
|
|
403
|
+
var split = /[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(val);
|
|
404
|
+
if (split) { return split[1]; }
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
function getTransformUnit(propName) {
|
|
408
|
+
if (stringContains(propName, 'translate') || propName === 'perspective') { return 'px'; }
|
|
409
|
+
if (stringContains(propName, 'rotate') || stringContains(propName, 'skew')) { return 'deg'; }
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// Values
|
|
413
|
+
|
|
414
|
+
function getFunctionValue(val, animatable) {
|
|
415
|
+
if (!is.fnc(val)) { return val; }
|
|
416
|
+
return val(animatable.target, animatable.id, animatable.total);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
function getAttribute(el, prop) {
|
|
420
|
+
return el.getAttribute(prop);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
function convertPxToUnit(el, value, unit) {
|
|
424
|
+
var valueUnit = getUnit(value);
|
|
425
|
+
if (arrayContains([unit, 'deg', 'rad', 'turn'], valueUnit)) { return value; }
|
|
426
|
+
var cached = cache.CSS[value + unit];
|
|
427
|
+
if (!is.und(cached)) { return cached; }
|
|
428
|
+
var baseline = 100;
|
|
429
|
+
var tempEl = document.createElement(el.tagName);
|
|
430
|
+
var parentEl = (el.parentNode && (el.parentNode !== document)) ? el.parentNode : document.body;
|
|
431
|
+
parentEl.appendChild(tempEl);
|
|
432
|
+
tempEl.style.position = 'absolute';
|
|
433
|
+
tempEl.style.width = baseline + unit;
|
|
434
|
+
var factor = baseline / tempEl.offsetWidth;
|
|
435
|
+
parentEl.removeChild(tempEl);
|
|
436
|
+
var convertedUnit = factor * parseFloat(value);
|
|
437
|
+
cache.CSS[value + unit] = convertedUnit;
|
|
438
|
+
return convertedUnit;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
function getCSSValue(el, prop, unit) {
|
|
442
|
+
if (prop in el.style) {
|
|
443
|
+
var uppercasePropName = prop.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
444
|
+
var value = el.style[prop] || getComputedStyle(el).getPropertyValue(uppercasePropName) || '0';
|
|
445
|
+
return unit ? convertPxToUnit(el, value, unit) : value;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
function getAnimationType(el, prop) {
|
|
450
|
+
if (is.dom(el) && !is.inp(el) && (!is.nil(getAttribute(el, prop)) || (is.svg(el) && el[prop]))) { return 'attribute'; }
|
|
451
|
+
if (is.dom(el) && arrayContains(validTransforms, prop)) { return 'transform'; }
|
|
452
|
+
if (is.dom(el) && (prop !== 'transform' && getCSSValue(el, prop))) { return 'css'; }
|
|
453
|
+
if (el[prop] != null) { return 'object'; }
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
function getElementTransforms(el) {
|
|
457
|
+
if (!is.dom(el)) { return; }
|
|
458
|
+
var str = el.style.transform || '';
|
|
459
|
+
var reg = /(\w+)\(([^)]*)\)/g;
|
|
460
|
+
var transforms = new Map();
|
|
461
|
+
var m; while (m = reg.exec(str)) { transforms.set(m[1], m[2]); }
|
|
462
|
+
return transforms;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
function getTransformValue(el, propName, animatable, unit) {
|
|
466
|
+
var defaultVal = stringContains(propName, 'scale') ? 1 : 0 + getTransformUnit(propName);
|
|
467
|
+
var value = getElementTransforms(el).get(propName) || defaultVal;
|
|
468
|
+
if (animatable) {
|
|
469
|
+
animatable.transforms.list.set(propName, value);
|
|
470
|
+
animatable.transforms['last'] = propName;
|
|
471
|
+
}
|
|
472
|
+
return unit ? convertPxToUnit(el, value, unit) : value;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
function getOriginalTargetValue(target, propName, unit, animatable) {
|
|
476
|
+
switch (getAnimationType(target, propName)) {
|
|
477
|
+
case 'transform': return getTransformValue(target, propName, animatable, unit);
|
|
478
|
+
case 'css': return getCSSValue(target, propName, unit);
|
|
479
|
+
case 'attribute': return getAttribute(target, propName);
|
|
480
|
+
default: return target[propName] || 0;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
function getRelativeValue(to, from) {
|
|
485
|
+
var operator = /^(\*=|\+=|-=)/.exec(to);
|
|
486
|
+
if (!operator) { return to; }
|
|
487
|
+
var u = getUnit(to) || 0;
|
|
488
|
+
var x = parseFloat(from);
|
|
489
|
+
var y = parseFloat(to.replace(operator[0], ''));
|
|
490
|
+
switch (operator[0][0]) {
|
|
491
|
+
case '+': return x + y + u;
|
|
492
|
+
case '-': return x - y + u;
|
|
493
|
+
case '*': return x * y + u;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
function validateValue(val, unit) {
|
|
498
|
+
if (is.col(val)) { return colorToRgb(val); }
|
|
499
|
+
if (/\s/g.test(val)) { return val; }
|
|
500
|
+
var originalUnit = getUnit(val);
|
|
501
|
+
var unitLess = originalUnit ? val.substr(0, val.length - originalUnit.length) : val;
|
|
502
|
+
if (unit) { return unitLess + unit; }
|
|
503
|
+
return unitLess;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
// getTotalLength() equivalent for circle, rect, polyline, polygon and line shapes
|
|
507
|
+
// adapted from https://gist.github.com/SebLambla/3e0550c496c236709744
|
|
508
|
+
|
|
509
|
+
function getDistance(p1, p2) {
|
|
510
|
+
return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
function getCircleLength(el) {
|
|
514
|
+
return Math.PI * 2 * getAttribute(el, 'r');
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
function getRectLength(el) {
|
|
518
|
+
return (getAttribute(el, 'width') * 2) + (getAttribute(el, 'height') * 2);
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
function getLineLength(el) {
|
|
522
|
+
return getDistance(
|
|
523
|
+
{x: getAttribute(el, 'x1'), y: getAttribute(el, 'y1')},
|
|
524
|
+
{x: getAttribute(el, 'x2'), y: getAttribute(el, 'y2')}
|
|
525
|
+
);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
function getPolylineLength(el) {
|
|
529
|
+
var points = el.points;
|
|
530
|
+
var totalLength = 0;
|
|
531
|
+
var previousPos;
|
|
532
|
+
for (var i = 0 ; i < points.numberOfItems; i++) {
|
|
533
|
+
var currentPos = points.getItem(i);
|
|
534
|
+
if (i > 0) { totalLength += getDistance(previousPos, currentPos); }
|
|
535
|
+
previousPos = currentPos;
|
|
536
|
+
}
|
|
537
|
+
return totalLength;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
function getPolygonLength(el) {
|
|
541
|
+
var points = el.points;
|
|
542
|
+
return getPolylineLength(el) + getDistance(points.getItem(points.numberOfItems - 1), points.getItem(0));
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
// Path animation
|
|
546
|
+
|
|
547
|
+
function getTotalLength(el) {
|
|
548
|
+
if (el.getTotalLength) { return el.getTotalLength(); }
|
|
549
|
+
switch(el.tagName.toLowerCase()) {
|
|
550
|
+
case 'circle': return getCircleLength(el);
|
|
551
|
+
case 'rect': return getRectLength(el);
|
|
552
|
+
case 'line': return getLineLength(el);
|
|
553
|
+
case 'polyline': return getPolylineLength(el);
|
|
554
|
+
case 'polygon': return getPolygonLength(el);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
function setDashoffset(el) {
|
|
559
|
+
var pathLength = getTotalLength(el);
|
|
560
|
+
el.setAttribute('stroke-dasharray', pathLength);
|
|
561
|
+
return pathLength;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
// Motion path
|
|
565
|
+
|
|
566
|
+
function getParentSvgEl(el) {
|
|
567
|
+
var parentEl = el.parentNode;
|
|
568
|
+
while (is.svg(parentEl)) {
|
|
569
|
+
if (!is.svg(parentEl.parentNode)) { break; }
|
|
570
|
+
parentEl = parentEl.parentNode;
|
|
571
|
+
}
|
|
572
|
+
return parentEl;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
function getParentSvg(pathEl, svgData) {
|
|
576
|
+
var svg = svgData || {};
|
|
577
|
+
var parentSvgEl = svg.el || getParentSvgEl(pathEl);
|
|
578
|
+
var rect = parentSvgEl.getBoundingClientRect();
|
|
579
|
+
var viewBoxAttr = getAttribute(parentSvgEl, 'viewBox');
|
|
580
|
+
var width = rect.width;
|
|
581
|
+
var height = rect.height;
|
|
582
|
+
var viewBox = svg.viewBox || (viewBoxAttr ? viewBoxAttr.split(' ') : [0, 0, width, height]);
|
|
583
|
+
return {
|
|
584
|
+
el: parentSvgEl,
|
|
585
|
+
viewBox: viewBox,
|
|
586
|
+
x: viewBox[0] / 1,
|
|
587
|
+
y: viewBox[1] / 1,
|
|
588
|
+
w: width,
|
|
589
|
+
h: height,
|
|
590
|
+
vW: viewBox[2],
|
|
591
|
+
vH: viewBox[3]
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
function getPath(path, percent) {
|
|
596
|
+
var pathEl = is.str(path) ? selectString(path)[0] : path;
|
|
597
|
+
var p = percent || 100;
|
|
598
|
+
return function(property) {
|
|
599
|
+
return {
|
|
600
|
+
property: property,
|
|
601
|
+
el: pathEl,
|
|
602
|
+
svg: getParentSvg(pathEl),
|
|
603
|
+
totalLength: getTotalLength(pathEl) * (p / 100)
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
function getPathProgress(path, progress, isPathTargetInsideSVG) {
|
|
609
|
+
function point(offset) {
|
|
610
|
+
if ( offset === void 0 ) offset = 0;
|
|
611
|
+
|
|
612
|
+
var l = progress + offset >= 1 ? progress + offset : 0;
|
|
613
|
+
return path.el.getPointAtLength(l);
|
|
614
|
+
}
|
|
615
|
+
var svg = getParentSvg(path.el, path.svg);
|
|
616
|
+
var p = point();
|
|
617
|
+
var p0 = point(-1);
|
|
618
|
+
var p1 = point(1);
|
|
619
|
+
var scaleX = isPathTargetInsideSVG ? 1 : svg.w / svg.vW;
|
|
620
|
+
var scaleY = isPathTargetInsideSVG ? 1 : svg.h / svg.vH;
|
|
621
|
+
switch (path.property) {
|
|
622
|
+
case 'x': return (p.x - svg.x) * scaleX;
|
|
623
|
+
case 'y': return (p.y - svg.y) * scaleY;
|
|
624
|
+
case 'angle': return Math.atan2(p1.y - p0.y, p1.x - p0.x) * 180 / Math.PI;
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
// Decompose value
|
|
629
|
+
|
|
630
|
+
function decomposeValue(val, unit) {
|
|
631
|
+
// const rgx = /-?\d*\.?\d+/g; // handles basic numbers
|
|
632
|
+
// const rgx = /[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g; // handles exponents notation
|
|
633
|
+
var rgx = /[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g; // handles exponents notation
|
|
634
|
+
var value = validateValue((is.pth(val) ? val.totalLength : val), unit) + '';
|
|
635
|
+
return {
|
|
636
|
+
original: value,
|
|
637
|
+
numbers: value.match(rgx) ? value.match(rgx).map(Number) : [0],
|
|
638
|
+
strings: (is.str(val) || unit) ? value.split(rgx) : []
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
// Animatables
|
|
643
|
+
|
|
644
|
+
function parseTargets(targets) {
|
|
645
|
+
var targetsArray = targets ? (flattenArray(is.arr(targets) ? targets.map(toArray) : toArray(targets))) : [];
|
|
646
|
+
return filterArray(targetsArray, function (item, pos, self) { return self.indexOf(item) === pos; });
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
function getAnimatables(targets) {
|
|
650
|
+
var parsed = parseTargets(targets);
|
|
651
|
+
return parsed.map(function (t, i) {
|
|
652
|
+
return {target: t, id: i, total: parsed.length, transforms: { list: getElementTransforms(t) } };
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
// Properties
|
|
657
|
+
|
|
658
|
+
function normalizePropertyTweens(prop, tweenSettings) {
|
|
659
|
+
var settings = cloneObject(tweenSettings);
|
|
660
|
+
// Override duration if easing is a spring
|
|
661
|
+
if (/^spring/.test(settings.easing)) { settings.duration = spring(settings.easing); }
|
|
662
|
+
if (is.arr(prop)) {
|
|
663
|
+
var l = prop.length;
|
|
664
|
+
var isFromTo = (l === 2 && !is.obj(prop[0]));
|
|
665
|
+
if (!isFromTo) {
|
|
666
|
+
// Duration divided by the number of tweens
|
|
667
|
+
if (!is.fnc(tweenSettings.duration)) { settings.duration = tweenSettings.duration / l; }
|
|
668
|
+
} else {
|
|
669
|
+
// Transform [from, to] values shorthand to a valid tween value
|
|
670
|
+
prop = {value: prop};
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
var propArray = is.arr(prop) ? prop : [prop];
|
|
674
|
+
return propArray.map(function (v, i) {
|
|
675
|
+
var obj = (is.obj(v) && !is.pth(v)) ? v : {value: v};
|
|
676
|
+
// Default delay value should only be applied to the first tween
|
|
677
|
+
if (is.und(obj.delay)) { obj.delay = !i ? tweenSettings.delay : 0; }
|
|
678
|
+
// Default endDelay value should only be applied to the last tween
|
|
679
|
+
if (is.und(obj.endDelay)) { obj.endDelay = i === propArray.length - 1 ? tweenSettings.endDelay : 0; }
|
|
680
|
+
return obj;
|
|
681
|
+
}).map(function (k) { return mergeObjects(k, settings); });
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
function flattenKeyframes(keyframes) {
|
|
686
|
+
var propertyNames = filterArray(flattenArray(keyframes.map(function (key) { return Object.keys(key); })), function (p) { return is.key(p); })
|
|
687
|
+
.reduce(function (a,b) { if (a.indexOf(b) < 0) { a.push(b); } return a; }, []);
|
|
688
|
+
var properties = {};
|
|
689
|
+
var loop = function ( i ) {
|
|
690
|
+
var propName = propertyNames[i];
|
|
691
|
+
properties[propName] = keyframes.map(function (key) {
|
|
692
|
+
var newKey = {};
|
|
693
|
+
for (var p in key) {
|
|
694
|
+
if (is.key(p)) {
|
|
695
|
+
if (p == propName) { newKey.value = key[p]; }
|
|
696
|
+
} else {
|
|
697
|
+
newKey[p] = key[p];
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
return newKey;
|
|
701
|
+
});
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
for (var i = 0; i < propertyNames.length; i++) loop( i );
|
|
705
|
+
return properties;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
function getProperties(tweenSettings, params) {
|
|
709
|
+
var properties = [];
|
|
710
|
+
var keyframes = params.keyframes;
|
|
711
|
+
if (keyframes) { params = mergeObjects(flattenKeyframes(keyframes), params); }
|
|
712
|
+
for (var p in params) {
|
|
713
|
+
if (is.key(p)) {
|
|
714
|
+
properties.push({
|
|
715
|
+
name: p,
|
|
716
|
+
tweens: normalizePropertyTweens(params[p], tweenSettings)
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
return properties;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// Tweens
|
|
724
|
+
|
|
725
|
+
function normalizeTweenValues(tween, animatable) {
|
|
726
|
+
var t = {};
|
|
727
|
+
for (var p in tween) {
|
|
728
|
+
var value = getFunctionValue(tween[p], animatable);
|
|
729
|
+
if (is.arr(value)) {
|
|
730
|
+
value = value.map(function (v) { return getFunctionValue(v, animatable); });
|
|
731
|
+
if (value.length === 1) { value = value[0]; }
|
|
732
|
+
}
|
|
733
|
+
t[p] = value;
|
|
734
|
+
}
|
|
735
|
+
t.duration = parseFloat(t.duration);
|
|
736
|
+
t.delay = parseFloat(t.delay);
|
|
737
|
+
return t;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
function normalizeTweens(prop, animatable) {
|
|
741
|
+
var previousTween;
|
|
742
|
+
return prop.tweens.map(function (t) {
|
|
743
|
+
var tween = normalizeTweenValues(t, animatable);
|
|
744
|
+
var tweenValue = tween.value;
|
|
745
|
+
var to = is.arr(tweenValue) ? tweenValue[1] : tweenValue;
|
|
746
|
+
var toUnit = getUnit(to);
|
|
747
|
+
var originalValue = getOriginalTargetValue(animatable.target, prop.name, toUnit, animatable);
|
|
748
|
+
var previousValue = previousTween ? previousTween.to.original : originalValue;
|
|
749
|
+
var from = is.arr(tweenValue) ? tweenValue[0] : previousValue;
|
|
750
|
+
var fromUnit = getUnit(from) || getUnit(originalValue);
|
|
751
|
+
var unit = toUnit || fromUnit;
|
|
752
|
+
if (is.und(to)) { to = previousValue; }
|
|
753
|
+
tween.from = decomposeValue(from, unit);
|
|
754
|
+
tween.to = decomposeValue(getRelativeValue(to, from), unit);
|
|
755
|
+
tween.start = previousTween ? previousTween.end : 0;
|
|
756
|
+
tween.end = tween.start + tween.delay + tween.duration + tween.endDelay;
|
|
757
|
+
tween.easing = parseEasings(tween.easing, tween.duration);
|
|
758
|
+
tween.isPath = is.pth(tweenValue);
|
|
759
|
+
tween.isPathTargetInsideSVG = tween.isPath && is.svg(animatable.target);
|
|
760
|
+
tween.isColor = is.col(tween.from.original);
|
|
761
|
+
if (tween.isColor) { tween.round = 1; }
|
|
762
|
+
previousTween = tween;
|
|
763
|
+
return tween;
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
// Tween progress
|
|
768
|
+
|
|
769
|
+
var setProgressValue = {
|
|
770
|
+
css: function (t, p, v) { return t.style[p] = v; },
|
|
771
|
+
attribute: function (t, p, v) { return t.setAttribute(p, v); },
|
|
772
|
+
object: function (t, p, v) { return t[p] = v; },
|
|
773
|
+
transform: function (t, p, v, transforms, manual) {
|
|
774
|
+
transforms.list.set(p, v);
|
|
775
|
+
if (p === transforms.last || manual) {
|
|
776
|
+
var str = '';
|
|
777
|
+
transforms.list.forEach(function (value, prop) { str += prop + "(" + value + ") "; });
|
|
778
|
+
t.style.transform = str;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
};
|
|
782
|
+
|
|
783
|
+
// Set Value helper
|
|
784
|
+
|
|
785
|
+
function setTargetsValue(targets, properties) {
|
|
786
|
+
var animatables = getAnimatables(targets);
|
|
787
|
+
animatables.forEach(function (animatable) {
|
|
788
|
+
for (var property in properties) {
|
|
789
|
+
var value = getFunctionValue(properties[property], animatable);
|
|
790
|
+
var target = animatable.target;
|
|
791
|
+
var valueUnit = getUnit(value);
|
|
792
|
+
var originalValue = getOriginalTargetValue(target, property, valueUnit, animatable);
|
|
793
|
+
var unit = valueUnit || getUnit(originalValue);
|
|
794
|
+
var to = getRelativeValue(validateValue(value, unit), originalValue);
|
|
795
|
+
var animType = getAnimationType(target, property);
|
|
796
|
+
setProgressValue[animType](target, property, to, animatable.transforms, true);
|
|
797
|
+
}
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
// Animations
|
|
802
|
+
|
|
803
|
+
function createAnimation(animatable, prop) {
|
|
804
|
+
var animType = getAnimationType(animatable.target, prop.name);
|
|
805
|
+
if (animType) {
|
|
806
|
+
var tweens = normalizeTweens(prop, animatable);
|
|
807
|
+
var lastTween = tweens[tweens.length - 1];
|
|
808
|
+
return {
|
|
809
|
+
type: animType,
|
|
810
|
+
property: prop.name,
|
|
811
|
+
animatable: animatable,
|
|
812
|
+
tweens: tweens,
|
|
813
|
+
duration: lastTween.end,
|
|
814
|
+
delay: tweens[0].delay,
|
|
815
|
+
endDelay: lastTween.endDelay
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
function getAnimations(animatables, properties) {
|
|
821
|
+
return filterArray(flattenArray(animatables.map(function (animatable) {
|
|
822
|
+
return properties.map(function (prop) {
|
|
823
|
+
return createAnimation(animatable, prop);
|
|
824
|
+
});
|
|
825
|
+
})), function (a) { return !is.und(a); });
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
// Create Instance
|
|
829
|
+
|
|
830
|
+
function getInstanceTimings(animations, tweenSettings) {
|
|
831
|
+
var animLength = animations.length;
|
|
832
|
+
var getTlOffset = function (anim) { return anim.timelineOffset ? anim.timelineOffset : 0; };
|
|
833
|
+
var timings = {};
|
|
834
|
+
timings.duration = animLength ? Math.max.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.duration; })) : tweenSettings.duration;
|
|
835
|
+
timings.delay = animLength ? Math.min.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.delay; })) : tweenSettings.delay;
|
|
836
|
+
timings.endDelay = animLength ? timings.duration - Math.max.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.duration - anim.endDelay; })) : tweenSettings.endDelay;
|
|
837
|
+
return timings;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
var instanceID = 0;
|
|
841
|
+
|
|
842
|
+
function createNewInstance(params) {
|
|
843
|
+
var instanceSettings = replaceObjectProps(defaultInstanceSettings, params);
|
|
844
|
+
var tweenSettings = replaceObjectProps(defaultTweenSettings, params);
|
|
845
|
+
var properties = getProperties(tweenSettings, params);
|
|
846
|
+
var animatables = getAnimatables(params.targets);
|
|
847
|
+
var animations = getAnimations(animatables, properties);
|
|
848
|
+
var timings = getInstanceTimings(animations, tweenSettings);
|
|
849
|
+
var id = instanceID;
|
|
850
|
+
instanceID++;
|
|
851
|
+
return mergeObjects(instanceSettings, {
|
|
852
|
+
id: id,
|
|
853
|
+
children: [],
|
|
854
|
+
animatables: animatables,
|
|
855
|
+
animations: animations,
|
|
856
|
+
duration: timings.duration,
|
|
857
|
+
delay: timings.delay,
|
|
858
|
+
endDelay: timings.endDelay
|
|
859
|
+
});
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
// Core
|
|
863
|
+
|
|
864
|
+
var activeInstances = [];
|
|
865
|
+
|
|
866
|
+
var engine = (function () {
|
|
867
|
+
var raf;
|
|
868
|
+
|
|
869
|
+
function play() {
|
|
870
|
+
if (!raf && (!isDocumentHidden() || !anime.suspendWhenDocumentHidden) && activeInstances.length > 0) {
|
|
871
|
+
raf = requestAnimationFrame(step);
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
function step(t) {
|
|
875
|
+
// memo on algorithm issue:
|
|
876
|
+
// dangerous iteration over mutable `activeInstances`
|
|
877
|
+
// (that collection may be updated from within callbacks of `tick`-ed animation instances)
|
|
878
|
+
var activeInstancesLength = activeInstances.length;
|
|
879
|
+
var i = 0;
|
|
880
|
+
while (i < activeInstancesLength) {
|
|
881
|
+
var activeInstance = activeInstances[i];
|
|
882
|
+
if (!activeInstance.paused) {
|
|
883
|
+
activeInstance.tick(t);
|
|
884
|
+
i++;
|
|
885
|
+
} else {
|
|
886
|
+
activeInstances.splice(i, 1);
|
|
887
|
+
activeInstancesLength--;
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
raf = i > 0 ? requestAnimationFrame(step) : undefined;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
function handleVisibilityChange() {
|
|
894
|
+
if (!anime.suspendWhenDocumentHidden) { return; }
|
|
895
|
+
|
|
896
|
+
if (isDocumentHidden()) {
|
|
897
|
+
// suspend ticks
|
|
898
|
+
raf = cancelAnimationFrame(raf);
|
|
899
|
+
} else { // is back to active tab
|
|
900
|
+
// first adjust animations to consider the time that ticks were suspended
|
|
901
|
+
activeInstances.forEach(
|
|
902
|
+
function (instance) { return instance ._onDocumentVisibility(); }
|
|
903
|
+
);
|
|
904
|
+
engine();
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
if (typeof document !== 'undefined') {
|
|
908
|
+
document.addEventListener('visibilitychange', handleVisibilityChange);
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
return play;
|
|
912
|
+
})();
|
|
913
|
+
|
|
914
|
+
function isDocumentHidden() {
|
|
915
|
+
return !!document && document.hidden;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
// Public Instance
|
|
919
|
+
|
|
920
|
+
function anime(params) {
|
|
921
|
+
if ( params === void 0 ) params = {};
|
|
922
|
+
|
|
923
|
+
|
|
924
|
+
var startTime = 0, lastTime = 0, now = 0;
|
|
925
|
+
var children, childrenLength = 0;
|
|
926
|
+
var resolve = null;
|
|
927
|
+
|
|
928
|
+
function makePromise(instance) {
|
|
929
|
+
var promise = window.Promise && new Promise(function (_resolve) { return resolve = _resolve; });
|
|
930
|
+
instance.finished = promise;
|
|
931
|
+
return promise;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
var instance = createNewInstance(params);
|
|
935
|
+
makePromise(instance);
|
|
936
|
+
|
|
937
|
+
function toggleInstanceDirection() {
|
|
938
|
+
var direction = instance.direction;
|
|
939
|
+
if (direction !== 'alternate') {
|
|
940
|
+
instance.direction = direction !== 'normal' ? 'normal' : 'reverse';
|
|
941
|
+
}
|
|
942
|
+
instance.reversed = !instance.reversed;
|
|
943
|
+
children.forEach(function (child) { return child.reversed = instance.reversed; });
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
function adjustTime(time) {
|
|
947
|
+
return instance.reversed ? instance.duration - time : time;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
function resetTime() {
|
|
951
|
+
startTime = 0;
|
|
952
|
+
lastTime = adjustTime(instance.currentTime) * (1 / anime.speed);
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
function seekChild(time, child) {
|
|
956
|
+
if (child) { child.seek(time - child.timelineOffset); }
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
function syncInstanceChildren(time) {
|
|
960
|
+
if (!instance.reversePlayback) {
|
|
961
|
+
for (var i = 0; i < childrenLength; i++) { seekChild(time, children[i]); }
|
|
962
|
+
} else {
|
|
963
|
+
for (var i$1 = childrenLength; i$1--;) { seekChild(time, children[i$1]); }
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
function setAnimationsProgress(insTime) {
|
|
968
|
+
var i = 0;
|
|
969
|
+
var animations = instance.animations;
|
|
970
|
+
var animationsLength = animations.length;
|
|
971
|
+
while (i < animationsLength) {
|
|
972
|
+
var anim = animations[i];
|
|
973
|
+
var animatable = anim.animatable;
|
|
974
|
+
var tweens = anim.tweens;
|
|
975
|
+
var tweenLength = tweens.length - 1;
|
|
976
|
+
var tween = tweens[tweenLength];
|
|
977
|
+
// Only check for keyframes if there is more than one tween
|
|
978
|
+
if (tweenLength) { tween = filterArray(tweens, function (t) { return (insTime < t.end); })[0] || tween; }
|
|
979
|
+
var elapsed = minMax(insTime - tween.start - tween.delay, 0, tween.duration) / tween.duration;
|
|
980
|
+
var eased = isNaN(elapsed) ? 1 : tween.easing(elapsed);
|
|
981
|
+
var strings = tween.to.strings;
|
|
982
|
+
var round = tween.round;
|
|
983
|
+
var numbers = [];
|
|
984
|
+
var toNumbersLength = tween.to.numbers.length;
|
|
985
|
+
var progress = (void 0);
|
|
986
|
+
for (var n = 0; n < toNumbersLength; n++) {
|
|
987
|
+
var value = (void 0);
|
|
988
|
+
var toNumber = tween.to.numbers[n];
|
|
989
|
+
var fromNumber = tween.from.numbers[n] || 0;
|
|
990
|
+
if (!tween.isPath) {
|
|
991
|
+
value = fromNumber + (eased * (toNumber - fromNumber));
|
|
992
|
+
} else {
|
|
993
|
+
value = getPathProgress(tween.value, eased * toNumber, tween.isPathTargetInsideSVG);
|
|
994
|
+
}
|
|
995
|
+
if (round) {
|
|
996
|
+
if (!(tween.isColor && n > 2)) {
|
|
997
|
+
value = Math.round(value * round) / round;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
numbers.push(value);
|
|
1001
|
+
}
|
|
1002
|
+
// Manual Array.reduce for better performances
|
|
1003
|
+
var stringsLength = strings.length;
|
|
1004
|
+
if (!stringsLength) {
|
|
1005
|
+
progress = numbers[0];
|
|
1006
|
+
} else {
|
|
1007
|
+
progress = strings[0];
|
|
1008
|
+
for (var s = 0; s < stringsLength; s++) {
|
|
1009
|
+
var b = strings[s + 1];
|
|
1010
|
+
var n$1 = numbers[s];
|
|
1011
|
+
if (!isNaN(n$1)) {
|
|
1012
|
+
if (!b) {
|
|
1013
|
+
progress += n$1 + ' ';
|
|
1014
|
+
} else {
|
|
1015
|
+
progress += n$1 + b;
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
setProgressValue[anim.type](animatable.target, anim.property, progress, animatable.transforms);
|
|
1021
|
+
anim.currentValue = progress;
|
|
1022
|
+
i++;
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
function setCallback(cb) {
|
|
1027
|
+
if (instance[cb] && !instance.passThrough) { instance[cb](instance); }
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
function countIteration() {
|
|
1031
|
+
if (instance.remaining && instance.remaining !== true) {
|
|
1032
|
+
instance.remaining--;
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
function setInstanceProgress(engineTime) {
|
|
1037
|
+
var insDuration = instance.duration;
|
|
1038
|
+
var insDelay = instance.delay;
|
|
1039
|
+
var insEndDelay = insDuration - instance.endDelay;
|
|
1040
|
+
var insTime = adjustTime(engineTime);
|
|
1041
|
+
instance.progress = minMax((insTime / insDuration) * 100, 0, 100);
|
|
1042
|
+
instance.reversePlayback = insTime < instance.currentTime;
|
|
1043
|
+
if (children) { syncInstanceChildren(insTime); }
|
|
1044
|
+
if (!instance.began && instance.currentTime > 0) {
|
|
1045
|
+
instance.began = true;
|
|
1046
|
+
setCallback('begin');
|
|
1047
|
+
}
|
|
1048
|
+
if (!instance.loopBegan && instance.currentTime > 0) {
|
|
1049
|
+
instance.loopBegan = true;
|
|
1050
|
+
setCallback('loopBegin');
|
|
1051
|
+
}
|
|
1052
|
+
if (insTime <= insDelay && instance.currentTime !== 0) {
|
|
1053
|
+
setAnimationsProgress(0);
|
|
1054
|
+
}
|
|
1055
|
+
if ((insTime >= insEndDelay && instance.currentTime !== insDuration) || !insDuration) {
|
|
1056
|
+
setAnimationsProgress(insDuration);
|
|
1057
|
+
}
|
|
1058
|
+
if (insTime > insDelay && insTime < insEndDelay) {
|
|
1059
|
+
if (!instance.changeBegan) {
|
|
1060
|
+
instance.changeBegan = true;
|
|
1061
|
+
instance.changeCompleted = false;
|
|
1062
|
+
setCallback('changeBegin');
|
|
1063
|
+
}
|
|
1064
|
+
setCallback('change');
|
|
1065
|
+
setAnimationsProgress(insTime);
|
|
1066
|
+
} else {
|
|
1067
|
+
if (instance.changeBegan) {
|
|
1068
|
+
instance.changeCompleted = true;
|
|
1069
|
+
instance.changeBegan = false;
|
|
1070
|
+
setCallback('changeComplete');
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
instance.currentTime = minMax(insTime, 0, insDuration);
|
|
1074
|
+
if (instance.began) { setCallback('update'); }
|
|
1075
|
+
if (engineTime >= insDuration) {
|
|
1076
|
+
lastTime = 0;
|
|
1077
|
+
countIteration();
|
|
1078
|
+
if (!instance.remaining) {
|
|
1079
|
+
instance.paused = true;
|
|
1080
|
+
if (!instance.completed) {
|
|
1081
|
+
instance.completed = true;
|
|
1082
|
+
setCallback('loopComplete');
|
|
1083
|
+
setCallback('complete');
|
|
1084
|
+
if (!instance.passThrough && 'Promise' in window) {
|
|
1085
|
+
resolve();
|
|
1086
|
+
makePromise(instance);
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
} else {
|
|
1090
|
+
startTime = now;
|
|
1091
|
+
setCallback('loopComplete');
|
|
1092
|
+
instance.loopBegan = false;
|
|
1093
|
+
if (instance.direction === 'alternate') {
|
|
1094
|
+
toggleInstanceDirection();
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
instance.reset = function() {
|
|
1101
|
+
var direction = instance.direction;
|
|
1102
|
+
instance.passThrough = false;
|
|
1103
|
+
instance.currentTime = 0;
|
|
1104
|
+
instance.progress = 0;
|
|
1105
|
+
instance.paused = true;
|
|
1106
|
+
instance.began = false;
|
|
1107
|
+
instance.loopBegan = false;
|
|
1108
|
+
instance.changeBegan = false;
|
|
1109
|
+
instance.completed = false;
|
|
1110
|
+
instance.changeCompleted = false;
|
|
1111
|
+
instance.reversePlayback = false;
|
|
1112
|
+
instance.reversed = direction === 'reverse';
|
|
1113
|
+
instance.remaining = instance.loop;
|
|
1114
|
+
children = instance.children;
|
|
1115
|
+
childrenLength = children.length;
|
|
1116
|
+
for (var i = childrenLength; i--;) { instance.children[i].reset(); }
|
|
1117
|
+
if (instance.reversed && instance.loop !== true || (direction === 'alternate' && instance.loop === 1)) { instance.remaining++; }
|
|
1118
|
+
setAnimationsProgress(instance.reversed ? instance.duration : 0);
|
|
1119
|
+
};
|
|
1120
|
+
|
|
1121
|
+
// internal method (for engine) to adjust animation timings before restoring engine ticks (rAF)
|
|
1122
|
+
instance._onDocumentVisibility = resetTime;
|
|
1123
|
+
|
|
1124
|
+
// Set Value helper
|
|
1125
|
+
|
|
1126
|
+
instance.set = function(targets, properties) {
|
|
1127
|
+
setTargetsValue(targets, properties);
|
|
1128
|
+
return instance;
|
|
1129
|
+
};
|
|
1130
|
+
|
|
1131
|
+
instance.tick = function(t) {
|
|
1132
|
+
now = t;
|
|
1133
|
+
if (!startTime) { startTime = now; }
|
|
1134
|
+
setInstanceProgress((now + (lastTime - startTime)) * anime.speed);
|
|
1135
|
+
};
|
|
1136
|
+
|
|
1137
|
+
instance.seek = function(time) {
|
|
1138
|
+
setInstanceProgress(adjustTime(time));
|
|
1139
|
+
};
|
|
1140
|
+
|
|
1141
|
+
instance.pause = function() {
|
|
1142
|
+
instance.paused = true;
|
|
1143
|
+
resetTime();
|
|
1144
|
+
};
|
|
1145
|
+
|
|
1146
|
+
instance.play = function() {
|
|
1147
|
+
if (!instance.paused) { return; }
|
|
1148
|
+
if (instance.completed) { instance.reset(); }
|
|
1149
|
+
instance.paused = false;
|
|
1150
|
+
activeInstances.push(instance);
|
|
1151
|
+
resetTime();
|
|
1152
|
+
engine();
|
|
1153
|
+
};
|
|
1154
|
+
|
|
1155
|
+
instance.reverse = function() {
|
|
1156
|
+
toggleInstanceDirection();
|
|
1157
|
+
instance.completed = instance.reversed ? false : true;
|
|
1158
|
+
resetTime();
|
|
1159
|
+
};
|
|
1160
|
+
|
|
1161
|
+
instance.restart = function() {
|
|
1162
|
+
instance.reset();
|
|
1163
|
+
instance.play();
|
|
1164
|
+
};
|
|
1165
|
+
|
|
1166
|
+
instance.remove = function(targets) {
|
|
1167
|
+
var targetsArray = parseTargets(targets);
|
|
1168
|
+
removeTargetsFromInstance(targetsArray, instance);
|
|
1169
|
+
};
|
|
1170
|
+
|
|
1171
|
+
instance.reset();
|
|
1172
|
+
|
|
1173
|
+
if (instance.autoplay) { instance.play(); }
|
|
1174
|
+
|
|
1175
|
+
return instance;
|
|
1176
|
+
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
// Remove targets from animation
|
|
1180
|
+
|
|
1181
|
+
function removeTargetsFromAnimations(targetsArray, animations) {
|
|
1182
|
+
for (var a = animations.length; a--;) {
|
|
1183
|
+
if (arrayContains(targetsArray, animations[a].animatable.target)) {
|
|
1184
|
+
animations.splice(a, 1);
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
function removeTargetsFromInstance(targetsArray, instance) {
|
|
1190
|
+
var animations = instance.animations;
|
|
1191
|
+
var children = instance.children;
|
|
1192
|
+
removeTargetsFromAnimations(targetsArray, animations);
|
|
1193
|
+
for (var c = children.length; c--;) {
|
|
1194
|
+
var child = children[c];
|
|
1195
|
+
var childAnimations = child.animations;
|
|
1196
|
+
removeTargetsFromAnimations(targetsArray, childAnimations);
|
|
1197
|
+
if (!childAnimations.length && !child.children.length) { children.splice(c, 1); }
|
|
1198
|
+
}
|
|
1199
|
+
if (!animations.length && !children.length) { instance.pause(); }
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
function removeTargetsFromActiveInstances(targets) {
|
|
1203
|
+
var targetsArray = parseTargets(targets);
|
|
1204
|
+
for (var i = activeInstances.length; i--;) {
|
|
1205
|
+
var instance = activeInstances[i];
|
|
1206
|
+
removeTargetsFromInstance(targetsArray, instance);
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
// Stagger helpers
|
|
1211
|
+
|
|
1212
|
+
function stagger(val, params) {
|
|
1213
|
+
if ( params === void 0 ) params = {};
|
|
1214
|
+
|
|
1215
|
+
var direction = params.direction || 'normal';
|
|
1216
|
+
var easing = params.easing ? parseEasings(params.easing) : null;
|
|
1217
|
+
var grid = params.grid;
|
|
1218
|
+
var axis = params.axis;
|
|
1219
|
+
var fromIndex = params.from || 0;
|
|
1220
|
+
var fromFirst = fromIndex === 'first';
|
|
1221
|
+
var fromCenter = fromIndex === 'center';
|
|
1222
|
+
var fromLast = fromIndex === 'last';
|
|
1223
|
+
var isRange = is.arr(val);
|
|
1224
|
+
var val1 = isRange ? parseFloat(val[0]) : parseFloat(val);
|
|
1225
|
+
var val2 = isRange ? parseFloat(val[1]) : 0;
|
|
1226
|
+
var unit = getUnit(isRange ? val[1] : val) || 0;
|
|
1227
|
+
var start = params.start || 0 + (isRange ? val1 : 0);
|
|
1228
|
+
var values = [];
|
|
1229
|
+
var maxValue = 0;
|
|
1230
|
+
return function (el, i, t) {
|
|
1231
|
+
if (fromFirst) { fromIndex = 0; }
|
|
1232
|
+
if (fromCenter) { fromIndex = (t - 1) / 2; }
|
|
1233
|
+
if (fromLast) { fromIndex = t - 1; }
|
|
1234
|
+
if (!values.length) {
|
|
1235
|
+
for (var index = 0; index < t; index++) {
|
|
1236
|
+
if (!grid) {
|
|
1237
|
+
values.push(Math.abs(fromIndex - index));
|
|
1238
|
+
} else {
|
|
1239
|
+
var fromX = !fromCenter ? fromIndex%grid[0] : (grid[0]-1)/2;
|
|
1240
|
+
var fromY = !fromCenter ? Math.floor(fromIndex/grid[0]) : (grid[1]-1)/2;
|
|
1241
|
+
var toX = index%grid[0];
|
|
1242
|
+
var toY = Math.floor(index/grid[0]);
|
|
1243
|
+
var distanceX = fromX - toX;
|
|
1244
|
+
var distanceY = fromY - toY;
|
|
1245
|
+
var value = Math.sqrt(distanceX * distanceX + distanceY * distanceY);
|
|
1246
|
+
if (axis === 'x') { value = -distanceX; }
|
|
1247
|
+
if (axis === 'y') { value = -distanceY; }
|
|
1248
|
+
values.push(value);
|
|
1249
|
+
}
|
|
1250
|
+
maxValue = Math.max.apply(Math, values);
|
|
1251
|
+
}
|
|
1252
|
+
if (easing) { values = values.map(function (val) { return easing(val / maxValue) * maxValue; }); }
|
|
1253
|
+
if (direction === 'reverse') { values = values.map(function (val) { return axis ? (val < 0) ? val * -1 : -val : Math.abs(maxValue - val); }); }
|
|
1254
|
+
}
|
|
1255
|
+
var spacing = isRange ? (val2 - val1) / maxValue : val1;
|
|
1256
|
+
return start + (spacing * (Math.round(values[i] * 100) / 100)) + unit;
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
// Timeline
|
|
1261
|
+
|
|
1262
|
+
function timeline(params) {
|
|
1263
|
+
if ( params === void 0 ) params = {};
|
|
1264
|
+
|
|
1265
|
+
var tl = anime(params);
|
|
1266
|
+
tl.duration = 0;
|
|
1267
|
+
tl.add = function(instanceParams, timelineOffset) {
|
|
1268
|
+
var tlIndex = activeInstances.indexOf(tl);
|
|
1269
|
+
var children = tl.children;
|
|
1270
|
+
if (tlIndex > -1) { activeInstances.splice(tlIndex, 1); }
|
|
1271
|
+
function passThrough(ins) { ins.passThrough = true; }
|
|
1272
|
+
for (var i = 0; i < children.length; i++) { passThrough(children[i]); }
|
|
1273
|
+
var insParams = mergeObjects(instanceParams, replaceObjectProps(defaultTweenSettings, params));
|
|
1274
|
+
insParams.targets = insParams.targets || params.targets;
|
|
1275
|
+
var tlDuration = tl.duration;
|
|
1276
|
+
insParams.autoplay = false;
|
|
1277
|
+
insParams.direction = tl.direction;
|
|
1278
|
+
insParams.timelineOffset = is.und(timelineOffset) ? tlDuration : getRelativeValue(timelineOffset, tlDuration);
|
|
1279
|
+
passThrough(tl);
|
|
1280
|
+
tl.seek(insParams.timelineOffset);
|
|
1281
|
+
var ins = anime(insParams);
|
|
1282
|
+
passThrough(ins);
|
|
1283
|
+
children.push(ins);
|
|
1284
|
+
var timings = getInstanceTimings(children, params);
|
|
1285
|
+
tl.delay = timings.delay;
|
|
1286
|
+
tl.endDelay = timings.endDelay;
|
|
1287
|
+
tl.duration = timings.duration;
|
|
1288
|
+
tl.seek(0);
|
|
1289
|
+
tl.reset();
|
|
1290
|
+
if (tl.autoplay) { tl.play(); }
|
|
1291
|
+
return tl;
|
|
1292
|
+
};
|
|
1293
|
+
return tl;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
anime.version = '3.2.1';
|
|
1297
|
+
anime.speed = 1;
|
|
1298
|
+
// TODO:#review: naming, documentation
|
|
1299
|
+
anime.suspendWhenDocumentHidden = true;
|
|
1300
|
+
anime.running = activeInstances;
|
|
1301
|
+
anime.remove = removeTargetsFromActiveInstances;
|
|
1302
|
+
anime.get = getOriginalTargetValue;
|
|
1303
|
+
anime.set = setTargetsValue;
|
|
1304
|
+
anime.convertPx = convertPxToUnit;
|
|
1305
|
+
anime.path = getPath;
|
|
1306
|
+
anime.setDashoffset = setDashoffset;
|
|
1307
|
+
anime.stagger = stagger;
|
|
1308
|
+
anime.timeline = timeline;
|
|
1309
|
+
anime.easing = parseEasings;
|
|
1310
|
+
anime.penner = penner;
|
|
1311
|
+
anime.random = function (min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; };
|
|
1312
|
+
|
|
1313
|
+
export { anime as a };
|