$(function() { $("div.social > div a.over").off("mouseover").off("mouseout"); $(document).on("mouseover", "#footer div.social > div a.over", function(){ $(this).parent().css({ "background-image" : "url(https://archive.gencompany.net/elements/btn_social.png)" }); $(this).stop().animate({ "opacity" : 0 }, 10); }); $(document).on("mouseout", "#footer div.social > div a.over", function(){ $(this).stop().animate({ "opacity" : 1 }, 500, function(){ $(this).parent().css({"background-image" : "none"}); }); }); $(document).on("mouseover", "#entry div.social > div a.over", function(){ $(this).parent().css({ "background-image" : "url(https://archive.gencompany.net/elements/btn_social_large.png)" }); $(this).stop().animate({ "opacity" : 0 }, 10); }); $(document).on("mouseout", "#entry div.social > div a.over", function(){ $(this).stop().animate({ "opacity" : 1 }, 500, function(){ $(this).parent().css({"background-image" : "none"}); }); }); var gen_archive_3170_timer_speed = 5000; var gen_archive_3170_set_fade_speed = 2000; var gen_archive_3170_swipe_speed = 500; var gen_archive_3170_ratio = "flexible"; var gen_archive_3170_type = "swipe"; var gen_archive_3170_create_i = 0; var gen_archive_3170_past_i = 1; var gen_archive_3170_single_page = "true"; var gen_archive_3170_preload_i = 0; var gen_archive_3170_past_target = ""; var gen_archive_3170_past_entry_title = ""; var gen_archive_3170_past_entry_description = ""; var gen_archive_3170_create_swipe_contents_i = 0; var gen_archive_3170_loop_id = 0; var gen_archive_3170_window_height = $(window).height(); var gen_archive_3170_window_width = $(window).width(); var gen_archive_3170_width = $("#gen_archive_3170").width(); var gen_archive_3170_height = $("#gen_archive_3170").height(); var gen_archive_3170_thumbnail_height = $("#gen_archive_3170 > .thumbnail").height(); var gen_archive_3170_pageHolder_width = $("#gen_archive_3170 > .thumbnail > .pageHolder").width(); var gen_archive_3170_pageWrap_width = $("#gen_archive_3170 > .thumbnail > .pageHolder > .pageWrap").width(); var gen_archive_3170_pageWrap_left = 0; function gen_archive_3170_initialize(){ $(window).on("resize", gen_archive_3170_window_resize); gen_archive_3170_window_resize(); if( gen_archive_3170_maxnum > 1 ){ $("#gen_archive_3170 div.arrow_image_right").fadeIn(200); $("#gen_archive_3170 div.arrow_image_left").fadeIn(200); gen_archive_3170_single_page = ""; }else{ gen_archive_3170_single_page = "true"; $("#gen_archive_3170 div.swipe_contents > .group:first").remove(); $("#gen_archive_3170 .pageHolder").hide(); } if( gen_archive_3170_type == "basic"){ gen_archive_3170_start_action(); gen_archive_3170_create_img(); $("#gen_archive_3170 div.swipe_contents").remove(); $("#gen_archive_3170 .swipe_me").remove(); } if( gen_archive_3170_type == "swipe"){ gen_archive_3170_create_swipe_contents(); } } function gen_archive_3170_start_action(){ $("#gen_archive_3170 > .spinner").animate({ "opacity": 0 }, 500, function(){ if( $("html#p_root")[0] || $("html#p_intro")[0] ){ setTimeout(function(){ $("#header").animate({'opacity':1},3000); setTimeout(function(){ $("#gen_archive_3170 div.arrow_image_right").animate({"right": 0},1000, "easeOutQuint"); $("#gen_archive_3170 div.arrow_image_left").animate({"left": 0},1000, "easeOutQuint"); },5000); },5000); } $("#gen_archive_3170 .thumbnail, #gen_archive_3170 .frame").animate({"opacity": 1},1000, "easeOutQuint"); $(this).remove(); }); } function gen_archive_3170_create_img(){ if( gen_archive_3170_type == "basic" ){ if( gen_archive_3170_past_i != gen_archive_3170_create_i ){ var img_url = gen_archive_3170_array[gen_archive_3170_create_i][0]; var thumb_url = gen_archive_3170_array[gen_archive_3170_create_i][1]; var img_height = gen_archive_3170_array[gen_archive_3170_create_i][2]; var img_width = gen_archive_3170_array[gen_archive_3170_create_i][3]; var caption_jp = gen_archive_3170_array[gen_archive_3170_create_i][4]; var caption_en = gen_archive_3170_array[gen_archive_3170_create_i][5]; var description_jp = gen_archive_3170_array[gen_archive_3170_create_i][6]; var description_en = gen_archive_3170_array[gen_archive_3170_create_i][7]; var link_url = gen_archive_3170_array[gen_archive_3170_create_i][8]; var link_target = gen_archive_3170_array[gen_archive_3170_create_i][9]; var link_to_flag = gen_archive_3170_array[gen_archive_3170_create_i][10]; var entry_title_jp = gen_archive_3170_array[gen_archive_3170_create_i][11]; var entry_title_en = gen_archive_3170_array[gen_archive_3170_create_i][12]; var entry_description_jp = gen_archive_3170_array[gen_archive_3170_create_i][13]; var entry_description_en = gen_archive_3170_array[gen_archive_3170_create_i][14]; gen_archive_3170_switch_thumbs(); gen_archive_3170_past_i = gen_archive_3170_create_i; $("#gen_archive_3170 > .frame > .controller > a").remove(); if( link_to_flag != "media" ){ $("#gen_archive_3170 > .frame > .controller").append(""); } var entry_description = entry_description_jp + entry_description_en; if( entry_description != gen_archive_3170_past_entry_description ){ $("#gen_archive_3170 > .frame > .controller > .text_entry > .description").removeClass("show"); $("#gen_archive_3170 > .frame > .controller > .text_entry").fadeOut( 500, function () { $("#gen_archive_3170 > .frame > .controller > .text_entry > .description > .jp").empty().append(entry_description_jp); $("#gen_archive_3170 > .frame > .controller > .text_entry > .description > .en").empty().append(entry_description_en); $(this).fadeIn( 1000, function () { $("#gen_archive_3170 > .frame > .controller > .text_entry > .description").addClass("show"); } ); } ); gen_archive_3170_past_entry_description = entry_description; } $("#gen_archive_3170 > .frame > .controller > .text_media").fadeOut(200, function() { $("#gen_archive_3170 > .frame > .controller > .text_media > .title > .jp").empty(); $("#gen_archive_3170 > .frame > .controller > .text_media > .title > .jp").append(caption_jp); $("#gen_archive_3170 > .frame > .controller > .text_media > .title > .en").empty(); $("#gen_archive_3170 > .frame > .controller > .text_media > .title > .en").append(caption_en); $("#gen_archive_3170 > .frame > .controller > .text_media > .description > .jp").empty(); $("#gen_archive_3170 > .frame > .controller > .text_media > .description > .jp").append(description_jp); $("#gen_archive_3170 > .frame > .controller > .text_media > .description > .en").empty(); $("#gen_archive_3170 > .frame > .controller > .text_media > .description > .en").append(description_en); $(this).fadeIn(200); } ); var set_img_div = "gen_archive_3170_img_div_" + gen_archive_3170_create_i; $("#gen_archive_3170 > .frame > .main").prepend("
"); var target = $("#gen_archive_3170 div#" + set_img_div); target.find("img.low").load(function () { target.find("img.low").fadeIn(gen_archive_3170_set_fade_speed, "easeOutQuint"); target.find("img.high").load(function () { gen_archive_3170_window_resize(); target.find("img.high").fadeIn(gen_archive_3170_set_fade_speed, "easeOutQuint"); }); target.find("img.high").attr("src", img_url); if( gen_archive_3170_past_target != "" ){ gen_archive_3170_past_target.parent().stop().fadeOut( gen_archive_3170_set_fade_speed, function () { $(this).remove(); } ); } gen_archive_3170_past_target = target; gen_archive_3170_preload_image(); gen_archive_3170_img_fit_action( target, img_height, img_width ); gen_archive_3170_set_timer(); gen_archive_3170_window_resize(); target.addClass("reduce"); }); target.find("img.low").attr("src", thumb_url); } } if( gen_archive_3170_type == "swipe" ){ var img_url = gen_archive_3170_array[gen_archive_3170_create_i][0]; var thumb_url = gen_archive_3170_array[gen_archive_3170_create_i][1]; var img_height = gen_archive_3170_array[gen_archive_3170_create_i][2]; var img_width = gen_archive_3170_array[gen_archive_3170_create_i][3]; var caption_jp = gen_archive_3170_array[gen_archive_3170_create_i][4]; var caption_en = gen_archive_3170_array[gen_archive_3170_create_i][5]; var description_jp = gen_archive_3170_array[gen_archive_3170_create_i][6]; var description_en = gen_archive_3170_array[gen_archive_3170_create_i][7]; var link_url = gen_archive_3170_array[gen_archive_3170_create_i][8]; var link_target = gen_archive_3170_array[gen_archive_3170_create_i][9]; var link_to_flag = gen_archive_3170_array[gen_archive_3170_create_i][10]; var entry_title_jp = gen_archive_3170_array[gen_archive_3170_create_i][11]; var entry_title_en = gen_archive_3170_array[gen_archive_3170_create_i][12]; var entry_description_jp = gen_archive_3170_array[gen_archive_3170_create_i][13]; var entry_description_en = gen_archive_3170_array[gen_archive_3170_create_i][14]; gen_archive_3170_switch_thumbs(); if( gen_archive_3170_single_page == "" ){ gen_archive_3170_loop_cloning(); } gen_archive_3170_past_i = gen_archive_3170_create_i; if( link_to_flag == "media" ){ $("#gen_archive_3170 .swipescroll > div.swipe_contents").css({"cursor": "default"}); }else{ $("#gen_archive_3170 .swipescroll > div.swipe_contents").css({"cursor": "pointer"}); } $("#gen_archive_3170 .swipescroll > div.swipe_contents > .text_media").fadeOut(200, function() { var left = gen_archive_3170_mainframe_width * (gen_archive_3170_create_i + gen_archive_3170_loop_id*gen_archive_3170_maxnum); $("#gen_archive_3170 .swipescroll > div.swipe_contents > .text_media").css("left", left); $("#gen_archive_3170 .swipescroll > div.swipe_contents > .text_media > div").removeClass().addClass(caption_en); $("#gen_archive_3170 .swipescroll > div.swipe_contents > .text_media > div > .message > .title > .jp").empty().append(caption_jp); $("#gen_archive_3170 .swipescroll > div.swipe_contents > .text_media > div > .message > .title > .en").empty().append(caption_en); $("#gen_archive_3170 .swipescroll > div.swipe_contents > .text_media > div > .message > .description > .jp").empty().append(description_jp); $("#gen_archive_3170 .swipescroll > div.swipe_contents > .text_media > div > .message > .description > .en").empty().append(description_en); $(this).fadeIn(200); } ); var entry_title = entry_title_jp + entry_title_en; if( entry_title != gen_archive_3170_past_entry_title ){ $("#gen_archive_3170 .swipescroll > .text_entry").fadeOut( 500, function () { $("#gen_archive_3170 > .frame > .controller > .text_entry > .title > .jp").empty().append(entry_title_jp); $("#gen_archive_3170 > .frame > .controller > .text_entry > .title > .en").empty().append(entry_title_en); $(this).fadeIn(1000); } ); } gen_archive_3170_past_entry_title = entry_title; var target = $("#gen_archive_3170 div#gen_archive_3170_img_div_" + gen_archive_3170_create_i); target.find("img.high").load(function () { gen_archive_3170_window_resize(); target.find("img.high").fadeIn(gen_archive_3170_set_fade_speed, "easeOutQuint"); }); target.find("img.high").attr("src", img_url); gen_archive_3170_past_target = target; gen_archive_3170_img_fit_action( target, img_height, img_width ); gen_archive_3170_set_timer(); } } function gen_archive_3170_preload_image(){ $("#gen_archive_3170 > .frame > .main > img").remove(); gen_archive_3170_preload_i = gen_archive_3170_create_i+1; if( gen_archive_3170_preload_i >= gen_archive_3170_maxnum ){ gen_archive_3170_preload_i = 0; } var next_img_url = gen_archive_3170_array[gen_archive_3170_preload_i][0]; $("#gen_archive_3170 > .frame > .main").append(""); var next_target = $("#gen_archive_3170 img#pre_" + gen_archive_3170_preload_i ); next_target.attr("src", next_img_url); } function gen_archive_3170_img_fit_action( target, img_height, img_width ){ target.addClass("fit"); gen_archive_3170_window_resize(); } function gen_archive_3170_img_cover_center_action( target, img_height, img_width ){ target.addClass("cover_center"); gen_archive_3170_window_resize(); } function gen_archive_3170_img_cover_pan_action( target, img_height, img_width ){ var target_width = $("#gen_archive_3170 > .frame > .main").width(); var target_height = parseInt(img_height*(target_width/img_width)); if( target_height <= gen_archive_3170_mainframe_height ){ target.addClass("cover_pan_expand"); target_height = gen_archive_3170_mainframe_height*1.25; target.css({ "top": gen_archive_3170_mainframe_height-target_height, "height": target_height }); target.animate({ "top": "0px" }, gen_archive_3170_timer_speed + 2000, "swing"); gen_archive_3170_window_resize(); }else{ target.addClass("cover_pan"); gen_archive_3170_window_resize(); target.css({ "top": gen_archive_3170_mainframe_height-target_height, "width": "100%" }); target.animate({ "top": "0px" }, gen_archive_3170_timer_speed + 2000, "swing"); } } function gen_archive_3170_window_resize(e) { gen_archive_3170_window_height = $(window).height(); gen_archive_3170_window_width = $(window).width(); if( gen_archive_3170_ratio == "flexible" ){ gen_archive_3170_width = $("#gen_archive_3170").width(); gen_archive_3170_height = $("#gen_archive_3170").height(); }else{ gen_archive_3170_width = $("#gen_archive_3170").width(); gen_archive_3170_height = Math.round(gen_archive_3170_width*0/0); $("#gen_archive_3170").css({"height": gen_archive_3170_height}); } gen_archive_3170_mainframe_width = $("#gen_archive_3170 > .frame > .main").width(); gen_archive_3170_mainframe_height = $("#gen_archive_3170 > .frame > .main").height(); gen_archive_3170_thumbnail_height = $("#gen_archive_3170 > .thumbnail").height(); gen_archive_3170_pageHolder_width = $("#gen_archive_3170 > .thumbnail > .pageHolder").width(); gen_archive_3170_pageWrap_width = $("#gen_archive_3170 > .thumbnail > .pageHolder > .pageWrap").width(); if( gen_archive_3170_type == "swipe"){ $("#gen_archive_3170 .swipescroll > div.swipe_contents > .group > .swipe_ul > .swipe_li").css("width", gen_archive_3170_mainframe_width); $("#gen_archive_3170 .swipescroll > div.swipe_contents > .text_media").css("width", gen_archive_3170_mainframe_width); if( $("#entry > article.gallery")[0] ){ if( typeof gen_archive_3170_caption_adjuster != "undefined" ){ clearTimeout( gen_archive_3170_caption_adjuster ); } gen_archive_3170_caption_adjuster = setTimeout( function(){ if( $("#gen_archive_3170 .swipescroll > .swipe_contents > .group > .swipe_ul > .swipe_li.swipe_" + gen_archive_3170_create_i + " > .slidebase > .image_wrapper > img")[0] ){ var gen_archive_3170_entry_offset_top = $("#entry > article.gallery").offset().top; var gen_archive_3170_img_offset_top = $("#gen_archive_3170 .swipescroll > .swipe_contents > .group > .swipe_ul > .swipe_" + gen_archive_3170_create_i + " > .slidebase > .image_wrapper > img").offset().top - 10 - gen_archive_3170_entry_offset_top; var gen_archive_3170_bottom_offset_top = gen_archive_3170_img_offset_top + $("#gen_archive_3170 .swipescroll > .swipe_contents > .group > .swipe_ul > .swipe_li.swipe_" + gen_archive_3170_create_i + " > .slidebase > .image_wrapper > img").height(); var gen_archive_3170_img_bottom_margin = gen_archive_3170_mainframe_height - gen_archive_3170_bottom_offset_top; $("#gen_archive_3170 .swipescroll > div.swipe_contents > .text_media > div > .message").css("width", gen_archive_3170_mainframe_width); $("#gen_archive_3170 .swipescroll > div.swipe_contents > .text_media > div").css("top", gen_archive_3170_bottom_offset_top); $("#gen_archive_3170 .swipescroll > div.swipe_contents > .text_media > div > .message").css("height", gen_archive_3170_img_bottom_margin); } } , 100); } $("#gen_archive_3170 .swipescroll > div.swipe_contents > .group").each(function(){ var swipe_li_num = $(this).find('.swipe_li').length; var group_width = gen_archive_3170_mainframe_width*swipe_li_num; $(this).css({"width":group_width}); }); var left = gen_archive_3170_mainframe_width * (gen_archive_3170_create_i + gen_archive_3170_loop_id*gen_archive_3170_maxnum); $("#gen_archive_3170 .swipescroll > div.swipe_contents").stop().animate({"left": -left}, gen_archive_3170_swipe_speed, "easeOutQuint"); var width = parseInt($("#gen_archive_3170 .swipescroll > div.swipe_contents > .group[data-loop-id = " + gen_archive_3170_loop_id + "]").width()); $("#gen_archive_3170 .swipescroll > div.swipe_contents > .group[data-loop-id = " + (gen_archive_3170_loop_id) + "]").css("left", width*(gen_archive_3170_loop_id)); $("#gen_archive_3170 .swipescroll > div.swipe_contents > .group[data-loop-id = " + (gen_archive_3170_loop_id - 1) + "]").css("left", width*(gen_archive_3170_loop_id - 1)); $("#gen_archive_3170 .swipescroll > div.swipe_contents > .group[data-loop-id = " + (gen_archive_3170_loop_id + 1) + "]").css("left", width*(gen_archive_3170_loop_id + 1)); if( gen_archive_3170_single_page == "" && isTouch() ){ gen_archive_3170_swipe_action(); } } if( $("#gen_archive_3170 div.image_wrapper")[0] ){ if( gen_archive_3170_type == "swipe"){ $("#gen_archive_3170 div.image_wrapper").each(function(){ if( "fit" == "cover_pan" ){ var img_height = $(this).attr("data-height"); var img_width = $(this).attr("data-width"); var target_width = $("#gen_archive_3170 > .frame > .main").width(); var target_height = parseInt(img_height*(target_width/img_width)); $(this).removeClass("cover_pan"); $(this).removeClass("cover_center"); if( target_height <= gen_archive_3170_mainframe_height ){ $(this).addClass("cover_center"); }else{ $(this).addClass("cover_pan"); } }else{ $(this).addClass("fit"); } }); } $("#gen_archive_3170 div.image_wrapper.fit").each(function(){ var img_height = $(this).attr("data-height"); var img_width = $(this).attr("data-width"); if( Math.round(img_width / gen_archive_3170_mainframe_width * 100) <= Math.round(img_height / gen_archive_3170_mainframe_height * 100) ){ var target_height = gen_archive_3170_mainframe_height; var target_width = img_width*Math.round(gen_archive_3170_mainframe_height/img_height*100)/100; var target_top = 0; var target_left = (gen_archive_3170_mainframe_width - target_width)/2; }else{ var target_width = gen_archive_3170_mainframe_width; var target_height = img_height*Math.round(gen_archive_3170_mainframe_width/img_width*100)/100; var target_top = (gen_archive_3170_mainframe_height - target_height)/2; var target_left = 0; } $(this).css({ "height": target_height, "width": target_width, "top": target_top, "left": target_left }); }); $("#gen_archive_3170 div.image_wrapper.cover_center").each(function(){ var img_height = $(this).attr("data-height"); var img_width = $(this).attr("data-width"); if( Math.round(img_width / gen_archive_3170_mainframe_width * 100) >= Math.round(img_height / gen_archive_3170_mainframe_height * 100) ){ var target_height = gen_archive_3170_mainframe_height; var target_width = img_width*Math.round(gen_archive_3170_mainframe_height/img_height*100)/100; var target_top = 0; var target_left = (gen_archive_3170_mainframe_width - target_width)/2; }else{ var target_width = gen_archive_3170_mainframe_width; var target_height = img_height*Math.round(gen_archive_3170_mainframe_width/img_width*100)/100; var target_top = (gen_archive_3170_mainframe_height - target_height)/2; var target_left = 0; } $(this).css({ "height": target_height, "width": target_width, "top": target_top, "left": target_left }); }); $("#gen_archive_3170 div.image_wrapper.cover_pan").each(function(){ var img_height = $(this).attr("data-height"); var img_width = $(this).attr("data-width"); var target_width = gen_archive_3170_mainframe_width; var target_height = img_height*Math.round(gen_archive_3170_mainframe_width/img_width*100)/100; $(this).css({ "height": target_height, "width": target_width, "margin-left": 0 }); }); $("#gen_archive_3170 div.image_wrapper.cover_pan_expand").each(function(){ var img_height = $(this).attr("data-height"); var img_width = $(this).attr("data-width"); var target_height = gen_archive_3170_mainframe_height*1.25; var target_width = img_width*Math.round(gen_archive_3170_mainframe_height/img_height*100)/100*1.25; $(this).css({ "height": target_height, "width": target_width, "margin-left": (gen_archive_3170_mainframe_width-target_width)/2 }); }); } gen_archive_3170_arrow_show_hide(); } function gen_archive_3170_set_timer(){ if( typeof gen_archive_3170_Repeater != "undefined" ){ clearTimeout( gen_archive_3170_Repeater ); } if( gen_archive_3170_repeat_flag == "true" ){ gen_archive_3170_Repeater = setTimeout( function(){ gen_archive_3170_slide_play(); } , gen_archive_3170_timer_speed); } } function gen_archive_3170_slide_play(){ gen_archive_3170_create_i ++; if( gen_archive_3170_create_i == gen_archive_3170_maxnum){ gen_archive_3170_create_i = 0; gen_archive_3170_loop_id ++; gen_archive_3170_create_img(); }else{ gen_archive_3170_create_img(); } } $("#gen_archive_3170 > .thumbnail > .pageHolder > .pageWrap > ul > li > a").click(function(){ gen_archive_3170_create_i = parseInt($(this).attr("id")); gen_archive_3170_create_img(); gen_archive_3170_set_timer(); return false; }) function gen_archive_3170_switch_thumbs(){ $( "#gen_archive_3170 > .thumbnail > .pageHolder > .pageWrap > ul > li > a#"+gen_archive_3170_past_i ).removeClass("active"); $( "#gen_archive_3170 > .thumbnail > .pageHolder > .pageWrap > ul > li > a#"+gen_archive_3170_past_i ).addClass("over"); $( "#gen_archive_3170 > .thumbnail > .pageHolder > .pageWrap > ul > li > a#"+gen_archive_3170_past_i ).css("opacity", 1); $( "#gen_archive_3170 > .thumbnail > .pageHolder > .pageWrap > ul > li > a#"+gen_archive_3170_past_i ).css("cursor", "pointer"); $( "#gen_archive_3170 > .thumbnail > .pageHolder > .pageWrap > ul > li > a#"+gen_archive_3170_create_i ).removeClass("over"); $( "#gen_archive_3170 > .thumbnail > .pageHolder > .pageWrap > ul > li > a#"+gen_archive_3170_create_i ).addClass("active"); $( "#gen_archive_3170 > .thumbnail > .pageHolder > .pageWrap > ul > li > a#"+gen_archive_3170_create_i ).css("opacity", 0.5); $( "#gen_archive_3170 > .thumbnail > .pageHolder > .pageWrap > ul > li > a#"+gen_archive_3170_create_i ).css("cursor", "default"); } function gen_archive_3170_arrow_show_hide() { if(gen_archive_3170_pageHolder_width >= gen_archive_3170_pageWrap_width){ $("#gen_archive_3170 .arrow_page_left").fadeOut(200); $("#gen_archive_3170 .arrow_page_right").fadeOut(200); }else if(gen_archive_3170_pageWrap_left == 0){ $("#gen_archive_3170 .arrow_page_left").fadeOut(200); $("#gen_archive_3170 .arrow_page_right").fadeIn(200); }else if(-gen_archive_3170_pageWrap_left + gen_archive_3170_pageHolder_width >= gen_archive_3170_pageWrap_width){ $("#gen_archive_3170 .arrow_page_left").fadeIn(200); $("#gen_archive_3170 .arrow_page_right").fadeOut(200); }else{ $("#gen_archive_3170 .arrow_page_left").fadeIn(200); $("#gen_archive_3170 .arrow_page_right").fadeIn(200); } } $("#gen_archive_3170 div.arrow_page_right").click(function(){ if(-(gen_archive_3170_pageWrap_left-gen_archive_3170_pageHolder_width) + gen_archive_3170_pageHolder_width >= gen_archive_3170_pageWrap_width){ gen_archive_3170_pageWrap_left += gen_archive_3170_pageHolder_width-(gen_archive_3170_pageWrap_width+gen_archive_3170_pageWrap_left); }else{ gen_archive_3170_pageWrap_left -= gen_archive_3170_pageHolder_width-60; } $("#gen_archive_3170 .pageHolder .pageWrap").stop().animate({ marginLeft : gen_archive_3170_pageWrap_left+"px" },200, "easeOutQuint"); gen_archive_3170_arrow_show_hide(); }) $("#gen_archive_3170 div.arrow_page_left").click(function(){ if(gen_archive_3170_pageWrap_left+gen_archive_3170_pageHolder_width-60 >= 0){ gen_archive_3170_pageWrap_left = 0; }else{ gen_archive_3170_pageWrap_left += gen_archive_3170_pageHolder_width-60; } $("#gen_archive_3170 .pageHolder .pageWrap").stop().animate({ marginLeft : gen_archive_3170_pageWrap_left+"px" },200, "easeOutQuint") gen_archive_3170_arrow_show_hide(); }) $("#gen_archive_3170 div.arrow_image_right").click(function(){ gen_archive_3170_create_i ++; if( gen_archive_3170_create_i == gen_archive_3170_maxnum){ gen_archive_3170_loop_id ++; gen_archive_3170_create_i = 0; } gen_archive_3170_create_img(); gen_archive_3170_set_timer(); }) $("#gen_archive_3170 div.arrow_image_left").click(function(){ if( gen_archive_3170_create_i == 0){ gen_archive_3170_loop_id --; gen_archive_3170_create_i = gen_archive_3170_maxnum; } gen_archive_3170_create_i --; gen_archive_3170_create_img(); gen_archive_3170_set_timer(); }) function gen_archive_3170_fade_show(){ if( typeof gen_archive_3170_fade_timer != "undefined" ){ clearTimeout( gen_archive_3170_fade_timer ); } $("#gen_archive_3170 .fade:not(:animated)").stop().animate({opacity: 1},400); gen_archive_3170_fade_timer = setInterval(gen_archive_3170_fade_hide, 2000); } function gen_archive_3170_fade_hide(){ $("#gen_archive_3170 .fade:not(:animated)").animate({opacity: 0.3}, 400); clearInterval( gen_archive_3170_fade_timer ); } $("#gen_archive_3170 > .frame").mousemove(function(e){ gen_archive_3170_fade_show(); }); function isTouch(){ return (document.ontouchstart !== undefined); } function gen_archive_3170_swipe_action(){ var setMainId = $('#gen_archive_3170 .swipescroll'); var setMainUl = setMainId.children('div.swipe_contents'); var listWidth = parseInt(setMainUl.find('.swipe_li').css('width')); var listCount = setMainUl.find('.swipe_li').length; var leftMax = -((listWidth)*((listCount)-1)); var isTouch = ('ontouchstart' in window); setMainUl.off(); setMainUl.on( {'touchstart': function(e){ if( "off" == "on"){ gen_archive_3170_repeat_flag = "false"; gen_archive_3170_set_timer(); } var setMainUlNot = setMainId.children('div.swipe_contents'); setMainUlNot.stop(); setMainUlNot.each(function(){ this.leftBegin = parseInt($(this).css('left')); this.touchX = event.changedTouches[0].pageX; this.touchY = event.changedTouches[0].pageY; this.slideX = $(this).position().left; }); },'touchmove': function(e){ var moveX = this.touchX - event.changedTouches[0].pageX; var moveY = this.touchY - event.changedTouches[0].pageY; var moveRate = moveX / moveY; if(moveRate > Math.tan(15 * Math.PI/180)) { e.preventDefault(); } this.slideX = this.slideX - (this.touchX - event.changedTouches[0].pageX ); $(this).css({left:this.slideX}); this.touchX = event.changedTouches[0].pageX; },'touchend': function(e){ var abs = Math.abs( this.leftBegin - this.slideX ); if( abs < 50 ){ gen_archive_3170_window_resize(); } else if(this.leftBegin > this.slideX){ gen_archive_3170_create_i ++; if( gen_archive_3170_create_i >= gen_archive_3170_maxnum ){ gen_archive_3170_loop_id ++; gen_archive_3170_create_i = 0; } setMainUl.find('.swipe_' + gen_archive_3170_create_i).addClass('active'); gen_archive_3170_create_img(); } else if(this.leftBegin < this.slideX) { gen_archive_3170_create_i --; if( gen_archive_3170_create_i < 0 ){ gen_archive_3170_loop_id --; gen_archive_3170_create_i = gen_archive_3170_maxnum -1; } setMainUl.find('.swipe_' + gen_archive_3170_create_i).addClass('active'); gen_archive_3170_create_img(); } else if(this.leftBegin === 0) { } else if(this.leftBegin <= leftMax) { } gen_archive_3170_loop_cloning(); if( "off" == "on"){ gen_archive_3170_repeat_flag = "true"; gen_archive_3170_set_timer(); } } }); $("#gen_archive_3170 div.swipe_contents > *").off(); $("#gen_archive_3170 div.swipe_contents > *").on({ 'touchstart mousedown': function() { this.isTouch = true; }, 'touchmove mousemove': function() { this.isTouch = false; }, 'touchend mouseup': function() { if(this.isTouch == true){ if( $(this).parent().find('.swipe_' + gen_archive_3170_create_i).children("a")[0] ){ var url = $(this).parent().find('.swipe_' + gen_archive_3170_create_i).children("a").attr("href"); var target = $(this).parent().find('.swipe_' + gen_archive_3170_create_i).children("a").attr("target"); var link_to_flag = $(this).parent().find('.swipe_' + gen_archive_3170_create_i).children("a").attr("data-link-to-flag"); if( link_to_flag != "media" ){ if( target == "" ){ window.location.href = url; }else{ window.open(url); } } } } } }); } function gen_archive_3170_swipe_me(span){ var target_wrapper = $("#gen_archive_3170 .swipe_me"); var target = $("#gen_archive_3170 .swipe_me > div"); target_wrapper.animate({ "opacity": 1 }, 500, function(){ target.animate({ "margin-left": -span }, 500, "swing", function(){ target_wrapper.animate({ "opacity": 0 }, 500, "swing", function(){ target.css({"margin-left": ""}); target_wrapper.animate({ "opacity": 1 }, 200, function(){ target.animate({ "margin-left": -span }, 500, "swing", function(){ target_wrapper.animate({ "opacity": 0 }, 500, function(){ target_wrapper.remove(); }); }); }); }); }); }); } function gen_archive_3170_create_swipe_contents(){ if( gen_archive_3170_create_swipe_contents_i < gen_archive_3170_maxnum ){ var img_url = gen_archive_3170_array[gen_archive_3170_create_swipe_contents_i][0]; var thumb_url = gen_archive_3170_array[gen_archive_3170_create_swipe_contents_i][1]; var img_height = gen_archive_3170_array[gen_archive_3170_create_swipe_contents_i][2]; var img_width = gen_archive_3170_array[gen_archive_3170_create_swipe_contents_i][3]; var caption_jp = gen_archive_3170_array[gen_archive_3170_create_swipe_contents_i][4]; var caption_en = gen_archive_3170_array[gen_archive_3170_create_swipe_contents_i][5]; var description_jp = gen_archive_3170_array[gen_archive_3170_create_swipe_contents_i][6]; var description_en = gen_archive_3170_array[gen_archive_3170_create_swipe_contents_i][7]; var link_url = gen_archive_3170_array[gen_archive_3170_create_swipe_contents_i][8]; var link_target = gen_archive_3170_array[gen_archive_3170_create_swipe_contents_i][9]; var link_to_flag = gen_archive_3170_array[gen_archive_3170_create_swipe_contents_i][10]; var entry_title_jp = gen_archive_3170_array[gen_archive_3170_create_swipe_contents_i][11]; var entry_title_en = gen_archive_3170_array[gen_archive_3170_create_swipe_contents_i][12]; var entry_description_jp = gen_archive_3170_array[gen_archive_3170_create_swipe_contents_i][13]; var entry_description_en = gen_archive_3170_array[gen_archive_3170_create_swipe_contents_i][14]; var target_wrapper = $("#gen_archive_3170 .swipe_" + gen_archive_3170_create_swipe_contents_i); var style = ""; if( link_url != "" ){ target_wrapper.append(""); } var set_img_div = "gen_archive_3170_img_div_" + gen_archive_3170_create_swipe_contents_i; target_wrapper.append("
"); var target = target_wrapper.find("div#" + set_img_div); target.find("img.low").load(function () { target.find("img.low").fadeIn(gen_archive_3170_set_fade_speed, "easeOutQuint"); target.addClass("fit"); setTimeout(function(){ gen_archive_3170_create_swipe_contents_i ++; gen_archive_3170_create_swipe_contents(); },10); }); target.find("img.low").attr("src", thumb_url); } if( gen_archive_3170_create_swipe_contents_i == 0 ){ gen_archive_3170_create_img(); gen_archive_3170_start_action(); if( isTouch() ){ setTimeout(function(){ gen_archive_3170_swipe_me(120); },800); }else{ $("#gen_archive_3170 .swipe_me").remove(); } } if( gen_archive_3170_create_swipe_contents_i == gen_archive_3170_maxnum ){ gen_archive_3170_window_resize(); } } function gen_archive_3170_loop_cloning(){ if( gen_archive_3170_create_i == 0 ){ var clone_target = $("#gen_archive_3170 .swipescroll > div.swipe_contents > .group[data-loop-id = " + gen_archive_3170_loop_id + "]"); if( ! $("#gen_archive_3170 .swipescroll > div.swipe_contents > .group[data-loop-id = " + (gen_archive_3170_loop_id - 1) + "]")[0] ){ var target = clone_target.after(clone_target.clone()); target.attr("data-loop-id",gen_archive_3170_loop_id - 1); target.css({"left": parseInt(clone_target.css("left")) - clone_target.width()}); } if( $("#gen_archive_3170 .swipescroll > div.swipe_contents > .group[data-loop-id = " + (gen_archive_3170_loop_id + 1) + "]")[0] ){ $("#gen_archive_3170 .swipescroll > div.swipe_contents > .group[data-loop-id = " + (gen_archive_3170_loop_id + 1) + "]").remove(); } }else if( gen_archive_3170_create_i == gen_archive_3170_maxnum-1 ){ var clone_target = $("#gen_archive_3170 .swipescroll > div.swipe_contents > .group[data-loop-id = " + gen_archive_3170_loop_id + "]"); if( ! $("#gen_archive_3170 .swipescroll > div.swipe_contents > .group[data-loop-id = " + (gen_archive_3170_loop_id + 1) + "]")[0] ){ var target = clone_target.before(clone_target.clone()); target.attr("data-loop-id",gen_archive_3170_loop_id + 1); target.css({"left": parseInt(clone_target.css("left")) + clone_target.width()}); } if( $("#gen_archive_3170 .swipescroll > div.swipe_contents > .group[data-loop-id = " + (gen_archive_3170_loop_id - 1) + "]")[0] ){ $("#gen_archive_3170 .swipescroll > div.swipe_contents > .group[data-loop-id = " + (gen_archive_3170_loop_id - 1) + "]").remove(); } }else{ if( gen_archive_3170_create_i > 1 && gen_archive_3170_create_i < gen_archive_3170_maxnum-2 ){ if( $("#gen_archive_3170 .swipescroll > div.swipe_contents > .group[data-loop-id = " + (gen_archive_3170_loop_id - 1) + "]")[0] ){ $("#gen_archive_3170 .swipescroll > div.swipe_contents > .group[data-loop-id = " + (gen_archive_3170_loop_id - 1) + "]").remove(); } if( $("#gen_archive_3170 .swipescroll > div.swipe_contents > .group[data-loop-id = " + (gen_archive_3170_loop_id + 1) + "]")[0] ){ $("#gen_archive_3170 .swipescroll > div.swipe_contents > .group[data-loop-id = " + (gen_archive_3170_loop_id + 1) + "]").remove(); } } } } $(document).on("mouseover", "#gen_archive_3170 .pageHolder img.over", function(){ $(this).stop().animate({ opacity : 0.5 },50) }); $(document).on("mouseout", "#gen_archive_3170 .pageHolder img.over", function(){ $(this).stop().animate({ opacity : 1 },200) }); var gen_archive_3170_array = new Array(); var count_i = 0; $("#gen_archive_3170 .thumbnail > .pageHolder > .pageWrap > ul").each(function(){ var i = 0; var entry_title_jp = ""; var entry_title_en = ""; var entry_description_jp = ""; var entry_description_en = ""; $(this).find("li").each(function(){ if(i==0){ entry_title_jp = $(this).children("h2").children(".entry_title_jp").html(); entry_title_en = $(this).children("h2").children(".entry_title_en").html(); entry_description_jp = $(this).children(".entry_description_jp").html(); entry_description_en = $(this).children(".entry_description_en").html(); }else{ var target = $(this).children("a"); var img_url = target.children(".img").attr("data-img-url"); var thumb_url = target.children(".img").attr("data-thumb-url"); var img_height = target.children(".img").attr("data-height"); var img_width = target.children(".img").attr("data-width"); var caption_jp = target.children(".caption_jp").html(); var caption_en = target.children(".caption_en").html(); var description_jp = target.children(".description_jp").html(); var description_en = target.children(".description_en").html(); var link_url = target.attr("href"); var link_target = target.attr("target"); var link_to_flag = target.attr("data-link-to-flag"); gen_archive_3170_array.push( [img_url, thumb_url, img_height, img_width, caption_jp, caption_en, description_jp, description_en, link_url, link_target, link_to_flag, entry_title_jp, entry_title_en, entry_description_jp, entry_description_en] ); count_i++; } i++; }); }); gen_archive_3170_maxnum = count_i; if( "off" == "on" && gen_archive_3170_maxnum > 1 ){ var gen_archive_3170_repeat_flag = "true"; }else{ var gen_archive_3170_repeat_flag = "false"; } function gen_archive_3170_preload(){ $("#gen_archive_3170 > .spinner").animate({"opacity": 1},500); var img = [], img_arr = $("#gen_archive_3170 .thumbnail img"), // ローディング対象の画像を指定 img_arr_lngth = img_arr.size(); img_arr.each(function(indx){ img[indx] = new Image(); img[indx].onload = function(){ img_arr_lngth = img_arr_lngth - 1; if( 0 >= img_arr_lngth ){ gen_archive_3170_initialize(); } }; img[indx].src = $(this).attr('src'); }); } $(window).on('load', function() { if( $("#gen_archive_3170")[0] ){ $("#gen_archive_3170").addClass("flexible"); $("#gen_archive_3170").addClass("fit"); setTimeout(function(){ if( gen_archive_3170_ratio != "flexible" ){ gen_archive_3170_width = $("#gen_archive_3170").width(); gen_archive_3170_height = Math.round(gen_archive_3170_width*0/0); $("#gen_archive_3170").css({"height": gen_archive_3170_height}); } gen_archive_3170_preload(); },10); } }); function htmlEncode(value){ return $('
').text(value).html(); } function htmlDecode(value){ return $('
').html(value).text(); } });