cyp/app/js/status.js

18 lines
346 B
JavaScript
Raw Normal View History

2019-03-20 03:45:23 +08:00
import * as mpd from "./mpd.js";
const DELAY = 2000;
2019-03-20 05:56:39 +08:00
const DOM = {};
2019-03-20 03:45:23 +08:00
async function tick() {
let data = await mpd.getStatus();
2019-03-20 05:56:39 +08:00
DOM.title.textContent = data["Title"];
// console.log(data);
2019-03-20 03:45:23 +08:00
setTimeout(tick, DELAY);
}
export function init() {
2019-03-20 05:56:39 +08:00
let node = document.querySelector("footer");
DOM.title = node.querySelector(".title");
2019-03-20 03:45:23 +08:00
tick();
}