mirror of
https://github.com/mashirozx/sakura.git
synced 2024-11-21 22:38:12 +08:00
Some fix
This commit is contained in:
parent
47d5abc8d0
commit
a6542c7f6e
@ -137,7 +137,6 @@
|
||||
data-fixed="true"
|
||||
data-theme="orange">
|
||||
</div>
|
||||
<script src="https://cdn.jsdelivr.net/npm/meting@1.2/dist/Meting.min.js"></script>
|
||||
<style>.skin-menu{left:auto;right:10px;}.changeSkin-gear{left:auto;right:5px;}</style>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
|
@ -22,6 +22,9 @@ mashiro_option.jsdelivr_css_src = "https://pages.shino.cc/cdn/css/lib.css";
|
||||
<?php } else { ?>
|
||||
mashiro_option.jsdelivr_css_src = "https://cdn.jsdelivr.net/gh/moezx/cdn@<?php echo akina_option('jsdelivr_cdn_version', 'latest'); ?>/css/lib.min.css";
|
||||
<?php } ?>
|
||||
<?php if (akina_option('playlist_id', '')): ?>
|
||||
mashiro_option.float_player_on = true;
|
||||
<?php endif; ?>
|
||||
|
||||
/*End of Initial Variables*/
|
||||
</script>
|
||||
|
103
js/sakura-app.js
103
js/sakura-app.js
@ -715,6 +715,108 @@ $(function () {
|
||||
inlojv_js_getqqinfo();
|
||||
});
|
||||
|
||||
if(mashiro_option.float_player_on) {
|
||||
function aplayerF() {
|
||||
'use strict';
|
||||
var aplayers = [],
|
||||
loadMeting = function () {
|
||||
function a(a, b) {
|
||||
var c = {
|
||||
container: a,
|
||||
audio: b,
|
||||
mini: null,
|
||||
fixed: null,
|
||||
autoplay: !1,
|
||||
mutex: !0,
|
||||
lrcType: 3,
|
||||
listFolded: !1,
|
||||
preload: 'auto',
|
||||
theme: '#2980b9',
|
||||
loop: 'all',
|
||||
order: 'list',
|
||||
volume: null,
|
||||
listMaxHeight: null,
|
||||
customAudioType: null,
|
||||
storageName: 'metingjs'
|
||||
};
|
||||
if (b.length) {
|
||||
b[0].lrc || (c.lrcType = 0);
|
||||
var d = {};
|
||||
for (var e in c) {
|
||||
var f = e.toLowerCase();
|
||||
(a.dataset.hasOwnProperty(f) || a.dataset.hasOwnProperty(e) || null !== c[e]) && (d[e] = a.dataset[f] || a.dataset[e] || c[e], ('true' === d[e] || 'false' === d[e]) && (d[e] = 'true' == d[e]))
|
||||
}
|
||||
aplayers.push(new APlayer(d))
|
||||
}
|
||||
for (var f = 0; f < aplayers.length; f++) try {
|
||||
aplayers[f].lrc.hide();
|
||||
} catch (a) {
|
||||
console.log(a)
|
||||
}
|
||||
var lrcTag = 1;
|
||||
$(".aplayer.aplayer-fixed").click(function(){
|
||||
if (lrcTag == 1) {
|
||||
for (var f = 0; f < aplayers.length; f++) try {
|
||||
aplayers[f].lrc.show();
|
||||
} catch (a) {
|
||||
console.log(a)
|
||||
}
|
||||
}
|
||||
lrcTag = 2;
|
||||
});
|
||||
var apSwitchTag = 0;
|
||||
$(".aplayer.aplayer-fixed .aplayer-body").addClass("ap-hover");
|
||||
$(".aplayer-miniswitcher").click(function(){
|
||||
if (apSwitchTag == 0) {
|
||||
$(".aplayer.aplayer-fixed .aplayer-body").removeClass( "ap-hover" );
|
||||
apSwitchTag = 1;
|
||||
} else {
|
||||
$(".aplayer.aplayer-fixed .aplayer-body").addClass( "ap-hover" );
|
||||
apSwitchTag =0;
|
||||
}
|
||||
});
|
||||
}
|
||||
var b = 'https://api.i-meto.com/meting/api?server=:server&type=:type&id=:id&r=:r';
|
||||
'undefined' != typeof meting_api && (b = meting_api);
|
||||
for (var f = 0; f < aplayers.length; f++) try {
|
||||
aplayers[f].destroy()
|
||||
} catch (a) {
|
||||
console.log(a)
|
||||
}
|
||||
aplayers = [];
|
||||
for (var c = document.querySelectorAll('.aplayer'), d = function () {
|
||||
var d = c[e],
|
||||
f = d.dataset.id;
|
||||
if (f) {
|
||||
var g = d.dataset.api || b;
|
||||
g = g.replace(':server', d.dataset.server), g = g.replace(':type', d.dataset.type), g = g.replace(':id', d.dataset.id), g = g.replace(':auth', d.dataset.auth), g = g.replace(':r', Math.random());
|
||||
var h = new XMLHttpRequest;
|
||||
h.onreadystatechange = function () {
|
||||
if (4 === h.readyState && (200 <= h.status && 300 > h.status || 304 === h.status)) {
|
||||
var b = JSON.parse(h.responseText);
|
||||
a(d, b)
|
||||
}
|
||||
}, h.open('get', g, !0), h.send(null)
|
||||
} else if (d.dataset.url) {
|
||||
var i = [{
|
||||
name: d.dataset.name || d.dataset.title || 'Audio name',
|
||||
artist: d.dataset.artist || d.dataset.author || 'Audio artist',
|
||||
url: d.dataset.url,
|
||||
cover: d.dataset.cover || d.dataset.pic,
|
||||
lrc: d.dataset.lrc,
|
||||
type: d.dataset.type || 'auto'
|
||||
}];
|
||||
a(d, i)
|
||||
}
|
||||
}, e = 0; e < c.length; e++) d()
|
||||
};
|
||||
document.addEventListener('DOMContentLoaded', loadMeting, !1);
|
||||
}
|
||||
if (document.body.clientWidth > 860) {
|
||||
aplayerF ();
|
||||
}
|
||||
}
|
||||
|
||||
function inlojv_js_getqqinfo() {
|
||||
var is_get_by_qq = false;
|
||||
if (!getCookie('user_qq') && !getCookie('user_qq_email') && !getCookie('user_author')) {
|
||||
@ -880,6 +982,7 @@ function convertChinese(zh) {
|
||||
mashiro_global.ini.normalize();
|
||||
loadCSS(mashiro_option.jsdelivr_css_src);
|
||||
loadCSS("https://at.alicdn.com/t/font_679578_qyt5qzzavdo39pb9.css");
|
||||
loadCSS("https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.css");
|
||||
loadCSS("https://fonts.googleapis.com/css?family=Noto+SerifMerriweather|Merriweather+Sans|Source+Code+Pro|Ubuntu:400,700");
|
||||
(function webpackUniversalModuleDefinition(b, a) {
|
||||
if (typeof exports === "object" && typeof module === "object") {
|
||||
|
Loading…
Reference in New Issue
Block a user