fix: make images responsive

This commit is contained in:
Christel Westerberg
2024-02-13 15:18:59 +01:00
parent 5689e68610
commit 4b193541b2
6 changed files with 50 additions and 49 deletions

View File

@@ -12,6 +12,7 @@
height: auto; height: auto;
object-fit: contain; object-fit: contain;
object-position: center; object-position: center;
width: 100%;
} }
.content { .content {

View File

@@ -14,7 +14,6 @@ export default async function Footer({ lang }: LangParams) {
}) })
const footerData = response.data.all_footer.items[0] const footerData = response.data.all_footer.items[0]
return ( return (
<footer className="global-footer"> <footer className="global-footer">
<div className="global-footer__content"> <div className="global-footer__content">

View File

@@ -1,4 +1,27 @@
.wrapper {
z-index: 0;
}
.picture {
visibility: visible;
opacity: 1;
transition: opacity 400ms ease-in-out 0s;
transform: translate(-50%, -50%) !important;
}
.heroImage { .heroImage {
object-fit: cover; object-fit: contain;
width: 100%; width: 100%;
} height: auto;
max-height: 600px;
min-height: 100px;
object-fit: cover;
object-position: center;
aspect-ratio: 1/1;
}
@media screen and (min-width: 740px) {
.heroImage {
aspect-ratio: auto;
}
}

View File

@@ -1,5 +1,3 @@
"use client"
import Image from "@/components/Image" import Image from "@/components/Image"
import styles from "./hero.module.css" import styles from "./hero.module.css"
@@ -8,47 +6,19 @@ import type { HeroProps } from "@/types/components/current/hero"
export default function Hero({ images }: HeroProps) { export default function Hero({ images }: HeroProps) {
return ( return (
<div className="hero-content-overlay hero-content-widget"> <div className={styles.wrapper} aria-label="Hero" tabIndex={0}>
<div className="hero-content-overlay__img-container"> <picture className={styles.picture}>
<div className="hero-fixed hero-fixed--deemphasized" style={{ marginTop: "0px" }}> {images.map(({ node: image }) => (
<div className="hero" style={{ top: "113px" }}> <Image
<div className="hero__img-container"> alt={image.title}
<div id="full-width-slider" className="royalSlider royalSlider--hero rsDefault rsHor rsFade rsWithBullets" data-js="hero-slider" tabIndex={0} aria-label="Carousel. Change slides with keyboard left and right arrows." style={{ touchAction: "pan-y" }}> className={styles.heroImage}
<div className="rsOverflow" style={{ width: "1555px", height: "650px" }}> height={image.dimension.height}
<div className="rsContainer"> key={image.title}
<div style={{ zIndex: 0 }} className="rsSlide "> src={image.url}
<picture style={{ visibility: "visible", opacity: 1, transition: "opacity 400ms ease-in-out 0s" }}> width={image.dimension.width}
{images.map(({ node: image }) => ( />
<Image ))}
alt={image.title} </picture>
className={`rsImg-x slider-plchldr ${styles.heroImage}`}
data-aspectratio="1.50"
height={image.dimension.height}
key={image.title}
src={image.url}
width={image.dimension.width}
/>
))}
</picture>
</div>
</div>
<div className="rsArrow rsArrowLeft" style={{ display: "none" }}>
<div className="rsArrowIcn" tabIndex={0} />
</div>
<div className="rsArrow rsArrowRight" style={{ display: "none" }}>
<div className="rsArrowIcn" tabIndex={0} />
</div>
</div>
<div className="rsNav rsBullets">
<div className="rsNavItem rsBullet rsNavSelected">
<span></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div> </div>
) )
} }

View File

@@ -3,6 +3,10 @@
padding-bottom: 8px; padding-bottom: 8px;
} }
.parent {
display: none;
}
.list { .list {
align-items: center; align-items: center;
display: grid; display: grid;

View File

@@ -9,14 +9,18 @@ export default function Breadcrumbs({ breadcrumbs, parent, title }: BreadcrumbsP
<nav className={styles.nav}> <nav className={styles.nav}>
<ul className={styles.list}> <ul className={styles.list}>
{parent ? ( {parent ? (
<li className="breadcrumb-list__parent hidden-medium hidden-large"> <li className={styles.parent}>
<Link href={parent.node.url}> <Link href={parent.node.url}>
{parent.node.breadcrumbs?.title ?? parent.node.title} {parent.node.breadcrumbs?.title ?? parent.node.title}
</Link> </Link>
</li> </li>
) : null} ) : null}
{breadcrumbs.edges.map(breadcrumb => ( {breadcrumbs.edges.map((breadcrumb) => (
<li className={styles.li} itemProp="breadcrumb" key={breadcrumb.node.title}> <li
className={styles.li}
itemProp="breadcrumb"
key={breadcrumb.node.title}
>
<Link className={styles.link} href={breadcrumb.node.url}> <Link className={styles.link} href={breadcrumb.node.url}>
{breadcrumb.node.breadcrumbs?.title ?? breadcrumb.node.title} {breadcrumb.node.breadcrumbs?.title ?? breadcrumb.node.title}
</Link> </Link>