@playpilot/tpi 5.34.1 → 6.0.0-beta.explore.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/link-injections.js +25 -10
  2. package/package.json +1 -1
  3. package/src/lib/api/titles.ts +13 -1
  4. package/src/lib/data/countries.json +216 -0
  5. package/src/lib/data/translations.ts +5 -0
  6. package/src/lib/enums/SplitTest.ts +1 -6
  7. package/src/lib/explore.ts +59 -0
  8. package/src/lib/fakeData.ts +1 -0
  9. package/src/lib/images/titles-list.webp +0 -0
  10. package/src/lib/modal.ts +7 -6
  11. package/src/lib/scss/global.scss +0 -2
  12. package/src/lib/trailer.ts +22 -0
  13. package/src/lib/types/api.d.ts +6 -0
  14. package/src/lib/types/config.d.ts +12 -0
  15. package/src/lib/types/filter.d.ts +2 -0
  16. package/src/lib/types/title.d.ts +4 -1
  17. package/src/routes/+page.svelte +6 -1
  18. package/src/routes/components/Ads/TopScroll.svelte +4 -18
  19. package/src/routes/components/Button.svelte +101 -0
  20. package/src/routes/components/Debugger.svelte +25 -0
  21. package/src/routes/components/Explore/Explore.svelte +240 -0
  22. package/src/routes/components/Explore/ExploreCallToAction.svelte +58 -0
  23. package/src/routes/components/Explore/ExploreModal.svelte +15 -0
  24. package/src/routes/components/Explore/Filter/Dropdown.svelte +72 -0
  25. package/src/routes/components/Explore/Filter/Filter.svelte +99 -0
  26. package/src/routes/components/Explore/Filter/FilterItem.svelte +57 -0
  27. package/src/routes/components/Explore/Filter/FilterSorting.svelte +70 -0
  28. package/src/routes/components/Explore/Filter/Search.svelte +57 -0
  29. package/src/routes/components/Explore/Filter/TogglesWithSearch.svelte +142 -0
  30. package/src/routes/components/GridTitle.svelte +122 -0
  31. package/src/routes/components/GridTitleSkeleton.svelte +36 -0
  32. package/src/routes/components/Icons/IconArrow.svelte +10 -2
  33. package/src/routes/components/Icons/IconClose.svelte +9 -1
  34. package/src/routes/components/Icons/IconFilter.svelte +5 -0
  35. package/src/routes/components/Icons/IconPlay.svelte +3 -0
  36. package/src/routes/components/Icons/IconSearch.svelte +3 -0
  37. package/src/routes/components/ListTitle.svelte +10 -68
  38. package/src/routes/components/ListTitleSkeleton.svelte +42 -0
  39. package/src/routes/components/Modal.svelte +5 -23
  40. package/src/routes/components/Participant.svelte +0 -4
  41. package/src/routes/components/Playlinks/PlaylinkIcon.svelte +1 -1
  42. package/src/routes/components/Playlinks/PlaylinksCompact.svelte +62 -0
  43. package/src/routes/components/Share.svelte +5 -23
  44. package/src/routes/components/Title.svelte +22 -22
  45. package/src/routes/components/TitleModal.svelte +4 -1
  46. package/src/routes/components/Trailer.svelte +18 -0
  47. package/src/routes/components/YouTubeEmbedOverlay.svelte +96 -0
  48. package/src/routes/elements/+page.svelte +39 -2
  49. package/src/routes/explore/+page.svelte +60 -0
  50. package/src/tests/lib/api/ads.test.js +0 -1
  51. package/src/tests/lib/api/titles.test.js +55 -0
  52. package/src/tests/lib/explore.test.js +139 -0
  53. package/src/tests/lib/trailer.test.js +56 -0
  54. package/src/tests/routes/components/Button.test.js +28 -0
  55. package/src/tests/routes/components/Explore/Explore.test.js +94 -0
  56. package/src/tests/routes/components/Explore/Filter/Dropdown.test.js +16 -0
  57. package/src/tests/routes/components/Explore/Filter/Filter.test.js +28 -0
  58. package/src/tests/routes/components/Explore/Filter/FilterItem.test.js +50 -0
  59. package/src/tests/routes/components/Explore/Filter/FilterSorting.test.js +34 -0
  60. package/src/tests/routes/components/Explore/Filter/Search.test.js +26 -0
  61. package/src/tests/routes/components/Explore/Filter/TogglesWithSearch.test.js +53 -0
  62. package/src/tests/routes/components/GridTitle.test.js +42 -0
  63. package/src/tests/routes/components/ListTitle.test.js +1 -1
  64. package/src/tests/routes/components/Playlinks/PlaylinksCompact.test.js +42 -0
  65. package/src/tests/routes/components/Share.test.js +12 -12
  66. package/src/tests/routes/components/Title.test.js +13 -0
  67. package/src/tests/routes/components/Trailer.test.js +20 -0
  68. package/src/tests/routes/components/YouTubeEmbedOverlay.test.js +31 -0
  69. package/src/tests/setup.js +2 -0
