2021-04-01 02:19:27 +00:00
|
|
|
document.addEventListener("DOMContentLoaded",()=>{function t(){window.scrollTo({top:0,behavior:"smooth"}),$(".joe_wallpaper__list").html(""),l=!0,$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"wallpaper_list",cid:e.cid,start:e.start,count:e.count},success(t){if(1!==t.code)return l=!1;l=!1;let e="";t.data.forEach(t=>{e+=`\n <a class="item animated bounceIn" data-fancybox="gallery" href="${t.url}">\n <img width="100%" height="100%" class="lazyload" src="${Joe.LAZY_LOAD}" data-src="${t.img_1024_768||t.url}" onerror="javascript: this.src = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='" alt="壁纸">\n </a>`}),$(".joe_wallpaper__list").html(e),i=t.total,a()}})}function a(){let t="";e.start/e.count!=0&&(t+=`\n <li class="joe_wallpaper__pagination-item" data-start="0">首页</li>\n <li class="joe_wallpaper__pagination-item" data-start="${e.start-e.count}">\n <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="12" height="12"><path d="M822.272 146.944l-396.8 396.8c-19.456 19.456-51.2 19.456-70.656 0-18.944-19.456-18.944-51.2 0-70.656l396.8-396.8c19.456-19.456 51.2-19.456 70.656 0 18.944 19.456 18.944 45.056 0 70.656z"/><path d="M745.472 940.544l-396.8-396.8c-19.456-19.456-19.456-51.2 0-70.656 19.456-19.456 51.2-19.456 70.656 0l403.456 390.144c19.456 25.6 19.456 51.2 0 76.8-26.112 19.968-51.712 19.968-77.312.512zm-564.224-63.488c0-3.584 0-7.68.512-11.264h-.512v-714.24h.512c-.512-3.584-.512-7.168-.512-11.264 0-43.008 21.504-78.336 48.128-78.336s48.128 34.816 48.128 78.336c0 3.584 0 7.68-.512 11.264h.512v714.24h-.512c.512 3.584.512 7.168.512 11.264 0 43.008-21.504 78.336-48.128 78.336s-48.128-35.328-48.128-78.336z"/></svg>\n </li>\n <li class="joe_wallpaper__pagination-item" data-start="${e.start-e.count}">${Math.ceil(e.start/e.count)}</li>\n `),t+=`<li class="joe_wallpaper__pagination-item active">${Math.ceil(e.start/e.count)+1}</li>`,e.start!=i-e.count&&(t+=`\n <li class="joe_wallpaper__pagination-item" data-start="${e.start+e.count}">${Math.ceil(e.start/e.count)+2}</li>\n <li class="joe_wallpaper__pagination-item" data-start="${e.start+e.count}">\n <svg class="next" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="12" height="12"><path d="M822.272 146.944l-396.8 396.8c-19.456 19.456-51.2 19.456-70.656 0-18.944-19.456-18.944-51.2 0-70.656l396.8-396.8c19.456-19.456 51.2-19.456 70.656 0 18.944 19.456 18.944 45.056 0 70.656z"/><path d="M745.472 940.544l-396.8-396.8c-19.456-19.456-19.456-51.2 0-70.656 19.456-19.456 51.2-19.456 70.656 0l403.456 390.144c19.456 25.6 19.456 51.2 0 76.8-26.112 19.968-51.712 19.968-77.312.512zm-564.224-63.488c0-3.584 0-7.68.512-11.264h-.512v-714.24h.512c-.512-3.584-.512-7.168-.512-11.264 0-43.008 21.504-78.336 48.128-78.336s48.128 34.816 48.128 78.336c0 3.584 0 7.68-.512 11.264h.512v714.24h-.512c.512 3.584.512 7.168.512 11.264 0 43.008-21.504 78.336-48.128 78.336s-48.128-35.328-48.128-78.336z"/></svg>\n </li>\n `),e.start<i-e.count&&(t+=`<li class="joe_wallpaper__pagination-item" data-start="${i-e.count}">末页</li>`),$(".joe_wallpaper__pagination").html(t)}let l=!1,e={cid:-999,start:-999,count:48},i=-999;$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"wallpaper_type"},success(t){if(1!==t.code)return $(".joe_wallpaper__type-list").html('<li class="error">壁纸抓取失败!请联系作者!</li>');if(!t.data.length)return $(".joe_wallpaper__type-list").html('<li class="error">暂无数据!</li>');let a="";t.data.forEach(t=>a+=`<li class="item animated swing" data-cid="${t.id}">${t.name}</li>`),$(".joe_wallpaper__type-list").html(a),$(".joe_wallpaper__type-list .item").first().click()}}),$(".joe_wallpaper__type-list").on("click",".item",function(){const a=$(this).attr("data-cid");l||($(this).addClass("active").siblings().removeClass("active"),e.cid=a,e.star
|