From 0ef39aa7fd25530990b174f62a805c88b3145503 Mon Sep 17 00:00:00 2001 From: Pijar <pierre.jarriges@tutanota.com> Date: Thu, 2 Jun 2022 14:34:20 +0200 Subject: [PATCH] fix embed content --- .../src/article-vew-components/game-article.js | 17 ++++++----------- website/src/article-view.scss | 14 ++++++++++---- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/website/src/article-vew-components/game-article.js b/website/src/article-vew-components/game-article.js index 4e4eb56..ac0e379 100644 --- a/website/src/article-vew-components/game-article.js +++ b/website/src/article-vew-components/game-article.js @@ -30,8 +30,8 @@ class GameArticle { init_details() { this.details = this.data.details.filter(d => { const { label, value } = d; - if (label === "video") { - this.video_link = value; + if (label === "embed") { + this.embed_content = value; return false; } return true; @@ -153,15 +153,10 @@ class GameArticle { tag: "p", contents: this.body }, - this.video_link && { - tag: "iframe", - src: this.video_link, - frameborder: 0, - allowfullscreen: true, - width: 400, - height: 250, - allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", - title, + this.embed_content && { + tag: "div", + class: "embed", + contents: this.embed_content, }, ], }, diff --git a/website/src/article-view.scss b/website/src/article-view.scss index 50ffdf2..9c206ce 100644 --- a/website/src/article-view.scss +++ b/website/src/article-view.scss @@ -83,10 +83,16 @@ text-align: justify; } - iframe { + .embed { width: 400px; height: 250px; + + iframe { + width: 100%; + height: 100%; + } } + } .image-carousel { @@ -123,7 +129,7 @@ #article-body { grid-template-columns: 1fr; - iframe { + .embed { width: 100%; height: 400px; } @@ -165,7 +171,7 @@ padding: 20px; #article-body { - iframe { + .embed { height: 300px; } } @@ -210,7 +216,7 @@ font-size: initial; } - iframe { + .embed { height: 250px; } } -- GitLab