Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
azure2870 authored Nov 25, 2024
1 parent 7faf0b2 commit 2fdc40a
Showing 1 changed file with 56 additions and 52 deletions.
108 changes: 56 additions & 52 deletions static/main.js
Original file line number Diff line number Diff line change
@@ -1,80 +1,84 @@

var windowWidth = $(window).width();
layer.config({
extend: 'homepage/style.css', //加载扩展样式
skin: 'layer-ext-kisou'
extend: "kzhomepage/style.css", //加载扩展样式
skin: "layer-ext-kzhomepage",
});

// Nav buttons
$('.kisou-nav-btn').on('click', function() {
$(".kz-nav-btn").on("click", function () {
let btn = $(this);
let type = btn.data('window') // pop current newtab
let content = btn.data('href')
let type = btn.data("window"); // pop current newtab
let content = btn.data("href");
switch (type) {
case 'pop':
let title = btn.data('title')
let shadeClose = btn.data('shade') === 'true' ? false : true
let anim = btn.data('anim') ? btn.data('anim')*1 : 4
let area_w = btn.data('area-w') ? btn.data('area-w') : '80%'
let area_h = btn.data('area-h') ? btn.data('area-h') : '90%'
case "pop":
let title = btn.data("title");
let shadeClose = btn.data("shade") === "true" ? false : true;
let anim = btn.data("anim") ? btn.data("anim") * 1 : 4;
let area_w = btn.data("area-w") ? btn.data("area-w") : "80%";
let area_h = btn.data("area-h") ? btn.data("area-h") : "90%";
layer.open({
type: 2,
title: title,
shadeClose: shadeClose,
anim:anim,
closeBtn: 2,
isOutAnim: false,
area: [area_w, area_h],
content: content
type: 2,
title: title,
shadeClose: shadeClose,
anim: anim,
closeBtn: 2,
isOutAnim: false,
area: [area_w, area_h],
content: content,
});
break;
case 'current':
window.location = content
case "current":
window.location = content;
break;
case 'newtab':
window.open('_blank').location = content
case "newtab":
window.open("_blank").location = content;
break;
}
});

// 兼容旧版
if(meting_music_api===""){
meting_api = "https://api.mizore.cn/meting/api.php";
}
var meting_api =
"https://api.mizore.cn/meting/api.php?server=:server&type=:type&id=:id";
console.log(
"\n" +
" %c KZHomePage v1.2.0 by kaygb " +
" %c https://blog.170601.xyz/archives/25.html " +
"\n" +
"\n",
"color: #fff; background: #fd79a8; padding:5px 0;",
"background: #FFF; padding:5px 0;"
);

$.ajax({
// url: "https://api.mizore.cn/meting/api.php?server=netease&type=playlist&id=20173709",
url: meting_music_api,
data:{
data: {
server: music_server,
type: music_type,
id: music_id
id: music_id,
},
dataType: "json",
success: function (audio) {
const ap = new APlayer({
container: music_fixed === false ? document.getElementById('aplayer-inner') : document.getElementById('aplayer-fixed') ,
audio: audio,
fixed: music_fixed === false ? false : true,
autoplay: music_autoplay,
order: music_order,
listFolded :true,
volum: music_volume,
mini: music_fixed === true ? true:music_mini,
lrcType: 3,
preload:"auto",
loop: music_loop
container:
music_fixed === false
? document.getElementById("aplayer-inner")
: document.getElementById("aplayer-fixed"),
audio: audio,
fixed: music_fixed === false ? false : true,
autoplay: music_autoplay,
order: music_order,
listFolded: true,
volum: music_volume,
mini: music_fixed === true ? true : music_mini,
lrcType: 3,
preload: "auto",
loop: music_loop,
});
},
});

fetch('https://v1.hitokoto.cn')
.then(response => response.json())
.then(data => {
const hitokoto = document.getElementById('hitokoto')
hitokoto.href = 'https://hitokoto.cn/?uuid=' + data.uuid
hitokoto.innerText = data.hitokoto
})
.catch(console.error)
fetch(hitokoto_api)
.then((response) => response.json())
.then((data) => {
const hitokoto = document.getElementById("hitokoto_text");
hitokoto.href = "https://hitokoto.cn/?uuid=" + data.uuid;
hitokoto.innerText = data.hitokoto;
})
.catch(console.error);

0 comments on commit 2fdc40a

Please sign in to comment.