From d5609493246ed91b707b71513dc6950dc7f4a2f9 Mon Sep 17 00:00:00 2001 From: Erlend Schei Date: Mon, 11 Nov 2024 15:12:57 +0100 Subject: [PATCH] Add video icon on normal article list --- src/main/frontend/styles/partials/_card.scss | 27 +++++++++++++++++++ src/main/resources/lib/labs/content-prep.js | 1 + .../site/parts/article-list/article-list.xml | 1 + .../resources/site/snippets/article-card.html | 7 +++++ 4 files changed, 36 insertions(+) diff --git a/src/main/frontend/styles/partials/_card.scss b/src/main/frontend/styles/partials/_card.scss index cc4f1be..d5439a8 100644 --- a/src/main/frontend/styles/partials/_card.scss +++ b/src/main/frontend/styles/partials/_card.scss @@ -3,6 +3,7 @@ &__imagecontainer { overflow: hidden; + position: relative; } &:hover img { @@ -28,6 +29,22 @@ font-size: 1.1em; } + &__video-overlay { + position: absolute; + inset: 0; + display: flex; + align-items: top; + justify-content: right; + padding-top: 0.5rem; + padding-right: 0.5rem; + } + + &__video-icon { + width: 3rem; /* 64px */ + height: 3rem; /* 64px */ + color: #222; /* Fargen på play-symbolet */ + } + &__category { position: relative; margin-bottom: 1.5rem; @@ -43,6 +60,11 @@ } } + &--featured { + display: block; + padding-bottom: 2rem; + } + &--featured > &__body { margin-top: -3em; margin-left: 1.5em; @@ -52,4 +74,9 @@ margin-top: -7em; } } + + &--featured &__video-icon { + width: 5rem; /* 80px */ + height: 5rem; /* 80px */ + } } diff --git a/src/main/resources/lib/labs/content-prep.js b/src/main/resources/lib/labs/content-prep.js index 1c57f91..de73271 100644 --- a/src/main/resources/lib/labs/content-prep.js +++ b/src/main/resources/lib/labs/content-prep.js @@ -33,6 +33,7 @@ var prepareFeaturedArticle = function (content, scaleLandscape, scalePortrait) { article.created = content.createdTime article.modifiedTime = content.modifiedTime ? content.modifiedTime : null article.heading = content.displayName + article.type = content.type.split(':')[1].trim() if (!content.data) return article diff --git a/src/main/resources/site/parts/article-list/article-list.xml b/src/main/resources/site/parts/article-list/article-list.xml index 934f5a3..1ef1b12 100644 --- a/src/main/resources/site/parts/article-list/article-list.xml +++ b/src/main/resources/site/parts/article-list/article-list.xml @@ -12,6 +12,7 @@ article + video diff --git a/src/main/resources/site/snippets/article-card.html b/src/main/resources/site/snippets/article-card.html index 65cb9cc..1f38995 100644 --- a/src/main/resources/site/snippets/article-card.html +++ b/src/main/resources/site/snippets/article-card.html @@ -26,6 +26,13 @@ '(max-width:768px) 95vw, (max-width:1087px) 30vw, (max-width:1279px) 301px, (max-width:1471px) 364px, 543px'" /> + +
+ + + + +