mirror of
https://github.com/NohamR/AM-Exporter.git
synced 2026-05-25 12:17:14 +00:00
front change
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
<html lang="pt-br">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
@@ -5,7 +5,7 @@ function secondsToMinutesAndSeconds(seconds) {
|
|||||||
}
|
}
|
||||||
function fetchDataAndAnimate() {
|
function fetchDataAndAnimate() {
|
||||||
// fetch('http://192.168.1.58:3005/music/get')
|
// fetch('http://192.168.1.58:3005/music/get')
|
||||||
fetch('http://192.168.1.64:3005/music/get')
|
fetch('https://api.noh.am/music/get')
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
const artist = data.artist;
|
const artist = data.artist;
|
||||||
@@ -20,6 +20,7 @@ function fetchDataAndAnimate() {
|
|||||||
let pPosition = Math.round(parseFloat(data.pPosition) + decalage - 3);
|
let pPosition = Math.round(parseFloat(data.pPosition) + decalage - 3);
|
||||||
const duration = parseFloat(data.duration);
|
const duration = parseFloat(data.duration);
|
||||||
const status = data.status;
|
const status = data.status;
|
||||||
|
const dominantcolor = data.dominantcolor;
|
||||||
|
|
||||||
const titleSongElement = document.querySelector('.title-song');
|
const titleSongElement = document.querySelector('.title-song');
|
||||||
// titleSongElement.textContent = name;
|
// titleSongElement.textContent = name;
|
||||||
@@ -31,8 +32,12 @@ function fetchDataAndAnimate() {
|
|||||||
const artistSongElement = document.querySelector('.name-artist');
|
const artistSongElement = document.querySelector('.name-artist');
|
||||||
artistSongElement.textContent = artist;
|
artistSongElement.textContent = artist;
|
||||||
|
|
||||||
const artwork_urlElement = document.querySelector('.artwork_url');
|
const artworkElement = document.querySelector('.artwork_url');
|
||||||
artwork_urlElement.src = artwork_url;
|
artworkElement.src = artwork_url;
|
||||||
|
|
||||||
|
const playerDiv = document.querySelector('.player');
|
||||||
|
const colorString = 'rgb(' + dominantcolor.join(',') + ')';
|
||||||
|
playerDiv.style.backgroundColor = colorString;
|
||||||
|
|
||||||
const artist_urlElement = document.querySelector('.artist-url');
|
const artist_urlElement = document.querySelector('.artist-url');
|
||||||
artist_urlElement.href = artist_url;
|
artist_urlElement.href = artist_url;
|
||||||
@@ -42,7 +47,7 @@ function fetchDataAndAnimate() {
|
|||||||
element.href = itunes_url;
|
element.href = itunes_url;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (status === 'playing') {
|
if (status === 'playing' && (pPosition / duration) * 100 <= 100) {
|
||||||
const totaltimeElement = document.querySelector('.total-time');
|
const totaltimeElement = document.querySelector('.total-time');
|
||||||
totaltimeElement.textContent = time;
|
totaltimeElement.textContent = time;
|
||||||
|
|
||||||
@@ -9,7 +9,6 @@
|
|||||||
body {
|
body {
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body * {
|
body * {
|
||||||
@@ -47,7 +46,7 @@ body * {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.player {
|
.player {
|
||||||
background-color: #080747;
|
background-color: rgb(119, 119, 119);
|
||||||
padding: 28px;
|
padding: 28px;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user