1// Overlay 2// ================================== 3// $(".overlaytrigger").on("click", function(e){ 4// e.preventDefault(); 5// $($(this).attr("href")).addClass("show"); 6// }); 7 8// $("#overlay-event .close-x").on("click", function(){ 9// $("#overlay-event").addClass("fadeout"); 10// var fade = setInterval(function(){$("").removeClass("show").removeClass("fadeout"); clearInterval(fade);}, 500); 11// }); 12 13 14// Perfect Scrollbar 15// ================================== 16$(function () { 17 $('body').on('click', '.privacy-policy', function (e) { 18 e.preventDefault(); 19 if (typeof window.UC_UI !== 'undefined') { 20 window.UC_UI.showSecondLayer(); 21 } 22 }); 23}); 24 25if ($('#overlay-event .scrollarea').length) { 26 const ps = new PerfectScrollbar('#overlay-event .scrollarea', { 27 suppressScrollX: true 28 }); 29} 30if ($('#overlay-poker .scrollarea').length) { 31 const ps = new PerfectScrollbar('#overlay-poker .scrollarea', { 32 suppressScrollX: true 33 }); 34} 35 36 37// Location Slider 38// ================================== 39$(window).on('load', function () { 40 if ($('#locationslider .flexslider').length) { 41 $('#locationslider .flexslider').each(function () { 42 $(this).flexslider({ 43 animation: "slide", 44 manualControls: $(this).prev(".flexslider-controls").find(".flex-control-nav li"), 45 useCSS: false, 46 animationLoop: false, 47 slideshow: false 48 }); 49 }); 50 } 51}); 52var bildInterval = undefined; 53 54function initAutoPlay() { 55 if (bildInterval !== undefined) { 56 clearInterval(bildInterval); 57 } 58 bildInterval = setInterval( 59 function () { 60 $('a.flex-next').trigger('click'); 61 62 }, 5000); 63} 64 65 66// Hero Slider 67// ================================== 68$(window).on('load', function () { 69 70 $('a.flex-next').on('click', function (item) { 71 72 //clearTimeout(bildTimeout); 73 74 75 var altesVideo = $(item).find('.flex-active-slide video.westspiel-video.heru'); 76 if (altesVideo.length > 0) { 77 altesVideo.trigger('load').trigger('pause'); 78 79 } 80 }); 81 82 if ($('.videoDesktop').length && $('.videoMobile').length) { 83 if ($(window).width() >= 1024) { 84 $('.videoDesktop').each(function () { 85 $(this).attr('src', $(this).attr('data-src')); 86 }); 87 } else { 88 $('.videoMobile').each(function () { 89 $(this).attr('src', $(this).attr('data-src')); 90 }); 91 } 92 } 93 if ($('.videoAll').length) { 94 $('.videoAll').each(function () { 95 $(this).attr('src', $(this).attr('data-src')); 96 }); 97 } 98 99 100 if ($('.heroslider .slides li').length === 1) { 101 $('.heroslider').flexslider({ 102 slideshow: false, 103 touch: true, 104 animation: "slide", 105 useCSS: false, 106 animationLoop: false, 107 controlNav: true, 108 }); 109 110 //$('.slider-counter').remove(); 111 } else if ($('.heroslider .slides li').length > 1) { 112 113 114 $('.heroslider').flexslider({ 115 slideshow: false, 116 touch: true, 117 animation: "slide", 118 useCSS: false, 119 animationLoop: true, 120 slideshow: false, 121 start: function (item) { 122 123 124 var bild = $(item).find('.flex-active-slide.heru-image'); 125 126 127 var video = $(item).find('.flex-active-slide video.westspiel-video.heru'); 128 129 if (bild.length > 0 && video.length == 0) { 130 initAutoPlay(); 131 } 132 133 134 if (video.length > 0) { 135 136 137 //video.trigger('load') 138 clearInterval(bildInterval); 139 video.trigger('play'); 140 141 video.on('ended', function (event) { 142 var altesVideo = video; 143 //video.trigger('load').trigger('pause'); 144 145 146 $('a.flex-next').on('click', function () { 147 148 }); 149 150 151 $('a.flex-next').trigger('click'); 152 153 setTimeout(function () { 154 altesVideo.trigger('load').trigger('pause'); 155 }, 1000); 156 157 158 $(video).off('ended'); 159 }); 160 161 } 162 163 }, 164 before: function (item) { 165 166 167 var video = $(item).find('.flex-active-slide video.westspiel-video.heru'); 168 setTimeout(function () { 169 video.trigger('load').trigger('pause'); 170 }, 600); 171 }, 172 after: function (item) { 173 174 // .hero-image Wird gesetz auch bei einem video!!! 175 var bild = $(item).find('.flex-active-slide.heru-image'); 176 177 var video = $(item).find('.flex-active-slide video.westspiel-video.heru'); 178 179 if (video.length > 0) { 180 181 182 //video.trigger('load') 183 clearInterval(bildInterval); 184 video.trigger('play'); 185 186 187 video.on('ended', function (event) { 188 //video.trigger('load').trigger('pause'); 189 190 $('a.flex-next').on('click', function () { 191 192 }); 193 194 $('a.flex-next').trigger('click'); 195 196 $(video).off('ended'); 197 }); 198 } 199 200 if (bild.length > 0 && video.length == 0) { 201 initAutoPlay(); 202 } 203 204 } 205 }); 206 } 207 208 if ($('.section-image-gallery').length) { 209 $('.section-image-gallery').each(function () { 210 let slideWidth = document.body.clientWidth; 211 if ($(window).width() >= 1024) { 212 slideWidth = document.body.clientWidth / 3; 213 } else if ($(window).width() >= 768) { 214 slideWidth = document.body.clientWidth / 2; 215 } 216 let gID = '#' + $(this).find('.gallery').attr('id'); 217 let gbID = '#' + $(this).find('.gallery-big').attr('id'); 218 $(this).find('.gallery').flexslider({ 219 animation: "slide", 220 animationLoop: false, 221 touch: true, 222 drag: true,
223 itemWidth: slideWidth, 224 itemMargin: 0, 225 asNavFor: gbID 226 }); 227 $(this).find('.gallery-big').flexslider({ 228 animation: "slide", 229 animationLoop: false, 230 slideshow: false, 231 touch: true, 232 drag: true, 233 sync: gID 234 }); 235 236 $(this).find('.gallery li img').on('click', function () { 237 $(this).closest('.section-image-gallery').find('.gallery-overlay').addClass('open'); 238 }); 239 $(this).find('.gallery-overlay .close').on('click', function () { 240 $(this).closest('.section-image-gallery').find('.gallery-overlay').removeClass('open'); 241 }); 242 }); 243 244 //$('.slider-counter').remove(); 245 } 246}); 247 248 249// Smartmenus 250// ================================== 251$(function () { 252 $('#main-menu').smartmenus({ 253 hideOnClick: false 254 }); 255}); 256 257$(function () { 258 if (window.location.pathname != '/') { 259 $('header.header').addClass('alwaysFixed'); 260 } 261}); 262 263// Single Column Menu 264// ======================== 265$(document).ready(function () { 266 $(".megamenu.onecolumn ul>li>ul").each(function () { 267 $(this).parent("li").addClass("has-submenue"); 268 }); 269}); 270 271 272// Owl Carousel 273// ================================== 274$(document).ready(function () { 275 if ($('.owl-events').length) { 276 $('.owl-events').owlCarousel({ 277 margin: 5, 278 nav: true, 279 dotsEach: true, 280 responsive: { 281 0: { 282 items: 2 283 }, 284 768: { 285 items: 3 286 }, 287 992: { 288 items: 4 289 }, 290 1680: { 291 items: 5 292 } 293 } 294 }); 295 } 296 if ($('.owl-poker').length) { 297 $('.owl-poker').owlCarousel({ 298 margin: 5, 299 nav: true, 300 dotsEach: true, 301 responsive: { 302 0: { 303 items: 2 304 }, 305 768: { 306 items: 3 307 }, 308 992: { 309 items: 4 310 }, 311 1680: { 312 items: 5 313 } 314 } 315 }); 316 } 317}); 318 319 320// MatchHeight 321// ================================== 322 323$(function () { 324 if ($('.eventitems .item').length) { 325 $('.eventitems .item:visible').matchHeight(); 326 } 327 if ($('.eventitems-nofilter .item').length) { 328 $('.eventitems-nofilter .item:visible').matchHeight(); 329 } 330 if ($('.staffitems .staff-teaser').length) { 331 $('.staffitems .staff-teaser').matchHeight(); 332 } 333 if ($('.pressitems .press-teaser').length) { 334 $('.pressitems .press-teaser').matchHeight(); 335 } 336}); 337 338 339// EVENTS without Filter (Isotope) 340// ================================== 341if ($('.eventitems-nofilter').length) { 342 var $grid2 = $('.eventitems-nofilter').isotope({ 343 itemSelector: '.item', 344 layoutMode: 'fitRows' 345 }); 346 $grid2.on('arrangeComplete', 347 function (event, filteredItems) { 348 $('.eventitems-nofilter .item:visible').css("height", "").matchHeight(); 349 } 350 ); 351 /* //Filter complete 352 $grid2.on( 'arrangeComplete', function( event, filteredItems ) { 353 //matchHeight on the visible items 354 $('.item:visible').matchHeight(); 355 //And re-layout the grid 356 $grid2.isotope('layout'); 357 }); */ 358 $grid2.on('layoutComplete', 359 function (event, filteredItems) { 360 $('.eventitems-nofilter .item:visible').matchHeight(); 361 } 362 ); 363 // filter functions 364 var filterFns = {}; 365 // bind filter on select change 366 $('.filters-select-standort').on('change', function () { 367 $('.eventitems .item, .eventitems-nofilter .item').each(function () { 368 $(this).css('height', ''); 369 }); 370 // get filter value from option value 371 var filterValue = this.value; 372 // use filterFn if matches value 373 filterValue = filterFns[filterValue] || filterValue; 374 $grid2.isotope({filter: filterValue}); 375 });
376 377} 378$(window).on('resize', function () { 379 $('.eventitems-nofilter .item:visible').css('height', "").matchHeight(); 380}); 381 382 383// EVENTS with Filter (Isotope) 384// ================================== 385 386// init Isotope 387if ($('.eventitems').length) { 388 var $grid = $('.eventitems').isotope({ 389 itemSelector: '.item', 390 layoutMode: 'fitRows' 391 }); 392 $grid.on('arrangeComplete', 393 function (event, filteredItems) { 394 $('.eventitems .item').css("height", "").matchHeight(); 395 } 396 ); 397 /* $grid.on( 'arrangeComplete', function( event, filteredItems ) { 398 //matchHeight on the visible items 399 $('.item:visible').matchHeight(); 400 //And re-layout the grid 401 $grid.isotope('layout'); 402 }); */ 403 $grid.on('layoutComplete', 404 function (event, filteredItems) { 405 $('.eventitems .item').css('height', '').matchHeight(); 406 } 407 ); 408 // filter functions 409 var filterFns = { 410 // show if number is greater than 7 411 upto7: function () { 412 var number = $(this).attr("aria-timespan"); 413 return parseInt(number) <= 7; 414 }, 415 upto14: function () { 416 var number = $(this).attr("aria-timespan"); 417 return parseInt(number) <= 14; 418 }, 419 upto21: function () { 420 var number = $(this).attr("aria-timespan"); 421 return parseInt(number) <= 21; 422 }, 423 upto28: function () { 424 var number = $(this).attr("aria-timespan"); 425 return parseInt(number) <= 28; 426 }, 427 ac: function () { 428 var place = $(this).attr("aria-place"); 429 return place === 'ac'; 430 }, 431 bo: function () { 432 var place = $(this).attr("aria-place"); 433 return place === 'bo'; 434 }, 435 hb: function () { 436 var place = $(this).attr("aria-place"); 437 return place === 'hb'; 438 }, 439 bh: function () { 440 var place = $(this).attr("aria-place"); 441 return place === 'bh'; 442 }, 443 du: function () { 444 var place = $(this).attr("aria-place"); 445 return place === 'du'; 446 }, 447 do: function () { 448 var place = $(this).attr("aria-place"); 449 return place === 'do'; 450 } 451 452 }; 453 // bind filter on select change 454 $('.filters-select').on('change', function () { 455 $('.eventitems .item, .eventitems-nofilter .item').each(function () { 456 console.log(1); 457 $(this).css('height', '') 458 }); 459 // get filter value from option value 460 var filterValue = this.value; 461 // use filterFn if matches value 462 filterValue = filterFns[filterValue] || filterValue; 463 $grid.isotope({filter: filterValue}); 464 }); 465} 466 467 468// STAFF with Filter (Isotope) 469// ================================== 470 471// init Isotope 472if ($('.staffitems').length) { 473 var $grid = $('.staffitems').isotope({ 474 itemSelector: '.item', 475 layoutMode: 'fitRows' 476 }); 477 $grid.on('arrangeComplete', 478 function (staff, filteredItems) { 479 $('.item:visible').matchHeight(); 480 //$('.staffitems .staff-teaser').css('height', 'auto').matchHeight(); 481 } 482 ); 483 /* $grid.on( 'arrangeComplete', function( event, filteredItems ) { 484 //matchHeight on the visible items 485 $('.item:visible').matchHeight(); 486 //And re-layout the grid 487 $grid.isotope('layout'); 488 }); */ 489 $grid.on('layoutComplete', 490 function (staff, filteredItems) { 491 $('.staffitems .staff-teaser').css('height', 'auto').matchHeight(); 492 } 493 ); 494 // filter functions 495 var filterFns = {}; 496 // bind filter on select change 497 $('.filters-select').on('change', function () { 498 // get filter value from option value 499 var filterValue = this.value; 500 // use filterFn if matches value 501 filterValue = filterFns[filterValue] || filterValue; 502 $grid.isotope({filter: filterValue}); 503 });
504} 505 506 507// PRESS with Filter (Isotope) 508// ================================== 509 510// init Isotope 511if ($('.pressitems').length) { 512 var $grid = $('.pressitems').isotope({ 513 itemSelector: '.item', 514 layoutMode: 'fitRows' 515 }); 516 $grid.on('arrangeComplete', 517 function (press, filteredItems) { 518 $('.item:visible').matchHeight(); 519 //$('.pressitems .press-teaser').css('height', 'auto').matchHeight(); 520 } 521 ); 522 $grid.on('layoutComplete', 523 function (press, filteredItems) { 524 $('.pressitems .press-teaser').css('height', 'auto').matchHeight(); 525 } 526 ); 527 // filter functions 528 var filterFns = {}; 529 // bind filter on select change 530 $('.filters-select').on('change', function () { 531 // get filter value from option value 532 var filterValue = this.value; 533 // use filterFn if matches value 534 filterValue = filterFns[filterValue] || filterValue; 535 $grid.isotope({filter: filterValue}); 536 }); 537 538 /* //Filter complete 539 $grid.on( 'arrangeComplete', function( event, filteredItems ) { 540 //matchHeight on the visible items 541 $('.item:visible').matchHeight(); 542 //And re-layout the grid 543 $grid.isotope('layout'); 544 }); */ 545 546} 547 548 549// WOW 550// ================================== 551var off = $(window).height() * 0.2; 552wow = new WOW( 553 { 554 boxClass: 'wow', // default 555 animateClass: 'animated', // default 556 offset: off, // default 557 mobile: false, // default 558 live: true // default 559 } 560) 561wow.init(); 562 563$('.section:not(.overlay .section)').addClass('wow animated fadeInUp'); 564$('#anchors').addClass('wow animated fadeInUp'); 565 566 567// COLLAPSE SCROLL TO 568// ================================== 569$('.collapse').on('shown.bs.collapse', function (e) { 570 var $card = $(this).closest('.card'); 571 $('html,body').animate({ 572 scrollTop: $card.offset().top - 170 573 }, 900); 574}); 575 576// ancor 577$("div[data-titel-navi]").each(function () { 578 var that = this; 579 // "\" id=\"" + $(that).attr("id") + 580 var text = "<li><a href=\"#" + $(that).attr("id") + "\">" + $(that).data("titel-navi") + "</a></li>"; 581 $("#anchors>div>div>ul").append(text); 582}); 583if ($("div[data-titel-navi]").length == 0) $("#anchors").hide(); 584 585if ($("#anchors").find("ul>li").length > 0) { 586 $("#anchors").prop("style", "animation-name: none"); 587} 588 589 590// Soft Scroll 591// ================================== 592if ($('#anchors').length) { 593 $('#anchors a[href^="#"]').not("a[data-toggle='collapse']").not('.pokerform').on('click', function (e) { 594 var href = $(this).attr('href'); 595 if ($(window).width() >= 1023) { 596 offset = 169; 597 } else { 598 offset = 0; 599 } 600 if ($(href).length > 0) { 601 $('html, body').animate({ 602 scrollTop: $(href).offset().top - offset 603 }, 'slow'); 604 605 //e.preventDefault(); 606 } 607 608 }); 609 610 $(window).on("scroll", function () { 611 612 $(".anchornav ul li a").each(function () { 613 let target = $(this).attr("href"); 614 let ftr = $('footer'); 615 let lastTarget = $($(".anchornav ul li:last-child a").attr('href')).next('section'); 616 let exists = $(".anchornav.sticky").length; 617 if ($(window).width() >= 1023) { 618 if (ftr.offset().top <= $(window).scrollTop() + 170 * exists) { 619 $(".anchornav ul li a").removeClass("active"); 620 } else if ($('.nav-anker.end').length && $('.nav-anker.end').offset().top <= $(window).scrollTop() + 170 * exists) { 621 $(".anchornav ul li a").removeClass("active"); 622 } else if ($(target).offset().top <= $(window).scrollTop() + 170 * exists) { 623 $(".anchornav ul li a").removeClass("active"); 624 $(this).addClass("active"); 625 } else { 626 $(this).removeClass("active"); 627 } 628 } 629 }); 630 let positionoffset = $("#anchors").offset().top; 631 if ($(window).width() >= 1023) { 632 if (positionoffset <= $(window).scrollTop() + $('header').height()) { 633 $(".anchornav").addClass("sticky").css({ 634 "position": "fixed", 635 "z-index": 20, 636 "top": $('header').height() + "px" 637 }) 638 } else { 639 $(".anchornav").removeClass("sticky").css({"position": "", "z-index": "", "top": ""}) 640 } 641 } 642 });
643} 644// Proceed / Mouse-Icon on hero section 645// ================================== 646$(function () { 647 $('.proceed').on('click', function () { 648 var scrollTo = $(this).closest('section.section-hero-slider').height(); 649 $('html, body').animate({'scrollTop': scrollTo}, 'slow'); 650 }); 651 652 if (document.location.href.split('#').length == 2) { 653 $('#anchors').prop("style", "visibility:visible").fadeIn(); 654 } 655}); 656 657/* Fixed header 658==================================*/ 659 660$(window).on("scroll", function () { 661 if ($(window).scrollTop() >= 100) { 662 $('header').addClass('fixed'); 663 } else { 664 $('header').removeClass('fixed'); 665 } 666}); 667 668 669// Counter 670// ================================== 671 672!function (t) { 673 t.extend(t.easing, { 674 spincrementEasing: function (t, a, e, n, r) { 675 return a === r ? e + n : n * (-Math.pow(2, -10 * a / r) + 1) + e 676 } 677 }), t.fn.spincrement = function (a) { 678 function e(t, a) { 679 if (t = t.toFixed(a), a > 0 && "." !== r.decimalPoint && (t = t.replace(".", r.decimalPoint)), r.thousandSeparator) for (; o.test(t);) t = t.replace(o, "$1" + r.thousandSeparator + "$2"); 680 return t 681 } 682 683 var n = { 684 from: 0, 685 to: null, 686 decimalPlaces: null, 687 decimalPoint: ".", 688 thousandSeparator: ",", 689 duration: 1e3, 690 leeway: 50, 691 easing: "spincrementEasing", 692 fade: !0, 693 complete: null 694 }, r = t.extend(n, a), o = new RegExp(/^(-?[0-9]+)([0-9]{3})/); 695 return this.each(function () { 696 var a = t(this), n = r.from; 697 a.attr("data-from") && (n = parseFloat(a.attr("data-from"))); 698 var o; 699 if (a.attr("data-to")) o = parseFloat(a.attr("data-to")); else if (null !== r.to) o = r.to; else { 700 var i = t.inArray(r.thousandSeparator, ["\\", "^", "$", "*", "+", "?", "."]) > -1 ? "\\" + r.thousandSeparator : r.thousandSeparator, 701 l = new RegExp(i, "g"); 702 o = parseFloat(a.text().replace(l, "")) 703 } 704 var c = r.duration; 705 r.leeway && (c += Math.round(r.duration * (2 * Math.random() - 1) * r.leeway / 100)); 706 var s; 707 if (a.attr("data-dp")) s = parseInt(a.attr("data-dp"), 10); else if (null !== r.decimalPlaces) s = r.decimalPlaces; else { 708 var d = a.text().indexOf(r.decimalPoint); 709 s = d > -1 ? a.text().length - (d + 1) : 0 710 } 711 a.css("counter", n), r.fade && a.css("opacity", 0), a.animate({counter: o, opacity: 1}, { 712 easing: r.easing, 713 duration: c, 714 step: function (t) { 715 a.html(e(t * o, s)) 716 }, 717 complete: function () { 718 a.css("counter", null), a.html(e(o, s)), r.complete && r.complete(a) 719 } 720 }) 721 }) 722 } 723}(jQuery); 724 725 726var a = 0; 727$(window).scroll(function () { 728 729 if ($('#counter-set').length > 0) { 730 731 var oTop = $('#counter-set').offset().top - window.innerHeight; 732 if (a == 0 && $(window).scrollTop() > oTop) { 733 734 $('.counter-nr').delay(250).spincrement({ 735 duration: 2500, 736 leeway: 0, 737 thousandSeparator: '.' 738 }) 739 740 a = 1; 741 } 742 743 } 744}); 745 746 747// Subnav scrolling on load 748// ================================== 749 750function anchorscroll() { 751 $('header').addClass('sticky'); 752 $(".anchornav ul li a").each(function () { 753 var target = $(this).attr("href"); 754 if ($(window).width() >= 1023) { 755 if ($(target).offset().top <= $(window).scrollTop() + 170) { 756 $(".anchornav ul li a").removeClass("active"); 757 $(this).addClass("active"); 758 } else { 759 $(this).removeClass("active"); 760 } 761 } 762 }); 763} 764 765function autoscroll() { 766 if (window.location.href.indexOf("#") > 0) { 767 var hashtag = $(window.location.href.substring(window.location.href.indexOf("#"), window.location.href.length)); 768 if ($(window).width() >= 1023) { 769 $('nav#anchors').css('visibility', 'visible'); 770 $('.anchornav').addClass('sticky').css({ 771 'position': 'fixed', 772 'z-index': 20, 773 'top': $('header').height() + 'px' 774 }) 775 } 776 if (hashtag.length > 0) { 777 $('html, body').animate({ 778 scrollTop: hashtag.offset().top - $('header.header').outerHeight() - $('.anchornav').outerHeight() + 30 779 }, 'slow'); 780 781 // Event Ausgabe 782 if ($('.section-carousel-events').length > 0) { 783 784 hashtag.trigger('click'); 785 786 } 787 if ($('a.pokerform').length > 0) { 788 hashtag.trigger('click'); 789 } 790 } 791 792 } 793} 794 795 796$(window).on('load', function () { 797 if (window.location.href.indexOf('#')) { 798 anchorscroll(); 799 setTimeout(function () { 800 autoscroll() 801 }, 500); 802 } 803}); 804 805 806// LanguageMenu 807// ================================== 808 809$(function () { 810 $('body').on('click', '.choose-lang label', function () { 811 var url = $(this).prev('input').val(); 812 location.href = url; 813 });
814}); 815 816$(function () { 817 $('.heru-image[data-link]').on('click', function () { 818 location.href = $(this).data('link'); 819 }) 820}) 821 822// Workload 823// ================================== 824 825$(function () { 826 827 var polar_to_cartesian, svg_circle_arc_path, animate_arc; 828 829 polar_to_cartesian = function (cx, cy, radius, angle) { 830 var radians; 831 radians = (angle - 90) * Math.PI / 180.0; 832 return [Math.round((cx + (radius * Math.cos(radians))) * 100) / 100, Math.round((cy + (radius * Math.sin(radians))) * 100) / 100]; 833 }; 834 835 svg_circle_arc_path = function (x, y, radius, start_angle, end_angle) { 836 var end_xy, start_xy; 837 start_xy = polar_to_cartesian(x, y, radius, end_angle); 838 end_xy = polar_to_cartesian(x, y, radius, start_angle); 839 return "M " + start_xy[0] + " " + start_xy[1] + " A " + radius + " " + radius + " 0 0 0 " + end_xy[0] + " " + end_xy[1]; 840 }; 841 842 animate_arc = function (ratio, svg, perc) { 843 var arc, center, radius, startx, starty; 844 arc = svg.path(''); 845 center = 500; 846 radius = 450; 847 startx = 0; 848 starty = 450; 849 return Snap.animate(0, ratio, (function (val) { 850 var path; 851 arc.remove(); 852 path = svg_circle_arc_path(500, 500, 450, -90, val * 180.0 - 90); 853 arc = svg.path(path); 854 arc.attr({ 855 class: 'data-arc' 856 }); 857 perc.text(Math.round(val * 100) + '%'); 858 }), Math.round(2000 * ratio), mina.easeinout); 859 }; 860 861 $('.metric').each(function () { 862 var ratio, svg, perc; 863 ratio = $(this).data('ratio'); 864 svg = Snap($(this).find('svg')[0]); 865 perc = $(this).find('text.percentage'); 866 if (typeof ratio === 'number') { 867 animate_arc(ratio, svg, perc); 868 } 869 }); 870}); 871 872// Lower volume on self hosted videos 873window.onload = function () { 874 let videos = document.querySelectorAll('video'); 875 if (videos.length) { 876 for (let i = 0; i < videos.length; i++) { 877 videos[i].volume = 0.5; 878 } 879 } 880} 881 882window.onload = function () { 883 let newsfeed = document.querySelectorAll('.wd--module_socia-feed .text-wrapper-inner'); 884 if (newsfeed.length) { 885 for (let i = 0; i < newsfeed.length; i++) { 886 if (newsfeed[i].clientHeight > newsfeed[i].parentElement.clientHeight) { 887 newsfeed[i].parentElement.classList += " longText"; 888 } 889 } 890 } 891 let readmore = document.querySelectorAll('#readmore'); 892 for (let j = 0; j < readmore.length; j++) { 893 readmore[j].onclick = function () { 894 readmore[j].closest('.text-wrapper').classList += " opened"; 895 }; 896 } 897 let readless = document.querySelectorAll('#readless'); 898 for (let k = 0; k < readless.length; k++) { 899 readless[k].onclick = function () { 900 readless[k].closest('.text-wrapper').classList.remove('opened'); 901 document.querySelector('.section-social').scrollIntoView(); 902 }; 903 } 904} 905 906$(function () { 907 if ($('a.news-detail').length > 0) { 908 var locationHref = window.location.href; 909 910 if (locationHref.split('#')[1]) { 911 var uid = (locationHref.split('#')[1].split('-')).pop(); 912 $.fancybox.open({ 913 src: '/?tx_news_pi1[action]=detail&tx_news_pi1[controller]=News&tx_news_pi1[news]=' + uid + '&type=400', 914 type: 'iframe', 915 }); 916 } 917 918 $('a.news-detail').each(function () { 919 $(this).click(function (event) { 920 var href = $(this).attr('href'); 921 locationHref = window.location.href; 922 923 window.location.href = locationHref.split('#')[0] + href; 924 925 var uid = $(this).data('uid'); 926 $.fancybox.open({ 927 src: '/?tx_news_pi1[action]=detail&tx_news_pi1[controller]=News&tx_news_pi1[news]=' + uid + '&type=400', 928 type: 'iframe', 929 afterClose: function () { 930 //window.location.hash = ''; 931 //window.history.pushState(locationHref.split('#')[0]); 932 history.pushState(null, 'Title', locationHref.split('#')[0]); 933 } 934 935 }); 936 937 }); 938 939 }); 940 } 941}); 942$(function () { 943 if (window.location.host.includes('safergambling') || window.location.host.includes('safer-gambling')) { 944 $('.footerlinks li').clone().addClass('metaLink').appendTo($('#main-menu')); 945 } 946}); 947 948 949 950// InfoPopup 951 952if (typeof jQuery !== 'undefined') { 953 (function ($) { 954 $(function () { 955 var popup = document.getElementById('infopopup'); 956 if (popup) { 957 var messageId = popup.getAttribute('data-uid'); 958 959 if (sessionStorage.getItem('popupMessage_' + messageId) !== 'seen') { 960 popup.style.display = 'flex'; 961 document.querySelector('.infopopup-close-button').addEventListener('click', function () { 962 popup.style.display = 'none'; 963 sessionStorage.setItem('popupMessage_' + messageId, 'seen'); 964 }); 965 } else { 966 popup.style.display = 'none'; 967 } 968 } 969 }); 970 })(jQuery); 971} else { 972 console.error('jQuery is not loaded. Please ensure jQuery is included before this script.'); 973} 974 function closePopup() { 975 document.getElementById('infopopup').style.display = 'none'; 976} 977 978// Modalbox history 979$(function() { 980 $('.modal').on('show.bs.modal', function (e) { 981 let id = $(this).attr("id"); 982 if (!history.state || !history.state.modalOpen || id != history.state.modalOpen) { 983 history.pushState({modalOpen: id}, '', '#' + id); 984 } 985 }) 986 $('.modal').on('hide.bs.modal', function (e) { 987 if (history.state && history.state.modalOpen && $(this).attr("id") == history.state.modalOpen) { 988 history.back(); 989 } 990 991 }) 992 993 994 window.addEventListener('popstate', function (event) { 995 if (event.state && event.state.modalOpen) { 996 $('.modal#' + event.state.modalOpen).modal('show'); 997 } else { 998 $('.modal.show').each(function () { 999 $(this).modal('hide'); 1000 }); 1001 } 1002 console.log(event.state) 1003 }) 1004}); 1005 1006
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.