diff --git a/.gitignore b/.gitignore index bc2eb94187..47fbf391c7 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ fly.toml .idea vendor/* QEMU_EFI.fd +asset-stats.html \ No newline at end of file diff --git a/assets/histoire.setup.js b/assets/histoire.setup.js index 24e2f461bb..3f72d04ee9 100644 --- a/assets/histoire.setup.js +++ b/assets/histoire.setup.js @@ -1,8 +1,6 @@ import { defineSetupVue3 } from "@histoire/plugin-vue"; import "bootstrap/dist/css/bootstrap.min.css"; -import "bootstrap"; import smoothscroll from "smoothscroll-polyfill"; -import VueNumber from "vue-number-animation"; import setupI18n from "./js/i18n"; import "./css/app.css"; import { watchThemeChanges } from "./js/theme"; @@ -13,5 +11,4 @@ watchThemeChanges(); export const setupVue3 = defineSetupVue3(({ app }) => { app.config.globalProperties.$hiddenFeatures = true; app.use(setupI18n()); - app.use(VueNumber); }); diff --git a/assets/js/app.js b/assets/js/app.js index 5ac2dafb1f..a52ad19d25 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -1,11 +1,9 @@ import "bootstrap/dist/css/bootstrap.min.css"; -import "bootstrap"; import smoothscroll from "smoothscroll-polyfill"; import "../css/app.css"; import { createApp, h } from "vue"; import { createMetaManager, plugin as metaPlugin } from "vue-meta"; import App from "./views/App.vue"; -import VueNumber from "vue-number-animation"; import setupRouter from "./router"; import setupI18n from "./i18n"; import featureflags from "./featureflags"; @@ -70,7 +68,6 @@ app.use(setupRouter(i18n)); app.use(createMetaManager()); app.use(metaPlugin); app.use(featureflags); -app.use(VueNumber); window.app = app.mount("#app"); watchThemeChanges(); diff --git a/assets/js/components/AnimatedNumber.vue b/assets/js/components/AnimatedNumber.vue index cdc903f394..831a272999 100644 --- a/assets/js/components/AnimatedNumber.vue +++ b/assets/js/components/AnimatedNumber.vue @@ -1,30 +1,46 @@ + + diff --git a/assets/js/components/LiveCommunity.vue b/assets/js/components/LiveCommunity.vue index 4304f3e6af..69d11fe879 100644 --- a/assets/js/components/LiveCommunity.vue +++ b/assets/js/components/LiveCommunity.vue @@ -5,8 +5,7 @@ icon="car" :title="$t('footer.community.power')" :value="chargePower" - :valueFmt="numberAnimationFmt" - :animationDuration="animationDuration" + :valueFmt="fmtAnimation" unit="kW" :sub1="$t('footer.community.powerSub1', { totalClients, activeClients })" :sub2="$t('footer.community.powerSub2')" @@ -17,8 +16,7 @@ icon="sun" :title="$t('footer.community.greenShare')" :value="greenShare" - :valueFmt="numberAnimationFmt" - :animationDuration="animationDuration" + :valueFmt="fmtAnimationDecimal" unit="%" :sub1="$t('footer.community.greenShareSub1')" :sub2="$t('footer.community.greenShareSub2')" @@ -29,8 +27,7 @@ icon="eco" :title="$t('footer.community.greenEnergy')" :value="greenEnergyMWh" - :valueFmt="numberAnimationFmt" - :animationDuration="animationDuration" + :valueFmt="fmtAnimationDecimal" unit="MWh" :sub1="$t('footer.community.greenEnergySub1')" :sub2="$t('footer.community.greenEnergySub2')" @@ -55,7 +52,6 @@ export default { return { refresh: null, result: {}, - animationDuration: 0.5, }; }, computed: { @@ -84,9 +80,6 @@ export default { async mounted() { this.refresh = setInterval(this.update, UPDATE_INTERVAL_SECONDS * 1e3); await this.update(); - this.$nextTick(() => { - this.animationDuration = UPDATE_INTERVAL_SECONDS; - }); }, unmounted() { clearInterval(this.refresh); @@ -100,7 +93,10 @@ export default { console.error(err); } }, - numberAnimationFmt(number) { + fmtAnimation(number) { + return this.fmtNumber(number, 0); + }, + fmtAnimationDecimal(number) { return this.fmtNumber(number, 1); }, }, diff --git a/assets/js/components/LoadpointSettingsButton.vue b/assets/js/components/LoadpointSettingsButton.vue index 2b96b2871f..664429b28a 100644 --- a/assets/js/components/LoadpointSettingsButton.vue +++ b/assets/js/components/LoadpointSettingsButton.vue @@ -1,9 +1,8 @@ diff --git a/assets/js/components/SavingsTile.vue b/assets/js/components/SavingsTile.vue index dac9289fc8..4c4682ded9 100644 --- a/assets/js/components/SavingsTile.vue +++ b/assets/js/components/SavingsTile.vue @@ -16,12 +16,7 @@

{{ title }}

- + {{ value }} {{ unit }} @@ -51,7 +46,6 @@ export default { icon: String, value: [String, Number], valueFmt: Function, - animationDuration: Number, unit: String, sub1: String, sub2: String, diff --git a/assets/js/components/StartupError.vue b/assets/js/components/StartupError.vue index 4ecc9e7f65..97d51ae1b4 100644 --- a/assets/js/components/StartupError.vue +++ b/assets/js/components/StartupError.vue @@ -93,7 +93,6 @@ export default { scrollTo(e) { const id = e.currentTarget.getAttribute("href").substring(1); const el = document.getElementById(id); - console.log({ id, el }); if (el) { el.scrollIntoView({ behavior: "smooth", block: "center" }); } diff --git a/assets/js/components/TargetCharge.vue b/assets/js/components/TargetCharge.vue index 37c7e1c28b..3f37d3088b 100644 --- a/assets/js/components/TargetCharge.vue +++ b/assets/js/components/TargetCharge.vue @@ -8,9 +8,8 @@