From ad4493380a934a1e4ea1bdb3a524234d03d39311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Sun, 6 Sep 2020 19:09:02 +0200 Subject: [PATCH] responsivity --- ui/src/components/BDay.vue | 62 ++++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 20 deletions(-) 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); }, };