feat: add news detail design
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
<div class="hero-image-wrapper">
|
||||
<f:if condition="{data.image}">
|
||||
<f:then>
|
||||
<picture>
|
||||
<figure>
|
||||
<!-- WEBP source -->
|
||||
<source
|
||||
type="image/webp"
|
||||
@@ -50,7 +50,7 @@
|
||||
alt="Hero Image"
|
||||
loading="lazy"
|
||||
class="hero-image" />
|
||||
</picture>
|
||||
</figure>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<p>No image available</p>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<div class="textimage-image-wrapper {sizeClass}">
|
||||
<f:if condition="{data.image}">
|
||||
<f:then>
|
||||
<picture class="textimage-picture">
|
||||
<figure class="textimage-picture">
|
||||
<!-- WEBP source -->
|
||||
<source
|
||||
type="image/webp"
|
||||
@@ -46,7 +46,7 @@
|
||||
alt="{data.image.0.alternative}"
|
||||
class="textimage-image"
|
||||
/>
|
||||
</picture>
|
||||
</figure>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<p>No image available</p>
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<f:layout name="General" />
|
||||
|
||||
<f:section name="content">
|
||||
<!-- First image if present -->
|
||||
<f:if condition="{newsItem.media}">
|
||||
<div class="news-detail__main-image">
|
||||
<figure>
|
||||
<f:image image="{newsItem.media.0.originalResource}" alt="{newsItem.media.0.originalResource.alternative}" title="{newsItem.media.0.originalResource.title}" loading="lazy" />
|
||||
</figure>
|
||||
</div>
|
||||
</f:if>
|
||||
|
||||
<!-- News title -->
|
||||
<h1 class="news-detail__title">{newsItem.title}</h1>
|
||||
|
||||
<!-- Teaser text -->
|
||||
<f:if condition="{newsItem.teaser}">
|
||||
<div class="news-detail__teaser">
|
||||
{newsItem.teaser}
|
||||
</div>
|
||||
</f:if>
|
||||
|
||||
<!-- Bodytext -->
|
||||
<div class="news-detail__bodytext">
|
||||
<f:format.html>
|
||||
{newsItem.bodytext}
|
||||
</f:format.html>
|
||||
</div>
|
||||
|
||||
<!-- Content elements if present -->
|
||||
<f:if condition="{newsItem.contentElements}">
|
||||
<!-- content elements -->
|
||||
<div class="news-detail__content-elements">
|
||||
<f:cObject typoscriptObjectPath="lib.tx_news.contentElementRendering">{newsItem.contentElementIdList}</f:cObject>
|
||||
</div>
|
||||
</f:if>
|
||||
|
||||
<!-- Gallery if more than one picture -->
|
||||
<f:if condition="{f:count(subject: newsItem.media)} > 1">
|
||||
<div class="news-detail__gallery news-detail__gallery--grid">
|
||||
<f:for each="{newsItem.media}" as="mediaItem" iteration="iterator">
|
||||
<figure class="news-detail__gallery-item">
|
||||
<f:image image="{mediaItem.originalResource}" alt="{mediaItem.originalResource.alternative}" title="{mediaItem.originalResource.title}" loading="lazy" />
|
||||
</figure>
|
||||
</f:for>
|
||||
</div>
|
||||
</f:if>
|
||||
</f:section>
|
||||
@@ -25,17 +25,20 @@
|
||||
</f:section>
|
||||
|
||||
<f:section name="content">
|
||||
<f:if condition="{settings.listPid}">
|
||||
<f:then>
|
||||
<div class="header">
|
||||
<div class="title">
|
||||
<h2>{contentObjectData.header}</h2>
|
||||
</div>
|
||||
<f:if condition="{settings.listPid}">
|
||||
<f:then>
|
||||
<!-- Desktop button -->
|
||||
<f:link.page title="Alle Artikel" pageUid="{settings.listPid}" class="btn header-btn">Alle Artikel</f:link.page>
|
||||
</f:then>
|
||||
</f:if>
|
||||
</div>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<h1><span class="tapered">{contentObjectData.header}</span></h1>
|
||||
</f:else>
|
||||
</f:if>
|
||||
<!--TYPO3SEARCH_end-->
|
||||
<f:if condition="{news}">
|
||||
<f:then>
|
||||
|
||||
@@ -24,11 +24,16 @@ h1, h2 {
|
||||
font-family: 'Hajime Sans', sans-serif;
|
||||
color: var(--bs-primary);
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align: center;
|
||||
font-size: 3rem;
|
||||
|
||||
@media (min-width: $breakpoint-md) {
|
||||
font-size: 4.5rem;
|
||||
}
|
||||
}
|
||||
h1 span.tapered {
|
||||
background-size: 100% 15%;
|
||||
|
||||
@@ -7,3 +7,14 @@ a {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
}
|
||||
|
||||
figure {
|
||||
border-radius: 1rem;
|
||||
overflow: hidden;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,6 +156,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
/* Show header button only on desktop */
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
.news-detail__title {
|
||||
max-width: 900px;
|
||||
margin: auto;
|
||||
margin-bottom: 2rem;
|
||||
font-size: 3rem;
|
||||
text-align: left;
|
||||
|
||||
@media (min-width: $breakpoint-md) {
|
||||
font-size: 4rem;
|
||||
}
|
||||
}
|
||||
|
||||
.news-detail__main-image {
|
||||
max-width: 900px;
|
||||
margin: auto;
|
||||
margin-bottom: 2rem;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
.news-detail__teaser {
|
||||
max-width: 900px;
|
||||
margin: auto;
|
||||
margin-bottom: 2rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.news-detail__bodytext {
|
||||
max-width: 900px;
|
||||
margin: auto;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.news-detail__content-elements {
|
||||
max-width: 900px;
|
||||
margin: auto;
|
||||
|
||||
margin-bottom: 2rem;
|
||||
|
||||
.container {
|
||||
padding: 0;
|
||||
}
|
||||
> * {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.news-detail__gallery {
|
||||
margin-top: 2rem;
|
||||
|
||||
&--grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 1rem;
|
||||
|
||||
.news-detail__gallery-item {
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.news-detail__gallery--grid {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.news-detail__gallery--grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
@@ -7,5 +7,6 @@
|
||||
@import 'components/navigation';
|
||||
@import 'components/images';
|
||||
@import 'components/news';
|
||||
@import "components/news_detail";
|
||||
@import 'components/footer';
|
||||
@import 'components/buttons';
|
||||
|
||||
Reference in New Issue
Block a user