{
const y = window.scrollY;
- // едет вверх медленнее, чем страница
const offset = Math.min(60, y * 0.15);
if (ref.current) ref.current.style.transform = `translateY(-${offset}px)`;
});
@@ -29,7 +29,7 @@ export default function HeroImage() {
{`
.hero-image-wrap {
position: absolute;
- top: 0; right: 0; bottom: 0;
- width: 100%;
+ inset: 0;
pointer-events: none;
overflow: hidden;
- z-index: -1;
+ z-index: 0;
}
.hero-image {
position: absolute;
@@ -63,8 +62,6 @@ export default function HeroImage() {
object-position: right top;
opacity: 0.85;
will-change: transform;
- transition: opacity 0.4s ease;
- /* плавный фейд от центра к левому краю — картинка тает */
-webkit-mask-image: linear-gradient(
to right,
transparent 0%,
@@ -93,27 +90,48 @@ export default function HeroImage() {
background: linear-gradient(to bottom, transparent, rgb(var(--bg)));
pointer-events: none;
}
- /* На мобилке картинка сверху, под ней — текст */
+
+ /* === MOBILE: картинка фоном, текст поверх === */
@media (max-width: 767px) {
- .hero-image-wrap {
- position: relative;
- width: 100vw;
- margin-left: -1rem;
- margin-right: -1rem;
- height: 240px;
- margin-bottom: 1rem;
- }
.hero-image {
- top: 0;
- right: 0;
+ top: -20px;
+ right: -30%; /* выезжает за правый край — видна только часть */
height: 100%;
- width: 100%;
- object-position: right center;
- opacity: 0.95;
- -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
- mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
+ width: auto;
+ max-width: 160%;
+ opacity: 0.45; /* приглушаем, чтобы текст читался */
+ -webkit-mask-image: linear-gradient(
+ to bottom right,
+ transparent 0%,
+ rgba(0,0,0,0.15) 30%,
+ rgba(0,0,0,0.6) 60%,
+ black 100%
+ );
+ mask-image: linear-gradient(
+ to bottom right,
+ transparent 0%,
+ rgba(0,0,0,0.15) 30%,
+ rgba(0,0,0,0.6) 60%,
+ black 100%
+ );
+ }
+ :global(.dark) .hero-image {
+ opacity: 0.32;
+ }
+ /* софт-вуаль для контраста заголовка */
+ .hero-image-wrap::before {
+ content: '';
+ position: absolute;
+ inset: 0;
+ background: linear-gradient(
+ to bottom,
+ rgb(var(--bg) / 0.4) 0%,
+ rgb(var(--bg) / 0.2) 40%,
+ rgb(var(--bg)) 100%
+ );
+ z-index: 1;
+ pointer-events: none;
}
- .hero-image-wrap::after { display: none; }
}
`}