From a6542c7f6e87bdc89913fb7760a54cca2d1a3eeb Mon Sep 17 00:00:00 2001 From: Mashiro Date: Sun, 4 Nov 2018 19:20:10 +0800 Subject: [PATCH] Some fix --- footer.php | 1 - inc/swicher.php | 3 ++ js/sakura-app.js | 103 +++++++++++++++++++++++++++++++++++++++++++++++ style.css | 2 +- 4 files changed, 107 insertions(+), 2 deletions(-) diff --git a/footer.php b/footer.php index 7da500f..ced4126 100644 --- a/footer.php +++ b/footer.php @@ -137,7 +137,6 @@ data-fixed="true" data-theme="orange"> - mashiro_option.jsdelivr_css_src = "https://cdn.jsdelivr.net/gh/moezx/cdn@/css/lib.min.css"; + +mashiro_option.float_player_on = true; + /*End of Initial Variables*/ diff --git a/js/sakura-app.js b/js/sakura-app.js index 61d7caf..5c05490 100644 --- a/js/sakura-app.js +++ b/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") { diff --git a/style.css b/style.css index f6aa2a4..da20561 100644 --- a/style.css +++ b/style.css @@ -1620,7 +1620,7 @@ i.iconfont.hotpost { text-align: right } .post-thumb a { - border-radius: 10px + border-radius: 10px !important } }