From ec41acb94613dfaf3adc02d25c6a8ea3872c50e2 Mon Sep 17 00:00:00 2001 From: Mahyuddin Susanto Date: Wed, 25 Nov 2026 00:18:59 +0700 Subject: [PATCH] Keep the home hero side by side on a tablet in portrait From 700px the copy sits on the start side and the photograph on the other, as on landscape; the title is a little smaller and the buttons stack in the narrow column. The photograph now fades into the hero with a mask instead of an overlay, which also removes a faint vertical edge. Phones (under 700px) are unchanged. --- _sass/_home.scss | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/_sass/_home.scss b/_sass/_home.scss index 7f3d191..f7771b8 100644 --- a/_sass/_home.scss +++ b/_sass/_home.scss @@ -13,23 +13,30 @@ .hero-actions { display: flex; flex-wrap: wrap; gap: 10px; } .hero-media { margin: 0; position: relative; aspect-ratio: 2 / 1; min-height: 190px; } .hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 55% 50%; display: block; } +// Side by side from 700px, so a tablet in portrait keeps the layout of landscape: the copy on the start side, the +// photograph on the other. The photograph fades into the hero colour with a mask (no overlay, so no visible edge). @media (min-width: 700px) { - .hero-copy { padding: 44px 40px 38px; } - .hero h1 { font-size: 3rem; } + .hero { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); min-height: 330px; } + .hero-copy { padding: 34px 10px 32px 32px; display: flex; flex-direction: column; justify-content: center; } + .hero h1 { font-size: 2.05rem; } + .hero-text { font-size: .96rem; margin-bottom: 18px; } + .hero-actions { flex-direction: column; align-items: flex-start; } + .hero-media { aspect-ratio: auto; min-height: 0; } + .hero-media img { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 30%); mask-image: linear-gradient(90deg, transparent 0, #000 30%); } } -// Beside each other from here; the photograph fades into the page colour on its start edge +// A wider screen: more room for the copy, and the buttons sit in a row @media (min-width: 960px) { .hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); min-height: 380px; } - .hero-copy { padding: 52px 12px 48px 52px; display: flex; flex-direction: column; justify-content: center; } + .hero-copy { padding: 52px 12px 48px 52px; } .hero h1 { font-size: 2.35rem; } - .hero-media { aspect-ratio: auto; min-height: 0; } - .hero-media:before { - content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; - background: linear-gradient(90deg, #f7f4ec 0%, rgba(247, 244, 236, 0) 32%); - } + .hero-text { font-size: 1.02rem; margin-bottom: 22px; } + .hero-actions { flex-direction: row; align-items: center; } + .hero-media img { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 32%); mask-image: linear-gradient(90deg, transparent 0, #000 32%); } } @media (min-width: 1180px) { .hero h1 { font-size: 2.8rem; } } -html[dir="rtl"] .hero-media:before { background: linear-gradient(270deg, #f7f4ec 0%, rgba(247, 244, 236, 0) 32%); } +@media (min-width: 700px) { + html[dir="rtl"] .hero-media img { -webkit-mask-image: linear-gradient(270deg, transparent 0, #000 30%); mask-image: linear-gradient(270deg, transparent 0, #000 30%); } +} // ---- Topic bar: one line; it scrolls sideways when it does not fit .topic-bar {