';
$(selector).html(html);
obj.isLoading = false;
obj.preload();
var owlRelated = $('#' + obj.renderTo+'-slider');
var owlRelatedOptions = {
loop: false,
margin: 16,
smartSpeed: 700,
nav: true,
dots: false,
navText: [
"
"
],
responsive:{
0: {
items: 2,
},
400: {
items: 3,
},
667: {
items: 4,
},
992: {
items: 5,
},
},
stagePadding: 50
};
owlRelated.owlCarousel(owlRelatedOptions);
checkLastItem(owlRelated);
owlRelated.on('translated.owl.carousel', function(event) {
checkLastItem(owlRelated);
});
} else {
if (sv == 'video') {
var textSearch = obj.reqParams.search ? obj.reqParams.search : '';
if(textSearch.length > 5) textSearch = textSearch.substring(0, 5) + '...';
var linktoVideoAC = 'https://video-ac.com/';
var html = '
';
if (isLogin) {
html += '
動画AC
';
} else {
html += '
動画ACの
「'+textSearch+'」のおすすめ動画
';
}
var lengthlimitData = obj.reqParams.limit > 6 ? obj.reqParams.limit - 1 : obj.reqParams.limit;
} else {
var textSearch = obj.reqParams.tags ? obj.reqParams.tags : '';
if(textSearch.length > 5) textSearch = textSearch.substring(0, 5) + '...';
var linktoDesignAC = 'https://www.design-ac.net';
var html = '
';
if (isLogin) {
html += '
デザインAC
';
} else {
html += '
デザインACの
「'+textSearch+'」のおすすめテンプレート
';
}
var lengthlimitData = obj.reqParams.max_results > 6 ? obj.reqParams.max_results - 1 : obj.reqParams.max_results;
}
for (var i = 0; i < cnt && i < lengthlimitData; i++) {
var detailUrl = data[i].detail_url;
if (sv == 'video') {
var id = data[i].id;
var thumbnail = 'https://media.video-ac.com/' + data[i]["pv_216"] + '.jpg';
var featuredImage = 'https://media.video-ac.com/' + data[i]["pv_540"] + '.jpg';
} else {
var id = data[i].id;
var thumbnail = data[i].thumbnail_url;
var requestModalURL = '/main/dl_info_' + sv + '.php?id=' + id + '&thumbnail=' + thumbnail;
detailUrl = data[i].detail_url + '?src=photo_ac_download_page_similar';
}
html += '
';
html += '
';
html += '
';
html += '';
html += '
';
html += '
';
}
if (isset(more_link)) {
if (isLogin) {
let text_attach = '
もっと見る
';
html += '
';
} else {
let text_service = (sv == 'video') ? '動画' : 'デザイン';
let text_attach = '
'+ textSearch +'の'+ text_service +'をもっと見る'+'
';
html += '
';
}
}
html += '
';
$(selector).html(html);
obj.isLoading = false;
obj.preload();
}
} else {
$(selector).html('
' + obj.emptyMessage + '
');
obj.isLoading = false;
obj.preload();
}
}
function callback(data, obj)
{
var html = '';
if(data.items != null && data.items.length > 0){
var cnt = data.items.length;
const cdn_domain = 'https://thumb.photo-ac.com';
html += '
';
for(var i=0; i')}`;
}
html += '
';
obj.isLoading = false;
obj.preload();
var selector = '#' + obj.renderTo;
$(selector).html(html);
triggerPhotoRelatedSlider();
$('.row-list-flex-top-items').flexImages({rowHeight: 250,truncate: 1});
$('#photo-related-slider .owl-prev').attr('aria-label', '前のデザイン');
$('#photo-related-slider .owl-next').attr('aria-label', '次のデザイン');
return;
} else {
obj.isLoading = false;
obj.preload();
var selector = '#' + obj.renderTo;
$(selector).html('
' + obj.emptyMessage + '
');
}
}
function anotherCallback(data, obj)
{
if(data.items != null && data.items.length > 0){
if ( window.innerWidth < 1555 ) {
triggerSliderAnotherRelated(data, obj);
} else {
renderAnotherRelated(data, obj);
}
} else {
obj.isLoading = false;
obj.preload();
var selector = '#' + obj.renderTo;
$(selector).html('
' + obj.emptyMessage + '
');
}
}
function renderAnotherRelated(data, obj) {
var search_by = data.search_by;
var textSearch = obj.reqParams.q ? obj.reqParams.q : '';
if(textSearch.length > 5) textSearch = textSearch.substring(0, 5) + '...';
var linktoillust = 'https://www.ac-illust.com';
var linktoslh = 'https://www.silhouette-ac.com';
var html = '
';
html += '
';
if (isLogin) {
if (obj.tbParams.sv == "illust") {
html += '
イラストAC
';
} else {
html += '
シルエットAC
';
}
} else {
if (obj.tbParams.sv == "illust") {
html += '
イラストACの
「'+textSearch+'」のおすすめイラスト
';
} else {
html += '
シルエットACの
「'+textSearch+'」のおすすめシルエット
';
}
}
html += '
';
var lengthlimitData = obj.reqParams.pp > 6 ? obj.reqParams.pp - 1 : obj.reqParams.pp;
for (var i = 0; i < data.items.length && i < lengthlimitData; i++) {
var tb_query = '';
var filename = isset(data.items[i]['filename']) ? data.items[i]['filename'] : '';
if (obj.reqParams) {
if (obj.reqParams.height == '') {
delete obj.reqParams.height;
}
tb_query = '&' + getQueryString(obj.reqParams);
filename = isset(data.items[i]['watermarked_img']) ? encodeURI(data.items[i]['watermarked_img']) : filename;
}
html += '
';
html += '
';
if (obj.tbParams.sv == "illust") {
html += '
';
html += '';
} else {
html += '
';
html += '';
}
html += '
';
html += '
';
}
let see_more_text = '';
var title = Object.values(obj.reqParams.q).join('');
var more_link = '';
var type_site = obj.tbParams.sv;
if (search_by === 'recommendation') {
if (Object.keys(obj.reqParams.q).length > 0) {
more_link = (type_site === 'illust') ? illust_domain + '/search/ris.php?object_token=' + filenameDetail + '&search_word=' + title : sil_domain + '/ris.php?object_token=' + filenameDetail + '&sw=' + title;
} else {
title = obj.reqParams.more_text;
more_link = (type_site === 'illust') ? illust_domain + '/search/ris.php?object_token=' + filenameDetail + '&search_word=' + title : sil_domain + '/ris.php?object_token=' + filenameDetail + '&sw=' + title;
}
if (isLogin) {
let text_attach = '
もっと見る
';
html += '
';
} else {
if (obj.tbParams.sv == "illust") {
let text_attach = '
'+textSearch+'のイラストをもっと見る'+'
';
html += '
';
} else {
let text_attach = '
'+textSearch+'のシルエットをもっと見る'+'
';
html += '
';
}
}
} else {
if (isLogin) {
let text_attach = '
もっと見る
';
html += '
';
} else {
if (obj.tbParams.sv == "illust") {
let text_attach = '
'+textSearch+'のイラストをもっと見る'+'
';
html += '
';
} else {
let text_attach = '
'+textSearch+'のシルエットをもっと見る'+'
';
html += '
';
}
}
}
html += '
';
obj.isLoading = false;
obj.preload();
var selector = '#' + obj.renderTo;
$(selector).html(html);
}
function triggerSliderAnotherRelated(data, obj) {
var html = '
';
for (var i = 0; i < data.items.length; i++) {
var tb_query = '';
var filename = isset(data.items[i]['filename']) ? data.items[i]['filename'] : '';
if (obj.tbParams) {
if (obj.tbParams.height == '') {
delete obj.tbParams.height;
}
tb_query = '&' + getQueryString(obj.tbParams);
filename = isset(data.items[i]['watermarked_img']) ? encodeURI(data.items[i]['watermarked_img']) : filename;
}
html += '
';
}
html += '
';
obj.isLoading = false;
obj.preload();
var selector = '#' + obj.renderTo;
$(selector).html(html);
var owlRelated = $('#' + obj.renderTo+'-slider');
var owlRelatedOptions = {
loop: false,
margin: 16,
smartSpeed: 700,
nav: true,
dots: false,
navText: [
"
",
"
"
],
responsive:{
0: {
items: 2,
},
400: {
items: 3,
},
667: {
items: 4,
},
992: {
items: 5,
},
},
stagePadding: 50
};
owlRelated.owlCarousel(owlRelatedOptions);
checkLastItem(owlRelated);
owlRelated.on('translated.owl.carousel', function(event) {
checkLastItem(owlRelated);
});
}
function init(){
$(document).on('click','.youtube',function(e){
e.preventDefault();
jQuery('#youtubeModal .modal-body').html('
');
jQuery('#youtubeModal iframe').attr('src', $(this).attr('href') );
$("#youtubeModal").modal('show');
});
}
function owl2RowsSliderFunc() {
(function ($, window, document, undefined) {
Owl2row = function (scope) {
this.owl = scope;
this.owl.options = $.extend({}, Owl2row.Defaults, this.owl.options);
this.handlers = {
'initialize.owl.carousel': $.proxy(function (e) {
if (this.owl.settings.owl2row) {
this.build2row(this);
}
}, this)
};
this.owl.$element.on(this.handlers);
};
Owl2row.Defaults = {
owl2row: false,
owl2rowTarget: 'item',
owl2rowContainer: 'owl2row-item',
owl2rowDirection: 'utd'
};
Owl2row.prototype.build2row = function(thisScope){
var carousel = $(thisScope.owl.$element);
var carouselItems = carousel.find('.' + thisScope.owl.options.owl2rowTarget);
var aEvenElements = [];
var aOddElements = [];
$.each(carouselItems, function (index, item) {
if ( index % 2 === 0 ) {
aEvenElements.push(item);
} else {
aOddElements.push(item);
}
});
carousel.empty();
switch (thisScope.owl.options.owl2rowDirection) {
case 'ltr':
thisScope.leftToright(thisScope, carousel, carouselItems);
break;
default :
thisScope.upTodown(thisScope, aEvenElements, aOddElements, carousel);
}
};
Owl2row.prototype.leftToright = function(thisScope, carousel, carouselItems){
var o2wContainerClass = thisScope.owl.options.owl2rowContainer;
var owlMargin = thisScope.owl.options.margin;
var carouselItemsLength = carouselItems.length;
var firsArr = [];
var secondArr = [];
if (carouselItemsLength %2 === 1) {
carouselItemsLength = ((carouselItemsLength - 1)/2) + 1;
} else {
carouselItemsLength = carouselItemsLength/2;
}
$.each(carouselItems, function (index, item) {
if (index < carouselItemsLength) {
firsArr.push(item);
} else {
secondArr.push(item);
}
});
$.each(firsArr, function (index, item) {
var rowContainer = $('
');
var firstRowElement = firsArr[index];
firstRowElement.style.marginBottom = owlMargin + 'px';
rowContainer
.append(firstRowElement)
.append(secondArr[index]);
carousel.append(rowContainer);
});
};
Owl2row.prototype.upTodown = function(thisScope, aEvenElements, aOddElements, carousel){
var o2wContainerClass = thisScope.owl.options.owl2rowContainer;
var owlMargin = thisScope.owl.options.margin;
$.each(aEvenElements, function (index, item) {
var rowContainer = $('
');
var evenElement = aEvenElements[index];
evenElement.style.marginBottom = owlMargin + 'px';
rowContainer
.append(evenElement)
.append(aOddElements[index]);
carousel.append(rowContainer);
});
};
Owl2row.prototype.destroy = function() {
var handler, property;
for (handler in this.handlers) {
this.owl.dom.$el.off(handler, this.handlers[handler]);
}
for (property in Object.getOwnPropertyNames(this)) {
typeof this[property] !== 'function' && (this[property] = null);
}
};
$.fn.owlCarousel.Constructor.Plugins['owl2row'] = Owl2row;
})( window.Zepto || window.jQuery, window, document );
$('#owl2RowsSlider').owlCarousel({
loop: false,
autoplay: false,
owl2row: true,
margin: 12,
items: 3,
nav: true,
dots: false,
stagePadding: 50,
smartSpeed: 400,
responsive: {
1: {
items: 1,
slideBy: 1
},
480: {
items: 2,
slideBy: 2
},
768: {
items: 2,
slideBy: 2
},
1024: {
items: 1,
slideBy: 1
},
1200: {
items: 2,
slideBy: 2
},
1440: {
items: 3,
slideBy: 3
}
},
navText: [
"
",
"
"
],
});
}
owl2RowsSliderFunc();
function triggerPhotoRelatedSlider() {
var photoRelatedSlider = $("#photo-related-slider");
photoRelatedSlider.owlCarousel({
margin: 8,
loop: false,
// autoplay: true,
autoplaySpeed: 1000,
autoplayTimeout: 3000,
dots: false,
nav: true,
navText: [
"
",
"
"
],
responsive:{
0: {
items: 2,
},
400: {
items: 3,
},
667: {
items: 4,
},
992: {
items: 5,
},
1024: {
items: 6,
},
1280: {
items: 7,
}
},
stagePadding: 50
});
checkLastItem(photoRelatedSlider);
photoRelatedSlider.on('translated.owl.carousel', function(event) {
checkLastItem(photoRelatedSlider);
});
}
function checkLastItem(selector){
selector.find('.owl-item img, .owl-item iframe').css('filter', 'blur(1.5px)');
selector.find('.owl-item.active img, .owl-item.active iframe').css('filter', 'unset');
if(selector.find('.owl-item.active').length != 3){
selector.find('.owl-item.active').next().find('img, iframe').css('filter', 'unset');
}
}
triggerDesignAcSlider();
function triggerDesignAcSlider() {
var designAcSlider = $("#photo-template-desgin-ac-slider");
designAcSlider.owlCarousel({
margin: 16,
loop: false,
lazyLoad:true,
autoplaySpeed: 1000,
autoplayTimeout: 3000,
autoWidth:true,
dots: false,
nav: true,
navText: [
"
",
"
"
],
});
designAcSlider.on('translated.owl.carousel', function(event) {
checkLastItem(designAcSlider);
});
}
$(document).ready(init);
window.lazyFunctions = {
executePhoto: (element) => searchItems(search, 'photo_related_tag'),
executeIllust: (element) => searchItems(search_ill, 'illust'),
executeSilhouette: (element) => searchItems(search_slh, 'silhouette'),
executeVideo: (element) => searchVideo(search_video, 'video'),
executeDesign: (element) => searchVideo(design_search, 'design')
};
素敵な無料写真を提供してくれた「ハルハルP」さんに応援のコメントを贈ろう!
素材の使用範囲や、使用方法など写真ACへのお問い合せについては、こちらのヘルプセンターをご確認ください。