사용자:CrMT/common.js

< 사용자:CrMT
CrMT (토론 | 기여)님의 2015년 6월 20일 (토) 17:33 판

참고: 설정을 저장한 후에 바뀐 점을 확인하기 위해서는 브라우저의 캐시를 새로 고쳐야 합니다.

  • 파이어폭스 / 사파리: Shift 키를 누르면서 새로 고침을 클릭하거나, Ctrl-F5 또는 Ctrl-R을 입력 (Mac에서는 ⌘-R)
  • 구글 크롬: Ctrl-Shift-R키를 입력 (Mac에서는 ⌘-Shift-R)
  • 인터넷 익스플로러 / 엣지: Ctrl 키를 누르면서 새로 고침을 클릭하거나, Ctrl-F5를 입력.
  • 오페라: Ctrl-F5를 입력.
/* user:다메즈마 */
function randomRange(n1, n2) {
  return Math.floor( (Math.random() * (n2 - n1)) + n1 );
}
if($(document).width() > 8)
{
	var libra = 
	{
		img:"",
		comment:"" 
	};
	var libra2 = libra;
	libra2.img = "";
	var libra3 =
	{
		img:"",
		comment:""
	};
	var libren =
	{
		img:"/images/b/be/리브렌_100.png",
		comment:"나 팩맨 아니라고!"
	};
	var itsurea_moe =
	{
		img:"",
		comment:""
	};
	var itsurea_moe2 = itsurea_moe;
	itsurea_moe2.comment = "";
	var mascot_list = 
	[
	libren,
	];
	var select = mascot_list[randomRange(0,mascot_list.length)];
	var comment = select.comment;
 
	var wrap_div = document.createElement("div");
	var mascot_img_html = document.createElement("img");
	var balloon = document.createElement("div");
	$(balloon).css("display","none");
	$(balloon).css("position","fixed");
	mascot_img_html.balloon = balloon;
	mascot_img_html.onload = function()
	{
		$(this.balloon).css("display","");
		$(this.balloon).html(comment);
		$(this.balloon).css("background-color","#000");
		$(this.balloon).css("color","#FFF");
		$(this.balloon).css("max-width","225px");
		$(this.balloon).css("padding","16px");
		$(this.balloon).css("bottom",$(this).height()/2 +32 - $(this.balloon).height()/2);
		$(this.balloon).css("right",$(this).width() + 32);
		$(this.balloon).css("border-radius",5);
		var timer_handle = 0;
		var balloon = this.balloon;
		function cleartimer()
		{
			clearInterval(timer_handle);
			$(balloon).fadeOut();
		}
		timer_handle = setInterval(function () {cleartimer()}, 3000);
 
	}
	mascot_img_html.src = select.img;
 
	$(wrap_div).css("position","fixed");
	$(wrap_div).css("right","32px");
	$(wrap_div).css("bottom","32px");
 
	$(mascot_img_html).css("height",256);
	$(wrap_div).append(mascot_img_html);
	$(document.body).append(wrap_div);
	$(document.body).append(balloon);
	mascot_img_html.is_small = false;
	$(mascot_img_html).click(function()
	{
		if(this.is_small == false)
		{
			$(this).css("height",128);
		}
		else
		{
			$(this).css("height",256);
		}
		this.is_small = !this.is_small;
	});
}