feat: Implement inline grouping for TuiLine components within TuiGroup, enhancing layout and music player UI.
This commit is contained in:
1 parent
84056824b5
commit
436e0a5910
5 files changed
+150
-55
No files matched your search
@@ -76,37 +76,71 @@
|
||||
terminal.updateById("music-player", {
|
||||
children: [
|
||||
{
|
||||
type: "output",
|
||||
content: `(&primary)Now Playing:(&)`,
|
||||
inline: true,
|
||||
},
|
||||
{
|
||||
type: "link",
|
||||
content: `(&blue)${song.title}(&)`,
|
||||
href: song.url,
|
||||
inline: true,
|
||||
external: true,
|
||||
},
|
||||
{ type: "blank", content: "" },
|
||||
{
|
||||
type: "output",
|
||||
content: `(&primary)Artist:(&)`,
|
||||
inline: true,
|
||||
},
|
||||
{
|
||||
type: "link",
|
||||
content: `(&blue)${song.author}(&)`,
|
||||
href: song.authorUrl,
|
||||
inline: true,
|
||||
external: true,
|
||||
},
|
||||
{
|
||||
type: "progress",
|
||||
type: "image",
|
||||
content: "",
|
||||
progress: progress,
|
||||
progressLabel: `${formatTime(Math.floor((progress / 100) * parseDuration(song.duration || "0:00")))} / ${song.duration}`,
|
||||
inline: false,
|
||||
progressStyle: "text",
|
||||
image: song.thumbnail,
|
||||
imageAlt: song.title,
|
||||
inline: true,
|
||||
imageWidth: 200,
|
||||
},
|
||||
{
|
||||
type: "group",
|
||||
content: "",
|
||||
groupDirection: "column",
|
||||
groupAlign: "stretch",
|
||||
inline: true,
|
||||
children: [
|
||||
{
|
||||
type: "group",
|
||||
content: "",
|
||||
groupDirection: "row",
|
||||
groupAlign: "center",
|
||||
inline: false,
|
||||
children: [
|
||||
{
|
||||
type: "output",
|
||||
content: `(&primary)Now Playing:(&)`,
|
||||
inline: true,
|
||||
},
|
||||
{
|
||||
type: "link",
|
||||
content: `(&blue)${song.title}(&)`,
|
||||
href: song.url,
|
||||
inline: true,
|
||||
external: true,
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
type: "group",
|
||||
content: "",
|
||||
groupDirection: "row",
|
||||
groupAlign: "center",
|
||||
inline: false,
|
||||
children: [
|
||||
{
|
||||
type: "output",
|
||||
content: `(&primary)Artist:(&)`,
|
||||
inline: true,
|
||||
},
|
||||
{
|
||||
type: "link",
|
||||
content: `(&blue)${song.author}(&)`,
|
||||
href: song.authorUrl,
|
||||
inline: true,
|
||||
external: true,
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
type: "progress",
|
||||
content: "",
|
||||
progress: progress,
|
||||
progressLabel: `${formatTime(Math.floor((progress / 100) * parseDuration(song.duration || "0:00")))} / ${song.duration}`,
|
||||
inline: false,
|
||||
progressStyle: "text",
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
type: "group",
|
||||
|
||||
Reference in new issue
Block a user