1function isMobileDevice() { 2 return window.innerWidth <= 768; // Adjust the width threshold as needed 3} 4 5document.addEventListener( 6 "DOMContentLoaded", () => { 7 const arisemenu = new Mmenu("#arisemenu", { 8 "offCanvas": { 9 "position": "right" 10 }, 11 "theme": "dark", 12 "counters": { 13 "add": true 14 }, 15 "iconbar": { 16 "use": true, 17 "top": [ 18 "<a href='#' onclick='menuTriggerClose();preventDefault();' class='arisemenu-close'><i class='fa-solid fa-xmark'></i></a>", 19 ], 20 "bottom": [ 21 "<a target='_blank' href='https://www.facebook.com/AriseTVNews/'><i class='fab fa-facebook'></i></a>", 22 "<a target='_blank' href='https://twitter.com/ARISEtv'><i class='fab fa-twitter'></i></a>", 23 "<a target='_blank' href='https://www.youtube.com/channel/UCyEJX-kSj0kOOCS7Qlq2G7g'><i class='fab fa-youtube'></i></a>", 24 "<a target='_blank' href='https://www.instagram.com/arisenewsofficial/'><i class='fab fa-instagram'></i></a>", 25 ] 26 }, 27 "navbar": { 28 "title": "ARISE NEWS" 29 }, 30 "navbars": [{ 31 "position": "top", 32 "content": [ 33 "searchfield" 34 ] 35 }, 36 { 37 "position": "top", 38 "content": [ 39 "prev", 40 "title" 41 ] 42 } 43 ] 44 }); 45 const api = arisemenu.API; 46 window.menuTriggerClose = function () { 47 // do whatever you want here 48 const panel = document.querySelector("#arisemenu"); 49 api.closePanel(panel); 50 api.close(); 51 }; 52 } 53); 54 55 56 57 58 59 60 61 62const btn = document.querySelector(".theme-switch"); 63const prefersDarkScheme = window.matchMedia("(prefers-color-scheme: dark)"); 64 65btn.addEventListener("click", function () { 66 if (prefersDarkScheme.matches) { 67 68 document.body.classList.toggle("light-mode"); 69 var theme = document.body.classList.contains("light-mode") ? "light" : "dark"; 70 71 } else { 72 document.body.classList.toggle("dark-mode"); 73 var theme = document.body.classList.contains("dark-mode") ? "dark" : "light"; 74 } 75 76 document.cookie = "theme" + "=" + theme + ";" + ";path=/"; 77 78 79}); 80 81 82 83/* 84 85var darkModeValue = $.cookie("darkmode"); 86 87if ( darkModeValue == 'true') { 88 89 $( "#dark_mode_switch" ).prop( "checked", true ); 90 91} else if ( darkModeValue == 'false') { 92 93 $( "#dark_mode_switch" ).prop( "checked", false ); 94 95} 96*/ 97 98 99 100 101 102 103// START DOCUMENT READY 104jQuery(document).ready(function () { 105 106 107 $("#masthead").appendTo("body"); 108 $("#wpadminbar").appendTo("body"); 109 110 111 Fancybox.bind("[data-fancybox-arise-video]", { 112 src: "#large_arise_news", 113 type: "inline", 114 on: { 115 destroy: (fancybox) => { 116 player_pop.muted(true); 117 } 118 } 119 }); 120 121 /* 122 $( function () { 123 124 $( "#dark_mode_switch" ).click( function () { 125 126 if ($( "#dark_mode_switch" ).hasClass("true")) { 127 128 $( "body" ).toggleClass( "dark-mode" ); 129 $( "#dark_mode_switch" ).removeClass("true").addClass("false"); 130 $( "#dark_mode_switch" ).html('<i class="fa-solid fa-moon"></i>'); 131 $.cookie('darkmode', 'false', { expires: 20*365, path: '/' }); 132 133 } else if ($( "#dark_mode_switch" ).hasClass("false")) { 134 135 $( "body" ).toggleClass( "dark-mode" ); 136 $( "#dark_mode_switch" ).removeClass("false").addClass("true"); 137 $( "#dark_mode_switch" ).html('<i class="fa-solid fa-brightness"></i>'); 138 $.cookie('darkmode', 'true', { expires: 20*365, path: '/' }); 139 140 } 141 142 143 144 145 } ); 146 147 } ); 148 */ 149 150 $(function () { 151 $('.matchHeight').matchHeight(); 152 }); 153 154 $('.search-toggle a').click(function (e) { 155 $('#search_bar').toggleClass("active"); 156 $(this).parent().toggleClass("active"); 157 e.preventDefault() 158 }); 159 160 $('.latest-headlines-slider').slick({ 161 dots: false, 162 infinite: true, 163 speed: 300, 164 slidesToShow: 4, 165 slidesToScroll: 4,
166 arrows: false, 167 dots: false, 168 169 responsive: [{ 170 breakpoint: 1200, 171 settings: { 172 slidesToShow: 3, 173 slidesToScroll: 3, 174 infinite: true, 175 dots: false 176 } 177 }, 178 { 179 breakpoint: 1000, 180 settings: { 181 slidesToShow: 2, 182 slidesToScroll: 2 183 } 184 }, 185 { 186 breakpoint: 800, 187 settings: { 188 slidesToShow: 1, 189 slidesToScroll: 1 190 } 191 } 192 // You can unslick at a given breakpoint now by adding: 193 // settings: "unslick" 194 // instead of a settings object 195 ] 196 }); 197 198 $('.news-flash-articles').slick({ 199 infinite: true, 200 vertical: true, 201 arrows: false, 202 dots: false, 203 autoplay: true, 204 autoplaySpeed: 4000, 205 adaptiveHeight: true 206 }); 207 208 $(window).resize(function () { 209 $('.news-flash-articles')[0].slick.refresh(); 210 }); 211 212 $(".scroll-to").click(function (e) { 213 var t = $(this).attr("href"), 214 a = $(t).offset(); 215 $("html, body").stop().animate({ 216 scrollTop: a.top - 183 217 }, 500), e.preventDefault() 218 }); 219 $(".wp-scroll-to a").click(function (e) { 220 var y = $(this).attr("href"), 221 s = $(y).offset(); 222 $("html, body").stop().animate({ 223 scrollTop: s.top - 183 224 }, 500), e.preventDefault() 225 }); 226 Fancybox.bind(".fancybox", {}); 227 $('.toggle').click(function (e) { 228 e.preventDefault(); 229 var $this = $(this); 230 $('.toggle').removeClass('active'); 231 if ($this.next().hasClass('show')) { 232 $this.next().removeClass('show'); 233 $this.next().slideUp(350); 234 } else { 235 $this.addClass('active'); 236 $this.parent().parent().find('li .inner').removeClass('show'); 237 $this.parent().parent().find('li .inner').slideUp(350); 238 $this.next().toggleClass('show'); 239 $this.next().slideToggle(350); 240 } 241 }); 242 243 244 245 246 (function ($) { 247 $.fn.ariseVideoShowInWindow = function () { 248 249 $("#arise_news").toggleClass('fixit'); 250 $("#arise_news").appendTo("body"); 251 }; 252 })(jQuery); 253 254 (function ($) { 255 $.fn.ariseVideoShowInPlace = function () { 256 257 $("#arise_news").toggleClass('fixit'); 258 $("#arise_news").appendTo("#arise_news_holder"); 259 }; 260 })(jQuery); 261 262 263 264 $('#hide_video').on('click', function (e) { 265 266 e.preventDefault(); 267 $("#arise_news_holder").attr('data-no-show', 1); 268 $("#arise_news_holder").addClass('show-fixed-option'); 269 $.fn.ariseVideoShowInPlace(); 270 271 272 }); 273 274 $('#fix_video').on('click', function (e) { 275 276 e.preventDefault(); 277 $("#arise_news_holder").attr('data-no-show', 0); 278 $.fn.ariseVideoShowInWindow(); 279 280 281 }); 282 283 function debounce(func, wait) { 284 let timeout; 285 return function() { 286 clearTimeout(timeout); 287 timeout = setTimeout(() => { 288 func.apply(this, arguments); 289 }, wait); 290 }; 291 } 292 293 294 // $(window).scroll(function () { 295 // var e = $(window).scrollTop(); 296 297 // if ($('#arise_news_holder').attr('data-no-show') == 1) { } else { 298 299 // let height = window.innerHeight; 300 301 // const isMuted = window.player ? window.player.muted : false; 302 // if (!isMobileDevice()) { 303 // const $mainStreamHolder = $('.main_stream_holder'); 304 305 // if (e > 400) { 306 // $mainStreamHolder.addClass('flying_stream'); 307 // let calculatedTop = height + e - ($mainStreamHolder.height() + 50); 308 // $mainStreamHolder.stop().animate({ top: calculatedTop + 'px' }, 300); 309 // } else { 310 // $mainStreamHolder.removeClass('flying_stream'); 311 // $mainStreamHolder.stop().animate({ top: 0 }, 300); 312 // } 313 314 // } 315 // else { 316 // const $mainStreamHolder = $('.main_stream_holder_mobile'); 317 318 // if (e > 100) { 319 // $mainStreamHolder.addClass('flying_stream_mobile'); 320 // let calculatedTop = height + e - ($mainStreamHolder.height() + 50); 321 // $mainStreamHolder.stop().animate({ top: calculatedTop + 'px' }, 300); 322 // } else { 323 // $mainStreamHolder.removeClass('flying_stream_mobile'); 324 // $mainStreamHolder.stop().animate({ top: 0 }, 300); 325 // } 326 327 // } 328 // } 329 330 // }); 331 332 333 $(window).scroll(function () { 334 var e = $(window).scrollTop(); 335 336 if ($('#arise_news_holder').attr('data-no-show') == 1) { } else { 337 338 const isMuted = window.player ? window.player.muted : false;
339 if (!isMobileDevice()) { 340 console.log('desktop') 341 e >= 150 && !Array.from(document.querySelector('#arise_news').classList).includes('fixit') && $("#arise_news").appendTo("body") 342 e >= 150 && !Array.from(document.querySelector('#arise_news').classList).includes('fixit') && $("#arise_news").addClass("fixit") 343 344 e <= 150 && $("#arise_news").removeClass("fixit") 345 e <= 150 && !document.querySelector('#arise_news_holder #arise_news') && $("#arise_news").appendTo("#arise_news_holder") 346 } 347 // else { 348 // if (e > 0 && !$("#arise_news_mobile").hasClass('fixit')) { 349 // $("#arise_news_mobile").appendTo("body") 350 // $("#arise_news_mobile").addClass("fixit") 351 // window.player_mobile.play() 352 // } else if (e === 0 && $("#arise_news_mobile").hasClass('fixit')) { 353 // $("#arise_news_mobile").removeClass("fixit") 354 // $("#arise_news_mobile").appendTo("#arise_news_holder_mobile") 355 // window.player_mobile.play() 356 357 // } 358 359 // } 360 setTimeout(() => { 361 window.player && isMuted && (window.player.muted = isMuted); 362 }, 500) 363 } 364 365 }); 366 367 368}); 369// END DOCUMENT READY 370 371 372const body = document.body; 373const scrollUp = "scroll-up"; 374const scrollDown = "scroll-down"; 375let lastScroll = 150; 376 377window.addEventListener("scroll", () => { 378 const currentScroll = window.pageYOffset; 379 if (currentScroll <= 150) { 380 body.classList.remove(scrollUp); 381 return; 382 } 383 384 if (currentScroll > lastScroll && !body.classList.contains(scrollDown)) { 385 // down 386 body.classList.remove(scrollUp); 387 body.classList.add(scrollDown); 388 //lottiePlayer.play(); 389 } else if ( 390 currentScroll < lastScroll && 391 body.classList.contains(scrollDown) 392 ) { 393 // up 394 body.classList.remove(scrollDown); 395 body.classList.add(scrollUp); 396 //lottiePlayer.stop(); 397 } 398 lastScroll = currentScroll; 399});
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.