Skip to content

Commit

Permalink
feat(link): use new design for links
Browse files Browse the repository at this point in the history
  • Loading branch information
seferturan authored and vladjerca committed Feb 10, 2025
1 parent 64d8ffe commit 4f88169
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 25 deletions.
4 changes: 4 additions & 0 deletions projects/client/src/lib/components/card/CardFooter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
gap: var(--gap-xs);
justify-content: space-between;
:global(.trakt-link) {
text-decoration: none;
}
.trakt-card-footer-information {
width: 100%;
margin-top: var(--ni-neg-4);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
align-items: center;
display: flex;
justify-content: space-between;
text-decoration: none;
}
@mixin color($color, $hover-bg, $active-bg, $outline-color, $bg-color) {
Expand Down
13 changes: 10 additions & 3 deletions projects/client/src/lib/components/link/Link.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,20 @@
.trakt-link {
-webkit-tap-highlight-color: transparent;
color: inherit;
text-decoration: none;
cursor: pointer;
transition: color var(--transition-increment) ease-in-out;
transition: var(--transition-increment) ease-in-out;
transition-property: color, text-decoration;
display: inherit;
:global(p),
:global(span) {
color: inherit;
}
text-decoration: underline;
text-underline-offset: var(--ni-2);
text-decoration-thickness: var(--ni-2);
&:focus-visible {
outline: none;
position: relative;
Expand All @@ -79,6 +83,8 @@
}
&[data-color="default"] {
text-decoration-color: var(--color-link-active);
&,
&:visited {
color: var(--color-foreground);
Expand Down Expand Up @@ -107,15 +113,16 @@
&[data-color="classic"] {
display: inline;
text-decoration: underline;
&:visited {
color: var(--red-300);
text-decoration-color: var(--red-300);
}
@include for-mouse {
&:hover {
color: var(--blue-600);
text-decoration-color: var(--blue-300);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,35 @@
const { castMember }: CastMemberCardProps = $props();
</script>

<Link focusable={false} href={UrlBuilder.people(castMember.id)}>
<div class="trakt-cast-member">
<PersonCard>
<CardCover
src={castMember.headShotUrl}
alt={`${m.person_headshot({ person: castMember.name })}`}
style="flat"
/>
</PersonCard>
<div class="trakt-cast-member-footer">
<p class="secondary ellipsis actor-name">{castMember.name}</p>
<p class="small secondary ellipsis">{castMember.characterName}</p>
<trakt-cast-member>
<Link focusable={false} href={UrlBuilder.people(castMember.id)}>
<div class="trakt-cast-member">
<PersonCard>
<CardCover
src={castMember.headShotUrl}
alt={`${m.person_headshot({ person: castMember.name })}`}
style="flat"
/>
</PersonCard>
<div class="trakt-cast-member-footer">
<p class="secondary ellipsis actor-name">{castMember.name}</p>
<p class="small secondary ellipsis">{castMember.characterName}</p>
</div>
</div>
</div>
</Link>
</Link>
</trakt-cast-member>

<style>
trakt-cast-member {
:global(.trakt-link) {
text-decoration: none;
}
}
.trakt-cast-member-footer {
height: var(--height-person-footer);
}
.trakt-cast-member {
display: flex;
flex-direction: column;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,9 @@
:global(.trakt-card .trakt-summary-item) {
padding: var(--ni-12);
}
:global(.trakt-link) {
text-decoration: none;
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
:global(a.trakt-link) {
text-decoration: none;
transition: background-color var(--transition-increment) ease-in-out;
@include for-mouse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,25 @@
: UrlBuilder.og.getVip();
</script>

<Link {href} target="_blank">
<div class="ytd-link-content">
<h2 class="ytd-year">{currentYear}</h2>
<div class="ytd-link-details">
<h5 class="ytd-label">{m.year_to_date()}</h5>
<YearToDateArrow />
<trakt-year-to-date-link>
<Link {href} target="_blank">
<div class="ytd-link-content">
<h2 class="ytd-year">{currentYear}</h2>
<div class="ytd-link-details">
<h5 class="ytd-label">{m.year_to_date()}</h5>
<YearToDateArrow />
</div>
</div>
</div>
</Link>
</Link>
</trakt-year-to-date-link>

<style>
trakt-year-to-date-link {
:global(.trakt-link) {
text-decoration: none;
}
}
.ytd-link-details {
display: flex;
align-items: center;
Expand Down

0 comments on commit 4f88169

Please sign in to comment.