@@ -0,0 +1,70 @@
1
+ <script lang="ts">
2
+ import Button from '../../Button.svelte'
3
+ import IconArrow from '../../Icons/IconArrow.svelte'
4
+ import type { ExploreFilter } from '$lib/types/filter'
5
+ import Dropdown from './Dropdown.svelte'
6
+
7
+ interface Props {
8
+ filter: ExploreFilter
9
+ }
10
+
11
+ const { filter }: Props = $props()
12
+
13
+ const param = 'ordering'
14
+
15
+ const options = [
16
+ { label: 'Popularity', value: 'popular' },
17
+ { label: 'New', value: 'new' },
18
+ { label: 'Top Rated', value: 'top-rated' },
19
+ ]
20
+
21
+ const label = $derived(options.find(({ value }) => value === filter[param])?.label || 'Sort by')
22
+
23
+ function setFilter(value: string): void {
24
+ if (value) filter[param] = value
25
+ else delete filter[param]
26
+ }
27
+ </script>
28
+
29
+ <Dropdown>
30
+ {#snippet button({ toggle })}
31
+ <Button variant="link" onclick={toggle}>
32
+ {label}
33
+ <IconArrow direction="down" />
34
+ </Button>
35
+ {/snippet}
36
+
37
+ {#snippet content()}
38
+ <div class="content" data-testid="content">
39
+ {#each options as { label, value }}
40
+ {@const active = value === filter[param]}
41
+ <button class="option" class:active onclick={() => setFilter(value)}>{label}</button>
42
+ {/each}
43
+ </div>
44
+ {/snippet}
45
+ </Dropdown>
46
+
47
+ <style lang="scss">
48
+ .content {
49
+ width: margin(7);
50
+ }
51
+
52
+ .option {
53
+ appearance: none;
54
+ padding: margin(0.75) margin(1);
55
+ width: 100%;
56
+ border: 0;
57
+ background: transparent;
58
+ text-align: left;
59
+ font-family: inherit;
60
+ font-size: inherit;
61
+ color: theme(text-color-alt);
62
+ cursor: pointer;
63
+
64
+ &:hover,
65
+ &.active {
66
+ color: theme(text-color);
67
+ background: theme(content-light);
68
+ }
69
+ }
70
+ </style>
@@ -0,0 +1,57 @@
1
+ <script lang="ts">
2
+ import IconSearch from '../../Icons/IconSearch.svelte'
3
+
4
+ interface Props {
5
+ // eslint-disable-next-line no-unused-vars
6
+ oninput: (query: string) => void
7
+ }
8
+
9
+ const { oninput }: Props = $props()
10
+
11
+ let query = $state('')
12
+ </script>
13
+
14
+ <div class="search" role="search">
15
+ <div class="icon">
16
+ <IconSearch />
17
+ </div>
18
+
19
+ <input bind:value={query} oninput={() => oninput(query)} class="input" type="search" placeholder="Search movies and shows" />
20
+ </div>
21
+
22
+ <style lang="scss">
23
+ .search {
24
+ position: relative;
25
+ }
26
+
27
+ .icon {
28
+ display: flex;
29
+ align-items: center;
30
+ position: absolute;
31
+ height: 100%;
32
+ left: margin(1);
33
+ color: theme(text-color-alt);
34
+ opacity: 0.75;
35
+ }
36
+
37
+ .input {
38
+ width: 100%;
39
+ max-width: theme(explore-header-max-width, 600px);
40
+ padding: margin(0.75) margin(1) margin(0.75) margin(3);
41
+ border: 0;
42
+ border-radius: theme(border-radius);
43
+ background: theme(content);
44
+ color: theme(text-color-alt);
45
+ font-size: theme(font-size-base);
46
+ font-family: theme(font-family);
47
+
48
+ &:focus {
49
+ outline: 1px solid white;
50
+ }
51
+
52
+ &::placeholder {
53
+ color: theme(text-color-alt);
54
+ opacity: 0.75;
55
+ }
56
+ }
57
+ </style>
@@ -0,0 +1,142 @@
1
+ <script lang="ts">
2
+ import { flip } from 'svelte/animate'
3
+ import { scale } from 'svelte/transition'
4
+
5
+ interface Option {
6
+ label: string
7
+ value: string
8
+ }
9
+
10
+ interface Props {
11
+ options?: Option[]
12
+ selected?: string[]
13
+ placeholder?: string
14
+ // eslint-disable-next-line no-unused-vars
15
+ onchange?: (selected: string[]) => void
16
+ }
17
+
18
+ let {
19
+ options = [{ label: 'Label', value: 'Value' }],
20
+ selected = [],
21
+ placeholder = 'Search...',
22
+ onchange = () => null,
23
+ }: Props = $props()
24
+
25
+ let query = $state('')
26
+
27
+ const shownOptions = $derived(search())
28
+
29
+ function search(): Option[] {
30
+ if (!options?.length) return []
31
+ if (!query) return options
32
+
33
+ return options.filter(({ label }) => label.toLowerCase().indexOf(query.toLowerCase()) !== -1)
34
+ }
35
+
36
+ function toggleItem(value: string): void {
37
+ const active = selected.find(o => o === value)
38
+
39
+ if (active) selected = selected.filter(o => o !== value)
40
+ else selected = [...selected, value]
41
+
42
+ onchange(selected)
43
+ }
44
+ </script>
45
+
46
+ <div class="header">
47
+ <input type="text" class="input" aria-label="Search" {placeholder} bind:value={query} />
48
+ </div>
49
+
50
+ <div class="options" data-testid="toggles-with-search">
51
+ {#each shownOptions || [] as { label, value } (value)}
52
+ {@const active = !!selected.find(o => o === value)}
53
+
54
+ <div animate:flip={{ duration: 150 }}>
55
+ <button class="option" class:active onclick={() => toggleItem(value)}>
56
+ {label}
57
+
58
+ <div class="action">
59
+ {#key active}
60
+ <div class="icon" transition:scale={{ start: 0.25, duration: 100 }}>
61
+ {active ? '-' : '+'}
62
+ </div>
63
+ {/key}
64
+ </div>
65
+ </button>
66
+ </div>
67
+ {/each}
68
+ </div>
69
+
70
+ <style lang="scss">
71
+ .header {
72
+ padding: margin(0.75);
73
+ }
74
+
75
+ .input {
76
+ width: 100%;
77
+ padding: margin(0.75) margin(1) margin(0.75);
78
+ border: 0;
79
+ border-radius: theme(border-radius);
80
+ background: theme(content-light);
81
+ color: theme(text-color-alt);
82
+ font-size: theme(font-size-base);
83
+ font-family: theme(font-family);
84
+
85
+ &:focus {
86
+ outline: 1px solid white;
87
+ }
88
+
89
+ &::placeholder {
90
+ color: theme(text-color-alt);
91
+ opacity: 0.75;
92
+ }
93
+ }
94
+
95
+ .option {
96
+ appearance: none;
97
+ display: flex;
98
+ align-items: center;
99
+ justify-content: space-between;
100
+ width: 100%;
101
+ padding: margin(0.75) margin(0.75);
102
+ border: 0;
103
+ border-top: 1px solid theme(content-light);
104
+ background: theme(content);
105
+ color: theme(text-color-alt);
106
+ font-family: inherit;
107
+ text-align: left;
108
+ cursor: pointer;
109
+
110
+ &:hover,
111
+ &.active {
112
+ color: theme(text-color);
113
+ filter: brightness(theme(hover-filter-brightness));
114
+ }
115
+ }
116
+
117
+ .action {
118
+ flex: 0 0 1lh;
119
+ position: relative;
120
+ width: 1lh;
121
+ height: 1lh;
122
+ font-size: 1.25em;
123
+ }
124
+
125
+ .icon {
126
+ position: absolute;
127
+ top: 0;
128
+ left: 0;
129
+ width: 100%;
130
+ height: 100%;
131
+ display: flex;
132
+ align-items: center;
133
+ justify-content: center;
134
+ border: 1px solid theme(content-light);
135
+ border-radius: 50%;
136
+
137
+ .active & {
138
+ color: theme(green);
139
+ border-color: theme(green);
140
+ }
141
+ }
142
+ </style>
@@ -0,0 +1,122 @@
1
+ <script lang="ts">
2
+ import type { TitleData } from '$lib/types/title'
3
+ import IconIMDb from './Icons/IconIMDb.svelte'
4
+ import PlaylinksCompact from './Playlinks/PlaylinksCompact.svelte'
5
+ import TitlePoster from './TitlePoster.svelte'
6
+
7
+ interface Props {
8
+ title: TitleData
9
+ // eslint-disable-next-line no-unused-vars
10
+ onclick?: (event: MouseEvent) => void
11
+ }
12
+
13
+ const { title, onclick = () => null }: Props = $props()
14
+ </script>
15
+
16
+ <button class="title" {onclick} data-testid="title">
17
+ <div class="poster">
18
+ <TitlePoster {title} width={120} height={213} lazy />
19
+
20
+ <div class="meta">
21
+ <div class="imdb">
22
+ <IconIMDb size={12} />
23
+ {title.imdb_score || '-'}
24
+ </div>
25
+
26
+ {#if title.type === 'series'}
27
+ <div>Series</div>
28
+ {/if}
29
+
30
+ {#if title.length}
31
+ <div>{title.length} min</div>
32
+ {/if}
33
+ </div>
34
+ </div>
35
+
36
+ <div class="content">
37
+ <div class="heading">{title.title}</div>
38
+
39
+ <PlaylinksCompact playlinks={title.providers} size={20} />
40
+ </div>
41
+ </button>
42
+
43
+ <style lang="scss">
44
+ .title {
45
+ position: relative;
46
+ appearance: none;
47
+ display: flex;
48
+ flex-direction: column;
49
+ width: 100%;
50
+ background: transparent;
51
+ padding: 0;
52
+ border: 0;
53
+ border-radius: theme(grid-item-border-radius, border-radius);
54
+ transition: transform 100ms;
55
+ text-decoration: none;
56
+ font-style: normal !important;
57
+ font-family: theme(font-family);
58
+ cursor: pointer;
59
+
60
+ &:hover {
61
+ filter: brightness(theme(grid-item-hover-filter-brightness, hover-filter-brightness));
62
+ background: theme(grid-item-hover-background, lighter);
63
+ box-shadow: theme(grid-item-hover-shadow, 0 0 0 #{margin(0.5)} theme(lighter));
64
+ transform: scale(1.025);
65
+ z-index: 1;
66
+ }
67
+ }
68
+
69
+ .poster {
70
+ position: relative;
71
+ width: 100%;
72
+ height: auto;
73
+ aspect-ratio: 2/3;
74
+ border-radius: theme(detail-image-border-radius, border-radius);
75
+ background: theme(detail-image-background, content);
76
+ overflow: hidden;
77
+ }
78
+
79
+ .content {
80
+ padding-top: margin(0.5);
81
+ }
82
+
83
+ .heading {
84
+ margin-bottom: margin(0.5);
85
+ overflow: hidden;
86
+ text-overflow: ellipsis;
87
+ white-space: nowrap;
88
+ font-family: inherit;
89
+ text-align: left;
90
+ font-size: theme(detail-font-size, font-size-base);
91
+ line-height: normal;
92
+ color: theme(grid-item-title-text-color, text-color-alt);
93
+ font-weight: theme(grid-item-title-font-weight, font-bold);
94
+
95
+ .title:hover & {
96
+ color: theme(grid-item-title-hover-text-color, text-color);
97
+ }
98
+ }
99
+
100
+ .meta {
101
+ display: flex;
102
+ justify-content: space-between;
103
+ position: absolute;
104
+ top: 0;
105
+ left: 0;
106
+ width: 100%;
107
+ padding: margin(0.5) margin(0.5) margin(1);
108
+ background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent);
109
+ color: white;
110
+ text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.25);
111
+
112
+ :global(svg) {
113
+ filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.35));
114
+ }
115
+ }
116
+
117
+ .imdb {
118
+ display: flex;
119
+ align-items: center;
120
+ gap: margin(0.25);
121
+ }
122
+ </style>
@@ -0,0 +1,36 @@
1
+ <div class="skeleton" data-testid="skeleton">
2
+ <div class="poster"></div>
3
+
4
+ <div class="lines">
5
+ <div class="line" style:width="60%"></div>
6
+ </div>
7
+ </div>
8
+
9
+ <style lang="scss">
10
+ .skeleton {
11
+ width: 100%;
12
+ }
13
+
14
+ .poster {
15
+ flex: 0 0 auto;
16
+ height: auto;
17
+ width: 100%;
18
+ aspect-ratio: 2/3;
19
+ border-radius: theme(detail-image-border-radius, border-radius);
20
+ background: theme(content);
21
+ }
22
+
23
+ .lines {
24
+ display: flex;
25
+ flex-direction: column;
26
+ margin-top: margin(0.5);
27
+ gap: margin(0.5);
28
+ width: 100%;
29
+ }
30
+
31
+ .line {
32
+ height: theme(font-size-base);
33
+ background: theme(content);
34
+ border-radius: 5rem;
35
+ }
36
+ </style>
@@ -1,13 +1,13 @@
1
1
  <script lang="ts">
2
2
  interface Props {
3
- direction?: 'left' | 'right'
3
+ direction?: 'left' | 'right' | 'down' | 'up'
4
4
  title?: string
5
5
  }
6
6
 
7
7
  const { direction = 'right', title = '' }: Props = $props()
8
8
  </script>
9
9
 
10
- <svg class="{direction}" height="16px" viewBox="0 -960 960 960" width="16px">
10
+ <svg class="{direction}" width="16px" height="16px" viewBox="0 -960 960 960">
11
11
  {#if title}
12
12
  <title>{title}</title>
13
13
  {/if}
@@ -16,10 +16,18 @@
16
16
  </svg>
17
17
 
18
18
  <style lang="scss">
19
+ .up {
20
+ transform: rotate(270deg);
21
+ }
22
+
19
23
  .right {
20
24
  margin-left: margin(0.125);
21
25
  }
22
26
 
27
+ .down {
28
+ transform: rotate(90deg);
29
+ }
30
+
23
31
  .left {
24
32
  margin-right: margin(0.125);
25
33
  transform: rotate(180deg);
@@ -1,3 +1,11 @@
1
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none">
1
+ <script lang="ts">
2
+ interface Props {
3
+ size?: number
4
+ }
5
+
6
+ const { size = 16 }: Props = $props()
7
+ </script>
8
+
9
+ <svg width={size} height={size} viewBox="0 0 16 16" fill="none">
2
10
  <path d="M14 2L2 14M2 2L14 14" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
3
11
  </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="11" height="13" viewBox="0 0 11 13">
2
+ <path d="M9.77037 6.86774C9.68778 7.21645 9.48992 7.52709 9.20883 7.74937C8.92774 7.97166 8.57987 8.09259 8.22151 8.09259C7.86315 8.09259 7.51528 7.97166 7.23419 7.74937C6.9531 7.52709 6.75525 7.21645 6.67265 6.86774L0.385491 6.86774C0.335766 6.87014 0.286069 6.86243 0.239415 6.84505C0.192761 6.82768 0.150121 6.80101 0.114079 6.76667C0.0780373 6.73233 0.0493441 6.69103 0.0297394 6.64527C0.0101337 6.5995 2.67029e-05 6.55024 2.67029e-05 6.50045C2.67029e-05 6.45067 0.0101337 6.40141 0.0297394 6.35565C0.0493441 6.30989 0.0780373 6.26858 0.114079 6.23424C0.150121 6.1999 0.192761 6.17323 0.239415 6.15586C0.286069 6.13849 0.335766 6.13077 0.385491 6.13317L6.67265 6.13317C6.75525 5.78446 6.9531 5.47382 7.23419 5.25154C7.51528 5.02925 7.86315 4.90833 8.22151 4.90833C8.57987 4.90833 8.92774 5.02925 9.20883 5.25154C9.48992 5.47382 9.68778 5.78446 9.77037 6.13317H10.1801C10.2298 6.13077 10.2795 6.13849 10.3262 6.15586C10.3728 6.17323 10.4155 6.1999 10.4515 6.23424C10.4875 6.26858 10.5162 6.30989 10.5358 6.35565C10.5554 6.40141 10.5656 6.45067 10.5656 6.50045C10.5656 6.55024 10.5554 6.5995 10.5358 6.64527C10.5162 6.69103 10.4875 6.73233 10.4515 6.76667C10.4155 6.80101 10.3728 6.82768 10.3262 6.84505C10.2795 6.86243 10.2298 6.87014 10.1801 6.86774H9.77037ZM8.22151 5.64374C8.05198 5.64374 7.88626 5.69401 7.74531 5.7882C7.60435 5.88238 7.49449 6.01625 7.42961 6.17287C7.36474 6.32949 7.34776 6.50183 7.38084 6.6681C7.41391 6.83437 7.49554 6.9871 7.61542 7.10698C7.73529 7.22685 7.88802 7.30849 8.05429 7.34156C8.22056 7.37463 8.3929 7.35766 8.54953 7.29278C8.70615 7.22791 8.84002 7.11805 8.9342 6.97709C9.02839 6.83613 9.07866 6.67041 9.07866 6.50089C9.07877 6.38825 9.05668 6.2767 9.01366 6.17261C8.97063 6.06851 8.90751 5.97392 8.82791 5.89424C8.7483 5.81455 8.65377 5.75134 8.54973 5.70821C8.44568 5.66508 8.33415 5.64288 8.22151 5.64288V5.64374Z" fill="currentColor"/>
3
+ <path d="M3.8929 2.45945C3.8103 2.80816 3.61245 3.11879 3.33136 3.34108C3.05027 3.56336 2.7024 3.68429 2.34404 3.68429C1.98568 3.68429 1.63781 3.56336 1.35672 3.34108C1.07563 3.11879 0.87778 2.80816 0.795181 2.45945H0.385466C0.291124 2.45489 0.202153 2.4142 0.136997 2.34582C0.0718422 2.27744 0.0354977 2.18661 0.0354977 2.09216C0.0354977 1.99771 0.0718422 1.90688 0.136997 1.8385C0.202153 1.77012 0.291124 1.72943 0.385466 1.72488H0.795181C0.87778 1.37617 1.07563 1.06553 1.35672 0.843245C1.63781 0.620959 1.98568 0.500031 2.34404 0.500031C2.7024 0.500031 3.05027 0.620959 3.33136 0.843245C3.61245 1.06553 3.8103 1.37617 3.8929 1.72488L10.1801 1.72488C10.2744 1.72943 10.3634 1.77012 10.4285 1.8385C10.4937 1.90688 10.53 1.99771 10.53 2.09216C10.53 2.18661 10.4937 2.27744 10.4285 2.34582C10.3634 2.4142 10.2744 2.45489 10.1801 2.45945L3.8929 2.45945ZM2.34404 1.23544C2.17451 1.23544 2.00879 1.28572 1.86784 1.3799C1.72688 1.47408 1.61702 1.60795 1.55214 1.76458C1.48727 1.9212 1.47029 2.09354 1.50337 2.25981C1.53644 2.42608 1.61807 2.57881 1.73795 2.69868C1.85782 2.81856 2.01055 2.90019 2.17682 2.93327C2.34309 2.96634 2.51543 2.94936 2.67206 2.88449C2.82868 2.81961 2.96255 2.70975 3.05673 2.56879C3.15092 2.42784 3.20119 2.26212 3.20119 2.09259C3.2013 1.97996 3.17921 1.8684 3.13619 1.76431C3.09316 1.66022 3.03004 1.56563 2.95044 1.48594C2.87083 1.40626 2.77631 1.34304 2.67226 1.29992C2.56821 1.25679 2.45668 1.23459 2.34404 1.23459V1.23544Z" fill="currentColor"/>
4
+ <path d="M6.0975 11.2752C6.01491 11.6239 5.81705 11.9345 5.53596 12.1568C5.25488 12.3791 4.907 12.5 4.54864 12.5C4.19028 12.5 3.84241 12.3791 3.56132 12.1568C3.28024 11.9345 3.08238 11.6239 2.99978 11.2752H0.385491C0.335766 11.2776 0.286069 11.2699 0.239415 11.2525C0.192761 11.2351 0.150121 11.2085 0.114079 11.1741C0.0780373 11.1398 0.0493441 11.0985 0.0297394 11.0527C0.0101337 11.0069 2.67029e-05 10.9577 2.67029e-05 10.9079C2.67029e-05 10.8581 0.0101337 10.8088 0.0297394 10.7631C0.0493441 10.7173 0.0780373 10.676 0.114079 10.6417C0.150121 10.6073 0.192761 10.5807 0.239415 10.5633C0.286069 10.5459 0.335766 10.5382 0.385491 10.5406H2.99978C3.08238 10.1919 3.28024 9.88126 3.56132 9.65898C3.84241 9.43669 4.19028 9.31577 4.54864 9.31577C4.907 9.31577 5.25488 9.43669 5.53596 9.65898C5.81705 9.88126 6.01491 10.1919 6.0975 10.5406H10.1801C10.2298 10.5382 10.2795 10.5459 10.3262 10.5633C10.3728 10.5807 10.4155 10.6073 10.4515 10.6417C10.4875 10.676 10.5162 10.7173 10.5358 10.7631C10.5554 10.8088 10.5656 10.8581 10.5656 10.9079C10.5656 10.9577 10.5554 11.0069 10.5358 11.0527C10.5162 11.0985 10.4875 11.1398 10.4515 11.1741C10.4155 11.2085 10.3728 11.2351 10.3262 11.2525C10.2795 11.2699 10.2298 11.2776 10.1801 11.2752H6.0975ZM4.54779 10.0503C4.37826 10.0503 4.21254 10.1006 4.07158 10.1948C3.93063 10.289 3.82077 10.4228 3.75589 10.5795C3.69101 10.7361 3.67404 10.9084 3.70711 11.0747C3.74018 11.241 3.82182 11.3937 3.94169 11.5136C4.06157 11.6334 4.2143 11.7151 4.38057 11.7481C4.54684 11.7812 4.71918 11.7642 4.8758 11.6994C5.03242 11.6345 5.16629 11.5246 5.26048 11.3837C5.35466 11.2427 5.40493 11.077 5.40493 10.9075C5.40493 10.6801 5.31463 10.4621 5.15388 10.3014C4.99313 10.1406 4.77512 10.0503 4.54779 10.0503Z" fill="currentColor"/>
5
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="24px" height="24px" viewBox="0 -960 960 960">
2
+ <path fill="currentColor" d="m380-300 280-180-280-180v360ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="18" height="18" viewBox="0 0 19 19">
2
+ <path fill="currentColor" d="M16.593,2.407a8.155,8.155,0,0,0-11.569,0A8.166,8.166,0,0,0,4.18,12.983L.38,16.8a1.3,1.3,0,0,0,0,1.837A1.372,1.372,0,0,0,1.288,19a1.3,1.3,0,0,0,.908-.38L6.017,14.8A8.172,8.172,0,0,0,16.593,2.407ZM15.327,12.688A6.4,6.4,0,1,1,17.184,8.17,6.324,6.324,0,0,1,15.327,12.688Z" />
3
+ </svg>
@@ -1,14 +1,8 @@
1
1
  <script lang="ts">
2
- import { titleUrl } from '$lib/routes'
3
- import { SplitTest } from '$lib/enums/SplitTest'
4
- import { t } from '$lib/localization'
5
- import { mergePlaylinks } from '$lib/playlink'
6
- import { isInSplitTestVariant, trackSplitTestAction } from '$lib/splitTest'
7
2
  import type { TitleData } from '$lib/types/title'
3
+ import PlaylinksCompact from './Playlinks/PlaylinksCompact.svelte'
8
4
  import IconArrow from './Icons/IconArrow.svelte'
9
5
  import IconIMDb from './Icons/IconIMDb.svelte'
10
- import PlaylinkIcon from './Playlinks/PlaylinkIcon.svelte'
11
- import PlaylinkLabel from './Playlinks/PlaylinkLabel.svelte'
12
6
  import TitlePoster from './TitlePoster.svelte'
13
7
 
14
8
  interface Props {
@@ -18,18 +12,9 @@
18
12
  }
19
13
 
20
14
  const { title, onclick = () => null }: Props = $props()
21
-
22
- const playlinks = $derived(mergePlaylinks(title.providers))
23
- const limitedPlaylinks = $derived(playlinks.slice(0, 3))
24
- const playlinksAsLabels = isInSplitTestVariant(SplitTest.ParticipantPlaylinkFormat, 1)
25
-
26
- function onPlaylinkClick(event: MouseEvent) {
27
- event.stopPropagation()
28
- trackSplitTestAction(SplitTest.ParticipantPlaylinkFormat, 'click')
29
- }
30
15
  </script>
31
16
 
32
- <a class="title" href={titleUrl(title)} {onclick} data-testid="title">
17
+ <button class="title" {onclick} data-testid="title">
33
18
  <div class="poster">
34
19
  <TitlePoster {title} width={30} height={43} lazy />
35
20
  </div>
@@ -40,7 +25,7 @@
40
25
  <div class="meta">
41
26
  <div class="imdb">
42
27
  <IconIMDb size={11} />
43
- {title.imdb_score}
28
+ {title.imdb_score || '-'}
44
29
  </div>
45
30
 
46
31
  <div>{title.year}</div>
@@ -55,33 +40,13 @@
55
40
  {title.description}
56
41
  </div>
57
42
 
58
- <div class="playlinks">
59
- {#each limitedPlaylinks as playlink}
60
- {#if playlinksAsLabels}
61
- <PlaylinkLabel {playlink} onclick={onPlaylinkClick} />
62
- {:else}
63
- <PlaylinkIcon {playlink} onclick={onPlaylinkClick} />
64
- {/if}
65
- {/each}
66
-
67
- {#if playlinks.length > limitedPlaylinks.length}
68
- <span class="more">
69
- +{playlinks.length - limitedPlaylinks.length}
70
- </span>
71
- {/if}
72
-
73
- {#if !playlinks.length}
74
- <div class="empty" data-testid="playlinks-empty">
75
- {t('Title Unavailable')}
76
- </div>
77
- {/if}
78
- </div>
43
+ <PlaylinksCompact playlinks={title.providers} />
79
44
  </div>
80
45
 
81
46
  <div class="action">
82
47
  <IconArrow />
83
48
  </div>
84
- </a>
49
+ </button>
85
50
 
86
51
  <style lang="scss">
87
52
  .title {
@@ -90,18 +55,18 @@
90
55
  align-items: center;
91
56
  width: 100%;
92
57
  background: theme(list-item-background, lighter);
93
- padding: margin(0.5);
58
+ padding: theme(list-item-padding, margin(0.5));
94
59
  border: 0;
95
60
  border-radius: theme(list-item-border-radius, border-radius);
96
61
  text-decoration: none;
97
62
  font-style: normal !important;
63
+ font-family: theme(font-family);
64
+ cursor: pointer;
98
65
 
99
66
  &:hover {
100
67
  filter: brightness(theme(list-item-hover-filter-brightness, hover-filter-brightness));
101
- }
102
-
103
- &:last-child {
104
- border-bottom: 0;
68
+ background: theme(list-item-hover-background, lighter);
69
+ box-shadow: theme(list-item-hover-shadow, none);
105
70
  }
106
71
  }
107
72
 
@@ -166,29 +131,6 @@
166
131
  color: theme(list-item-description-text-color, text-color);
167
132
  }
168
133
 
169
- .playlinks {
170
- display: flex;
171
- flex-wrap: wrap;
172
- gap: margin(0.25);
173
- margin-top: auto;
174
- }
175
-
176
- .more {
177
- display: flex;
178
- align-items: center;
179
- padding: 0 margin(0.25);
180
- color: theme(list-item-more-text-color, text-color-alt);
181
- font-size: theme(detail-font-size-small, font-size-small);
182
- }
183
-
184
- .empty {
185
- margin-top: margin(0.5);
186
- opacity: 0.65;
187
- font-style: italic;
188
- font-size: 0.85em;
189
- white-space: initial;
190
- }
191
-
192
134
  .action {
193
135
  display: flex;
194
136
  margin: 0 margin(0.5) 0 auto;
@@ -0,0 +1,42 @@
1
+ <div class="skeleton" data-testid="skeleton">
2
+ <div class="poster"></div>
3
+
4
+ <div class="lines">
5
+ <div class="line" style:width="40%"></div>
6
+ <div class="line" style:width="60%"></div>
7
+ <div class="line" style:width="80%"></div>
8
+ </div>
9
+ </div>
10
+
11
+ <style lang="scss">
12
+ .skeleton {
13
+ display: flex;
14
+ align-items: center;
15
+ width: 100%;
16
+ gap: margin(1);
17
+ }
18
+
19
+ .poster {
20
+ flex: 0 0 auto;
21
+ height: auto;
22
+ align-self: start;
23
+ width: margin(4.125);
24
+ aspect-ratio: 2/3;
25
+ border-radius: theme(detail-image-border-radius, border-radius);
26
+ background: theme(content);
27
+ }
28
+
29
+ .lines {
30
+ display: flex;
31
+ flex-direction: column;
32
+ gap: margin(0.5);
33
+ width: 100%;
34
+ }
35
+
36
+ .line {
37
+ width: 60%;
38
+ height: theme(font-size-base);
39
+ background: theme(content);
40
+ border-radius: 5rem;
41
+ }
42
+ </style>