PageSourceSearch

https://munksjo.com/wp-content/themes/uncode/library/js/changeSkinOnScroll.js?ver=1202972420

js munksjo.com collected 2026-09-24 22:57:55 UTC 2,745 bytes, 102 lines download raw bytes

1(function($) {
2	"use strict";
3
4	UNCODE.changeSkinOnScroll = function(){
5	if ( UNCODE.isFullPage && ! UNCODE.isFullPageSnap ) {
6		return;
7	}
8	var $masthead = $('#masthead'),
9		transDesktop,
10		transMobile,
11		changeSkin,
12
13	checkTransparencyAndChange = function( $col ){
14		transDesktop = $masthead.hasClass('menu-desktop-transparent') && UNCODE.wwidth >= UNCODE.mediaQuery;
15		transMobile = $masthead.hasClass('menu-mobile-transparent') && UNCODE.wwidth < UNCODE.mediaQuery;
16		changeSkin = $masthead.hasClass('menu-change-skin');
17
18		if ( ! transDesktop && ! transMobile ) {
19			return false;
20		}
21
22		if ( ! changeSkin ) {
23			return false;
24		}
25
26		if ( $col.hasClass('style-light') ){
27			$masthead.removeClass('style-dark-override').addClass('style-light-override');
28			return false;
29		} else if ( $col.hasClass('style-dark') ) {
30			$masthead.removeClass('style-light-override').addClass('style-dark-override');
31			return false;
32		}
33	};
34
35	var prev_row = 'normal',
36		odd = true,
37		$rows = $('.vc_row[data-parent]:visible:not(.overlay-menu *):not(#uncode-mobile-menu-block *):not(.block-wrapper-parent *)');
38	$.each($rows, function(index, row){
39		var $row = $(row),
40			$col = $('.uncol', $row).first(),
41			$slider = $('.uncode-slider', $row);
42
43		if ( $row.closest('li.menu-item').length ) {
44			return;
45		}
46
47		var wayDown = new Waypoint({
48			context: UNCODE.isUnmodalOpen ? document.getElementById('unmodal-content') : window,
49			element: row,
50			handler: function(direction) {
51				if ( direction == 'down' && ( prev_row !== 'normal' || !row.hasAttribute('data-bg-changer') ) ) {
52					if ( $slider.length ) {
53						$col = $('.owl-item.index-active .uncol', $slider).first();
54					}
55					checkTransparencyAndChange($col);
56				}
57				if ( odd === false ) {
58					if ( row.hasAttribute('data-bg-changer') ) {
59						prev_row = 'bg-changer';
60					} else {
61						prev_row = 'normal';
62					}
63					odd = true;
64				} else {
65					odd = false;
66				}
67			},
68			offset: function() {
69				return UNCODE.menuHeight / 2
70			}
71		});
72		var wayUp = new Waypoint({
73			context: UNCODE.isUnmodalOpen ? document.getElementById('unmodal-content') : window,
74			element: row,
75			handler: function(direction) {
76				if ( direction == 'up' && ( prev_row !== 'normal' || !row.hasAttribute('data-bg-changer') ) ) {
77					if ( $slider.length ) {
78						$col = $('.owl-item.index-active .uncol', $slider).first();
79					}
80					checkTransparencyAndChange($col);
81				}
82				if ( odd === false ) {
83					if ( row.hasAttribute('data-bg-changer') ) {
84						prev_row = 'bg-changer';
85					} else {
86						prev_row = 'normal';
87					}
88					odd = true;
89				} else {
90					odd = false;
91				}
92			},
93			offset: function() {
94				return -row.clientHeight + ( UNCODE.menuHeight / 2 )
95			}
96		});
97	});
98
99};
100
101
102})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.