feat(nvim): implement basic layout
This commit is contained in:
@@ -18,8 +18,12 @@ export const SpotifyPlayer = (props: {
|
||||
<div
|
||||
className="grid select-none"
|
||||
style={{
|
||||
gridTemplateColumns: `${CHAR_WIDTH}px ${CHAR_WIDTH * 8}px 1fr ${CHAR_WIDTH}px`,
|
||||
gridTemplateRows: `${CHAR_HEIGHT}px ${CHAR_HEIGHT * 3}px ${CHAR_HEIGHT}px`,
|
||||
gridTemplateColumns: `${CHAR_WIDTH}px ${
|
||||
CHAR_WIDTH * 8
|
||||
}px 1fr ${CHAR_WIDTH}px`,
|
||||
gridTemplateRows: `${CHAR_HEIGHT}px ${
|
||||
CHAR_HEIGHT * 3
|
||||
}px ${CHAR_HEIGHT}px`,
|
||||
}}
|
||||
>
|
||||
{kitty && <InnerSpotifyPlayer {...props} {...kitty} />}
|
||||
@@ -35,7 +39,9 @@ const InnerSpotifyPlayer = (props: InnerKittyProps<typeof SpotifyPlayer>) => {
|
||||
);
|
||||
const emptySize = props.cols - 2 - fillSize;
|
||||
|
||||
const timeString = `${formatMMSS(props.played)}/${formatMMSS(props.duration)}`;
|
||||
const timeString = `${formatMMSS(props.played)}/${formatMMSS(
|
||||
props.duration,
|
||||
)}`;
|
||||
const timeStringLeft = Math.round(
|
||||
(props.cols - 2) / 2 - timeString.length / 2,
|
||||
);
|
||||
|
||||
@@ -30,9 +30,9 @@ export const Music = () => {
|
||||
if (metadata) return;
|
||||
|
||||
void fetch(song)
|
||||
.then((r) => r.blob())
|
||||
.then((b) => parseBlob(b))
|
||||
.then((m) => {
|
||||
.then(r => r.blob())
|
||||
.then(b => parseBlob(b))
|
||||
.then(m => {
|
||||
if (!audio.current) return;
|
||||
|
||||
setMetadata(m);
|
||||
|
||||
Reference in New Issue
Block a user