PageSourceSearch

https://soehne-mannheims.de/wp-content/themes/soehnema/js/nicesScript.js?ver=1.0.0

js soehne-mannheims.de collected 2026-10-02 11:20:53 UTC 11,411 bytes, 320 lines download raw bytes

1window.onload = function() {
2  /*
3  // First we get the viewport height and we multiple it by 1% to get a value for a vh unit
4  let vh = window.innerHeight * 0.01;
5  // Then we set the value in the --vh custom property to the root of the document
6  document.documentElement.style.setProperty('--vh', `${vh}px`);
7
8  // We listen to the resize event
9  window.addEventListener('resize', () => {
10    // We execute the same script as before
11    let vh = window.innerHeight * 0.01;
12    document.documentElement.style.setProperty('--vh', `${vh}px`);
13  });
14  */
15
16  if( $('.page-id-2').length != 0 ) {
17    if( $(this).width() <= 575 ) { //small
18
19      $.ajax({
20        url: head.ajaxurl,
21        type: "POST",
22        data: {
23            action: 'apply_small_img'
24        },
25        success: function(data) { //Data is that from php!
26          //$('.headerimage').css( 'display', 'none' );
27          $('.head').css( 'background-image', 'url('+data.slice(0, -1)+')' );
28        },
29        error: function (errorThrown, data) {
30        }
31      });
32    } else if ( $(this).width() > 575 && $(this).width() < 992 ) { //large
33
34      $.ajax({
35        url: head.ajaxurl,
36        type: "POST",
37        data: {
38            action: 'apply_medium_img'
39        },
40        success: function(data) { //Data is that from php!
41          //$('.headerimage').css( 'display', 'none' );
42          $('.head').css( 'background-image', 'url('+data.slice(0, -1)+')' );
43        },
44        error: function (errorThrown, data) {
45        }
46      });
47    }
48
49    if( $(window).scrollTop() != 0 ) {
50      $('.topnav').css( 'background', 'black' );
51      $('.mobile-nav').css( 'background', 'black' );
52    }
53
54  };
55}
56
57$(document).ready(function() {
58
59  var vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
60  var vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0);
61
62  if( vw > vh && vw < 992 ) {
63    $('.header-content').css( 'top', '20%' );
64    $('.master-heading').css( "font-size", "3rem" ).css( 'margin-top', 0 );//.css( 'margin-top', 0 );
65    $('.shopimage').css('height', 'auto').css( 'width', '100%' );
66  }
67
68  if( $('.page-id-2').length != 0 ) {
69    window.onload = function() {
70      if( $(this).width() <= 575 ) { //small
71  
72        $.ajax({
73          url: head.ajaxurl,
74          type: "POST",
75          data: {
76              action: 'apply_small_img'
77          },
78          success: function(data) { //Data is that from php!
79            //$('.headerimage').css( 'display', 'none' );
80            $('.head').css( 'background-image', 'url('+data.slice(0, -1)+')' );
81          },
82          error: function (errorThrown, data) {
83          }
84        });
85      } else if ( $(this).width() > 575 && $(this).width() < 992 ) { //large
86
87        $.ajax({
88          url: head.ajaxurl,
89          type: "POST",
90          data: {
91              action: 'apply_medium_img'
92          },
93          success: function(data) { //Data is that from php!
94            //$('.headerimage').css( 'display', 'none' );
95            $('.head').css( 'background-image', 'url('+data.slice(0, -1)+')' );
96          },
97          error: function (errorThrown, data) {
98          }
99        });
100      }
101
102      if( $(window).scrollTop() != 0 ) {
103        $('.topnav').css( 'background', 'black' );
104        $('.mobile-nav').css( 'background', 'black' );
105      }
106
107    };
108  }
109
110  if( $('body').hasClass('home') ) {
111    $(window).scroll(function() {
112        if( $(window).scrollTop() == 0 && $('.topnav-mobile').css( 'display' ) != 'none' ) {
113          $('.topnav').css( 'background', 'black' );
114          $('.mobile-nav').css( 'background', 'black' );
115        } else if( $(window).scrollTop() == 0 ) {
116            $('.topnav').css( 'background', 'none' );
117            $('.mobile-nav').css( 'background', 'none' );
118        } else if( $(window).scrollTop() > 0 ) {
119          $('.topnav').css( 'background', 'black' );
120          $('.mobile-nav').css( 'background', 'black' );
121        }
122    });
123  }
124
125    $('a[href*="#"]')
126  // Remove links that don't actually link to anything
127  .not('[href="#"]')
128  .not('[href="#0"]')
129  .click(function(event) {
130    
131    if( $('.topnav-mobile').css( 'display' ) != 'none' ) {
132      $('.topnav-toggler').show(200);
133      $('.fill').show(200);
134      $('html').css( 'overflow', 'visible' ).css( 'position', 'relative' ).css( 'height', '100%' );
135    }
136
137    // On-page links
138    if (
139      location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') 
140      && 
141      location.hostname == this.hostname
142    ) {
143      // Figure out element to scroll to
144      var target = $(this.hash);
145      target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
146      // Does a scroll target exist?
147      if (target.length) {
148        // Only prevent default if animation is actually gonna happen
149        event.preventDefault();
150        $('html, body').animate({
151          scrollTop: target.offset().top
152        }, 500, function() {
153          // Callback after animation
154          // Must change focus!
155          var $target = $(target);
156          $target.focus();
157          if ($target.is(":focus")) { // Checking if the target was focused
158            return false;
159          } else {
160            $target.attr('tabindex','-1'); // Adding tabindex for elements not focusable
161            $target.focus(); // Set focus again
162          };
163        });
164      }
165    }
166  });
167  
168  var hidden = $('.mobile-nav');
169  
170  $('.anchor:not(.to-content)').css( 'top', '-'+hidden.outerHeight()+'px' );
171  
172  var top;
173
174  $('.topnav-toggler').on('click', function() {
175          top = $(window).scrollTop();
176          $('html').css( 'overflow', 'hidden' );
177          $('.mobile-nav').css( 'background', 'rgba( 0, 0, 0, 1 )' ).css( 'top', 0 ).css( 'height', 'calc(100% - 2rem)' ); //32 for 2rem padding
178          var height = window.innerHeight ? window.innerHeight : $(window).height();
179          $('.topnav-mobile').css( 'height', 'fill-available' ).fadeToggle( 600 ); //17 for Scrollbar -.-
180          $(this).hide(400);
181          $('.fill').hide(400);
182          if( $('.mobile-nav').css( 'justify-content' ) == 'center' ) {
183            //$('.mobile-nav').css( 'justify-content', 'initial' );
184          } else {
185            $('.mobile-nav').css( 'justify-content', 'center' ).css( 'background', 'black' );
186          }
187          if( $(window).scrollTop() == 0 && $('html').css( 'overflow' ) == 'hidden' ) { //toggler hidden & overflow hidden -> NAV!
188            $('.topnav').css( 'background', 'none' );
189            $('.mobile-nav').css( 'background', 'black' );
190          } else {
191            $('.topnav').css( 'background', 'none' );
192            $('.mobile-nav').css( 'background', 'black' );
193          }
194      });
195
196      $('.close').on('click', function() {
197        $('.topnav-toggler').show(400);
198        $('.fill').show(400);
199        if( $('.mobile-nav').css( 'justify-content' ) == 'center' ) {
200          $('.mobile-nav').css( 'justify-content', 'initial' );
201          $('.fill').css( 'display', 'inline-block' );
202        } else {
203          $('.mobile-nav').css( 'justify-content', 'center' );
204        }
205          $('.topnav-mobile').fadeToggle( 600, function() {
206            if( $('body').hasClass('home') && $(window).scrollTop() == 0 ) {
207              $('.mobile-nav').css( 'background', 'none' );
208            } else {
209              $('.mobile-nav').css( 'background', 'black' )
210            }
211              $('body').css( 'overflow', 'visible' );
212              //$('.to-content').css( 'z-index', 5 );
213              //$('.header-content').css( 'z-index', 4 );
214              $('html').css( 'overflow', 'visible' ).css( 'bottom', 0 );
215              window.scrollTo( 0, top );
216              $('.mobile-nav').css( 'height', 'auto' );
217          });
218      });
219
220      $('.topnav-mobile').find('a').on('click', function() {
221        $('.topnav-mobile').fadeToggle( 200, function() {
222          if( $('body').hasClass('home') ) {
223            $('.mobile-nav').css( 'background', 'black' );
224          }
225            $('.topnav-toggler').fadeIn(400);
226            $('body').css( 'overflow', 'visible' );
227            $('.to-content').css( 'z-index', 5 );
228            $('.header-content').css( 'z-index', 4 );
229        });
230		$('.mobile-nav').css( 'height', 'auto' );
231      })
232
233      var breakpoint = 991;
234      
235      function Height() {
236          $('.stream').css('height', 'fit-content');
237          $('.streamimage').css('height', '100%');
238          if( $('body').hasClass( 'home' ) ) {
239            //$('.head').css('height', $(window).height());
240          }
241          //$('.headerimage').css('height', $(window).height());
242          $('.merchandise').css('height', $(window).height());
243          //$('.shopimage').css('height', 'auto').css( 'width', '100%' );
244      };
245      var windowWidth = $(window).width();
246
247      if( windowWidth <= breakpoint ) {
248        Height();
249      }
250
251
252      $(window).resize( function() {
253        if (($(this).width() <= breakpoint) && ($(this).width() != windowWidth)) {
254          Height();
255        }
256  
257        windowWidth = $(window).height();
258
259        var vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
260        var vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0
260);
261
262        if( vw > vh && vw < 992 ) {
263          $('.header-content').css( 'top', '20%' );
264          $('.master-heading').css( "font-size", "3rem" ).css( 'margin-top', 0 );//.css( 'margin-top', 0 );
265          $('.shopimage').css('height', 'auto').css( 'width', '100%' );
266        } else {
267          $('.shopimage').css('height', '100%').css( 'width', 'auto' );
268        }
269      })
270
271      if( $('.page-id-2').length != 0 ) {
272        $(window).on('resize', function() {
273          if( $(this).width() <= 575 ) { //small
274  
275            $.ajax({
276              url: head.ajaxurl,
277              type: "POST",
278              data: {
279                  action: 'apply_small_img'
280              },
281              success: function(data) { //Data is that from php!
282                //$('.headerimage').css( 'display', 'none' );
283                $('.head').css( 'background-image', 'url('+data.slice(0, -1)+')' );
284              },
285              error: function (errorThrown, data) {
286                //alert(data);
287              }
288            });
289          } else if ( $(this).width() > 575 && $(this).width() < 992 ) { //large
290  
291            $.ajax({
292              url: head.ajaxurl,
293              type: "POST",
294              data: {
295                  action: 'apply_medium_img'
296              },
297              success: function(data) { //Data is that from php!
298                //$('.headerimage').css( 'display', 'none' );
299                $('.head').css( 'background-image', 'url('+data.slice(0, -1)+')' );
300              },
301              error: function (errorThrown, data) {
302              }
303            });
304          }
305        });
306      }
307
308      if( $('body').length != 0 ) {
309        var height = $(window).height();
310
311        var sectionheight = $('section#content').height();
312
313        if( height - sectionheight - ( parseInt( $('.footer').css( 'margin-top' ).slice( 0, -2 ) ) + $('.footer').height() ) > 0  ) { //Passt footer noch unter section? + 100 for margin section - footer
314            $('#footer').css( 'position', 'absolute' ).css( 'bottom', 0 ).css( 'width', '100%' );
315        } else {
316            $('#footer').css( 'position', 'relative' );
317        }
318      }
319
320})

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.