debug NetworkAnimation; add buy me a coffee :D

2.0
adb-sh 2 years ago
parent f0c6b1fdce
commit f45b77c9ed

@ -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{

@ -22,8 +22,16 @@ export default {
}),
},
},
data: () => ({
animation: null,
}),
mounted() {
new ParticleNetworkAnimation(this.$refs.pna, this.options);
setTimeout(() =>
this.animation = new ParticleNetworkAnimation(this.$refs.pna, this.options
), 200);
},
updated() {
this.animation?.forceUpdate();
},
};
</script>

@ -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: ^-^
<script>
import StickyWrapper from "../.vuepress/components/StickyWrapper";
export default {
components: {StickyWrapper}
}
</script>
- Liberapay: [liberapay/adb.sh](https://liberapay.com/adb.sh)
- Bitcoin: [BC1QGP24D6GKPM4TEZ4ZRT3KZGKHYUJQUV68PTAXKQ](bitcoin:BC1QGP24D6GKPM4TEZ4ZRT3KZGKHYUJQUV68PTAXKQ)
- PayPal: [paypal.me/ad2b](https://paypal.me/ad2b)

Loading…
Cancel
Save