Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
AURA
dashboard-clock
Commits
563a6ac1
Commit
563a6ac1
authored
Sep 18, 2020
by
david
Browse files
Display track type.
#6
parent
f5c5d419
Changes
1
Show whitespace changes
Inline
Side-by-side
src/StudioClock.svelte
View file @
563a6ac1
...
...
@@ -151,7 +151,9 @@
function
displayTitle
(
track
)
{
if
(
track
!=
null
)
{
let
artist
=
""
;
let
title
=
unknowntitle
;
let
title
=
""
;
if
(
track
.
track_type
==
0
)
title
=
unknowntitle
;
if
(
track
.
track_artist
!=
null
&&
track
.
track_artist
!=
""
)
artist
=
track
.
track_artist
+
"
-
"
;
if
(
track
.
track_title
!=
null
&&
track
.
track_title
!=
""
)
...
...
@@ -161,6 +163,17 @@
return
""
;
}
/* Display the type of a track */
function
displayType
(
track
)
{
let
tracktype
=
""
;
if
(
track
!=
null
)
{
if
(
track
.
track_type
==
2
)
tracktype
=
"
STREAM
"
;
else
if
(
track
.
track_type
==
3
)
tracktype
=
"
LIVE STUDIO
"
;
}
return
tracktype
;
}
/* Format the time */
function
formatTime
(
seconds
)
{
...
...
@@ -318,6 +331,7 @@
background-color
:
rgb
(
24
,
24
,
24
);
margin-right
:
20px
;
padding
:
12px
;
text-align
:
center
;
}
#current-schedule
.schedule-title
{
...
...
@@ -376,7 +390,7 @@
.playlist-entry
{
font-size
:
1.9em
;
padding-left
:
53px
;
padding-bottom
:
1
3px
;
padding-bottom
:
2
3px
;
color
:
#AAA
;
}
...
...
@@ -384,8 +398,16 @@
font-size
:
1.5em
;
}
.track-duration
{
border-radius
:
25px
;
padding
:
5px
33px
;
border
:
1px
solid
gray
;
}
.track-time-left
{
margin
:
25px
50px
;
border-radius
:
25px
;
padding
:
5px
33px
;
border
:
1px
solid
gray
;
}
.is-active
{
...
...
@@ -394,6 +416,17 @@
padding-left
:
0
;
}
.track-type
{
border-radius
:
25px
;
background
:
#73AD21
;
color
:
white
;
padding
:
5px
33px
;
}
.track-type
:empty
{
display
:
none
;
}
.is-active
.track-title
::before
{
content
:
"\00a0\00a0▶\00a0\00a0\00a0"
;
font-size
:
larger
;
...
...
@@ -550,14 +583,16 @@
<li
id=
"current-playlist-entry"
class=
"playlist-entry is-active"
bind:this=
{currentTrackElement}
>
<!-- <span class="play-icon">▶</span> -->
<span
class=
"track-title"
>
{displayTitle(entry)}
</span>
<span
class=
"track-time-left"
>
({formatTime(timeLeft)})
</span>
<span
class=
"track-type"
>
{displayType(entry)}
</span>
<span
class=
"track-time-left"
>
{formatTime(timeLeft)}
</span>
</li>
{:else}
<li
class=
"playlist-entry"
>
<span
class=
"track-title"
>
{displayTitle(entry)}
</span>
<span
class=
"track-duration"
>
({formatTime(entry.track_duration)})
</span>
<span
class=
"track-type"
>
{displayType(entry)}
</span>
<span
class=
"track-duration"
>
{formatTime(entry.track_duration)}
</span>
</li>
{/if}
...
...
@@ -568,7 +603,8 @@
{#if value.current_track}
<div
id=
"current-track"
class=
"is-active"
>
<h2>
<span
class=
"track-title"
>
{displayTitle(value.track)}
</span>
<span
class=
"track-title"
>
{displayTitle(value.current_track)}
</span>
<span
class=
"track-type"
>
{displayType(value.current_track)}
</span>
<span
class=
"track-time-left"
>
{formatTime(timeLeft)}
</span>
</h2>
</div>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment