debug NetworkAnimation; add buy me a coffee :D
This commit is contained in:
parent
f0c6b1fdce
commit
f45b77c9ed
@ -22,15 +22,18 @@ class ParticleNetworkAnimation {
|
|||||||
|
|
||||||
bindUiActions() {
|
bindUiActions() {
|
||||||
window.addEventListener('resize', () => {
|
window.addEventListener('resize', () => {
|
||||||
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
this.forceUpdate();
|
||||||
this.sizeCanvas();
|
|
||||||
this.particleNetwork.createParticles();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
sizeCanvas() {
|
sizeCanvas() {
|
||||||
this.canvas.width = this.container.offsetWidth;
|
this.canvas.width = this.container.offsetWidth;
|
||||||
this.canvas.height = this.container.offsetHeight;
|
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{
|
class Particle{
|
||||||
|
@ -22,8 +22,16 @@ export default {
|
|||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
data: () => ({
|
||||||
|
animation: null,
|
||||||
|
}),
|
||||||
mounted() {
|
mounted() {
|
||||||
new ParticleNetworkAnimation(this.$refs.pna, this.options);
|
setTimeout(() =>
|
||||||
|
this.animation = new ParticleNetworkAnimation(this.$refs.pna, this.options
|
||||||
|
), 200);
|
||||||
|
},
|
||||||
|
updated() {
|
||||||
|
this.animation?.forceUpdate();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -58,13 +58,8 @@ home: true
|
|||||||
- Matrix: [@adb:adb.sh](https://matrix.to/#/@adb:adb.sh)
|
- Matrix: [@adb:adb.sh](https://matrix.to/#/@adb:adb.sh)
|
||||||
- Mail: info [at] this.domain
|
- Mail: info [at] this.domain
|
||||||
|
|
||||||
|
## buy me a coffee :coffee: ^-^
|
||||||
|
|
||||||
<script>
|
- Liberapay: [liberapay/adb.sh](https://liberapay.com/adb.sh)
|
||||||
import StickyWrapper from "../.vuepress/components/StickyWrapper";
|
- Bitcoin: [BC1QGP24D6GKPM4TEZ4ZRT3KZGKHYUJQUV68PTAXKQ](bitcoin:BC1QGP24D6GKPM4TEZ4ZRT3KZGKHYUJQUV68PTAXKQ)
|
||||||
|
- PayPal: [paypal.me/ad2b](https://paypal.me/ad2b)
|
||||||
export default {
|
|
||||||
|
|
||||||
components: {StickyWrapper}
|
|
||||||
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
Loading…
Reference in New Issue
Block a user