PageSourceSearch

https://fanplanet.jp/static/original/assets/js/common.js?=202610020902

js fanplanet.jp collected 2026-10-02 00:02:54 UTC 3,398 bytes, 105 lines download raw bytes

1function drawer() {
2	$('.drawer__btn').on('click',function(){
3		$('body').toggleClass('drawer-visible');
4	});
5}
6function loaded(){
7	setTimeout(function(){
8		$('body').addClass('loaded');
9	},10);
10}
11function videoThumb(){
12	$('.list--video li').each(function(){
13    var $this = $(this),
14    $thumb = $this.find('.thumb'),
15		thumbID = $thumb.attr('id'),
16    thumbImg = new Image();
17    thumbImg.src = 'https://img.youtube.com/vi/'+thumbID+'/maxresdefault.jpg';
18    thumbImg.onload = function (){
19      var imgW = thumbImg.naturalWidth;
20      if( imgW == 120 ){
21        thumbImgsd = new Image();
22        thumbImgsd.src = 'https://img.youtube.com/vi/'+thumbID+'/sddefault.jpg';
23        thumbImgsd.onload = function (){
24          var imgWsd = thumbImgsd.naturalWidth;
25          if( imgWsd == 640 ){
26            $thumb.attr("style",'background-image:url(https://img.youtube.com/vi/'+thumbID+'/sddefault.jpg)');
27            if( $('.list--video').hasClass('list--thumnail--center') ){
28              $this.css({maxWidth:'640px'});
29            }
30          }else{
31            thumbImghq = new Image();
32            thumbImghq.src = 'https://img.youtube.com/vi/'+thumbID+'/hqdefault.jpg';
33            thumbImghq.onload = function (){
34              var imgWhq = thumbImghq.naturalWidth;
35              if( imgWhq == 480 ){
36                $thumb.attr("style",'background-image:url(https://img.youtube.com/vi/'+thumbID+'/hqdefault.jpg)');
37                if( $('.list--video').hasClass('list--thumnail--center') ){
38                  $this.css({maxWidth:'480px'});
39                }
40              }else{//default
41                $thumb.attr("style",'background-image:url(/static/fcopen/common/thumb--none-play.jpg)');
42              }//hq
43            }
44          }//sd
45        }
46      }//maxres
47    }
48  });
49}
50// scroll
51function scroll() {
52  $(window).on('scroll', function () {
53    if ($(this).scrollTop() > 10) {
54      $('body').addClass('window-scroll');
55    }else{
56      $('body').removeClass('window-scroll');
57    }
58  });
59}
60// nav
61function scheduleNav() {
62	$('nav.g-nav .nav .g-nav--item a').each(function(){
63		var navUrl = $(this).attr('href');
64		if(navUrl.indexOf('live_information/schedule/list/') > -1 ){
65			if( navUrl.indexOf('?live') > -1 || navUrl.indexOf('?media') > -1 || navUrl.indexOf('&live') > -1 || navUrl.indexOf('&media') > -1){
66				$(this).attr('target','_self');
67			}
68		}
69	});
70}
71$(function(){
72	scheduleNav();
73	drawer();
74	loaded();
75	scroll();
76	if( $('body').hasClass('page--video') ){
77		videoThumb();
78	}
79});
80
81// SNS logo color change by pattern and scroll
82window.addEventListener('load', function() {
83	var svgPaths = document.querySelectorAll('.ri-logo--bubble svg path');
84	function updateSvgColor() {
85		var linkColor;
86		if (document.body.classList.contains('window-scroll')) {
87			var linkElement = document.querySelector('.block--title .section-tit');
88			if (linkElement) {
89				linkColor = window.getComputedStyle(linkElement).getPropertyValue('color');
90			}
91		} else {
92			var navLinkElement = document.querySelector('.header .drawer .nav li a');
93			if (navLinkElement) {
94				linkColor = window.getComputedStyle(navLinkElement).getPropertyValue('color');
95			}
96		}
97		if (linkColor) {
98			svgPaths.forEach(function(svgPath) {
99				svgPath.setAttribute('fill', linkColor);
100			});
101		}
102	}
103	updateSvgColor();//1st color
104	window.addEventListener('scroll', updateSvgColor);//scroll change color trigger
105});

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.