From f45b77c9ed23d88c77eb2c27c99c923ef6771eb2 Mon Sep 17 00:00:00 2001 From: adb-sh Date: Wed, 21 Sep 2022 19:59:05 +0200 Subject: [PATCH] debug NetworkAnimation; add buy me a coffee :D --- src/.vuepress/ParticleNetworkAnimation.js | 9 ++++++--- src/.vuepress/components/BannerWrapperNetwork.vue | 12 ++++++++++-- src/me/index.md | 13 ++++--------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/.vuepress/ParticleNetworkAnimation.js b/src/.vuepress/ParticleNetworkAnimation.js index 6151071..0a9f143 100644 --- a/src/.vuepress/ParticleNetworkAnimation.js +++ b/src/.vuepress/ParticleNetworkAnimation.js @@ -22,15 +22,18 @@ class ParticleNetworkAnimation { bindUiActions() { window.addEventListener('resize', () => { - this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); - this.sizeCanvas(); - this.particleNetwork.createParticles(); + this.forceUpdate(); }); } sizeCanvas() { this.canvas.width = this.container.offsetWidth; this.canvas.height = this.container.offsetHeight; } + forceUpdate() { + this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); + this.sizeCanvas(); + this.particleNetwork.createParticles(); + } } class Particle{ diff --git a/src/.vuepress/components/BannerWrapperNetwork.vue b/src/.vuepress/components/BannerWrapperNetwork.vue index 93a9d3f..a9dc6de 100644 --- a/src/.vuepress/components/BannerWrapperNetwork.vue +++ b/src/.vuepress/components/BannerWrapperNetwork.vue @@ -22,8 +22,16 @@ export default { }), }, }, - mounted(){ - new ParticleNetworkAnimation(this.$refs.pna, this.options); + data: () => ({ + animation: null, + }), + mounted() { + setTimeout(() => + this.animation = new ParticleNetworkAnimation(this.$refs.pna, this.options + ), 200); + }, + updated() { + this.animation?.forceUpdate(); }, }; diff --git a/src/me/index.md b/src/me/index.md index ab719b9..d597220 100755 --- a/src/me/index.md +++ b/src/me/index.md @@ -58,13 +58,8 @@ home: true - Matrix: [@adb:adb.sh](https://matrix.to/#/@adb:adb.sh) - Mail: info [at] this.domain +## buy me a coffee :coffee: ^-^ - \ No newline at end of file +- Liberapay: [liberapay/adb.sh](https://liberapay.com/adb.sh) +- Bitcoin: [BC1QGP24D6GKPM4TEZ4ZRT3KZGKHYUJQUV68PTAXKQ](bitcoin:BC1QGP24D6GKPM4TEZ4ZRT3KZGKHYUJQUV68PTAXKQ) +- PayPal: [paypal.me/ad2b](https://paypal.me/ad2b)