Some styling
This commit is contained in:
parent
603c06ef2e
commit
8ec2795057
2 changed files with 31 additions and 7 deletions
|
@ -67,6 +67,24 @@ class MPD extends Component {
|
||||||
root.removeChild(root.firstChild);
|
root.removeChild(root.firstChild);
|
||||||
}
|
}
|
||||||
root.appendChild(render());
|
root.appendChild(render());
|
||||||
|
const styles = document.createElement('style');
|
||||||
|
styles.appendChild(document.createTextNode(`
|
||||||
|
.artist, .song {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
progress {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
appearance: none;
|
||||||
|
width: 40%;
|
||||||
|
}
|
||||||
|
progress::-webkit-progress-bar {
|
||||||
|
background-color: #2e3436;
|
||||||
|
}
|
||||||
|
progress[value]::-webkit-progress-value {
|
||||||
|
background-color: hsl(35, 98%, 46%);
|
||||||
|
}
|
||||||
|
`));
|
||||||
|
root.appendChild(styles);
|
||||||
}
|
}
|
||||||
|
|
||||||
render({ data }) {
|
render({ data }) {
|
||||||
|
@ -91,10 +109,10 @@ class MPD extends Component {
|
||||||
volume = 0;
|
volume = 0;
|
||||||
}
|
}
|
||||||
el.innerHTML = `
|
el.innerHTML = `
|
||||||
<div>${artist}</div>
|
<div class="artist">${artist}</div>
|
||||||
<div>${data.current_song.title}</div>
|
<div class="song">${data.current_song.title}</div>
|
||||||
<div>${status}</div>
|
<div>${status}</div>
|
||||||
<div><progress min="0" max="100" value="${volume}"></progress> 🔈 ${volume}</div>
|
<div><progress min="0" max="100" value="${volume}"></progress> volume ${volume}</div>
|
||||||
`;
|
`;
|
||||||
return el;
|
return el;
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,12 @@ class UserList extends Component {
|
||||||
-webkit-animation-timing-function:ease-in-out;
|
-webkit-animation-timing-function:ease-in-out;
|
||||||
-webkit-animation-direction: alternate;
|
-webkit-animation-direction: alternate;
|
||||||
}
|
}
|
||||||
|
span.output {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
span.prompt {
|
||||||
|
color: #a0a0a0;
|
||||||
|
}
|
||||||
`));
|
`));
|
||||||
root.appendChild(styles);
|
root.appendChild(styles);
|
||||||
}
|
}
|
||||||
|
@ -61,10 +67,10 @@ class UserList extends Component {
|
||||||
const el = document.createElement('div');
|
const el = document.createElement('div');
|
||||||
el.className = 'terminal';
|
el.className = 'terminal';
|
||||||
el.innerHTML = `
|
el.innerHTML = `
|
||||||
<div>user@c-beam> #who</div>
|
<div><span class="prompt">user@c-beam></span> #who</div>
|
||||||
<div>${data.join(', ')}</div>
|
<div><span class="output">${data.join(', ')}</span></div>
|
||||||
<div>total: ${data.length}</div>
|
<div>total: <span class="output">${data.length}</span></div>
|
||||||
<div>user@c-beam> <blink>_</blink></div>
|
<div><span class="prompt">user@c-beam></span> <blink>_</blink></div>
|
||||||
`;
|
`;
|
||||||
return el;
|
return el;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue