Vinoteca: модуль, шаблон и компоненты интернет-магазина вина на 1С-Битрикс
This commit is contained in:
commit
f6ba0d2174
470 files changed
+26454
No files matched your search
@@ -0,0 +1,28 @@
|
||||
(function (run) {
|
||||
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', run);
|
||||
else run();
|
||||
})(function () {
|
||||
(function () {
|
||||
var root = document.documentElement;
|
||||
if (!root.classList.contains('vino-reveal')) return;
|
||||
var els = document.querySelectorAll('.vino-section, .vino-story, .vino-sales, .vino-footer, .vino-pdp, .vino-reviews, .vino-pdp-related, .vino-auth:not(.vino-auth--embed), .vino-cab, .vino-cart, .vino-order, .vino-done, .vino-about__panel, .vino-brand-detail, .vino-article, .vino-news-feed, .vino-offers, .vino-offer, .vino-offers-wines, .vino-showcase, .vino-showcase-shots');
|
||||
els.forEach(function (el) {
|
||||
el.classList.add('vino-reveal__item');
|
||||
if (el.classList.contains('vino-section') || el.classList.contains('vino-news-feed') || el.classList.contains('vino-offers-wines')) el.classList.add('vino-reveal__item--deep');
|
||||
});
|
||||
var seen = false;
|
||||
var io = new IntersectionObserver(function (list) {
|
||||
seen = true;
|
||||
list.forEach(function (e) {
|
||||
if (e.isIntersecting) {
|
||||
e.target.classList.add('vino-reveal__item--visible');
|
||||
io.unobserve(e.target);
|
||||
}
|
||||
});
|
||||
}, { rootMargin: '0px 0px -12% 0px' });
|
||||
els.forEach(function (el) { io.observe(el); });
|
||||
setTimeout(function () {
|
||||
if (!seen) els.forEach(function (el) { el.classList.add('vino-reveal__item--visible'); });
|
||||
}, 3000);
|
||||
})();
|
||||
});
|
||||
Reference in new issue
Block a user