$(function(){
var data = $.cookie("over18");
var opt = {
hashTracking: false,
closeOnOutsideClick: false,
closeOnCancel:false,
closeOnEscape:false,
modifier: "with-dot"
};
// $('body').append('
');
if(!data){
var inst = $('[data-remodal-id=auth]').remodal(opt);
inst.open();
}else{
}
$("#enterSP").on('click', 'img', function(event) {
event.preventDefault();
inst.close();
setCookie();
});
$("#enterSIMPLE").on('click', 'a', function(event) {
event.preventDefault();
window.location.href = '../simple/';
setCookie();
});
$("#toPC").on('click', 'a', function(event) {
event.preventDefault();
setCookie();
});
var magazine = $('[data-remodal-id=magazine]').remodal(opt);
$(document).on("click",".popmagazine", function(e){
e.preventDefault();
magazine.open();
});
$(document).on("click",".fnc_cls", function(e){
data = $.cookie("over18");
e.preventDefault();
magazine.close();
if(!data){
var inst = $('[data-remodal-id=auth]').remodal(opt);
inst.open();
}
});
/* urlのパラメータをレスポンシブ対応
------------------------------------------------------------*/
var src = $("#cityWIG").attr("src");
const cityurl = new URL(src);
var fs;
const mediaQueryList = window.matchMedia("(max-width:428px)");
const listener = (event) => {
if (event.matches) {
fs = 12;
// console.log('SP用ブレークポイント用処理');
} else {
fs = 14;
// console.log('PC用ブレークポイント用処理');
}
cityurl.searchParams.set("fontsize", fs);
$("#cityWIG").attr("src",cityurl.href);
};
// mediaQueryList.addEventListener("change", listener);
mediaQueryList.addListener(listener);
listener(mediaQueryList);
});
function setCookie (){
var clifetime = new Date();
clifetime.setTime(clifetime.getTime()+(2*60*60*1000));//2時間
$.cookie('over18', true, { expires: clifetime , path: '/'});
}