初始化

This commit is contained in:
2025-03-15 10:31:07 +08:00
commit c01915af62
20 changed files with 551 additions and 0 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
static/Meting.min.js vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";function _objectSpread(a){for(var b=1;b<arguments.length;b++){var c=null==arguments[b]?{}:arguments[b],d=Object.keys(c);"function"==typeof Object.getOwnPropertySymbols&&(d=d.concat(Object.getOwnPropertySymbols(c).filter(function(a){return Object.getOwnPropertyDescriptor(c,a).enumerable}))),d.forEach(function(b){_defineProperty(a,b,c[b])})}return a}function _defineProperty(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}class MetingJSElement extends HTMLElement{connectedCallback(){window.APlayer&&window.fetch&&(this._init(),this._parse())}disconnectedCallback(){this.lock||this.aplayer.destroy()}_camelize(a){return a.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(a,b)=>b.toUpperCase())}_init(){let a={};for(let b=0;b<this.attributes.length;b+=1)a[this._camelize(this.attributes[b].name)]=this.attributes[b].value;let b=["server","type","id","api","auth","auto","lock","name","title","artist","author","url","cover","pic","lyric","lrc"];this.meta={};for(var c=0;c<b.length;c++){let d=b[c];this.meta[d]=a[d],delete a[d]}this.config=a,this.api=this.meta.api||window.meting_api||"https://api.i-meto.com/meting/api?server=:server&type=:type&id=:id&r=:r",this.meta.auto&&this._parse_link()}_parse_link(){let a=[["music.163.com.*song.*id=(\\d+)","netease","song"],["music.163.com.*album.*id=(\\d+)","netease","album"],["music.163.com.*artist.*id=(\\d+)","netease","artist"],["music.163.com.*playlist.*id=(\\d+)","netease","playlist"],["music.163.com.*discover/toplist.*id=(\\d+)","netease","playlist"],["y.qq.com.*song/(\\w+).html","tencent","song"],["y.qq.com.*album/(\\w+).html","tencent","album"],["y.qq.com.*singer/(\\w+).html","tencent","artist"],["y.qq.com.*playsquare/(\\w+).html","tencent","playlist"],["y.qq.com.*playlist/(\\w+).html","tencent","playlist"],["xiami.com.*song/(\\w+)","xiami","song"],["xiami.com.*album/(\\w+)","xiami","album"],["xiami.com.*artist/(\\w+)","xiami","artist"],["xiami.com.*collect/(\\w+)","xiami","playlist"]];for(var b=0;b<a.length;b++){let c=a[b],d=new RegExp(c[0]),e=d.exec(this.meta.auto);if(null!==e)return this.meta.server=c[1],this.meta.type=c[2],void(this.meta.id=e[1])}}_parse(){if(this.meta.url){let a={name:this.meta.name||this.meta.title||"Audio name",artist:this.meta.artist||this.meta.author||"Audio artist",url:this.meta.url,cover:this.meta.cover||this.meta.pic,lrc:this.meta.lrc||this.meta.lyric||"",type:this.meta.type||"auto"};return a.lrc||(this.meta.lrcType=0),this.innerText&&(a.lrc=this.innerText,this.meta.lrcType=2),void this._loadPlayer([a])}let a=this.api.replace(":server",this.meta.server).replace(":type",this.meta.type).replace(":id",this.meta.id).replace(":auth",this.meta.auth).replace(":r",Math.random());fetch(a).then(a=>a.json()).then(a=>this._loadPlayer(a))}_loadPlayer(a){let b={audio:a,mutex:!0,lrcType:this.meta.lrcType||3,storageName:"metingjs"};if(a.length){let a=_objectSpread({},b,this.config);for(let b in a)("true"===a[b]||"false"===a[b])&&(a[b]="true"===a[b]);let c=document.createElement("div");a.container=c,this.appendChild(c),this.aplayer=new APlayer(a)}}}console.log("\n %c MetingJS v2.0.1 %c https://github.com/metowolf/MetingJS \n","color: #fadfa3; background: #030307; padding:5px 0;","background: #fadfa3; padding:5px 0;"),window.customElements&&!window.customElements.get("meting-js")&&(window.MetingJSElement=MetingJSElement,window.customElements.define("meting-js",MetingJSElement));

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
/*! layer mobile-v2.0.0 Web 通用弹出层组件 MIT License */
;!function(e){"use strict";var t=document,n="querySelectorAll",i="getElementsByClassName",a=function(e){return t[n](e)},s={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},l={extend:function(e){var t=JSON.parse(JSON.stringify(s));for(var n in e)t[n]=e[n];return t},timer:{},end:{}};l.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var r=0,o=["layui-m-layer"],c=function(e){var t=this;t.config=l.extend(e),t.view()};c.prototype.view=function(){var e=this,n=e.config,s=t.createElement("div");e.id=s.id=o[0]+r,s.setAttribute("class",o[0]+" "+o[0]+(n.type||0)),s.setAttribute("index",r);var l=function(){var e="object"==typeof n.title;return n.title?'<h3 style="'+(e?n.title[1]:"")+'">'+(e?n.title[0]:n.title)+"</h3>":""}(),c=function(){"string"==typeof n.btn&&(n.btn=[n.btn]);var e,t=(n.btn||[]).length;return 0!==t&&n.btn?(e='<span yes type="1">'+n.btn[0]+"</span>",2===t&&(e='<span no type="0">'+n.btn[1]+"</span>"+e),'<div class="layui-m-layerbtn">'+e+"</div>"):""}();if(n.fixed||(n.top=n.hasOwnProperty("top")?n.top:100,n.style=n.style||"",n.style+=" top:"+(t.body.scrollTop+n.top)+"px"),2===n.type&&(n.content='<i></i><i class="layui-m-layerload"></i><i></i><p>'+(n.content||"")+"</p>"),n.skin&&(n.anim="up"),"msg"===n.skin&&(n.shade=!1),s.innerHTML=(n.shade?"<div "+("string"==typeof n.shade?'style="'+n.shade+'"':"")+' class="layui-m-layershade"></div>':"")+'<div class="layui-m-layermain" '+(n.fixed?"":'style="position:static;"')+'><div class="layui-m-layersection"><div class="layui-m-layerchild '+(n.skin?"layui-m-layer-"+n.skin+" ":"")+(n.className?n.className:"")+" "+(n.anim?"layui-m-anim-"+n.anim:"")+'" '+(n.style?'style="'+n.style+'"':"")+">"+l+'<div class="layui-m-layercont">'+n.content+"</div>"+c+"</div></div></div>",!n.type||2===n.type){var d=t[i](o[0]+n.type),y=d.length;y>=1&&layer.close(d[0].getAttribute("index"))}document.body.appendChild(s);var u=e.elem=a("#"+e.id)[0];n.success&&n.success(u),e.index=r++,e.action(n,u)},c.prototype.action=function(e,t){var n=this;e.time&&(l.timer[n.index]=setTimeout(function(){layer.close(n.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),layer.close(n.index)):e.yes?e.yes(n.index):layer.close(n.index)};if(e.btn)for(var s=t[i]("layui-m-layerbtn")[0].children,r=s.length,o=0;o<r;o++)l.touch(s[o],a);if(e.shade&&e.shadeClose){var c=t[i]("layui-m-layershade")[0];l.touch(c,function(){layer.close(n.index,e.end)})}e.end&&(l.end[n.index]=e.end)},e.layer={v:"2.0",index:r,open:function(e){var t=new c(e||{});return t.index},close:function(e){var n=a("#"+o[0]+e)[0];n&&(n.innerHTML="",t.body.removeChild(n),clearTimeout(l.timer[e]),delete l.timer[e],"function"==typeof l.end[e]&&l.end[e](),delete l.end[e])},closeAll:function(){for(var e=t[i](o[0]),n=0,a=e.length;n<a;n++)layer.close(0|e[0].getAttribute("index"))}},"function"==typeof define?define(function(){return layer}):function(){var e=document.scripts,n=e[e.length-1],i=n.src,a=i.substring(0,i.lastIndexOf("/")+1);n.getAttribute("merge")||document.head.appendChild(function(){var e=t.createElement("link");return e.href=a+"need/layer.css?2.0",e.type="text/css",e.rel="styleSheet",e.id="layermcss",e}())}()}(window);

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,30 @@
body .layer-ext-kzhomepage .layui-layer-title{
color: transparent;
border: 0px;
display: none;
}
body .layui-ext-kzhomepage .layui-layer-btn{}
body .layui-ext-kzhomepage .layui-layer-btn a{}
.layer-ext-kzhomepage{
background-color: transparent;
box-shadow: none;
border: none;
}
/* .layui-layer-setwin{
right: -50px;
width: 50px;
background: transparent;
color: #fff;
}
.layui-layer-setwin .layui-layer-close{
background-color: #00000080;
width: 30px;
height: 30px;
}
.layui-layer-setwin .layui-layer-min cite{
background-color: #fff;
width: 15px;
left: 17.5px;
height: 2px;
} */

2
static/layer.js Normal file

File diff suppressed because one or more lines are too long

90
static/main.js Normal file
View File

@@ -0,0 +1,90 @@
var windowWidth = $(window).width();
layer.config({
extend: 'kzhomepage/style.css', //加载扩展样式
skin: 'layer-ext-kzhomepage'
});
// Nav buttons
$('.kz-nav-btn').on('click', function() {
let btn = $(this);
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%'
layer.open({
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
break;
case 'newtab':
window.open('_blank').location = content
break;
}
});
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;"
);
// 兼容旧版
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";
$.ajax({
// url: "https://api.mizore.cn/meting/api.php?server=netease&type=playlist&id=20173709",
url: meting_music_api,
data:{
server: music_server,
type: music_type,
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
});
},
});
fetch('https://v1.hitokoto.cn')
.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)

