$(function() { entry = Array(); category = Array(); category['root'] = Array(); category['root']['title'] = "top"; category['root']['description'] = ""; category['root']['type'] = "page"; category['root']['pagenation'] = "0"; category['root']['format'] = "Part_Content_001"; category['root']['directory'] = "root"; category['intro'] = Array(); category['intro']['title'] = "top/はじめての方へ"; category['intro']['description'] = ""; category['intro']['type'] = "ground"; category['intro']['pagenation'] = "1"; category['intro']['format'] = "Part_Content_002"; category['intro']['directory'] = "root"; category['about'] = Array(); category['about']['title'] = "top/コンテナハウスとは"; category['about']['description'] = ""; category['about']['type'] = "ground"; category['about']['pagenation'] = "2"; category['about']['format'] = "Part_Content_003"; category['about']['directory'] = "root"; category['gallery'] = Array(); category['gallery']['title'] = "top/施工実績"; category['gallery']['description'] = ""; category['gallery']['type'] = "ground"; category['gallery']['pagenation'] = "3"; category['gallery']['format'] = "Part_Content_004"; category['gallery']['directory'] = "root"; category['flow'] = Array(); category['flow']['title'] = "top/お問合せからお引渡しまで"; category['flow']['description'] = ""; category['flow']['type'] = "ground"; category['flow']['pagenation'] = "4"; category['flow']['format'] = "Part_Content_006"; category['flow']['directory'] = "root"; category['sns'] = Array(); category['sns']['title'] = "top/SNS"; category['sns']['description'] = "<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="https://www.instagram.com/p/ClpzTynLz4U/?utm_source=ig_embed&amp;utm_campaign=loading" data-instgrm-version="14" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:540px; min-width:326px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"><div style="padding:16px;"> <a href="https://www.instagram.com/p/ClpzTynLz4U/?utm_source=ig_embed&amp;utm_campaign=loading" style=" background:#FFFFFF; line-height:0; padding:0 0; text-align:center; text-decoration:none; width:100%;" target="_blank"> <div style=" display: flex; flex-direction: row; align-items: center;"> <div style="background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 40px; margin-right: 14px; width: 40px;"></div> <div style="display: flex; flex-direction: column; flex-grow: 1; justify-content: center;"> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 100px;"></div> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; width: 60px;"></div></div></div><div style="padding: 19% 0;"></div> <div style="display:block; height:50px; margin:0 auto 12px; width:50px;"><svg width="50px" height="50px" viewBox="0 0 60 60" version="1.1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g transform="translate(-511.000000, -20.000000)" fill="#000000"><g><path d="M556.869,30.41 C554.814,30.41 553.148,32.076 553.148,34.131 C553.148,36.186 554.814,37.852 556.869,37.852 C558.924,37.852 560.59,36.186 560.59,34.131 C560.59,32.076 558.924,30.41 556.869,30.41 M541,60.657 C535.114,60.657 530.342,55.887 530.342,50 C530.342,44.114 535.114,39.342 541,39.342 C546.887,39.342 551.658,44.114 551.658,50 C551.658,55.887 546.887,60.657 541,60.657 M541,33.886 C532.1,33.886 524.886,41.1 524.886,50 C524.886,58.899 532.1,66.113 541,66.113 C549.9,66.113 557.115,58.899 557.115,50 C557.115,41.1 549.9,33.886 541,33.886 M565.378,62.101 C565.244,65.022 564.756,66.606 564.346,67.663 C563.803,69.06 563.154,70.057 562.106,71.106 C561.058,72.155 560.06,72.803 558.662,73.347 C557.607,73.757 556.021,74.244 553.102,74.378 C549.944,74.521 548.997,74.552 541,74.552 C533.003,74.552 532.056,74.521 528.898,74.378 C525.979,74.244 524.393,73.757 523.338,73.347 C521.94,72.803 520.942,72.155 519.894,71.106 C518.846,70.057 518.197,69.06 517.654,67.663 C517.244,66.606 516.755,65.022 516.623,62.101 C516.479,58.943 516.448,57.996 516.448,50 C516.448,42.003 516.479,41.056 516.623,37.899 C516.755,34.978 517.244,33.391 517.654,32.338 C518.197,30.938 518.846,29.942 519.894,28.894 C520.942,27.846 521.94,27.196 523.338,26.654 C524.393,26.244 525.979,25.756 528.898,25.623 C532.057,25.479 533.004,25.448 541,25.448 C548.997,25.448 549.943,25.479 553.102,25.623 C556.021,25.756 557.607,26.244 558.662,26.654 C560.06,27.196 561.058,27.846 562.106,28.894 C563.154,29.942 563.803,30.938 564.346,32.338 C564.756,33.391 565.244,34.978 565.378,37.899 C565.522,41.056 565.552,42.003 565.552,50 C565.552,57.996 565.522,58.943 565.378,62.101 M570.82,37.631 C570.674,34.438 570.167,32.258 569.425,30.349 C568.659,28.377 567.633,26.702 565.965,25.035 C564.297,23.368 562.623,22.342 560.652,21.575 C558.743,20.834 556.562,20.326 553.369,20.18 C550.169,20.033 549.148,20 541,20 C532.853,20 531.831,20.033 528.631,20.18 C525.438,20.326 523.257,20.834 521.349,21.575 C519.376,22.342 517.703,23.368 516.035,25.035 C514.368,26.702 513.342,28.377 512.574,30.349 C511.834,32.258 511.326,34.438 511.181,37.631 C511.035,40.831 511,41.851 511,50 C511,58.147 511.035,59.17 511.181,62.369 C511.326,65.562 511.834,67.743 512.574,69.651 C513.342,71.625 514.368,73.296 516.035,74.965 C517.703,76.634 519.376,77.658 521.349,78.425 C523.257,79.167 525.438,79.673 528.631,79.82 C531.831,79.965 532.853,80.001 541,80.001 C549.148,80.001 550.169,79.965 553.369,79.82 C556.562,79.673 558.743,79.167 560.652,78.425 C562.623,77.658 564.297,76.634 565.965,74.965 C567.633,73.296 568.659,71.625 569.425,69.651 C570.167,67.743 570.674,65.562 570.82,62.369 C570.966,59.17 571,58.147 571,50 C571,41.851 570.966,40.831 570.82,37.631"></path></g></g></g></svg></div><div style="padding-top: 8px;"> <div style=" color:#3897f0; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:550; line-height:18px;">この投稿をInstagramで見る</div></div><div style="padding: 12.5% 0;"></div> <div style="display: flex; flex-direction: row; margin-bottom: 14px; align-items: center;"><div> <div style="background-color: #F4F4F4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(0px) translateY(7px);"></div> <div style="background-color: #F4F4F4; height: 12.5px; transform: rotate(-45deg) translateX(3px) translateY(1px); width: 12.5px; flex-grow: 0; margin-right: 14px; margin-left: 2px;"></div> <div style="background-color: #F4F4F4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(9px) translateY(-18px);"></div></div><div style="margin-left: 8px;"> <div style=" background-color: #F4F4F4; border-radius: 50%; flex-grow: 0; height: 20px; width: 20px;"></div> <div style=" width: 0; height: 0; border-top: 2px solid transparent; border-left: 6px solid #f4f4f4; border-bottom: 2px solid transparent; transform: translateX(16px) translateY(-4px) rotate(30deg)"></div></div><div style="margin-left: auto;"> <div style=" width: 0px; border-top: 8px solid #F4F4F4; border-right: 8px solid transparent; transform: translateY(16px);"></div> <div style=" background-color: #F4F4F4; flex-grow: 0; height: 12px; width: 16px; transform: translateY(-4px);"></div> <div style=" width: 0; height: 0; border-top: 8px solid #F4F4F4; border-left: 8px solid transparent; transform: translateY(-4px) translateX(8px);"></div></div></div> <div style="display: flex; flex-direction: column; flex-grow: 1; justify-content: center; margin-bottom: 24px;"> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 224px;"></div> <div style=" background-color: #F4F4F4; border-radius: 4px; flex-grow: 0; height: 14px; width: 144px;"></div></div></a><p style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;"><a href="https://www.instagram.com/p/ClpzTynLz4U/?utm_source=ig_embed&amp;utm_campaign=loading" style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none;" target="_blank">2040fukuoka.jp(@2040fukuoka.jp)がシェアした投稿</a></p></div></blockquote> <script async src="//www.instagram.com/embed.js"></script>"; category['sns']['type'] = "ground"; category['sns']['pagenation'] = "5"; category['sns']['format'] = "Part_Content_007"; category['sns']['directory'] = "root"; category['intro/'] = Array(); category['intro/']['title'] = "INTRO - はじめての方へ"; category['intro/']['description'] = ""; category['intro/']['type'] = "page"; category['intro/']['pagenation'] = "6"; category['intro/']['format'] = "Part_Content_010"; category['intro/']['directory'] = "intro/"; category['intro/concept'] = Array(); category['intro/concept']['title'] = "コンセプト"; category['intro/concept']['description'] = ""; category['intro/concept']['type'] = "ground"; category['intro/concept']['pagenation'] = "7"; category['intro/concept']['format'] = "Part_Content_011"; category['intro/concept']['directory'] = "intro/"; category['intro/outline'] = Array(); category['intro/outline']['title'] = "会社概要・協力会社"; category['intro/outline']['description'] = ""; category['intro/outline']['type'] = "ground"; category['intro/outline']['pagenation'] = "8"; category['intro/outline']['format'] = "Part_Content_012"; category['intro/outline']['directory'] = "intro/"; category['about/'] = Array(); category['about/']['title'] = "ABOUT - コンテナハウスとは"; category['about/']['description'] = ""; category['about/']['type'] = "page"; category['about/']['pagenation'] = "9"; category['about/']['format'] = "Part_Content_020"; category['about/']['directory'] = "about/"; category['about/feature'] = Array(); category['about/feature']['title'] = "コンテナハウスの特徴"; category['about/feature']['description'] = ""; category['about/feature']['type'] = "ground"; category['about/feature']['pagenation'] = "10"; category['about/feature']['format'] = "Part_Content_021"; category['about/feature']['directory'] = "about/"; category['about/lineup'] = Array(); category['about/lineup']['title'] = "ラインナップ"; category['about/lineup']['description'] = ""; category['about/lineup']['type'] = "ground"; category['about/lineup']['pagenation'] = "11"; category['about/lineup']['format'] = "Part_Content_022"; category['about/lineup']['directory'] = "about/"; category['about/spec'] = Array(); category['about/spec']['title'] = "基本仕様"; category['about/spec']['description'] = ""; category['about/spec']['type'] = "ground"; category['about/spec']['pagenation'] = "12"; category['about/spec']['format'] = "Part_Content_023"; category['about/spec']['directory'] = "about/"; category['flow/'] = Array(); category['flow/']['title'] = "FLOW - お問合せからお引渡しまで"; category['flow/']['description'] = ""; category['flow/']['type'] = "page"; category['flow/']['pagenation'] = "13"; category['flow/']['format'] = "Part_Content_030"; category['flow/']['directory'] = "flow/"; category['gallery/'] = Array(); category['gallery/']['title'] = "GALLERY - 施工実績"; category['gallery/']['description'] = ""; category['gallery/']['type'] = "page"; category['gallery/']['pagenation'] = "14"; category['gallery/']['format'] = "Part_Content_040"; category['gallery/']['directory'] = "gallery/"; category['gallery/house/'] = Array(); category['gallery/house/']['title'] = "施工実績/HOUSE"; category['gallery/house/']['description'] = ""; category['gallery/house/']['type'] = "page"; category['gallery/house/']['pagenation'] = "15"; category['gallery/house/']['format'] = "Part_Content_040"; category['gallery/house/']['directory'] = "gallery/house/"; category['gallery/store/'] = Array(); category['gallery/store/']['title'] = "施工実績/STORE"; category['gallery/store/']['description'] = ""; category['gallery/store/']['type'] = "page"; category['gallery/store/']['pagenation'] = "16"; category['gallery/store/']['format'] = "Part_Content_040"; category['gallery/store/']['directory'] = "gallery/store/"; category['gallery/office/'] = Array(); category['gallery/office/']['title'] = "施工実績/OFFICE"; category['gallery/office/']['description'] = ""; category['gallery/office/']['type'] = "page"; category['gallery/office/']['pagenation'] = "17"; category['gallery/office/']['format'] = "Part_Content_040"; category['gallery/office/']['directory'] = "gallery/office/"; category['gallery/accommodation/'] = Array(); category['gallery/accommodation/']['title'] = "施工実績/ACCOMMODATION"; category['gallery/accommodation/']['description'] = ""; category['gallery/accommodation/']['type'] = "page"; category['gallery/accommodation/']['pagenation'] = "18"; category['gallery/accommodation/']['format'] = "Part_Content_040"; category['gallery/accommodation/']['directory'] = "gallery/accommodation/"; category['gallery/others/'] = Array(); category['gallery/others/']['title'] = "施工実績/OTHERS"; category['gallery/others/']['description'] = ""; category['gallery/others/']['type'] = "page"; category['gallery/others/']['pagenation'] = "19"; category['gallery/others/']['format'] = "Part_Content_040"; category['gallery/others/']['directory'] = "gallery/others/"; category['faq/'] = Array(); category['faq/']['title'] = "FAQ - よくある質問"; category['faq/']['description'] = ""; category['faq/']['type'] = "page"; category['faq/']['pagenation'] = "20"; category['faq/']['format'] = "Part_Content_060"; category['faq/']['directory'] = "faq/"; category['contact/'] = Array(); category['contact/']['title'] = "CONTACT - お問い合わせ"; category['contact/']['description'] = ""; category['contact/']['type'] = "page"; category['contact/']['pagenation'] = "21"; category['contact/']['format'] = "Part_Content_070"; category['contact/']['directory'] = "contact/"; category['event/'] = Array(); category['event/']['title'] = "EVENT - イベント参加申込"; category['event/']['description'] = ""; category['event/']['type'] = "page"; category['event/']['pagenation'] = "22"; category['event/']['format'] = "Part_Content_080"; category['event/']['directory'] = "event/"; category['privacy/'] = Array(); category['privacy/']['title'] = "PRIVACY POLICY - プライバシーポリシー"; category['privacy/']['description'] = ""; category['privacy/']['type'] = "page"; category['privacy/']['pagenation'] = "23"; category['privacy/']['format'] = "Part_Content_090"; category['privacy/']['directory'] = "privacy/"; function htmlEncode(value){ return $('
').text(value).html(); } function htmlDecode(value){ return $('
').html(value).text(); } var href = ""; var past_href = location.href; var past_directory = $("body").attr("data-directory"); var past_index_num = $("body").attr("data-index_num"); var past_archive_year_dir = $("body").attr("data-archive_year_dir"); var past_modal_content_type = ""; var memo_scroll = 0; var id = past_href.replace( "https://2040fukuoka.jp/", "" ).replace( "?mode=preview", "" ); var option = ""; class_active(past_directory); var hash = ""; if(past_href.indexOf( "#/" ) != -1){ hash_arr = past_href.split("#/"); past_href = hash_arr[0]; hash = hash_arr[1]; PJAX_hash( hash ); } function PJAX_pjax( href, option, target ) { hash = ""; if(href.indexOf( "#/" ) != -1){ hash_arr = href.split("#/"); href = hash_arr[0]; hash = hash_arr[1]; PJAX_hash( hash ); } var scroll_id = href.replace( "https://2040fukuoka.jp/", "" ).replace( "?mode=preview", "" ); if( scroll_id == "" ){ scroll_id = "root"; } PJAX_scroll_ground( scroll_id, option ); if( href && past_href != href && href.indexOf( "#" ) == -1 ){ scroll_action_flag = false; if( typeof scroll_action_limiter != "undefined" ){ clearTimeout( scroll_action_limiter ); } id = href.replace( "https://2040fukuoka.jp/", "" ).replace( "?mode=preview", "" ); if( typeof entry[id] != "undefined" ){ id = entry[id]; href = href.replace( id, entry[id] ); } past_href = href; console.log("──── pjax ────"); console.log("href: " + href); console.log("id: " + id); console.log("option: " + option); console.log("target: " + target); var data_directory = ""; if( typeof $("body").attr("data-directory") !== 'undefined' && $("body").attr("data-directory") !== false ){ var data_directory = String($("body").attr("data-directory")); } var data_archive_year_dir = ""; if( typeof $("body").attr("data-archive_year_dir") !== 'undefined' && $("body").attr("data-archive_year_dir") !== false ){ var data_archive_year_dir = String($("body").attr("data-archive_year_dir")); } var data_index_num = ""; if( typeof $("body").attr("data-index_num") !== 'undefined' && $("body").attr("data-index_num") !== false ){ var data_index_num = String($("body").attr("data-index_num")); } if( option != "by_scroll" && typeof category[scroll_id] != "undefined" && category[scroll_id]['type'] != "modal" && category[scroll_id]['directory'] == data_directory && data_archive_year_dir+data_index_num == "" ){ }else if( option != "by_onpop" && option != "by_scroll" && option != "by_load_more" ){ $("body").append('
'); $("body > div.loading").addClass("show"); } if( typeof pjax_request != "undefined" ){ pjax_request.abort(); } pjax_request = $.ajax({ url: "https://2040fukuoka.jp/js_pjax_json.php", data: "id=" + id + "&type=json" + "", dataType: "json", success: function(data, dataType){ var pagetitle = data.pagetitle; var meta_og_image = data.meta_og_image; var permalink = data.permalink; var page_format = data.page_format; var body_class = data.body_class; var path = data.path; var directory = data.directory; var directory_1 = data.directory_1; var directory_2 = data.directory_2; var directory_3 = data.directory_3; var directory_4 = data.directory_4; var file = data.file; var scroll = data.scroll; var page_type = data.page_type; var pagenation = data.pagenation; var index_num = data.index_num; var archive_year_dir = data.archive_year_dir; var index_parent_dir = data.index_parent_dir; var modal_content_type = data.modal_content_type; var modal_content_page_format = data.modal_content_page_format; var modal_content_entry_date = data.modal_content_entry_date; var modal_content_entry_title_jp = data.modal_content_entry_title_jp; var modal_content_entry_title_en = data.modal_content_entry_title_en; var modal_content_entry_description_jp = data.modal_content_entry_description_jp; var modal_content_entry_description_en = data.modal_content_entry_description_en; var modal_content_media = data.modal_content_media; if( option != "by_onpop" && // option != "by_forward" && option != "by_load_more" ){ console.log("push"); PJAX_pushState( href, pagetitle ); } document.title = pagetitle; var ga_title = pagetitle; if( option != "by_load_more" ){ $("body").attr("class",body_class); $("body").attr("data-directory",directory); $("body").attr("data-file",file); $("body").attr("data-scroll",scroll); $("body").attr("data-index_num",index_num); $("body").attr("data-archive_year_dir",archive_year_dir); } console.log("modal_content_type: " + modal_content_type); console.log("past_directory: " + past_directory); console.log("directory: " + directory); console.log("pagenation: " + pagenation); console.log("page_type: " + page_type); console.log("index_num: " + index_num); console.log("archive_year_dir: " + archive_year_dir); console.log("index_parent_dir: " + index_parent_dir); console.log("scroll: " + scroll); class_active(directory); if( modal_content_type != "" ){ past_modal_content_type = modal_content_type; PJAX_ajaxload_modal( href, data, option, target ); }else{ if( option != "by_scroll" ){ if( option == "by_load_more" && target != "" ){ PJAX_ajaxload_loadmore( href, data, option, target ); }else if( past_directory != directory || past_index_num != index_num || past_archive_year_dir != archive_year_dir ){ past_index_num = index_num; past_directory = directory; past_archive_year_dir = archive_year_dir; scrollto(0); PJAX_ajaxload_directory( href, data, option, target ); }else if( past_directory == directory && scroll == "" ){ scroll_action_flag = true; // if( past_modal_content_type == "" ){ // scrollto(0); // }else{ // } PJAX_loading_remove(); }else{ scroll_action_flag = true; if( past_modal_content_type == "" ){ scroll_action_flag = false; var scrollto_val = 0; if( scroll != "" ){ // window_resize(); scrollto_val = $("#" + selectorEscape(scroll)).position().top + 10; } scrollto(scrollto_val); }else{ if( scroll != "" ){ // window_resize(); scrollto_val = $("#" + selectorEscape(scroll)).position().top + 10; scrollto(scrollto_val); } } PJAX_loading_remove(); } } past_modal_content_type = ""; } setTimeout( function(){ if( $("body #entry").css("z-index") == -1 ){ $("body #entry").empty(); } } , 2000); }, error: function(XMLHttpRequest, textStatus, errorThrown){ } }); }else{ if( option != "by_scroll" ){ // var elm_id = id.replace( /\//g, '' ); // if( $("#"+elm_id)[0] ){ // var target= $("#"+elm_id); // var scrollto_val = target.position().top + 10; // scrollto(scrollto_val); // }else{ // scrollto(0); // } } PJAX_loading_remove(); } } function PJAX_loading_remove() { $("body > div.loading").removeClass("show"); setTimeout( function(){ $("body > div.loading").remove(); } , 1000); } function PJAX_scroll_ground( scroll_id, option ) { // window_resize(); if( option != "by_scroll" && typeof category[scroll_id] != "undefined" && category[scroll_id]['type'] != "modal" && category[scroll_id]['directory'] == $("body").attr("data-directory") ){ if( past_modal_content_type == "" ){ // console.log("ground: " + scroll_id); var scrollto_val = 0; if( category[scroll_id]['type'] == "ground" && $("#" + selectorEscape(scroll_id))[0] ){ scrollto_val = $("#" + selectorEscape(scroll_id)).position().top + 10; } scrollto(scrollto_val); }else{ $("body").removeClass("entry modal"); } PJAX_loading_remove(); } } function PJAX_ajaxload_modal( href, data, option, target ) { $("#entry").empty(); if( typeof ajax_request != "undefined" ){ ajax_request.abort(); } ajax_request = $.ajax({ url: href, dataType: "html", success: function(data, dataType){ var get_elm = $('#entry > *', $('
').prepend(data)); $("#entry").append(get_elm); $("#entry > div.inner").addClass("pending"); setTimeout( function(){ $("#entry > div.inner").removeClass("pending"); window_resize(); } , 100); // var container_id = $("body #container > div#base > article").attr("id"); // if( container_id == "root" ){ // container_id = ""; // } // var return_href = "https://2040fukuoka.jp/" + container_id; // $("#entry a.pjax.close").attr("href",return_href); // $("#entry a.pjax.return").attr("href",return_href); img_load(); window_resize(); PJAX_loading_remove(); }, error: function(XMLHttpRequest, textStatus, errorThrown){ } }); } function PJAX_ajaxload_directory( href, data, option, target ) { $("body > #wrapper > #container > div.static_elm").fadeOut(1000, function() { $(this).remove(); }); $("html").addClass("moving"); var scroll = data.scroll; if( typeof ajax_request != "undefined" ){ ajax_request.abort(); } ajax_request = $.ajax({ url: href, dataType: "html", success: function(ajax_data, dataType){ console.log($('#wrapper.logged_in', $('
').prepend(ajax_data))); if( $('#wrapper.logged_in', $('
').prepend(ajax_data))[0] ){ $("#wrapper").addClass("logged_in"); }else{ $("#wrapper").removeClass("logged_in"); } var get_article_elm = $('#container > div#base > article', $('
').prepend(ajax_data)); $("#container > div#base > article").addClass("leave"); $("#container > div#base").append(get_article_elm); // var get_navi_elm = $('#navi', $('
').prepend(ajax_data)); // $("#navi").empty(); // $("#navi").prepend(get_navi_elm); $("#container > div#base > article").addClass("ajax"); setTimeout( function(){ $("#container > div#base > article.leave").remove(); setTimeout( function(){ $("html").removeClass("moving"); base_scroll(); scroll_trigger(); } , 500); load_iframe(); // FB.XFBML.parse(); window_resize(); PJAX_loading_remove(); var scrollto_val = 0; if( scroll != "" ){ scrollto_val = $("#" + selectorEscape(scroll)).position().top; } scrollto(scrollto_val); img_load(); } , 10); if( data.directory == "root" ){ slide_start( $("body #container > div#base > article#root > article#top > div.inner > div.slide") ); window.FB.XFBML.parse(); } img_load(); scroll_action_flag = true; }, error: function(XMLHttpRequest, textStatus, errorThrown){ } }); } function PJAX_ajaxload_loadmore( href, data, option, target ) { var scroll = data.scroll; if( typeof ajax_request != "undefined" ){ ajax_request.abort(); } ajax_request = $.ajax({ url: href, dataType: "html", success: function(data, dataType){ target.children("li.load_more").remove(); var get_elm = $('div.index > ul > *', $('
').prepend(data)); target.append(get_elm); img_load(); window_resize(); PJAX_loading_remove(); if( ! $("body.modal")[0] && ! $("body.entry")[0] ){ scroll_action_flag = true; } var target_index = target.closest(".index"); // thm_random_fade_start( target_index ); }, error: function(XMLHttpRequest, textStatus, errorThrown){ } }); } function class_active(directory){ var slsh_to_ub = directory.replace( /\//g, "_" ); $("#navi nav li").removeClass("active"); $("#navi nav li").removeClass("p_active"); if( $(".class_" + slsh_to_ub + " a")[0] ){ var target_nav = $(".class_" + slsh_to_ub + " a"); target_nav.parent("li").removeClass("over"); target_nav.parent("li").addClass("active"); target_nav.closest("li.parent").removeClass("over"); target_nav.closest("li.parent").addClass("p_active"); } } function scrollto(val){ scroll_action_flag = false; $('#container > div#base').stop().animate({ scrollTop: val }, 1000, "easeOutQuint",function(){ scroll_action_flag = true; }); } function PJAX_pushState( href, title ) { if ( window.history.pushState ) { window.history.pushState( title, null, href ); } else { } } window.onpopstate = function(event){ if (event.state) { } else { } var href = location.href; if ( window.history.pushState ) { PJAX_pjax( href, "by_onpop", "" ); } else { var href = "https://2040fukuoka.jp/#!/" + href.replace( /^.\//, '' ); window.location = href; } } $(document).on("click", "a.pjax:not(.deactive)", function(){ var href = $(this).attr("href"); if ( window.history.pushState ) { PJAX_pjax( href, "", "" ); } else { var href = href.replace( "https://2040fukuoka.jp/", "" ); var href = "https://2040fukuoka.jp/#!/" + href.replace( /^.\//, '' ); var past_href = location.href; window.location = href; } return false; }); $(document).on("click", "div.index > ul > li.load_more > a.pjax_load_more", function(){ var href = $(this).attr("href"); var target = $(this).closest("ul"); if ( window.history.pushState ) { var parent = $(this).parent(); parent.addClass("loading"); parent.append('
loading
'); PJAX_pjax( href, "by_load_more", target ); } return false; }); $(window).hashchange( function(){ var hash = location.hash; if( hash.indexOf( "#!/" ) != -1 ){ var href = hash.replace( /^#!\//, '' ); if( href == "" ){ var href = "https://2040fukuoka.jp/"; } PJAX_pjax( href, "", "" ); }else if(hash.indexOf( "#/" ) != -1){ hash_arr = hash.split("#/"); hash = hash_arr[1]; PJAX_hash( hash ); } }) $(window).bind('load', function() { var hash = location.hash; if( hash.indexOf( "#!/" ) != -1 ){ var href = hash.replace( /^#!\//, '' ); if ( window.history.pushState ) { window.location = href; }else{ PJAX_pjax( href, "", "" ); } } }); function scroll_trigger() { if( $("html:not(.moving) .scroll_trigger:not(.action)")[0] ){ $(".scroll_trigger:not(.action)").each(function(i){ var target = $(this); var position = target.offset().top + scroll_val; var move_y = +(position - scroll_val); var in_position = position + window_height/100; var window_bottom_position = $("body #container > div#base").scrollTop() + $(window).height(); if(in_position < window_bottom_position){ target.addClass('action'); if( target.find(".auto_fade")[0] ){ var target_elm = target.find(".auto_fade"); setTimeout(function(){ elm_fade( target_elm, 200 ); },100); } if( target.find(".textillate_wrapper")[0] ){ var target_textillate = target.find(".textillate_wrapper"); setTimeout(function(){ textillate( target_textillate, 600 ); },100); } if( target.find("iframe.pending")[0] ){ var target_iframe = target.find("iframe.pending"); setTimeout(function(){ target_iframe.removeClass("pending") target_iframe.attr("src",target_iframe.attr("data-src")); },100); } // if( target.find("video[autoplay]")[0] ){ // var target_video = target.find("video[autoplay]"); // target_video.each(function(i){ // var player = $(this).get(0); // player.play(); // }); // } } }); } } function textillate(wrapper,speed) { if( wrapper.find("span")[0] ){ wrapper.addClass("textillate"); wrapper.find("span").each(function(i){ // $(this).delay(speed*i).queue(function() { // $(this).addClass("show"); // }); $(this).delay(speed*i).queue(function() { $(this).textillate({ in: { effect: 'fadeIn', delay: 50 } }).dequeue(); }); }); } } function elm_fade( targets, delay ){ var target_num = targets.length; $(targets[0]).addClass("show"); targets.splice(0,1); if (target_num > 0) { setTimeout(function(){ elm_fade( targets, delay ); },delay); } else { return false; } } function thm_random_fade_start( target_index ){ var target_thms = target_index.find("ul > li.thm:not(.show)"); thm_random_fade( target_thms, 200 ); } function thm_random_fade( targets, delay ){ var target_num = targets.length; var random_i = Math.floor(Math.random()*target_num); $(targets[random_i]).addClass("show"); targets.splice(random_i,1); if (target_num > 0) { setTimeout(function(){ thm_random_fade( targets, delay ); },delay); } else { return false; } } function scroll_off(){ var scroll_event = 'onwheel' in document ? 'wheel' : 'onmousewheel' in document ? 'mousewheel' : 'DOMMouseScroll'; $(document).on(scroll_event,function(e){e.preventDefault();}); $(document).on('touchmove.noScroll', function(e) {e.preventDefault();}); } function scroll_on(){ var scroll_event = 'onwheel' in document ? 'wheel' : 'onmousewheel' in document ? 'mousewheel' : 'DOMMouseScroll'; $(document).off(scroll_event); $(document).off('.noScroll'); } if( id == "" ){ // scroll_off(); }else{ // scroll_on(); } var document_height = $(document).height(); var content_height = get_total_height($("#container > div#base > *")); var entry_height = get_total_height($("#entry > div.inner > *")); if( $("html.touch_device")[0] ){ if( window.innerHeight > window.innerWidth ){ var window_height = $(window).height(); }else{ var window_height = $(window).height(); } }else{ var window_height = window.innerHeight ? window.innerHeight: $(window).height(); } var window_width = $(window).width(); var window_ratio = window_height / window_width; var scroll_val = $("body #container > div#base").scrollTop(); var scroll_action_flag = true; if( $("body #container > div#base article.ground")[0] ){ scroll_action_flag = false; } if( $("body.modal")[0] ){ scroll_action_flag = false; } if( $("body.entry")[0] ){ scroll_action_flag = false; } function base_scroll() { scroll_trigger(); scroll_val = $("body #container > div#base").scrollTop(); // console.log(scroll_val+window_height+"|"+content_height); if( scroll_val+window_height > content_height - 200 ){ $("html").addClass("scrolled") $("html").addClass("scrollend") }else if( scroll_val < Math.round(window_height/4) ){ $("html").removeClass("scrolled") $("html").removeClass("scrollend") }else if( scroll_val >= Math.round(window_height/4) && scroll_val+window_height < content_height - 200 ){ $("html").addClass("scrolled") $("html").removeClass("scrollend") }else{ $("html").addClass("scrolled") $("html").addClass("scrollend") } if( $("html.iOS")[0] ){ scrollbar_height = parseInt(window_height * window_height / content_height); $('.scrollbar_thumb').css('height', scrollbar_height); var scrollbar_track = window_height - scrollbar_height; var scrollbar_offset = scroll_val * scrollbar_track / (content_height - window_height); $('.scrollbar_thumb').css('transform', 'translateY(' + scrollbar_offset + 'px)'); } if( $("article#root > article#top div.slide")[0] ){ if( scroll_val < window_height*1.5 ){ $("article#root > article#top div.slide > ul.carousel li.cell > a > div.img").css({ "transform": "matrix(1, 0, 0, 1, 0, "+ (scroll_val/4) +")" }); $("article#root > article#top div#top_navi").css({ "transform": "matrix(1, 0, 0, 1, 0, "+ (scroll_val/4) +")" }); } } if( $("body.root")[0] ){ if( scroll_val < window_height ){ $("body.root div#navi > nav").removeClass("show"); }else{ $("body.root div#navi > nav").addClass("show"); } } if( $("img.parallax")[0] ){ var window_center_y = window_height/2 + scroll_val; $("img.parallax").each(function(){ var target = $(this); var wrapper = $(this).closest(".parallax_base"); var speed_adjust = 1; if( target.attr("data-speed_adjust") != undefined ){ speed_adjust = target.attr("data-speed_adjust"); } if( target.height() <= wrapper.height() ){ target.css({"height": "120%" }); } var wrapper_y = wrapper.offset().top + scroll_val; var wrapper_center_y = wrapper_y + wrapper.height()/2; var distance = window_center_y - wrapper_center_y; var parallax_height = wrapper.height(); var img_height = target.height(); var val = img_height-parallax_height; var move_y = Math.round((val/window_height)*distance)*speed_adjust; target.css({"transform": "matrix(1, 0, 0, 1, 0, "+ move_y +")"}); }); } if( scroll_action_flag === true && $("body #container > div#base article.ground")[0] ){ scroll_action_flag = false; if( typeof scroll_action_limiter != "undefined" ){ clearTimeout( scroll_action_limiter ); } scroll_action_limiter = setTimeout( function(){ $("body #container > div#base article.ground").each(function(){ if( $(this).attr("id") != null ){ var ground_id = $(this).attr("id"); if( typeof category[ground_id] != "undefined" ){ var ground_offset = $("#" + selectorEscape( ground_id )).position().top; var ground_height = $("#" + selectorEscape( ground_id )).height(); if( scroll_val >= ground_offset && scroll_val <= ground_offset + ground_height ){ // console.log("ground_id::"+ground_id); // console.log(id); // console.log(ground_id); var href = "https://2040fukuoka.jp/" + ground_id; // console.log("do"); PJAX_pjax( href, "by_scroll", "" ); }else if( scroll_val < $("body #container > div#base article.ground").first().position().top ){ if( $("body").attr("data-scroll") != "" ){ var scroll_split = $("body").attr("data-scroll").split('/'); var ground_directory = $("body").attr("data-scroll").replace( scroll_split[scroll_split.length-1], "" ); var href = "https://2040fukuoka.jp/" + ground_directory; // console.log("top::"+href); // console.log("why"); PJAX_pjax( href, "by_scroll", "" ); } } } } }); // console.log("true"); scroll_action_flag = true; } , 1000); } } function entry_scroll() { scroll_val = $("#entry > div.inner").scrollTop(); if( $("#entry > div.inner > article")[0] ){ scroll_val = $("#entry > div.inner").scrollTop(); // console.log(scroll_val+window_height+"|"+ Number(entry_height - 200)); if( scroll_val+window_height > entry_height - 200 ){ $("html").addClass("scrolled") $("html").addClass("scrollend") }else if( scroll_val < Math.round(window_height/4) ){ $("html").removeClass("scrolled") $("html").removeClass("scrollend") }else if( scroll_val >= Math.round(window_height/4) && scroll_val+window_height < entry_height - 200 ){ $("html").addClass("scrolled") $("html").removeClass("scrollend") }else{ $("html").addClass("scrolled") $("html").addClass("scrollend") } } } function window_resize() { document_height = $(document).height(); content_height = get_total_height($("#container > div#base > *")); entry_height = get_total_height($("#entry > div.inner > *")); if( $("html.touch_device")[0] ){ if( window.innerHeight > window.innerWidth ){ window_height = $(window).height(); }else{ window_height = $(window).height(); } }else{ window_height = window.innerHeight ? window.innerHeight: $(window).height(); } window_width = $(window).width(); window_ratio = window_height / window_width; if( window_ratio > 1 ){ $("html").removeClass("horizontal"); $("html").addClass("portrait"); }else{ $("html").removeClass("portrait"); $("html").addClass("horizontal"); } if( window_ratio < 0.6 ){ $("html").addClass("panorama"); }else{ $("html").removeClass("panorama"); } $("body").css({"height": window_height}); if( $("article#root > article#top")[0] ){ $("article#root > article#top").css({"height": window_height}); } if( $("body #container > div#base > article#root > article#top > div.inner > div.slide > ul")[0] ){ var wrapper_ratio = $("body #container > div#base > article#root > article#top > div.inner > div.slide > ul").height() / $("body #container > div#base > article#root > article#top > div.inner > div.slide > ul").width(); $("body #container > div#base > article#root > article#top > div.inner > div.slide > ul li.cell").each(function(){ var target_li = $(this); var target_img = $(this).find("div.img > img"); target_img.imagesLoaded(function(){ target_img.addClass("loaded"); var img_ratio = target_img.height() / target_img.width(); target_li.removeClass("horizontal vertical"); if( wrapper_ratio < img_ratio ){ target_li.addClass("vertical"); }else{ target_li.addClass("horizontal"); } }); }); } base_scroll(); entry_scroll_bind(); entry_scroll(); } var scroll_flug = true; $("body #container > div#base").on("scroll.main",function(){ setTimeout(function(){ scroll_flug = true; }, 10); if(scroll_flug){ scroll_flug = false; base_scroll(); } }); function entry_scroll_bind(){ if( $("#entry > div.inner > article")[0] ){ $("html").removeClass("scrolled"); $("html").removeClass("scrollend"); $("#entry > div.inner").on("scroll.main",function(){ entry_scroll(); // if(scroll_flug){ // scroll_flug = false; // base_scroll(); // setTimeout(function(){ // scroll_flug = true; // return scroll_flug; // }, 50); // } }); } } entry_scroll_bind(); $(window).bind("resize", window_resize); function selectorEscape(val){ return val.replace(/\//g, '\\/'); } function video_stop(){ $("article#top > div.inner > div.video > ul > li.video_1.part").removeClass("active"); setTimeout(function(){ $("article#top > div.inner > div.video > ul > li.video_1.part > div").empty(); $("article#top > div.inner > div.video > ul > li.video_2.part").removeClass("active"); setTimeout(function(){ $("article#top > div.inner > div.video > ul > li.video_2.part > div").empty(); },1000); },1000); } function video_play(){ if( $("body.root")[0] ){ setTimeout(function(){ $("article#top > div.inner > div.video > ul > li.video_1.part").addClass("active"); create_video( $("article#top > div.inner > div.video > ul > li.video_1.part > div") , "https://2040fukuoka.jp/elements/video_01" , "video_01" ); setTimeout(function(){ $("article#top > div.inner > div.video > ul > li.video_2.part").addClass("active"); create_video( $("article#top > div.inner > div.video > ul > li.video_2.part > div") , "https://2040fukuoka.jp/elements/video_02" , "video_02" ); setTimeout(function(){ $("article#top > div.inner > div.video > ul > li.part > div > img").fadeIn(1000); },1000); },500); },4000); } // if( $("body.root")[0] ){ // setTimeout(function(){ // $("article#top > div.inner > div.video > ul > li.video_1.part").addClass("active"); // create_video( $("article#top > div.inner > div.video > ul > li.video_1.part > div") , "http://test:1111@leafbrand.co.jp/elements/video_01" , "video_01" ); // setTimeout(function(){ // $("article#top > div.inner > div.video > ul > li.video_2.part").addClass("active"); // create_video( $("article#top > div.inner > div.video > ul > li.video_2.part > div") , "http://test:1111@leafbrand.co.jp/elements/video_02" , "video_02" ); // setTimeout(function(){ // $("article#top > div.inner > div.video > ul > li.part > div > img").fadeIn(1000); // },1000); // },500); // },4000); // } } function create_video(target, video_file, target_id) { if( $("html.touch_device.iOS")[0] ) { var width = target.outerWidth(); var height = target.outerHeight(); target.append(''); setTimeout(function(){ target.parent().addClass("play"); var video = document.createElement('video'); video.style.display = 'none'; document.body.appendChild(video); var canvas = document.getElementById('video_canvas_'+target_id); $(canvas).css({"display": "block"}); var ctx = canvas.getContext("2d"); var ctime = 0; var lastTime; video.addEventListener('canplay',function(){ lastTime = Date.now(); setInterval(function(){ var curTime = Date.now(); var diff = Date.now() - lastTime; lastTime = curTime; ctime += diff/1000; video.currentTime = ctime; ctx.drawImage(video, 0, 0, width, height); if(video.duration <= video.currentTime){ ctime = 0; } }, 1000/30); },false); video.src = video_file +'.mp4?24042821'; video.load(); },1000); }else{ target.append(''); setTimeout(function(){ target.parent().addClass("play"); target.find("video").each(function(){ if( ! $(this).hasClass("play") ){ $(this).addClass("play"); $(this).get(0).play(); } }); },1000); } } function load_iframe(){ $("iframe.preload:not('.loaded')").each(function(){ $(this).load(function(){ $(this).addClass("loaded"); }); }); } load_iframe(); var start_limit = 2500; $("html").data("preloaded", 0); function preload(){ var img = [], img_arr = $("img.preload"), // ローディング対象の画像を指定 img_arr_lngth = img_arr.size(); var img_arr_lngth_total = img_arr_lngth; if( img_arr_lngth_total > 0 ){ img_arr.each(function(indx){ img[indx] = new Image(); img[indx].onload = function(){ img_arr_lngth = img_arr_lngth - 1; var progress = Math.round((1-img_arr_lngth/img_arr_lngth_total)*100); $("div.progress").stop().animate({"width": progress + "%"},1000); if( 0 >= img_arr_lngth ){ // img_load(); window_resize(); $("html").data("preloaded", 1); $("div.progress").stop().animate({"width": "100%"},1500,"easeOutQuad",function(){ setTimeout(function(){ $("div.progress").addClass("out"); var timer = getPast(); console.log(timer); $("#header").addClass("start"); if( timer > start_limit ){ preload_finish(); }else{ setTimeout(function(){ console.log(getPast()); preload_finish(); },start_limit-timer); } },200); }); } }; img[indx].src = $(this).attr('src'); }); }else{ $("html").data("preloaded", 1); $("div#progress").stop().animate({"width": "100%"},1500,"easeOutQuad",function(){ $.getScript("https://2040fukuoka.jp/js/3d.js?1707063", function(){ }); setTimeout(function(){ $("div.progress").addClass("out"); setTimeout(function(){ $("div#preloader").fadeOut(1000, function() { $(this).remove(); window_resize(); }); },2000); },200); }); } } function preload_finish(){ $("div#preloader").fadeOut(1000, function() { $(this).remove(); $("html").addClass("start"); if( $("body #container > div#base > article#root > article#top > div.inner > div.slide")[0] ) { slide_start( $("body #container > div#base > article#root > article#top > div.inner > div.slide") ); } window.FB.XFBML.parse(); }); } function img_load(){ $("img.preload:not('.loaded')").each(function(){ $(this).imagesLoaded(function(){ $(this).addClass("loaded"); window_resize(); }); }); } var watch_target = document.getElementById('base'); var article_id = ""; function watch_reflesh(){ var observer = new MutationObserver(function() { article_id = $("body #container > div#base > article:not(.leave)").attr("id"); if( article_id == "login/" && $("#login_complete")[0] ){ var href = "https://2040fukuoka.jp/accounts/"; PJAX_pjax( href, "", "" ); } }); observer.observe(watch_target, { childList: true, subtree: true }); } $("body #header > header > h1 > a > img").imagesLoaded(function(){ if( $("#preloader")[0] ){ $("div#preloader > div.bg").addClass("show"); preload(); getPast(); setTimeout(function(){ $("#header > header > h1 > div.area > div.circle").addClass("show"); },1000); } }); $(window).bind('load', function() { if( $("#preloader")[0] ){ img_load(); // window_resize(); if( $("body #container > div#base article.ground")[0] ){ var target = $("#" + selectorEscape($("body").attr("data-scroll"))); if( target[0] ){ var val = target.position().top; scrollto(val); }else{ scroll_action_flag = true; } } watch_reflesh(); } }); function rnd(n){ return Math.floor(Math.random()*(n+1)); } function slide_switch(target_wrapper, past_target, next_target) { var next_id = next_target.attr("id"); target_wrapper.children("ul.dots").find("li").removeClass("active"); var next_dot = target_wrapper.find("."+next_id).addClass("active"); if( past_target != "" ){ past_target.addClass("pending active"); } img_url = next_target.find("div.img").attr("data-img-url"); next_target.find("div.img > img").imagesLoaded(function(){ next_target.addClass("active"); if( past_target != "" ){ setTimeout(function(){ past_target.removeClass("pending active"); },500); } slide_repeat(target_wrapper); }); next_target.find("div.img > img").attr("src", img_url); } function slide_repeat(target_wrapper) { var max_num = target_wrapper.find("ul.carousel > li.cell").length; if( typeof timerId_slide != "undefined" ){ clearTimeout(timerId_slide); } timerId_slide = setTimeout(function(){ if( max_num > 1 ){ var past_target = target_wrapper.find("ul.carousel > li.cell.active"); var next_target = ""; if( past_target.next("li")[0] ){ next_target = past_target.next("li"); }else{ next_target = target_wrapper.find("ul.carousel > li.cell").first(); } slide_switch(target_wrapper, past_target, next_target); }else{ clearTimeout(timerId_slide); } },6000); } function slide_start(target_wrapper) { target_wrapper.addClass("active"); target_wrapper.append('
    '); target_wrapper.find("ul.carousel > li.cell").each(function(i){ var set_class = $(this).attr("id"); target_wrapper.children("ul.dots").append('
  • '); }); var max_num = target_wrapper.find("ul.carousel > li.cell").length; var first_target = target_wrapper.find("ul.carousel > li.cell").eq(rnd(max_num-1)); // var first_target = target_wrapper.find("ul.carousel > li.cell").eq(0); var img_url = first_target.find("div.img").attr("data-img-url"); first_target.find("div.img > img").imagesLoaded(function(){ slide_switch(target_wrapper, "", first_target); slide_repeat(target_wrapper); }); first_target.find("div.img > img").attr("src", img_url); target_wrapper.children("ul.dots").find("li").click(function(){ if( !$(this).hasClass("active") ){ var past_target = target_wrapper.find("ul.carousel > li.cell.active"); var next_target = target_wrapper.find("ul.carousel > li.cell#"+$(this).attr("class")); slide_switch(target_wrapper, past_target, next_target); } }) } $(document).on("click", "article#root > article#top div.slide > ul.carousel > li.cell > a[data-link-to-flag='media']", function(){ return false; }); $(document).on("click", "div.list.faq > div.media_list > dl > dt.over", function() { $(this).next("dd").slideToggle(); return false; }); function get_total_height(elms) { var total_height = 0; elms.each(function(i){ var height = $(this).outerHeight(true); total_height += height; }); return total_height; } function PJAX_hash( hash ) { if( $("[data-scrollto='"+hash+"']")[0] ){ var val = $("[data-scrollto='"+hash+"']").first().position().top - 120; scrollto(val); } } $(document).on("click", "article#root > article#top a.arrow_scroll, body #header > header > h1 > a", function(){ scrollto(window_height); return false; }); var getPast = (function() { var lastDate = NaN; return function() { var now = Date.now(); var past = now - lastDate; lastDate = now; return past; }; })(); });