101var vid = $(v).videoBG(options);102103videoLoadProcessor.registerNewVideo(vid, {104isNeedStop: false,105});106});107};108109function SequenceController() {110this.setScrollCb();111this.itemHeight = screen.availHeight; /* document.documentElement.clientHeight || window.innerHeight || screen.availHeight;*/112var itemTransitionItemRelation = 0.25;
this.itemTransitionTop = this.itemHeight * itemTransitionItemRelation; this.activeItemIndex = null; this.windowHeight = document.documentElement.clientHeight || window.innerHeight || screen.availHeight; this.topOffsetShift = -150; $(window).resize(jQuery.proxy(this.recalculateAllSequencesOffsets, this)); this._resizeInterval = setInterval(jQuery.proxy(this.scrollCb, this), 500);}SequenceController.prototype.defaultConfig = { orientation: 'vertical', speedFactor: 1, automated: false,};SequenceController.prototype.sequenceObjects = [];/** * @param {{}} sO */SequenceController.prototype.recalculateAllSequencesOffsets = function () { if (this._resizeTimeout) { clearTimeout(this._resizeTimeout); } if (this._resizeInterval) { clearInterval(this._resizeInterval); } this._resizeTimeout = setTimeout( jQuery.proxy(function () { this.scrollCb(); this._resizeInterval = setInterval(jQuery.proxy(this.scrollCb, this), 500); }, this), 10 );};SequenceController.prototype.registerNewBlock = function (node) { if (!(node instanceof HTMLElement)) { throw new Error('Wrong node type in registerNewBlock'); } for (var i = 0, l = this.sequenceObjects.length; i < l; i++) { if (this.sequenceObjects[i].sequenceBlock === node) { return false; } } var sequenceHolder = node.querySelector('[data-hook="sequence-holder"]'); var sequenceHeight = 0; var sequenceOffsetTop = this.getAbsoluteTopOffset(sequenceHolder); var items = function () { var _items = Array.prototype.slice.call(node.querySelectorAll('[data-hook="sequence-item"]'), 0), __items = []; _items.forEach( jQuery.proxy(function (el, i, array) { var elHeight = this.getItemHeight(el); var backgroundHolder = el.querySelector('[data-hook="item-background"]'); el.style.height = elHeight + 'px'; backgroundHolder.style.height = this.itemHeight + 'px'; if (i < array.length - 1) { sequenceHeight += elHeight; } __items.push({ node: el, height: elHeight, topOffset: this.getAbsoluteTopOffset(el.querySelector('.txt-holder')) - (i == array.length - 1 ? 0 : this.topOffsetShift), backgroundHolder: backgroundHolder, }); }, this) ); return __items; }.call(this); var sequenceObject = { sequenceBlock: node, sequenceHolder: sequenceHolder, sequenceHolderTopOffset: sequenceOffsetTop, sequenceHeight: sequenceHeight, items: items, started: false, prevBackgroundColor: '', }; this.sequenceObjects.push(sequenceObject); this.scrollCb(); return true;};