244
static/style.css Normal file
View File

@@ -0,0 +1,244 @@
body {
font-size: 18px;
color: #6c767d;
background-color: #ebf1f5;
background-image: url("https://bu.dusays.com/2022/06/04/629b0a2a89425.png");
background-attachment: fixed;
background-repeat: no-repeat;
background-size: cover;
height: 100vh;
min-height: 800px;
}
/*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
::-webkit-scrollbar {
width: 5px;
/* height: 5px; */
background-color: #F5F5F5;
}
/*定义滚动条轨道 内阴影+圆角*/
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
border-radius: 10px;
background-color: #F5F5F5;
}
/*定义滑块 内阴影+圆角*/
::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
background-color: #555;
}
#main .aplayer{
margin: 10px 0!important;
}
h1 {
font-size: 36px;
margin-bottom: .5em;
}
h2 {
font-size: 24px;
}
h3 {
font-size: 20px;
margin-top: 1em;
}
h4 {
font-size: 16px;
}
h1,
h2,
h3,
h4 {
color: black;
}
.card {
border: none;
padding: 50px 30px 0px;
border-radius: 0;
}
.container {
position: relative;
top: 50%;
transform: translateY(-50%);
}
.my-card {
/* box-shadow: 0px 5px 15px 5px rgb(203, 221, 232); */
}
strike {
color: red;
}
.btn {
border-radius: 0;
margin: 5px 0;
width: 100%;
padding: 12px 40px;
transition: ease;
}
.btn-primary {
/* box-shadow: 0px 5px 15px 5px rgb(203, 221, 232); */
padding: 12px 40px;
transition: ease;
}
.btn-primary:hover {
box-shadow: 5px -2px 15px 0px rgb(203, 221, 232);
}
.btn-secondary {
/* box-shadow: 0px 5px 15px 5px rgb(203, 221, 232); */
padding: 12px 40px;
transition: ease;
}
.btn-secondary:hover {
box-shadow: 5px -2px 15px 0px rgb(203, 221, 232);
}
.btn-success {
/* box-shadow: 0px 5px 15px 5px rgb(203, 221, 232); */
padding: 12px 40px;
transition: ease;
}
.btn-success:hover {
box-shadow: 5px -2px 15px 0px rgb(203, 221, 232);
}
.social {
padding-left: 0;
}
.social p {
margin-bottom: 0;
}
.social li {
list-style: none;
float: left;
margin-right: 15px;
}
.card-text {
margin-bottom: 20px;
}
.social .fa {
font-size: 24px;
}
.photo-bg {
/* background-image: url(assets/background.jpg); */
background-image: url(https://tva1.sinaimg.cn/large/0072Vf1pgy1foxk456b0fj31hc0u0dxu.jpg);
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
footer p {
font-size: 12px;
}
#kaygb-blog-a,
#kaygb-mail-a {
display: none;
}
@media (max-width: 1199px) {
body {
min-height: 600px;
}
h1 {
font-size: 24px;
}
h2,
.social .fa {
font-size: 20px;
}
h3 {
font-size: 16px;
}
h4,
p {
font-size: 14px;
}
.card {
padding: 50px 50px 0px;
}
}
@media (max-width: 1199px) {
.photo-bg {
min-height: calc(100vh - 500px);
}
}
@media(max-width:991px) {
.photo-bg {
background-position: top;
min-height: calc(90vh - 440px);
}
}
@media(max-width: 767px) {
.container {
position: relative;
top: 0;
transform: translateY(0);
}
.photo-bg {
height: 180px;
}
.card {
padding: 20px;
}
#kaygb-blog-a,
#kaygb-mail-a {
display: block;
}
#kaygb-blog,
#kaygb-mail {
display: none;
}
}
#frame {
width: 50%;
height: 50vh;
margin: 0;
background: #fff;
position: fixed;
z-index: 999;
top: 5%;
left: 5%;
}
#aplayer {
z-index: 20000000;
}
#para1{
width: 100%;
height: 30px;
line-height: 30px;
text-align: center;
color:white;
background-color:rgba(220,38,38,0.2);
}