Vinoteca: wine shop on 1C-Bitrix (module, template, components, pages)

This commit is contained in:
jimagie committed 2026-10-22 19:35:23 +05:00
commit 0590195880
593 files changed
+27942

No files matched your search

+87
View File
@@ -0,0 +1,87 @@
<?php
declare(strict_types=1);
use Bitrix\Iblock\ElementTable;
use Bitrix\Main\Application;
use Bitrix\Main\Data\Cache;
use Bitrix\Main\Loader;
use Bitrix\Main\Localization\Loc;
use Bitrix\Main\DI\ServiceLocator;
use Jinove\Vinoteca\Catalog\MegaMenu;
use Jinove\Vinoteca\Config;
use Jinove\Vinoteca\PageSchema;
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die();
}
Loc::loadMessages(__FILE__);
class JinoveAboutComponent extends CBitrixComponent
{
private const CACHE_TTL = 86400;
private const CACHE_DIR = "/jinove.vinoteca/about";
private const MAP_ADDRESS = "Краснодар, улица Красная, 251";
private const MAP_LAT = 45.0508;
private const MAP_LON = 38.9803;
private const MAP_ZOOM = 15;
public function executeComponent(): array
{
global $APPLICATION;
$title = (string)Loc::getMessage("VINO_ABOUT_TITLE");
$APPLICATION->SetTitle($title);
$APPLICATION->SetPageProperty("title", (string)Loc::getMessage("VINO_ABOUT_BROWSER_TITLE"));
$APPLICATION->SetPageProperty("description", (string)Loc::getMessage("VINO_ABOUT_DESCRIPTION"));
$contacts = Config::contacts();
$counts = $this->counts();
$this->arResult = [
"TITLE" => $title,
"WINES" => $counts["wines"],
"BRANDS" => $counts["brands"],
"TYPES" => $counts["types"],
"PHONE" => (string)($contacts["phone"] ?? ""),
"PHONE_LABEL" => (string)($contacts["phoneLabel"] ?? ""),
"EMAIL" => (string)($contacts["email"] ?? ""),
"MAP_URL" => "https://yandex.ru/maps/?text=" . rawurlencode(self::MAP_ADDRESS),
"CATALOG_URL" => SITE_DIR . "catalog/",
"BRANDS_URL" => SITE_DIR . "brands/",
"DESCRIPTION" => (string)Loc::getMessage("VINO_ABOUT_DESCRIPTION"),
"SCHEMA" => PageSchema::aboutPage(SITE_DIR . "about/", $title, (string)Loc::getMessage("VINO_ABOUT_DESCRIPTION"), PageSchema::image(Config::host() . SITE_DIR . "about/#image", Config::host() . SITE_TEMPLATE_PATH . "/assets/media/about-intro-1400.webp", 1400, 933)),
"MAP" => ["LAT" => self::MAP_LAT, "LON" => self::MAP_LON, "ZOOM" => self::MAP_ZOOM, "STYLE" => SITE_TEMPLATE_PATH . "/assets/map/vinoteca-dark.json"],
];
$this->includeComponentTemplate();
return $this->arResult;
}
private function counts(): array
{
$cache = Cache::createInstance();
if ($cache->initCache(self::CACHE_TTL, "counts-" . LANGUAGE_ID, self::CACHE_DIR)) {
return (array)$cache->getVars();
}
$cache->startDataCache();
$taggedCache = Application::getInstance()->getTaggedCache();
$taggedCache->startTagCache(self::CACHE_DIR);
try {
$brandsId = Config::iblockId("brands");
$taggedCache->registerTag("iblock_id_" . Config::iblockId("catalog"));
$taggedCache->registerTag("iblock_id_" . $brandsId);
$counts = [
"wines" => ServiceLocator::getInstance()->get("jinove.vinoteca.wineStats")->getActiveCount(),
"brands" => Loader::includeModule("iblock") ? ElementTable::getCount(["=IBLOCK_ID" => $brandsId, "=ACTIVE" => "Y"]) : 0,
"types" => MegaMenu::types(Config::iblockId("catalog")),
];
} catch (\Throwable $e) {
$taggedCache->abortTagCache();
$cache->abortDataCache();
return ["wines" => 0, "brands" => 0, "types" => []];
}
$taggedCache->endTagCache();
$cache->endDataCache($counts);
return $counts;
}
}
@@ -0,0 +1,4 @@
<?php
$MESS["VINO_ABOUT_TITLE"] = "About us";
$MESS["VINO_ABOUT_BROWSER_TITLE"] = "About us | Vinoteca";
$MESS["VINO_ABOUT_DESCRIPTION"] = "Vinoteca: a place to get to know wine and find your own taste. Wines of many countries and styles, sommelier help and pickup from the warehouse in Krasnodar.";
@@ -0,0 +1,4 @@
<?php
$MESS["VINO_ABOUT_TITLE"] = "O nas";
$MESS["VINO_ABOUT_BROWSER_TITLE"] = "O nas | Vinoteca";
$MESS["VINO_ABOUT_DESCRIPTION"] = "Vinoteca: miejsce, w którym można poznać wino i odnaleźć własny smak. Wina z różnych krajów, pomoc sommeliera i odbiór osobisty z magazynu w Krasnodarze.";
@@ -0,0 +1,4 @@
<?php
$MESS["VINO_ABOUT_TITLE"] = "О нас";
$MESS["VINO_ABOUT_BROWSER_TITLE"] = "О нас | Vinoteca";
$MESS["VINO_ABOUT_DESCRIPTION"] = "Vinoteca: место для знакомства с вином и поиска своего вкуса. Вина разных стран и стилей, помощь сомелье и самовывоз со склада в Краснодаре.";
@@ -0,0 +1,36 @@
<?php
$MESS["VINO_ABOUT_LEAD"] = "A place to get to know wine and find your own #ACCENT#";
$MESS["VINO_ABOUT_ACCENT"] = "taste";
$MESS["VINO_ABOUT_LEAD_2"] = "Wines of different countries and styles, from light whites and fresh rosés to rich reds and festive sparkling wines. We help you choose by mood, dish or occasion.";
$MESS["VINO_ABOUT_FACTS_TITLE"] = "The collection in numbers";
$MESS["VINO_ABOUT_HOW_TITLE"] = "How to buy";
$MESS["VINO_ABOUT_PICKUP_T"] = "Collect the order";
$MESS["VINO_ABOUT_PICKUP_D"] = "Pickup from the warehouse at #LINK#";
$MESS["VINO_ABOUT_PAY_T"] = "Place an order";
$MESS["VINO_ABOUT_PAY_D"] = "Pay online or on pickup";
$MESS["VINO_ABOUT_ASK_T"] = "Choose a wine";
$MESS["VINO_ABOUT_ASK_D"] = "On your own or with #LINK#";
$MESS["VINO_ABOUT_WHERE_TITLE"] = "Where to collect";
$MESS["VINO_ABOUT_ADDRESS_T"] = "Address";
$MESS["VINO_ABOUT_ADDRESS_D"] = "251 Krasnaya St.";
$MESS["VINO_ABOUT_PHONE_T"] = "Phone";
$MESS["VINO_ABOUT_EMAIL_T"] = "E-mail";
$MESS["VINO_ABOUT_ASK"] = "Ask the sommelier";
$MESS["VINO_ABOUT_MAP"] = "Open on the map";
$MESS["VINO_ABOUT_CATALOG"] = "Browse the catalogue";
$MESS["VINO_ABOUT_PHOTO_ALT"] = "Two wine glasses beside warm string lights";
$MESS["VINO_ABOUT_WINES_PLURAL_0"] = "Wine in the collection";
$MESS["VINO_ABOUT_WINES_PLURAL_1"] = "Wines in the collection";
$MESS["VINO_ABOUT_BRANDS_PLURAL_0"] = "Brand";
$MESS["VINO_ABOUT_BRANDS_PLURAL_1"] = "Brands";
$MESS["VINO_ABOUT_ASK_LINK"] = "a sommelier";
$MESS["VINO_ABOUT_PICKUP_LINK"] = "251 Krasnaya St.";
$MESS["VINO_ABOUT_MAP_STUB"] = "The map loads after consent to third-party services.";
$MESS["VINO_ABOUT_MAP_ALLOW"] = "Allow and show the map";
$MESS["VINO_ABOUT_MAP_LABEL"] = "Map: where to collect the order";
$MESS["VINO_ABOUT_MAP_WINDOWS"] = "Use Ctrl + scroll to zoom the map";
$MESS["VINO_ABOUT_MAP_MAC"] = "Use ⌘ + scroll to zoom the map";
$MESS["VINO_ABOUT_MAP_MOBILE"] = "Use two fingers to move the map";
$MESS["VINO_ABOUT_MAP_ZOOM_IN"] = "Zoom in";
$MESS["VINO_ABOUT_MAP_ZOOM_OUT"] = "Zoom out";
$MESS["VINO_ABOUT_MAP_FAIL"] = "The map could not be loaded. The address and phone are listed alongside.";
@@ -0,0 +1,38 @@
<?php
$MESS["VINO_ABOUT_LEAD"] = "Miejsce, w którym można poznać wino i odnaleźć własny #ACCENT#";
$MESS["VINO_ABOUT_ACCENT"] = "smak";
$MESS["VINO_ABOUT_LEAD_2"] = "Wina z różnych krajów i w różnych stylach: od lekkich białych i świeżych różowych po intensywne czerwone i odświętne musujące. Pomagamy wybrać na nastrój, do dania lub na okazję.";
$MESS["VINO_ABOUT_FACTS_TITLE"] = "Kolekcja w liczbach";
$MESS["VINO_ABOUT_HOW_TITLE"] = "Jak kupić";
$MESS["VINO_ABOUT_PICKUP_T"] = "Odebrać zamówienie";
$MESS["VINO_ABOUT_PICKUP_D"] = "Odbiór osobisty z magazynu przy #LINK#";
$MESS["VINO_ABOUT_PAY_T"] = "Złożyć zamówienie";
$MESS["VINO_ABOUT_PAY_D"] = "Płatność online lub przy odbiorze";
$MESS["VINO_ABOUT_ASK_T"] = "Wybrać wino";
$MESS["VINO_ABOUT_ASK_D"] = "Samodzielnie lub z pomocą #LINK#";
$MESS["VINO_ABOUT_WHERE_TITLE"] = "Gdzie odebrać";
$MESS["VINO_ABOUT_ADDRESS_T"] = "Adres";
$MESS["VINO_ABOUT_ADDRESS_D"] = "ul. Krasna 251";
$MESS["VINO_ABOUT_PHONE_T"] = "Telefon";
$MESS["VINO_ABOUT_EMAIL_T"] = "E-mail";
$MESS["VINO_ABOUT_ASK"] = "Zapytaj sommeliera";
$MESS["VINO_ABOUT_MAP"] = "Otwórz na mapie";
$MESS["VINO_ABOUT_CATALOG"] = "Przejdź do katalogu";
$MESS["VINO_ABOUT_PHOTO_ALT"] = "Dwa kieliszki obok ciepłych światełek";
$MESS["VINO_ABOUT_WINES_PLURAL_0"] = "Wino w kolekcji";
$MESS["VINO_ABOUT_WINES_PLURAL_1"] = "Wina w kolekcji";
$MESS["VINO_ABOUT_WINES_PLURAL_2"] = "Win w kolekcji";
$MESS["VINO_ABOUT_BRANDS_PLURAL_0"] = "Marka";
$MESS["VINO_ABOUT_BRANDS_PLURAL_1"] = "Marki";
$MESS["VINO_ABOUT_BRANDS_PLURAL_2"] = "Marek";
$MESS["VINO_ABOUT_ASK_LINK"] = "sommeliera";
$MESS["VINO_ABOUT_PICKUP_LINK"] = "ul. Krasnej 251";
$MESS["VINO_ABOUT_MAP_STUB"] = "Mapa załaduje się po wyrażeniu zgody na usługi zewnętrzne.";
$MESS["VINO_ABOUT_MAP_ALLOW"] = "Zezwól i pokaż mapę";
$MESS["VINO_ABOUT_MAP_LABEL"] = "Mapa: gdzie odebrać zamówienie";
$MESS["VINO_ABOUT_MAP_WINDOWS"] = "Aby powiększyć mapę, użyj Ctrl + przewijanie";
$MESS["VINO_ABOUT_MAP_MAC"] = "Aby powiększyć mapę, użyj ⌘ + przewijanie";
$MESS["VINO_ABOUT_MAP_MOBILE"] = "Przesuwaj mapę dwoma palcami";
$MESS["VINO_ABOUT_MAP_ZOOM_IN"] = "Powiększ";
$MESS["VINO_ABOUT_MAP_ZOOM_OUT"] = "Pomniejsz";
$MESS["VINO_ABOUT_MAP_FAIL"] = "Nie udało się załadować mapy. Adres i telefon są podane obok.";
@@ -0,0 +1,38 @@
<?php
$MESS["VINO_ABOUT_LEAD"] = "Место для знакомства с вином и поиска своего #ACCENT#";
$MESS["VINO_ABOUT_ACCENT"] = "вкуса";
$MESS["VINO_ABOUT_LEAD_2"] = "Вина разных стран и стилей: от лёгких белых и свежих розовых до насыщенных красных и праздничных игристых. Мы поможем выбрать под настроение, блюдо или повод.";
$MESS["VINO_ABOUT_FACTS_TITLE"] = "Коллекция в цифрах";
$MESS["VINO_ABOUT_HOW_TITLE"] = "Как купить";
$MESS["VINO_ABOUT_PICKUP_T"] = "Забрать заказ";
$MESS["VINO_ABOUT_PICKUP_D"] = "Самовывоз со склада на #LINK#";
$MESS["VINO_ABOUT_PAY_T"] = "Оформить заказ";
$MESS["VINO_ABOUT_PAY_D"] = "Оплата онлайн или при получении";
$MESS["VINO_ABOUT_ASK_T"] = "Выбрать вино";
$MESS["VINO_ABOUT_ASK_D"] = "Самостоятельно или с помощью #LINK#";
$MESS["VINO_ABOUT_WHERE_TITLE"] = "Где забрать";
$MESS["VINO_ABOUT_ADDRESS_T"] = "Адрес";
$MESS["VINO_ABOUT_ADDRESS_D"] = "ул. Красная, 251";
$MESS["VINO_ABOUT_PHONE_T"] = "Телефон";
$MESS["VINO_ABOUT_EMAIL_T"] = "Почта";
$MESS["VINO_ABOUT_ASK"] = "Спросить сомелье";
$MESS["VINO_ABOUT_MAP"] = "Открыть на карте";
$MESS["VINO_ABOUT_CATALOG"] = "Смотреть каталог";
$MESS["VINO_ABOUT_PHOTO_ALT"] = "Два бокала рядом с гирляндой тёплого света";
$MESS["VINO_ABOUT_WINES_PLURAL_0"] = "Вино в коллекции";
$MESS["VINO_ABOUT_WINES_PLURAL_1"] = "Вина в коллекции";
$MESS["VINO_ABOUT_WINES_PLURAL_2"] = "Вин в коллекции";
$MESS["VINO_ABOUT_BRANDS_PLURAL_0"] = "Бренд";
$MESS["VINO_ABOUT_BRANDS_PLURAL_1"] = "Бренда";
$MESS["VINO_ABOUT_BRANDS_PLURAL_2"] = "Брендов";
$MESS["VINO_ABOUT_ASK_LINK"] = "сомелье";
$MESS["VINO_ABOUT_PICKUP_LINK"] = "ул. Красной, 251";
$MESS["VINO_ABOUT_MAP_STUB"] = "Карта загрузится после согласия на сторонние сервисы.";
$MESS["VINO_ABOUT_MAP_ALLOW"] = "Разрешить и показать карту";
$MESS["VINO_ABOUT_MAP_LABEL"] = "Карта: где забрать заказ";
$MESS["VINO_ABOUT_MAP_WINDOWS"] = "Для масштабирования прокручивайте колесо с зажатым Ctrl";
$MESS["VINO_ABOUT_MAP_MAC"] = "Для масштабирования прокручивайте с зажатой клавишей ⌘";
$MESS["VINO_ABOUT_MAP_MOBILE"] = "Двигайте карту двумя пальцами";
$MESS["VINO_ABOUT_MAP_ZOOM_IN"] = "Приблизить";
$MESS["VINO_ABOUT_MAP_ZOOM_OUT"] = "Отдалить";
$MESS["VINO_ABOUT_MAP_FAIL"] = "Не получилось загрузить карту. Адрес и телефон указаны рядом.";
@@ -0,0 +1,125 @@
(function (run) {
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', run);
else run();
})(function () {
var box = document.querySelector('[data-map]');
if (!box) return;
var canvas = box.querySelector('[data-map-canvas]');
var stub = box.querySelector('[data-map-stub]');
var note = box.querySelector('[data-map-note]');
var allow = box.querySelector('[data-map-allow]');
var started = false;
var map = null;
var library = null;
var near = !('IntersectionObserver' in window);
function allowed() {
return !!(window.VinoConsent && window.VinoConsent.allowed());
}
function text(name) {
return box.getAttribute('data-text-' + name) || '';
}
function reset(message) {
if (map) {
map.remove();
map = null;
}
started = false;
note.textContent = message;
stub.hidden = false;
}
function localize() {
var lang = box.getAttribute('data-lang');
var names = lang === 'ru' ? ['name:ru', 'name'] : ['name:' + lang, 'name:latin', 'name'];
var field = ['coalesce'].concat(names.map(function (key) { return ['get', key]; }));
map.getStyle().layers.forEach(function (layer) {
var current = layer.layout && layer.layout['text-field'];
if (layer.type !== 'symbol' || !current || JSON.stringify(current).indexOf('"ref"') !== -1) return;
map.setLayoutProperty(layer.id, 'text-field', field);
});
}
function build() {
var lon = parseFloat(box.getAttribute('data-lon'));
var lat = parseFloat(box.getAttribute('data-lat'));
try {
map = new maplibregl.Map({
container: canvas,
style: box.getAttribute('data-style'),
center: [lon, lat],
zoom: parseInt(box.getAttribute('data-zoom'), 10),
cooperativeGestures: true,
locale: {
'CooperativeGesturesHandler.WindowsHelpText': text('windows'),
'CooperativeGesturesHandler.MacHelpText': text('mac'),
'CooperativeGesturesHandler.MobileHelpText': text('mobile'),
'NavigationControl.ZoomIn': text('zoom-in'),
'NavigationControl.ZoomOut': text('zoom-out')
}
});
} catch (error) {
reset(text('fail'));
return;
}
map.on('load', function () {
localize();
stub.hidden = true;
});
map.on('error', function () {
if (map && !map.loaded()) reset(text('fail'));
});
map.addControl(new maplibregl.NavigationControl({ showCompass: false }), 'top-right');
var pin = document.createElement('span');
pin.className = 'vino-about__pin';
new maplibregl.Marker({ element: pin }).setLngLat([lon, lat]).addTo(map);
}
function load() {
if (window.maplibregl) return build();
if (library) return;
var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = box.getAttribute('data-lib-css');
document.head.appendChild(link);
library = document.createElement('script');
library.src = box.getAttribute('data-lib-js');
library.onload = build;
library.onerror = function () {
link.remove();
library.remove();
library = null;
reset(text('fail'));
};
document.head.appendChild(library);
}
function start() {
if (started || !near || !allowed()) return;
started = true;
load();
}
function consent() {
if (allowed()) start();
else if (started) reset(text('stub'));
}
if (allow) allow.addEventListener('click', function () {
if (window.VinoConsent) window.VinoConsent.accept();
});
if (!near) {
var watcher = new IntersectionObserver(function (entries) {
if (!entries.some(function (entry) { return entry.isIntersecting; })) return;
near = true;
watcher.disconnect();
start();
}, { rootMargin: '200px 0px' });
watcher.observe(box);
}
document.addEventListener('vino:consent', consent);
window.addEventListener('load', start);
start();
});
@@ -0,0 +1,390 @@
.vino-about {
--vino-about-map-height: 440px;
--vino-about-lead-measure: 640px;
--vino-about-text-measure: 560px;
--vino-about-heading-measure: 22ch;
--vino-about-note-measure: 30ch;
--vino-about-stub-measure: 32ch;
--vino-about-list-width: 720px;
--vino-about-type-min: 150px;
--vino-about-term-width: 200px;
--vino-about-pin-size: 18px;
--vino-about-fade: 22%;
--vino-about-deep: color-mix(in srgb, var(--color-burgundy-800) 62%, var(--color-bg-deep));
--vino-about-soft: color-mix(in srgb, var(--color-burgundy-800) 90%, var(--color-bg-deep));
}
.vino-about__panel {
display: flex;
align-items: center;
padding: var(--space-24) var(--gutter);
background: var(--vino-about-deep);
}
.vino-about__panel--soft {
background: var(--vino-about-soft);
}
.vino-about__panel--intro {
align-items: flex-start;
padding-top: var(--space-8);
padding-bottom: var(--space-24);
background: var(--color-bg-deep);
}
.vino-about__inner {
display: grid;
gap: var(--space-6);
justify-items: start;
width: 100%;
max-width: var(--container);
margin: 0 auto;
}
.vino-about__inner--intro {
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
gap: var(--space-12);
align-items: center;
}
.vino-about__copy {
display: grid;
gap: var(--space-6);
justify-items: start;
}
.vino-about__photo {
display: block;
width: 100%;
height: auto;
-webkit-mask-image: linear-gradient(to right, transparent, #000 var(--vino-about-fade), #000 calc(100% - var(--vino-about-fade)), transparent), linear-gradient(to bottom, transparent, #000 var(--vino-about-fade), #000 calc(100% - var(--vino-about-fade)), transparent);
-webkit-mask-composite: source-in;
mask-image: linear-gradient(to right, transparent, #000 var(--vino-about-fade), #000 calc(100% - var(--vino-about-fade)), transparent), linear-gradient(to bottom, transparent, #000 var(--vino-about-fade), #000 calc(100% - var(--vino-about-fade)), transparent);
mask-composite: intersect;
}
.vino-about__title {
margin: 0;
color: var(--color-text);
font-family: var(--font-serif);
font-size: var(--fs-display);
font-weight: 400;
line-height: var(--leading-tight);
}
.vino-about__lead {
max-width: var(--vino-about-lead-measure);
margin: 0;
color: var(--color-text);
font-family: var(--font-serif);
font-size: var(--fs-h3);
font-weight: 400;
line-height: var(--leading-title);
}
.vino-about__accent {
color: var(--color-accent);
}
.vino-about__heading {
max-width: var(--vino-about-heading-measure);
margin: 0;
color: var(--color-text);
font-family: var(--font-serif);
font-size: var(--fs-title-lg);
font-weight: 400;
line-height: var(--leading-tight);
}
.vino-about__text {
max-width: var(--vino-about-text-measure);
margin: 0;
color: var(--color-text-muted);
font-size: var(--text-19);
line-height: var(--leading-text);
}
.vino-about__inner--center {
justify-items: center;
text-align: center;
}
.vino-about__inner--center .vino-about__heading {
max-width: none;
}
.vino-about__inner--center .vino-about__stats {
justify-content: center;
}
.vino-about__inner--center .vino-about__stat,
.vino-about__inner--center .vino-about__type {
justify-items: center;
}
.vino-about__stats {
display: flex;
flex-wrap: wrap;
gap: var(--space-12);
margin: var(--space-10) 0 0;
padding: 0;
list-style: none;
}
.vino-about__stat {
display: grid;
gap: var(--space-2);
}
.vino-about__stat-value {
color: var(--color-accent);
font-family: var(--font-serif);
font-size: var(--fs-display);
font-variant-numeric: lining-nums;
line-height: 1;
}
.vino-about__stat-label {
color: var(--color-text-muted);
font-size: var(--text-17);
text-decoration: none;
}
.vino-about__types {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(var(--vino-about-type-min), 1fr));
gap: var(--space-8);
width: 100%;
margin: var(--space-10) 0 0;
padding: var(--space-10) 0 0;
border-top: 1px solid var(--color-line);
list-style: none;
}
.vino-about__type {
display: grid;
gap: var(--space-1);
}
.vino-about__type-value {
color: var(--color-accent);
font-family: var(--font-serif);
font-size: var(--fs-title-md);
font-variant-numeric: lining-nums;
line-height: 1;
}
.vino-about__type-link {
color: var(--color-text-muted);
font-size: var(--text-17);
text-decoration: none;
}
.vino-about__flow {
display: grid;
grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
align-items: start;
width: 100%;
margin: var(--space-8) 0 0;
padding: 0;
list-style: none;
}
.vino-about__stage {
display: grid;
justify-items: center;
gap: var(--space-5);
}
.vino-about__word,
.vino-about__arrow {
font-family: var(--font-serif);
font-size: var(--fs-title-md);
line-height: var(--leading-tight);
}
.vino-about__word {
color: var(--color-text);
}
.vino-about__arrow {
padding: 0 var(--space-6);
color: var(--color-accent);
}
.vino-about__note {
max-width: var(--vino-about-note-measure);
color: var(--color-text-muted);
font-size: var(--text-17);
line-height: var(--leading-text);
}
.vino-about__inner--where {
grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
gap: var(--space-12);
align-items: stretch;
justify-items: stretch;
}
.vino-about__where {
display: grid;
align-content: center;
gap: var(--space-6);
justify-items: start;
}
.vino-about__map-wrap {
display: grid;
}
.vino-about__map {
position: relative;
overflow: hidden;
width: 100%;
min-height: var(--vino-about-map-height);
border: 1px solid var(--color-line);
border-radius: var(--radius-sm);
background: color-mix(in srgb, var(--color-bg-deep) 70%, transparent);
}
.vino-about__map .vino-about__map-canvas {
position: absolute;
inset: 0;
}
.vino-about__map-stub {
position: absolute;
inset: 0;
display: grid;
align-content: center;
justify-items: center;
gap: var(--space-4);
padding: var(--space-8);
text-align: center;
}
.vino-about__map-stub[hidden] {
display: none;
}
.vino-about__map-note {
max-width: var(--vino-about-stub-measure);
margin: 0;
color: var(--color-text-muted);
font-size: var(--text-17);
line-height: var(--leading-text);
}
.vino-about__pin {
display: block;
width: var(--vino-about-pin-size);
height: var(--vino-about-pin-size);
border: 3px solid var(--color-bg-deep);
border-radius: 50%;
background: var(--color-accent);
box-shadow: 0 0 0 6px color-mix(in srgb, var(--color-accent) 30%, transparent);
}
.vino-about__map .maplibregl-ctrl-group {
border: 1px solid var(--color-line);
border-radius: var(--radius-sm);
background: var(--color-bg-deep);
box-shadow: none;
}
.vino-about__map .maplibregl-ctrl-group button + button {
border-top: 1px solid var(--color-line);
}
.vino-about__map .maplibregl-ctrl-icon {
filter: invert(1);
}
.vino-about__map .maplibregl-ctrl-attrib {
background: color-mix(in srgb, var(--color-bg-deep) 75%, transparent);
color: var(--color-text-muted);
}
.vino-about__map .maplibregl-ctrl-attrib a {
color: inherit;
}
.vino-about__map .maplibregl-cooperative-gesture-screen {
font-family: var(--font-sans);
}
.vino-about__accent-link {
padding: 0;
border: 0;
background: none;
color: var(--color-accent);
font: inherit;
white-space: nowrap;
text-decoration: underline;
text-decoration-color: color-mix(in srgb, var(--color-accent) 50%, transparent);
text-underline-offset: .25em;
cursor: pointer;
transition: color var(--duration-fast) var(--ease-base);
}
.vino-about__list {
width: 100%;
max-width: var(--vino-about-list-width);
margin: 0;
}
.vino-about__row {
display: grid;
grid-template-columns: minmax(0, var(--vino-about-term-width)) minmax(0, 1fr);
gap: var(--space-6);
padding: var(--space-5) 0;
border-top: 1px solid var(--color-line);
}
.vino-about__term {
color: var(--color-accent);
font-size: var(--text-13);
letter-spacing: var(--tracking-ui);
text-transform: uppercase;
}
.vino-about__def {
margin: 0;
overflow-wrap: anywhere;
color: var(--color-text);
font-size: var(--text-19);
line-height: var(--leading-text);
}
.vino-about__link {
color: inherit;
text-decoration: underline;
text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
text-underline-offset: .25em;
transition: color var(--duration-fast) var(--ease-base);
}
.vino-about__actions {
display: flex;
flex-wrap: wrap;
gap: var(--space-3);
margin-top: var(--space-4);
}
@media (max-width: 980px) {
.vino-about__inner--where {
grid-template-columns: minmax(0, 1fr);
gap: var(--space-8);
}
.vino-about {
--vino-about-map-height: 320px;
}
.vino-about__flow {
grid-template-columns: minmax(0, 1fr);
gap: var(--space-8);
}
.vino-about__arrow {
display: none;
}
.vino-about__inner--intro {
grid-template-columns: minmax(0, 1fr);
gap: var(--space-8);
}
}
@media (max-width: 560px) {
.vino-about__panel {
padding-top: var(--space-16);
padding-bottom: var(--space-16);
}
.vino-about__types {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.vino-about__type:last-child:nth-child(odd) {
grid-column: 1 / -1;
}
.vino-about__panel--intro {
padding-top: var(--space-8);
}
.vino-about__row {
grid-template-columns: minmax(0, 1fr);
gap: var(--space-2);
}
.vino-about__actions {
width: 100%;
}
.vino-about__actions .vino-btn {
justify-content: center;
width: 100%;
}
}
@media (pointer: coarse) {
.vino-about__stat-label,
.vino-about__type-link,
.vino-about__accent-link,
.vino-about__link {
position: relative;
}
.vino-about__stat-label::before,
.vino-about__type-link::before,
.vino-about__accent-link::before,
.vino-about__link::before {
content: "";
position: absolute;
inset: -12px -6px;
}
}
@media (hover: hover) {
.vino-about__accent-link:hover,
.vino-about__link:hover,
.vino-about__stat-label:hover,
.vino-about__type-link:hover {
color: var(--color-accent-hover);
}
}
@@ -0,0 +1,120 @@
<?php
use Bitrix\Main\Localization\Loc;
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die();
}
Loc::loadMessages(__FILE__);
$text = static fn(string $key): string => htmlspecialcharsbx((string)Loc::getMessage($key));
$stats = [
["value" => $arResult["WINES"], "label" => Loc::getMessagePlural("VINO_ABOUT_WINES", $arResult["WINES"]), "url" => $arResult["CATALOG_URL"]],
["value" => $arResult["BRANDS"], "label" => Loc::getMessagePlural("VINO_ABOUT_BRANDS", $arResult["BRANDS"]), "url" => $arResult["BRANDS_URL"]],
];
$steps = ["ASK", "PAY", "PICKUP"];
$note = static function (string $step): string {
$line = htmlspecialcharsbx((string)Loc::getMessage("VINO_ABOUT_" . $step . "_D"));
$label = htmlspecialcharsbx((string)Loc::getMessage("VINO_ABOUT_" . $step . "_LINK"));
if ($step === "ASK") {
$link = '<button class="vino-about__accent-link" type="button" data-sommelier-open>' . $label . '</button>';
} elseif ($step === "PICKUP") {
$link = '<a class="vino-about__accent-link" href="#vino-about-where">' . $label . '</a>';
} else {
return $line;
}
return str_replace("#LINK#", $link, $line);
};
?>
<div class="vino-about">
<section class="vino-about__panel vino-about__panel--intro">
<div class="vino-about__inner vino-about__inner--intro">
<div class="vino-about__copy">
<?php \Jinove\Vinoteca\Breadcrumbs::show(array(array($arResult["TITLE"]))); ?>
<h1 class="vino-about__title"><?= htmlspecialcharsbx($arResult["TITLE"]) ?></h1>
<p class="vino-about__lead"><?= str_replace("#ACCENT#", '<span class="vino-about__accent">' . $text("VINO_ABOUT_ACCENT") . '</span>', $text("VINO_ABOUT_LEAD")) ?></p>
<p class="vino-about__text"><?= $text("VINO_ABOUT_LEAD_2") ?></p>
</div>
<img class="vino-about__photo" src="<?= SITE_TEMPLATE_PATH ?>/assets/media/about-intro-1400.webp" srcset="<?= SITE_TEMPLATE_PATH ?>/assets/media/about-intro-800.webp 800w, <?= SITE_TEMPLATE_PATH ?>/assets/media/about-intro-1400.webp 1400w" sizes="(max-width: 760px) 100vw, 50vw" width="1400" height="933" alt="<?= $text("VINO_ABOUT_PHOTO_ALT") ?>" fetchpriority="high" decoding="async">
</div>
</section>
<?php if ($arResult["WINES"] > 0): ?>
<section class="vino-about__panel vino-about__panel--deep">
<div class="vino-about__inner vino-about__inner--center">
<h2 class="vino-about__heading"><?= $text("VINO_ABOUT_FACTS_TITLE") ?></h2>
<ul class="vino-about__stats">
<?php foreach ($stats as $stat): ?>
<li class="vino-about__stat">
<span class="vino-about__stat-value"><?= (int)$stat["value"] ?></span>
<a class="vino-about__stat-label" href="<?= htmlspecialcharsbx($stat["url"]) ?>"><?= htmlspecialcharsbx($stat["label"]) ?></a>
</li>
<?php endforeach; ?>
</ul>
<?php if ($arResult["TYPES"]): ?>
<ul class="vino-about__types">
<?php foreach ($arResult["TYPES"] as $type): ?>
<li class="vino-about__type">
<span class="vino-about__type-value"><?= (int)$type["COUNT"] ?></span>
<a class="vino-about__type-link" href="<?= htmlspecialcharsbx($type["URL"]) ?>"><?= htmlspecialcharsbx($type["NAME"]) ?></a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
</section>
<?php endif; ?>
<section class="vino-about__panel vino-about__panel--soft">
<div class="vino-about__inner vino-about__inner--center">
<h2 class="vino-about__heading"><?= $text("VINO_ABOUT_HOW_TITLE") ?></h2>
<ol class="vino-about__flow">
<?php foreach ($steps as $index => $step): ?>
<?php if ($index > 0): ?><li class="vino-about__arrow" aria-hidden="true">&rarr;</li><?php endif; ?>
<li class="vino-about__stage">
<span class="vino-about__word"><?= $text("VINO_ABOUT_" . $step . "_T") ?></span>
<span class="vino-about__note"><?= $note($step) ?></span>
</li>
<?php endforeach; ?>
</ol>
</div>
</section>
<section class="vino-about__panel vino-about__panel--deep" id="vino-about-where">
<div class="vino-about__inner vino-about__inner--where">
<div class="vino-about__where">
<h2 class="vino-about__heading"><?= $text("VINO_ABOUT_WHERE_TITLE") ?></h2>
<dl class="vino-about__list">
<div class="vino-about__row">
<dt class="vino-about__term"><?= $text("VINO_ABOUT_ADDRESS_T") ?></dt>
<dd class="vino-about__def"><?= $text("VINO_ABOUT_ADDRESS_D") ?></dd>
</div>
<?php if ($arResult["PHONE"] !== ""): ?>
<div class="vino-about__row">
<dt class="vino-about__term"><?= $text("VINO_ABOUT_PHONE_T") ?></dt>
<dd class="vino-about__def"><a class="vino-about__link" href="tel:<?= htmlspecialcharsbx($arResult["PHONE"]) ?>"><?= htmlspecialcharsbx($arResult["PHONE_LABEL"]) ?></a></dd>
</div>
<?php endif; ?>
<?php if ($arResult["EMAIL"] !== ""): ?>
<div class="vino-about__row">
<dt class="vino-about__term"><?= $text("VINO_ABOUT_EMAIL_T") ?></dt>
<dd class="vino-about__def"><a class="vino-about__link" href="mailto:<?= htmlspecialcharsbx($arResult["EMAIL"]) ?>"><?= htmlspecialcharsbx($arResult["EMAIL"]) ?></a></dd>
</div>
<?php endif; ?>
</dl>
<div class="vino-about__actions">
<button class="vino-btn" type="button" data-sommelier-open><?= $text("VINO_ABOUT_ASK") ?></button>
<a class="vino-btn vino-btn--outline" href="<?= htmlspecialcharsbx($arResult["CATALOG_URL"]) ?>"><?= $text("VINO_ABOUT_CATALOG") ?></a>
</div>
<a class="vino-about__accent-link" href="<?= htmlspecialcharsbx($arResult["MAP_URL"]) ?>" target="_blank" rel="noopener noreferrer"><?= $text("VINO_ABOUT_MAP") ?></a>
</div>
<div class="vino-about__map-wrap">
<div class="vino-about__map" data-map data-lat="<?= (float)$arResult["MAP"]["LAT"] ?>" data-lon="<?= (float)$arResult["MAP"]["LON"] ?>" data-zoom="<?= (int)$arResult["MAP"]["ZOOM"] ?>" data-style="<?= htmlspecialcharsbx($arResult["MAP"]["STYLE"]) ?>" data-lang="<?= LANGUAGE_ID ?>" data-lib-js="<?= SITE_TEMPLATE_PATH ?>/assets/vendor/maplibre/maplibre-gl.js" data-lib-css="<?= SITE_TEMPLATE_PATH ?>/assets/vendor/maplibre/maplibre-gl.css" data-text-windows="<?= $text("VINO_ABOUT_MAP_WINDOWS") ?>" data-text-mac="<?= $text("VINO_ABOUT_MAP_MAC") ?>" data-text-mobile="<?= $text("VINO_ABOUT_MAP_MOBILE") ?>" data-text-zoom-in="<?= $text("VINO_ABOUT_MAP_ZOOM_IN") ?>" data-text-zoom-out="<?= $text("VINO_ABOUT_MAP_ZOOM_OUT") ?>" data-text-stub="<?= $text("VINO_ABOUT_MAP_STUB") ?>" data-text-fail="<?= $text("VINO_ABOUT_MAP_FAIL") ?>" role="region" aria-label="<?= $text("VINO_ABOUT_MAP_LABEL") ?>">
<div class="vino-about__map-canvas" data-map-canvas></div>
<div class="vino-about__map-stub" data-map-stub>
<p class="vino-about__map-note" data-map-note><?= $text("VINO_ABOUT_MAP_STUB") ?></p>
<button class="vino-btn vino-btn--outline" type="button" data-map-allow><?= $text("VINO_ABOUT_MAP_ALLOW") ?></button>
</div>
</div>
</div>
</div>
</section>
</div>
<script type="application/ld+json"><?= json_encode($arResult["SCHEMA"], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_HEX_TAG) ?></script>