refactor: 修改默认主题
This commit is contained in:
parent
accc449824
commit
73df9dec48
@ -6,9 +6,9 @@
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<title>Debug For XiaoMusic</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="./main.css?version=1733743591">
|
||||
<link rel="stylesheet" type="text/css" href="./main.css?version=1733933734">
|
||||
<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
|
||||
<script src="./jquery-3.7.1.min.js?version=1733743591"></script>
|
||||
<script src="./jquery-3.7.1.min.js?version=1733933734"></script>
|
||||
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z09NC1K7ZW"></script>
|
||||
|
@ -4,8 +4,8 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<title>歌曲下载工具</title>
|
||||
<link rel="stylesheet" type="text/css" href="./main.css?version=1733743591">
|
||||
<script src="./jquery-3.7.1.min.js?version=1733743591"></script>
|
||||
<link rel="stylesheet" type="text/css" href="./main.css?version=1733933734">
|
||||
<script src="./jquery-3.7.1.min.js?version=1733933734"></script>
|
||||
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z09NC1K7ZW"></script>
|
||||
|
@ -5,9 +5,9 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>小爱音箱操控面板</title>
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<script src="./jquery-3.7.1.min.js?version=1733743591"></script>
|
||||
<link rel="stylesheet" href="./main.css?version=1733743591">
|
||||
<link href="https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined" rel="stylesheet">
|
||||
<script src="./jquery-3.7.1.min.js?version=1733933734"></script>
|
||||
<link rel="stylesheet" href="./main.css?version=1733933734">
|
||||
<link rel="icon" href="./favicon.ico">
|
||||
|
||||
<!-- Google tag (gtag.js) -->
|
||||
@ -53,69 +53,71 @@
|
||||
<select id="music_name" class="song-selector">
|
||||
</select>
|
||||
|
||||
<progress class="progress" id="progress" value="0" max="100"></progress>
|
||||
<div style="display: flex; justify-content: space-between; width: 100%;">
|
||||
<span class="current-time" id="current-time">0:00</span>
|
||||
<div class="current-song" id="playering-music">当前播放歌曲:无</div>
|
||||
<span class="duration" id="duration">0:00</span>
|
||||
<div id="device-audio">
|
||||
<progress class="progress" id="progress" value="0" max="100"></progress>
|
||||
<div style="display: flex; justify-content: space-between; width: 100%;">
|
||||
<span class="current-time" id="current-time">0:00</span>
|
||||
<div class="current-song" id="playering-music">当前播放歌曲:无</div>
|
||||
<span class="duration" id="duration">00:00</span>
|
||||
</div>
|
||||
</div>
|
||||
<audio id="audio" controls src="" autoplay>
|
||||
</audio>
|
||||
<audio id="audio" controls src="" autoplay></audio>
|
||||
|
||||
<div class="buttons">
|
||||
<div class="player-controls button-group">
|
||||
<button onclick="prevTrack()">
|
||||
<div id="modeBtn" onclick="togglePlayMode()" class="control-button device-enable">
|
||||
<span class="material-icons">shuffle</span>
|
||||
<span class="tooltip">切换播放模式</span>
|
||||
</div>
|
||||
<div onclick="prevTrack()" class="control-button device-enable">
|
||||
<span class="material-icons">skip_previous</span>
|
||||
<span class="tooltip">上一首</span>
|
||||
</button>
|
||||
<button onclick="playOnDevice()">
|
||||
<span class="material-icons" id="playPauseIcon">play_arrow</span>
|
||||
</div>
|
||||
<div onclick="play()" class="control-button">
|
||||
<span class="material-icons-outlined play">play_circle_outline</span>
|
||||
<span class="tooltip">播放</span>
|
||||
</button>
|
||||
<button onclick="nextTrack()">
|
||||
</div>
|
||||
<div onclick="nextTrack()" class="control-button device-enable">
|
||||
<span class="material-icons">skip_next</span>
|
||||
<span class="tooltip">下一首</span>
|
||||
</button>
|
||||
<button onclick="stopPlay()">
|
||||
<span class="material-icons" id="playPauseIcon">stop</span>
|
||||
</div>
|
||||
<div onclick="stopPlay()" class="control-button device-enable">
|
||||
<span class="material-icons">stop</span>
|
||||
<span class="tooltip">关机</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="mode-controls button-group">
|
||||
<button id="modeBtn" onclick="togglePlayMode()">
|
||||
<span class="material-icons">shuffle</span>
|
||||
<span class="tooltip">切换播放模式</span>
|
||||
</button>
|
||||
<button onclick="addToFavorites()" class="favorite">
|
||||
<div onclick="addToFavorites()" class="favorite icon-item device-enable">
|
||||
<span class="material-icons">favorite</span>
|
||||
<span class="tooltip">收藏歌曲</span>
|
||||
</button>
|
||||
<button onclick="toggleVolume()">
|
||||
<p>收藏</p>
|
||||
</div>
|
||||
<div onclick="toggleVolume()" class="icon-item device-enable">
|
||||
<span class="material-icons">volume_up</span>
|
||||
<span class="tooltip">调节音量</span>
|
||||
</button>
|
||||
<button onclick="toggleLocalPlay()" id="web_play">
|
||||
<p>音量</p>
|
||||
</div>
|
||||
<!--
|
||||
<div onclick="toggleLocalPlay()" id="web_play">
|
||||
<span class="material-icons">headphones</span>
|
||||
<span class="tooltip">网页播放</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mode-controls button-group">
|
||||
<button onclick="toggleSearch()">
|
||||
</div>
|
||||
-->
|
||||
<div onclick="toggleSearch()" class="icon-item device-enable">
|
||||
<span class="material-icons">search</span>
|
||||
<span class="tooltip">搜索歌曲</span>
|
||||
</button>
|
||||
<button onclick="togglePlayLink()">
|
||||
<p>搜索</p>
|
||||
</div>
|
||||
<div onclick="togglePlayLink()" class="icon-item device-enable">
|
||||
<span class="material-icons">link</span>
|
||||
<span class="tooltip">播放链接</span>
|
||||
</button>
|
||||
<button onclick="toggleTimer()">
|
||||
<p>链接</p>
|
||||
</div>
|
||||
<div onclick="toggleTimer()" class="icon-item device-enable">
|
||||
<span class="material-icons">timer</span>
|
||||
<span class="tooltip">定时关机</span>
|
||||
</button>
|
||||
<button onclick="openSettings()">
|
||||
<p>定时</p>
|
||||
</div>
|
||||
<div onclick="openSettings()" class="icon-item">
|
||||
<span class="material-icons">settings</span>
|
||||
<span class="tooltip">设置</span>
|
||||
</button>
|
||||
<p>设置</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -194,7 +196,7 @@
|
||||
Powered by XiaoMusic
|
||||
</div>
|
||||
|
||||
<script src="./md.js?version=1733743591">
|
||||
<script src="./md.js?version=1733933734">
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<title>M3U to JSON Converter</title>
|
||||
<link rel="stylesheet" type="text/css" href="./main.css?version=1733743591">
|
||||
<link rel="stylesheet" type="text/css" href="./main.css?version=1733933734">
|
||||
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z09NC1K7ZW"></script>
|
||||
|
@ -112,12 +112,12 @@ button:hover {
|
||||
bottom: 150%; /* 控制tooltip相对按钮的位置 */
|
||||
left: 50%;
|
||||
margin-left: -50px; /* 调整位置以居中显示 Tooltip */
|
||||
width: 100px; /* 设置固定宽度以保证足够的显示空间 */
|
||||
width: 80px; /* 设置固定宽度以保证足够的显示空间 */
|
||||
white-space: nowrap; /* 防止换行 */
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s;
|
||||
}
|
||||
button:hover .tooltip,.option-inline:hover .tooltip {
|
||||
button:hover .tooltip,.option-inline:hover .tooltip,.control-button:hover .tooltip {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
@ -129,9 +129,12 @@ button:hover .tooltip,.option-inline:hover .tooltip {
|
||||
}
|
||||
.option-inline:hover .tooltip {
|
||||
/* 位置调整到左边 */
|
||||
left: -80px; /* 调整位置以居中显示 Tooltip */
|
||||
left: -50px; /* 调整位置以居中显示 Tooltip */
|
||||
bottom: 0;
|
||||
}
|
||||
.control-button{
|
||||
position: relative; /* 为tooltip绝对定位做准备 */
|
||||
}
|
||||
.progress {
|
||||
width: 90%;
|
||||
height: 6px;
|
||||
@ -193,8 +196,14 @@ progress::-webkit-progress-value {
|
||||
|
||||
.player-controls {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.play {
|
||||
font-size: 48px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
@ -202,6 +211,7 @@ progress::-webkit-progress-value {
|
||||
bottom: 20px;
|
||||
font-size: 14px;
|
||||
color: #555;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.timer-tooltip {
|
||||
@ -306,3 +316,29 @@ textarea {
|
||||
.song-selector {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.mode-controls {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
padding: 10px 0;
|
||||
border-top: 1px solid #ddd;
|
||||
color: #555;
|
||||
}
|
||||
.icon-item {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.icon-item p {
|
||||
font-size: 12px;
|
||||
margin: 5px 0 0;
|
||||
}
|
||||
.disabled {
|
||||
color: #ccc;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
span,p {
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
|
@ -29,7 +29,28 @@ const playModes = {
|
||||
|
||||
let favoritelist = []; //收藏列表
|
||||
|
||||
function webPlay() {
|
||||
console.log("webPlay");
|
||||
const music_name = $("#music_name").val();
|
||||
$.get(`/musicinfo?name=${music_name}`, function (data, status) {
|
||||
console.log(data);
|
||||
if (data.ret == "OK") {
|
||||
validHost(data.url) && $("audio").attr("src", data.url);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function play() {
|
||||
var did = $("#did").val();
|
||||
if (did == "web_device") {
|
||||
webPlay();
|
||||
} else {
|
||||
playOnDevice();
|
||||
}
|
||||
}
|
||||
|
||||
function playOnDevice() {
|
||||
console.log("playOnDevice");
|
||||
var music_list = $("#music_list").val();
|
||||
var music_name = $("#music_name").val();
|
||||
if (no_warning) {
|
||||
@ -153,7 +174,7 @@ $.get("/getsetting", function (data, status) {
|
||||
}
|
||||
console.log("cur_did", did);
|
||||
console.log("dids", dids);
|
||||
if (dids.length > 0 && (did == null || did == "" || !dids.includes(did))) {
|
||||
if (did != "web_device" && dids.length > 0 && (did == null || did == "" || !dids.includes(did))) {
|
||||
did = dids[0];
|
||||
localStorage.setItem("cur_did", did);
|
||||
}
|
||||
@ -189,6 +210,11 @@ $.get("/getsetting", function (data, status) {
|
||||
}
|
||||
}
|
||||
});
|
||||
var option = $("<option></option>")
|
||||
.val("web_device")
|
||||
.text("本机")
|
||||
.prop("selected", "web_device" === did);
|
||||
$("#did").append(option);
|
||||
|
||||
console.log("cur_did", did);
|
||||
$("#did").change(function () {
|
||||
@ -198,6 +224,16 @@ $.get("/getsetting", function (data, status) {
|
||||
console.log("cur_did", did);
|
||||
location.reload();
|
||||
});
|
||||
|
||||
if (did == "web_device") {
|
||||
$("#audio").fadeIn();
|
||||
$("#device-audio").fadeOut();
|
||||
$(".device-enable").addClass('disabled');
|
||||
} else {
|
||||
$("#audio").fadeOut();
|
||||
$("#device-audio").fadeIn();
|
||||
$(".device-enable").removeClass('disabled');
|
||||
}
|
||||
});
|
||||
|
||||
function compareVersion(version1, version2) {
|
||||
@ -333,16 +369,6 @@ $("#play_music_list").on("click", () => {
|
||||
});
|
||||
});
|
||||
|
||||
$("#web_play").on("click", () => {
|
||||
const music_name = $("#music_name").val();
|
||||
$.get(`/musicinfo?name=${music_name}`, function (data, status) {
|
||||
console.log(data);
|
||||
if (data.ret == "OK") {
|
||||
validHost(data.url) && $("audio").attr("src", data.url);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#playurl").on("click", () => {
|
||||
var url = $("#music-url").val();
|
||||
const encoded_url = encodeURIComponent(url);
|
||||
|
@ -5,9 +5,9 @@
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<title>小爱音箱操控面板</title>
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<script src="./jquery-3.7.1.min.js?version=1733743591"></script>
|
||||
<script src="./setting.js?version=1733743591"></script>
|
||||
<link rel="stylesheet" type="text/css" href="./main.css?version=1733743591">
|
||||
<script src="./jquery-3.7.1.min.js?version=1733933734"></script>
|
||||
<script src="./setting.js?version=1733933734"></script>
|
||||
<link rel="stylesheet" type="text/css" href="./main.css?version=1733933734">
|
||||
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z09NC1K7ZW"></script>
|
||||
|
Loading…
Reference in New Issue
Block a user