Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Marquee to Make Long Text Readable #767

Merged
merged 12 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 42 additions & 22 deletions src/components/InfoHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
padding-left: 15px;
align-items: center;
padding-right: 15px;
display: flex;
width: 100%;
"
>
<!-- left side: cover image -->
Expand All @@ -54,6 +56,7 @@
margin-bottom: 15px;
margin-right: 24px;
align-content: center;
flex-shrink: 0;
"
>
<div v-if="item.media_type && item.media_type == MediaType.ARTIST">
Expand All @@ -70,7 +73,7 @@
</div>
</div>

<div style="width: 100%; text-align: left">
<div style="min-width: 0">
<!-- Main title -->
<img
v-if="artistLogo"
Expand All @@ -80,7 +83,9 @@
style="padding-left: 10px"
/>
<v-card-title v-else>
{{ item.name }}
<MarqueeText :sync="marqueeSync">
{{ item.name }}
</MarqueeText>
</v-card-title>

<!-- other details -->
Expand Down Expand Up @@ -108,52 +113,64 @@
<!-- item artists -->
<v-card-subtitle
v-if="'artists' in item && item.artists"
class="title accent--text"
class="title accent--text d-flex"
>
<v-icon
style="margin-left: -3px; margin-right: 3px"
small
color="primary"
icon="mdi-account-music"
/>
<span
v-for="(artist, artistindex) in item.artists"
:key="artist.item_id"
>
<a style="color: accent" @click="artistClick(artist)">{{
artist.name
}}</a>
<MarqueeText :sync="marqueeSync">
<span
v-if="artistindex + 1 < item.artists.length"
:key="artistindex"
style="color: accent"
>{{ " / " }}</span
v-for="(artist, artistindex) in item.artists"
:key="artist.item_id"
>
</span>
<a style="color: accent" @click="artistClick(artist)">{{
artist.name
}}</a>
<span
v-if="artistindex + 1 < item.artists.length"
:key="artistindex"
style="color: accent"
>{{ " / " }}</span
>
</span>
</MarqueeText>
</v-card-subtitle>

<!-- playlist owner -->
<v-card-subtitle v-if="'owner' in item && item.owner" class="title">
<v-card-subtitle
v-if="'owner' in item && item.owner"
class="title d-flex"
>
<v-icon
color="primary"
style="margin-left: -3px; margin-right: 3px"
small
icon="mdi-account-music"
/>
<a style="color: primary">{{ item.owner }}</a>
<MarqueeText :sync="marqueeSync">
<a style="color: primary">{{ item.owner }}</a>
</MarqueeText>
</v-card-subtitle>

<v-card-subtitle v-if="'album' in item && item.album">
<v-card-subtitle
v-if="'album' in item && item.album"
class="d-flex"
>
<v-icon
color="primary"
style="margin-left: -3px; margin-right: 3px"
small
icon="mdi-album"
/>
<a
style="color: secondary"
@click="albumClick((item as Track)?.album)"
>{{ item.album.name }}</a
<MarqueeText :sync="marqueeSync">
<a
style="color: secondary"
@click="albumClick((item as Track)?.album)"
>{{ item.album.name }}</a
></MarqueeText
>
</v-card-subtitle>
</div>
Expand Down Expand Up @@ -322,6 +339,8 @@ import {
} from "@/layouts/default/ItemContextMenu.vue";
import Toolbar from "@/components/Toolbar.vue";
import { useI18n } from "vue-i18n";
import MarqueeText from "./MarqueeText.vue";
import { MarqueeTextSync } from "@/helpers/marquee_text_sync";

// properties
export interface Props {
Expand All @@ -335,6 +354,7 @@ const { mobile } = useDisplay();
const imgGradient = new URL("../assets/info_gradient.jpg", import.meta.url)
.href;

const marqueeSync = new MarqueeTextSync();
const router = useRouter();
const { t } = useI18n();

Expand Down
Loading
Loading