diff --git a/ui/src/components/BDay.vue b/ui/src/components/BDay.vue index e4eeb75..4413ed6 100644 --- a/ui/src/components/BDay.vue +++ b/ui/src/components/BDay.vue @@ -1,20 +1,29 @@ @@ -69,6 +78,7 @@ export default { }, videoLoaded: function () { + this.placePlay(); if (this.currentVideo >= 0) { this.player.play(); } @@ -80,22 +90,36 @@ export default { this.currentVideo += 1; this.player.source = this.getVideoSource(this.currentVideo); }, + + placePlay: function () { + let top = (this.$refs.plyrContainer.offsetHeight - 100) / 2; + let left = (this.$refs.plyrContainer.offsetWidth - 100) / 2; + + console.log(left, top); + + this.$refs.play.style.top = top + "px"; + this.$refs.play.style.left = left + "px"; + }, }, mounted() { document.title = "Herzlichen Glückwunsch!"; + window.addEventListener("resize", this.placePlay); }, };