доставка в плавающем

This commit is contained in:
Alisa
2026-06-08 10:58:47 +03:00
parent 3a065b34d6
commit 256afcbb80
18 changed files with 1478 additions and 187 deletions
+517 -58
View File
@@ -1662,8 +1662,8 @@ a:hover {
.home-catalog-showcase {
display: grid;
gap: 16px;
margin-top: 24px;
gap: 18px;
margin-top: 28px;
}
.home-catalog-heading,
@@ -1675,18 +1675,18 @@ a:hover {
}
.home-catalog-heading {
border: 1px solid rgba(13, 93, 128, 0.12);
border-radius: 16px;
padding: clamp(16px, 2vw, 24px);
border: 1px solid rgba(13, 93, 128, 0.16);
border-radius: 12px;
padding: clamp(16px, 2vw, 22px);
background:
linear-gradient(135deg, rgba(13, 93, 128, 0.08), rgba(255, 255, 255, 0.78) 58%),
linear-gradient(135deg, rgba(13, 93, 128, 0.1), rgba(255, 255, 255, 0.82) 58%),
#fffefa;
box-shadow: 0 14px 36px rgba(22, 60, 43, 0.06);
box-shadow: 0 14px 34px rgba(22, 60, 43, 0.055);
}
.home-catalog-heading h2 {
margin: 0;
font-size: clamp(26px, 2.45vw, 36px);
font-size: clamp(24px, 2.2vw, 34px);
line-height: 1.05;
}
@@ -1717,15 +1717,15 @@ a:hover {
.home-product-section {
position: relative;
display: grid;
gap: 14px;
gap: 12px;
overflow: hidden;
padding: clamp(14px, 1.8vw, 22px);
padding: clamp(12px, 1.6vw, 18px);
border: 1px solid rgba(19, 66, 45, 0.12);
border-radius: 14px;
border-radius: 12px;
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 254, 250, 0.96)),
#fff;
box-shadow: 0 16px 44px rgba(22, 60, 43, 0.08);
box-shadow: 0 12px 34px rgba(22, 60, 43, 0.06);
}
.home-product-section::after {
@@ -1755,7 +1755,7 @@ a:hover {
.home-product-section-head h3 {
margin: 0;
font-size: clamp(22px, 2vw, 30px);
font-size: clamp(20px, 1.75vw, 28px);
line-height: 1.05;
}
@@ -1809,8 +1809,8 @@ a:hover {
.home-products-strip {
display: grid;
grid-auto-flow: column;
grid-auto-columns: clamp(250px, 18vw, 286px);
gap: 14px;
grid-auto-columns: clamp(218px, 15.5vw, 250px);
gap: 12px;
overflow-x: hidden;
overflow-y: visible;
margin-inline: -2px;
@@ -1828,9 +1828,9 @@ a:hover {
.home-products-strip .product-card {
min-width: 0;
padding: 12px;
padding: 10px;
border-color: rgba(19, 66, 45, 0.1);
box-shadow: 0 12px 26px rgba(22, 60, 43, 0.055);
box-shadow: 0 10px 22px rgba(22, 60, 43, 0.05);
scroll-snap-align: start;
}
@@ -1844,20 +1844,20 @@ a:hover {
}
.home-products-strip .product-card .product-category {
height: 26px;
height: 24px;
margin-bottom: 6px;
font-size: 10px;
font-size: 9px;
}
.home-products-strip .product-card h3 {
height: 54px;
height: 48px;
margin-bottom: 10px;
font-size: 15px;
line-height: 1.18;
font-size: 14px;
line-height: 1.15;
}
.home-products-strip .variant-choice {
height: 64px;
height: 58px;
grid-template-rows: auto 30px;
gap: 5px;
margin-bottom: 8px;
@@ -1867,7 +1867,7 @@ a:hover {
.home-products-strip .variant-choice > span,
.home-products-strip .price-line,
.home-products-strip .package-price-line {
font-size: 12px;
font-size: 11px;
}
.home-products-strip .package-price-note {
@@ -1875,18 +1875,18 @@ a:hover {
}
.home-products-strip .price-line {
grid-template-columns: 1fr;
gap: 2px;
align-items: start;
min-height: 42px;
grid-template-columns: minmax(0, 1fr) auto;
gap: 5px;
align-items: center;
min-height: 32px;
margin-bottom: 5px;
}
.home-products-strip .package-price-line {
grid-template-columns: 1fr;
gap: 2px;
align-items: start;
min-height: 50px;
grid-template-columns: minmax(0, 1fr) auto;
gap: 5px;
align-items: center;
min-height: 42px;
padding-top: 8px;
}
@@ -1896,14 +1896,14 @@ a:hover {
color: #546251;
font-size: 11px;
line-height: 1.2;
text-overflow: clip;
white-space: normal;
text-overflow: ellipsis;
white-space: nowrap;
}
.home-products-strip .price-unit-values,
.home-products-strip .package-price-values {
justify-content: flex-start;
font-size: 13px;
justify-content: flex-end;
font-size: 12px;
line-height: 1.2;
}
@@ -1930,7 +1930,7 @@ a:hover {
}
.home-products-strip .product-card-actions {
grid-template-columns: 84px minmax(104px, 1fr);
grid-template-columns: 84px minmax(92px, 1fr);
min-height: 38px;
}
@@ -2934,11 +2934,16 @@ body[data-payment-mode="cash"] .price-tier-popover:hover {
width: min(var(--page-max), 100%);
margin: 0 auto;
display: grid;
grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
gap: 18px;
grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.22fr);
gap: 22px;
align-items: start;
}
.product-detail > .panel {
border-color: rgba(23, 61, 44, 0.12);
box-shadow: 0 18px 48px rgba(23, 61, 44, 0.08);
}
.product-gallery img {
display: block;
width: 100%;
@@ -2946,6 +2951,11 @@ body[data-payment-mode="cash"] .price-tier-popover:hover {
object-fit: cover;
}
.product-gallery > img {
aspect-ratio: 1 / 0.82;
background: #f4f6f1;
}
.product-thumbs {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
@@ -2969,7 +2979,11 @@ body[data-payment-mode="cash"] .price-tier-popover:hover {
}
.product-detail-main h1 {
margin-top: 0;
max-width: 820px;
margin: 0;
font-size: clamp(32px, 4vw, 58px);
line-height: 0.98;
letter-spacing: 0;
}
.product-lead {
@@ -2978,6 +2992,26 @@ body[data-payment-mode="cash"] .price-tier-popover:hover {
color: var(--muted);
}
.product-detail-notes {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 8px;
margin: 18px 0;
}
.product-detail-notes span {
display: flex;
align-items: center;
min-height: 48px;
padding: 10px 12px;
border: 1px solid #dbe6d7;
border-radius: 8px;
color: #143c2a;
background: linear-gradient(135deg, #f4f8ef 0%, #ffffff 100%);
font-size: 13px;
font-weight: 900;
}
.variant-list {
display: grid;
gap: 10px;
@@ -2985,41 +3019,124 @@ body[data-payment-mode="cash"] .price-tier-popover:hover {
}
.variant-list h2 {
margin-bottom: 2px;
margin: 0 0 2px;
}
.variant-row {
position: relative;
display: grid;
grid-template-columns: minmax(0, 1.2fr) minmax(130px, 0.7fr) minmax(110px, 0.55fr) minmax(220px, 0.75fr);
gap: 12px;
align-items: center;
border: 1px solid var(--line);
grid-template-columns: minmax(130px, 0.55fr) minmax(260px, 1fr) minmax(220px, 0.68fr);
gap: 14px;
align-items: stretch;
border: 1px solid #dbe6d7;
border-radius: 8px;
padding: 12px;
background: #f8faf5;
padding: 14px;
background: #fbfcf7;
}
.variant-row-head {
display: grid;
align-content: start;
gap: 7px;
min-width: 0;
}
.variant-row-head span {
color: var(--muted);
font-size: 12px;
font-weight: 900;
}
.variant-row-head strong {
min-height: 32px;
color: var(--brand-green);
font-size: 18px;
line-height: 1.08;
}
.variant-row-prices {
position: relative;
display: grid;
align-content: start;
gap: 6px;
min-width: 0;
padding-top: 1px;
}
.variant-row .price-line,
.variant-row .package-price-line {
min-height: 32px;
margin: 0;
padding: 0;
border: 0;
}
.variant-row .package-price-note {
min-height: 16px;
}
.variant-row .price-unit-label,
.variant-row .package-price-label {
white-space: normal;
}
.variant-row .price-unit-values,
.variant-row .package-price-values {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 5px;
min-width: 118px;
}
.variant-row .product-card-actions {
align-self: end;
display: grid;
grid-template-columns: minmax(108px, 0.62fr) minmax(118px, 0.78fr);
gap: 10px;
margin-top: 0;
}
.variant-row b {
display: grid;
gap: 3px;
color: var(--brand-green);
text-align: right;
}
.variant-row b small {
font-size: 12px;
font-weight: 700;
color: var(--muted);
.variant-row .quantity-stepper button,
.variant-row .quantity-stepper input {
min-height: 42px;
}
.variant-row .add-to-cart-button {
min-height: 42px;
margin-top: 0;
}
.variant-row .price-tier-popover {
inset: auto 0 calc(100% + 10px) 0;
max-width: 430px;
margin-left: auto;
}
body[data-payment-mode="cash"] .variant-row .price-line:has(.price-tier-trigger:hover) ~ .price-tier-popover,
body[data-payment-mode="cash"] .variant-row .package-price-line:has(.price-tier-trigger:hover) ~ .price-tier-popover,
body[data-payment-mode="cash"] .variant-row .price-tier-popover:hover {
opacity: 1;
visibility: visible;
transform: translateY(0);
pointer-events: auto;
}
.product-detail-preorder {
margin: 18px 0 0;
padding: 12px 14px;
border-left: 4px solid var(--brand-red);
border-radius: 0 8px 8px 0;
color: #355141;
background: #f6f1e8;
font-size: 14px;
line-height: 1.45;
}
.product-detail-main .eyebrow {
margin-bottom: 10px;
}
.cart-page {
width: min(var(--page-max), 100%);
margin: 0 auto;
@@ -3057,6 +3174,14 @@ body[data-payment-mode="cash"] .price-tier-popover:hover {
background: #fff8f4;
}
.cart-live-notice {
border-color: rgba(23, 61, 44, 0.16);
border-left-color: var(--brand-green);
margin-top: 10px;
color: #486050;
background: #f6fbf3;
}
.cart-layout {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(300px, 0.36fr);
@@ -3162,6 +3287,44 @@ body[data-payment-mode="cash"] .price-tier-popover:hover {
font-size: 16px;
}
.cart-row-states {
display: flex;
flex-wrap: wrap;
gap: 6px;
min-height: 24px;
margin-bottom: 4px;
}
.cart-row-states:empty {
display: none;
}
.cart-row-state {
display: inline-flex;
align-items: center;
min-height: 22px;
border-radius: 999px;
padding: 4px 8px;
font-size: 11px;
font-weight: 950;
line-height: 1;
}
.cart-row-state.is-price-drop {
color: #14623b;
background: #dff4dc;
}
.cart-row-state.is-package-change {
color: #7b471a;
background: #f9e4c6;
}
.cart-row-state.is-unavailable {
color: #6b2b23;
background: #f5d7d1;
}
.cart-row-main p {
margin: 0;
font-size: 14px;
@@ -3661,6 +3824,14 @@ body[data-payment-mode="invoice"] .cart-invoice-details {
margin-bottom: 0;
}
.catalog-heading-lead {
max-width: 820px;
margin: 10px 0 0;
color: var(--muted);
font-size: 15px;
line-height: 1.55;
}
.payment-benefit-banner {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(260px, 0.38fr);
@@ -4665,6 +4836,10 @@ body[data-payment-mode="invoice"] .invoice-benefit-banner {
grid-template-columns: 1fr;
}
.product-detail-notes {
grid-template-columns: 1fr;
}
.hero-media {
min-height: 240px;
}
@@ -4971,6 +5146,26 @@ body[data-payment-mode="invoice"] .invoice-benefit-banner {
.variant-row {
grid-template-columns: 1fr;
gap: 12px;
}
.variant-row-head strong {
min-height: 0;
}
.variant-row .price-unit-values,
.variant-row .package-price-values {
justify-content: flex-start;
min-width: 0;
}
.variant-row .price-tier-popover {
inset: auto 0 calc(100% + 8px) 0;
max-width: none;
}
.variant-row .product-card-actions {
grid-template-columns: 1fr;
}
.product-card-actions {
@@ -5005,3 +5200,267 @@ body[data-payment-mode="invoice"] .invoice-benefit-banner {
width: 100%;
}
}
/* Final overrides for the current step. Keep this block at the end of the file. */
.start-screen.wide {
display: flex;
flex-direction: column;
}
.start-screen.wide > .home-value-system { order: 1; }
.start-screen.wide > .home-catalog-showcase { order: 2; margin-top: clamp(18px, 2.4vw, 28px); }
.start-screen.wide > .audience-system { order: 3; }
.start-screen.wide > .price-request-panel { order: 4; }
.start-screen.wide > .warehouse-showcase { order: 5; }
.start-screen.wide > .wishlist-request-panel { order: 6; }
.start-screen.wide > .home-delivery-summary { order: 7; }
.start-screen.wide > .status-box { order: 8; }
.home-delivery-summary {
display: grid;
grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
gap: clamp(18px, 3vw, 34px);
align-items: center;
border: 1px solid rgba(13, 93, 128, 0.18);
border-radius: 14px;
padding: clamp(22px, 4vw, 42px);
background:
radial-gradient(circle at 86% 20%, rgba(13, 93, 128, 0.18), transparent 30%),
linear-gradient(135deg, #fffdf6 0%, #eef6f4 56%, #eaf3e8 100%);
box-shadow: 0 24px 60px rgba(22, 60, 43, 0.08);
}
.home-delivery-summary h2 {
max-width: 780px;
margin: 0 0 12px;
color: var(--brand-green);
font-size: clamp(26px, 3.1vw, 44px);
line-height: 1.02;
}
.home-delivery-summary p:not(.eyebrow) {
max-width: 720px;
margin: 0;
color: var(--muted);
font-size: clamp(15px, 1.35vw, 18px);
line-height: 1.55;
}
.home-delivery-benefits {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 10px;
}
.home-delivery-benefits article {
min-height: 142px;
border: 1px solid rgba(19, 66, 45, 0.12);
border-radius: 12px;
padding: 16px;
background: rgba(255, 255, 255, 0.72);
}
.home-delivery-benefits span {
display: block;
margin-bottom: 10px;
color: var(--muted);
font-size: 12px;
font-weight: 900;
text-transform: uppercase;
}
.home-delivery-benefits strong {
display: block;
margin-bottom: 8px;
color: var(--brand-red);
font-size: clamp(24px, 2.5vw, 34px);
line-height: 1;
}
.home-delivery-benefits p {
font-size: 13px !important;
line-height: 1.35 !important;
}
.home-delivery-summary > .primary-button {
justify-self: start;
}
.home-catalog-showcase .home-catalog-heading {
padding: clamp(12px, 1.5vw, 18px);
}
.home-catalog-showcase .home-catalog-heading h2 {
font-size: clamp(24px, 2.4vw, 38px);
}
.home-products-strip {
grid-auto-columns: clamp(252px, 18.5vw, 292px);
gap: 14px;
overflow-x: hidden;
scrollbar-width: none;
}
.home-products-strip .product-card {
min-height: 548px;
padding: 12px;
}
.home-products-strip .product-card h3 {
height: 58px;
font-size: 15px;
line-height: 1.2;
}
.home-products-strip .price-line,
.home-products-strip .package-price-line {
grid-template-columns: minmax(88px, 1fr) auto auto;
min-height: 30px;
overflow: visible;
font-size: 12px;
}
.home-products-strip .quantity-control {
grid-template-columns: 34px 34px 34px;
}
.home-products-strip .add-to-cart-button {
min-width: 84px;
}
.catalog-content {
display: flex;
flex-direction: column;
gap: 12px;
}
.catalog-content > .catalog-heading {
order: 1;
margin-bottom: 0;
padding: clamp(14px, 1.7vw, 20px);
}
.catalog-content > .catalog-heading h1 {
font-size: clamp(28px, 3vw, 42px);
}
.catalog-content > .catalog-search-result-panel {
order: 2;
margin-bottom: 0;
padding: 14px 16px;
}
.catalog-content > .catalog-search-result-panel h2 {
margin: 0 0 4px;
font-size: clamp(18px, 1.7vw, 24px);
}
.catalog-content > .catalog-search-result-panel p:not(.eyebrow) {
margin: 0;
font-size: 14px;
}
.catalog-content > .catalog-count-panel { order: 3; }
.catalog-content > .catalog-product-grid,
.catalog-content > .panel { order: 4; }
.catalog-content > .catalog-pagination { order: 5; }
.catalog-content > .payment-benefit-banner {
order: 6;
grid-template-columns: minmax(0, 1fr) minmax(210px, 0.28fr);
margin: 8px 0 0;
padding: clamp(16px, 2vw, 22px);
}
.catalog-content > .payment-benefit-banner .cash-benefit-copy h2 {
font-size: clamp(22px, 2.1vw, 30px);
}
.catalog-content > .payment-benefit-banner .cash-benefit-copy p:not(.eyebrow) {
font-size: 14px;
}
.catalog-content > .catalog-seo-panel { order: 7; }
.delivery-vehicle-visual {
display: block;
overflow: hidden;
border-radius: 12px;
margin: 0 0 18px;
background: #eaf4f0;
box-shadow: inset 0 0 0 1px rgba(19, 66, 45, 0.08);
}
.delivery-vehicle-visual img {
display: block;
width: 100%;
aspect-ratio: 16 / 8;
object-fit: cover;
}
.calculator-submit {
align-self: end;
min-height: 44px;
}
.route-actions {
display: inline-flex;
flex-wrap: wrap;
gap: 10px;
align-items: center;
justify-content: flex-end;
}
.cart-delivery-options label,
.cart-lift-label,
.checkbox-label {
cursor: pointer;
}
.cart-lift-label {
min-height: 48px;
align-content: center;
border: 1px solid #cfd8c9;
border-radius: 10px;
padding: 12px 14px;
background: #ffffff;
transition: border-color 0.16s ease, background 0.16s ease;
}
.cart-lift-label:hover,
.cart-lift-label:has(input:checked) {
border-color: var(--brand-green);
background: #f0f7ef;
}
@media (max-width: 1024px) {
.home-delivery-summary,
.catalog-content > .payment-benefit-banner {
grid-template-columns: 1fr;
}
.home-delivery-benefits {
grid-template-columns: repeat(3, minmax(160px, 1fr));
overflow-x: auto;
padding-bottom: 4px;
}
}
@media (max-width: 720px) {
.home-products-strip {
grid-auto-columns: minmax(248px, 82vw);
}
.home-product-section-head,
.home-catalog-heading {
align-items: flex-start;
}
.home-delivery-benefits {
grid-template-columns: 1fr;
}
.catalog-content > .catalog-heading {
padding: 14px;
}
}
+44
View File
@@ -0,0 +1,44 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 960 520" role="img" aria-labelledby="title desc">
<title id="title">Рефрижератор Рыбсток в Москве</title>
<desc id="desc">Фирменная машина Рыбсток для доставки внутри МКАД</desc>
<defs>
<linearGradient id="sky" x1="0" y1="0" x2="1" y2="1">
<stop offset="0" stop-color="#d9edf4"/>
<stop offset="1" stop-color="#f7f2e9"/>
</linearGradient>
<linearGradient id="van" x1="0" y1="0" x2="1" y2="1">
<stop offset="0" stop-color="#fffdf7"/>
<stop offset="1" stop-color="#dfe8e2"/>
</linearGradient>
<filter id="shadow" x="-20%" y="-20%" width="140%" height="140%">
<feDropShadow dx="0" dy="18" stdDeviation="18" flood-color="#073322" flood-opacity=".25"/>
</filter>
</defs>
<rect width="960" height="520" rx="34" fill="url(#sky)"/>
<path d="M0 377c158-42 306-49 444-20 131 27 272 22 516-42v205H0z" fill="#cddfd3"/>
<path d="M0 417c210-41 386-38 530 8 130 42 247 38 430-12v107H0z" fill="#f4efe6"/>
<g opacity=".42" fill="#ffffff">
<rect x="62" y="100" width="76" height="185" rx="7"/>
<rect x="152" y="75" width="105" height="220" rx="9"/>
<rect x="282" y="118" width="92" height="177" rx="8"/>
<rect x="748" y="90" width="132" height="214" rx="10"/>
</g>
<g filter="url(#shadow)" transform="translate(130 150)">
<path d="M54 124c0-34 28-62 62-62h378c25 0 48 14 59 36l35 69h57c26 0 47 21 47 47v62H54z" fill="url(#van)"/>
<path d="M79 55c0-27 22-49 49-49h332c27 0 49 22 49 49v202H79z" fill="#f9fbf5"/>
<path d="M511 107h38c18 0 34 10 43 26l27 51H511z" fill="#d7ecf0"/>
<path d="M111 42h360v51H111z" fill="#144631"/>
<text x="130" y="78" font-family="Arial, sans-serif" font-size="42" font-weight="900" fill="#fff">РЫБ</text>
<text x="233" y="78" font-family="Arial, sans-serif" font-size="42" font-weight="900" fill="#d23b30">СТОК</text>
<text x="112" y="134" font-family="Arial, sans-serif" font-size="20" font-weight="700" fill="#144631">Качество со склада. Стоковые цены.</text>
<path d="M86 174h396" stroke="#d23b30" stroke-width="8" stroke-linecap="round"/>
<path d="M86 194h396" stroke="#144631" stroke-width="8" stroke-linecap="round"/>
<rect x="102" y="218" width="104" height="22" rx="11" fill="#eaf3ed"/>
<rect x="230" y="218" width="145" height="22" rx="11" fill="#eaf3ed"/>
<circle cx="170" cy="287" r="44" fill="#10261d"/>
<circle cx="170" cy="287" r="22" fill="#dfe9e1"/>
<circle cx="568" cy="287" r="44" fill="#10261d"/>
<circle cx="568" cy="287" r="22" fill="#dfe9e1"/>
<path d="M36 257h676" stroke="#154631" stroke-width="18" stroke-linecap="round"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

+42
View File
@@ -0,0 +1,42 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 960 520" role="img" aria-labelledby="title desc">
<title id="title">Рефрижератор Рыбсток за МКАД</title>
<desc id="desc">Фирменная машина Рыбсток для доставки по Московской области</desc>
<defs>
<linearGradient id="sunset" x1="0" y1="0" x2="1" y2="1">
<stop offset="0" stop-color="#f3d9b6"/>
<stop offset=".58" stop-color="#cfe7df"/>
<stop offset="1" stop-color="#6d9ab1"/>
</linearGradient>
<filter id="shadow" x="-20%" y="-20%" width="140%" height="140%">
<feDropShadow dx="0" dy="20" stdDeviation="20" flood-color="#0a3323" flood-opacity=".28"/>
</filter>
</defs>
<rect width="960" height="520" rx="34" fill="url(#sunset)"/>
<circle cx="792" cy="92" r="42" fill="#fff2bf" opacity=".82"/>
<path d="M0 318c100-64 208-84 333-48 122 35 205 35 318 0 109-34 208-20 309 38v212H0z" fill="#80a884" opacity=".7"/>
<path d="M0 395c150-39 319-33 510 17 139 36 283 33 450-8v116H0z" fill="#f6efe4"/>
<g fill="#184631" opacity=".38">
<path d="M80 294c24-65 55-65 80 0z"/>
<path d="M154 306c31-83 71-83 102 0z"/>
<path d="M704 288c28-76 64-76 92 0z"/>
<path d="M778 306c35-94 80-94 115 0z"/>
</g>
<g filter="url(#shadow)" transform="translate(110 152)">
<path d="M48 118c0-35 28-63 63-63h391c27 0 51 16 62 41l28 65h77c25 0 45 20 45 45v74H48z" fill="#fffdf5"/>
<path d="M76 48c0-27 22-48 48-48h343c27 0 48 22 48 48v208H76z" fill="#f7faf2"/>
<path d="M520 103h44c18 0 35 11 42 28l23 53H520z" fill="#cde7ec"/>
<path d="M108 38h371v57H108z" fill="#143f2d"/>
<text x="129" y="80" font-family="Arial, sans-serif" font-size="43" font-weight="900" fill="#fff">РЫБ</text>
<text x="235" y="80" font-family="Arial, sans-serif" font-size="43" font-weight="900" fill="#d23b30">СТОК</text>
<text x="110" y="135" font-family="Arial, sans-serif" font-size="20" font-weight="700" fill="#143f2d">Доставка по Москве и области</text>
<path d="M94 172h405" stroke="#d23b30" stroke-width="8" stroke-linecap="round"/>
<path d="M94 193h405" stroke="#143f2d" stroke-width="8" stroke-linecap="round"/>
<rect x="104" y="221" width="124" height="23" rx="12" fill="#e8f0e8"/>
<rect x="250" y="221" width="168" height="23" rx="12" fill="#e8f0e8"/>
<circle cx="174" cy="292" r="45" fill="#10261d"/>
<circle cx="174" cy="292" r="22" fill="#dfe9e1"/>
<circle cx="590" cy="292" r="45" fill="#10261d"/>
<circle cx="590" cy="292" r="22" fill="#dfe9e1"/>
<path d="M31 261h702" stroke="#144631" stroke-width="18" stroke-linecap="round"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

+84
View File
@@ -16,6 +16,86 @@ require_once dirname(__DIR__) . '/app/bootstrap.php';
$router = new Router();
$absoluteSiteUrl = static function (): string {
$siteUrl = rtrim((string) app_env('SITE_URL', ''), '/');
if ($siteUrl !== '') {
return $siteUrl;
}
$host = preg_replace('/[^a-z0-9.\-:]/i', '', (string) ($_SERVER['HTTP_HOST'] ?? 'new.rybstock.ru'));
return 'https://' . $host;
};
$xmlEscape = static fn (string $value): string => htmlspecialchars($value, ENT_XML1 | ENT_COMPAT, 'UTF-8');
$sitemapHandler = static function () use ($absoluteSiteUrl, $xmlEscape): void {
$baseUrl = $absoluteSiteUrl();
$today = date('Y-m-d');
$urls = [];
$addUrl = static function (
string $path,
string $priority,
string $changefreq = 'weekly',
?string $lastmod = null
) use (&$urls, $baseUrl, $today): void {
$urls[] = [
'loc' => $baseUrl . ($path === '/' ? '/' : '/' . ltrim($path, '/')),
'lastmod' => $lastmod ?: $today,
'changefreq' => $changefreq,
'priority' => $priority,
];
};
$addUrl('/', '1.0', 'daily');
$addUrl('/catalog', '0.9', 'daily');
$addUrl('/promo', '0.8', 'daily');
$addUrl('/new', '0.8', 'daily');
$addUrl('/delivery', '0.6', 'monthly');
$addUrl('/payment', '0.5', 'monthly');
$addUrl('/contacts', '0.5', 'monthly');
$addUrl('/returns', '0.4', 'monthly');
try {
foreach ((new CategoryRepository())->active() as $category) {
$addUrl('/catalog/' . (string) $category['slug'], '0.7', 'weekly');
}
foreach ((new ProductRepository())->sitemapProducts() as $product) {
$dateSource = $product['updated_at'] ?: ($product['published_at'] ?: $product['created_at']);
$lastmod = $dateSource ? date('Y-m-d', strtotime((string) $dateSource)) : $today;
$addUrl('/product/' . (string) $product['slug'], '0.6', 'weekly', $lastmod);
}
} catch (Throwable) {
// Keep a valid sitemap available even during database maintenance.
}
header('Content-Type: application/xml; charset=UTF-8');
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n";
foreach ($urls as $url) {
echo " <url>\n";
echo ' <loc>' . $xmlEscape($url['loc']) . "</loc>\n";
echo ' <lastmod>' . $xmlEscape($url['lastmod']) . "</lastmod>\n";
echo ' <changefreq>' . $xmlEscape($url['changefreq']) . "</changefreq>\n";
echo ' <priority>' . $xmlEscape($url['priority']) . "</priority>\n";
echo " </url>\n";
}
echo "</urlset>\n";
};
$robotsHandler = static function () use ($absoluteSiteUrl): void {
header('Content-Type: text/plain; charset=UTF-8');
echo "User-agent: *\n";
echo "Allow: /\n";
echo "Disallow: /admin/\n";
echo "Disallow: /public/admin/\n";
echo "Disallow: /cart\n";
echo "\n";
echo 'Sitemap: ' . $absoluteSiteUrl() . "/sitemap.xml\n";
};
$catalogSearchHandler = static function (?string $rawQuery = null): void {
$queryParameters = [];
parse_str((string) (parse_url($_SERVER['REQUEST_URI'] ?? '', PHP_URL_QUERY) ?? ''), $queryParameters);
@@ -111,11 +191,15 @@ $catalogSearchHandler = static function (?string $rawQuery = null): void {
};
$router->get('/', static fn () => (new HomeController())->index());
$router->get('/robots.txt', $robotsHandler);
$router->get('/sitemap.xml', $sitemapHandler);
$router->post('/price-request', static fn () => (new PriceRequestController())->store());
$router->post('/wishlist-request', static fn () => (new WishlistRequestController())->store());
$router->post('/api/cart/sync', static fn () => (new CartController())->sync());
$router->get('/search', static fn () => $catalogSearchHandler());
$router->get('/search/{query}', static fn (string $query) => $catalogSearchHandler($query));
$router->get('/promo', static fn () => (new CatalogController())->promo());
$router->get('/new', static fn () => (new CatalogController())->newest());
$router->get('/catalog', static fn () => trim((string) ($_GET['q'] ?? '')) !== '' ? $catalogSearchHandler() : (new CatalogController())->index());
$router->get('/delivery', static fn () => (new PageController())->delivery());
$router->get('/payment', static fn () => (new PageController())->payment());