@playpilot/tpi 1.1.0 → 1.3.0
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.
- package/dist/link-injections.js +7 -7
- package/package.json +3 -1
- package/src/lib/api.js +4 -2
- package/src/lib/linkInjection.js +11 -4
- package/src/lib/playlink.js +28 -0
- package/src/lib/scss/_functions.scss +3 -0
- package/src/lib/scss/global.scss +75 -0
- package/src/lib/{variables.css → scss/variables.scss} +8 -2
- package/src/lib/url.js +7 -0
- package/src/routes/+layout.svelte +23 -21
- package/src/routes/+page.svelte +20 -18
- package/src/routes/components/AfterArticlePlaylinks.svelte +12 -11
- package/src/routes/components/ContextMenu.svelte +9 -9
- package/src/routes/components/Description.svelte +7 -7
- package/src/routes/components/Editorial/Alert.svelte +4 -4
- package/src/routes/components/Editorial/DragHandle.svelte +27 -26
- package/src/routes/components/Editorial/Editor.svelte +63 -47
- package/src/routes/components/Editorial/EditorItem.svelte +44 -44
- package/src/routes/components/Editorial/ManualInjection.svelte +23 -20
- package/src/routes/components/Editorial/PlaylinkTypeSelect.svelte +22 -22
- package/src/routes/components/Editorial/Search/TitleSearch.svelte +22 -22
- package/src/routes/components/Editorial/Switch.svelte +21 -20
- package/src/routes/components/Editorial/TextInput.svelte +12 -12
- package/src/routes/components/Genres.svelte +8 -8
- package/src/routes/components/Icons/IconChevron.svelte +1 -1
- package/src/routes/components/Modal.svelte +13 -15
- package/src/routes/components/Participants.svelte +11 -9
- package/src/routes/components/Playlinks.svelte +44 -39
- package/src/routes/components/Popover.svelte +17 -15
- package/src/routes/components/RoundButton.svelte +6 -6
- package/src/routes/components/SkeletonText.svelte +15 -15
- package/src/routes/components/Title.svelte +61 -57
- package/src/tests/lib/api.test.js +8 -0
- package/src/tests/lib/linkInjection.test.js +8 -5
- package/src/tests/lib/playlink.test.js +82 -0
- package/src/tests/lib/url.test.js +35 -0
- package/src/tests/routes/components/Editorial/Editor.test.js +8 -2
- package/src/tests/routes/components/Editorial/ManualInjection.test.js +51 -0
- package/src/typedefs.js +1 -1
- package/svelte.config.js +9 -0
- package/src/lib/global.css +0 -69
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
{/if}
|
|
93
93
|
</div>
|
|
94
94
|
|
|
95
|
-
<style>
|
|
95
|
+
<style lang="scss">
|
|
96
96
|
.search {
|
|
97
97
|
position: relative;
|
|
98
98
|
}
|
|
@@ -100,12 +100,12 @@
|
|
|
100
100
|
.results {
|
|
101
101
|
z-index: 1;
|
|
102
102
|
position: absolute;
|
|
103
|
-
top: calc(100% + 0.
|
|
103
|
+
top: calc(100% + margin(0.5));
|
|
104
104
|
left: 0;
|
|
105
105
|
right: 0;
|
|
106
106
|
height: 30vh;
|
|
107
|
-
max-height:
|
|
108
|
-
border-radius: 0.
|
|
107
|
+
max-height: margin(10);
|
|
108
|
+
border-radius: margin(0.5);
|
|
109
109
|
background: var(--playpilot-light);
|
|
110
110
|
scrollbar-width: thin;
|
|
111
111
|
overflow: auto;
|
|
@@ -116,28 +116,28 @@
|
|
|
116
116
|
appearance: none;
|
|
117
117
|
display: flex;
|
|
118
118
|
align-items: flex-start;
|
|
119
|
-
gap:
|
|
119
|
+
gap: margin(1);
|
|
120
120
|
width: 100%;
|
|
121
121
|
background: transparent;
|
|
122
122
|
border: 0;
|
|
123
|
-
padding: 0.
|
|
123
|
+
padding: margin(0.5);
|
|
124
124
|
border-bottom: 1px solid var(--playpilot-content);
|
|
125
125
|
color: var(--playpilot-text-color-alt);
|
|
126
126
|
font-family: inherit;
|
|
127
127
|
text-align: left;
|
|
128
|
-
}
|
|
129
128
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
&:hover {
|
|
130
|
+
background: var(--playpilot-lighter);
|
|
131
|
+
}
|
|
133
132
|
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
&:last-child {
|
|
134
|
+
border-bottom: 0;
|
|
135
|
+
}
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
.poster {
|
|
139
|
-
width: 1.
|
|
140
|
-
border-radius: 0.
|
|
139
|
+
width: margin(1.75);
|
|
140
|
+
border-radius: margin(0.25);
|
|
141
141
|
height: auto;
|
|
142
142
|
background: var(--playpilot-dark);
|
|
143
143
|
}
|
|
@@ -149,28 +149,28 @@
|
|
|
149
149
|
.meta {
|
|
150
150
|
display: flex;
|
|
151
151
|
flex-wrap: wrap;
|
|
152
|
-
gap: 0 0.
|
|
153
|
-
font-size: 0.
|
|
152
|
+
gap: 0 margin(0.5);
|
|
153
|
+
font-size: margin(0.75);
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
.imdb {
|
|
157
157
|
display: flex;
|
|
158
158
|
align-items: center;
|
|
159
|
-
gap: 0.
|
|
159
|
+
gap: margin(0.25);
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
.empty {
|
|
163
|
-
padding: 0.
|
|
164
|
-
font-size: 0.
|
|
163
|
+
padding: margin(0.5);
|
|
164
|
+
font-size: margin(0.75);
|
|
165
165
|
color: var(--playpilot-text-color-alt);
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
.open-in-new-tab {
|
|
169
169
|
margin-left: auto;
|
|
170
170
|
color: var(--playpilot-text-color-alt);
|
|
171
|
-
}
|
|
172
171
|
|
|
173
|
-
|
|
174
|
-
|
|
172
|
+
&:hover {
|
|
173
|
+
color: vaR(--playpilot-text-color);
|
|
174
|
+
}
|
|
175
175
|
}
|
|
176
176
|
</style>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
</div>
|
|
17
17
|
</button>
|
|
18
18
|
|
|
19
|
-
<style>
|
|
19
|
+
<style lang="scss">
|
|
20
20
|
.switch {
|
|
21
21
|
appearance: none;
|
|
22
22
|
display: flex;
|
|
@@ -35,42 +35,43 @@
|
|
|
35
35
|
.label {
|
|
36
36
|
display: flex;
|
|
37
37
|
align-items: center;
|
|
38
|
-
gap: 0.
|
|
39
|
-
margin-right: 0.
|
|
38
|
+
gap: margin(0.5);
|
|
39
|
+
margin-right: margin(0.5);
|
|
40
40
|
font-family: var(--playpilot-font-family);
|
|
41
41
|
color: var(--playpilot-text-color-alt);
|
|
42
|
-
font-size: 0.
|
|
43
|
-
}
|
|
42
|
+
font-size: margin(0.75);
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
.switch:hover & {
|
|
45
|
+
color: var(--playpilot-text-color);
|
|
46
|
+
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.track {
|
|
50
50
|
position: relative;
|
|
51
|
-
width:
|
|
52
|
-
height: 1.
|
|
53
|
-
border-radius:
|
|
51
|
+
width: margin(2);
|
|
52
|
+
height: margin(1.25);
|
|
53
|
+
border-radius: margin(1);
|
|
54
54
|
background: var(--playpilot-content);
|
|
55
55
|
transition: background-color 100ms;
|
|
56
|
-
}
|
|
57
56
|
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
.active & {
|
|
58
|
+
background: var(--playpilot-green);
|
|
59
|
+
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
.knob {
|
|
63
63
|
position: absolute;
|
|
64
|
-
top: 0.
|
|
65
|
-
left: 0.
|
|
66
|
-
height:
|
|
67
|
-
width:
|
|
64
|
+
top: margin(0.125);
|
|
65
|
+
left: margin(0.125);
|
|
66
|
+
height: margin(1);
|
|
67
|
+
width: margin(1);
|
|
68
68
|
border-radius: 50%;
|
|
69
69
|
background: white;
|
|
70
70
|
transition: left 100ms;
|
|
71
|
-
}
|
|
72
71
|
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
.active & {
|
|
73
|
+
left: margin(0.875);
|
|
74
|
+
}
|
|
75
75
|
}
|
|
76
|
+
|
|
76
77
|
</style>
|
|
@@ -5,25 +5,25 @@
|
|
|
5
5
|
|
|
6
6
|
<input type="text" bind:value {name} aria-label={label} placeholder={label} {readonly} {oninput} />
|
|
7
7
|
|
|
8
|
-
<style>
|
|
8
|
+
<style lang="scss">
|
|
9
9
|
input {
|
|
10
10
|
width: 100%;
|
|
11
|
-
padding: 0.
|
|
11
|
+
padding: margin(0.5) margin(1);
|
|
12
12
|
border: 0;
|
|
13
|
-
border-radius:
|
|
13
|
+
border-radius: margin(2);
|
|
14
14
|
background: var(--playpilot-light);
|
|
15
15
|
color: var(--playpilot-text-color-alt);
|
|
16
|
-
font-size: 0.
|
|
16
|
+
font-size: margin(0.75);
|
|
17
17
|
font-family: var(--playpilot-font-family);
|
|
18
|
-
}
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
&:focus {
|
|
20
|
+
background: var(--playpilot-lighter);
|
|
21
|
+
outline: 1px solid white;
|
|
22
|
+
}
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
&::placeholder {
|
|
25
|
+
color: var(--playpilot-text-color-alt);
|
|
26
|
+
opacity: 0.75;
|
|
27
|
+
}
|
|
28
28
|
}
|
|
29
29
|
</style>
|
|
@@ -18,25 +18,25 @@
|
|
|
18
18
|
<button class="genre expand" onclick={() => expanded = true}>+{genres.length - 1}</button>
|
|
19
19
|
{/if}
|
|
20
20
|
|
|
21
|
-
<style>
|
|
21
|
+
<style lang="scss">
|
|
22
22
|
.genre {
|
|
23
23
|
display: flex;
|
|
24
24
|
flex-wrap: wrap;
|
|
25
25
|
background: var(--playpilot-genre-background, var(--playpilot-content));
|
|
26
26
|
border: 0;
|
|
27
|
-
border-radius: var(--playpilot-genre-border-radius,
|
|
28
|
-
padding: 0.
|
|
27
|
+
border-radius: var(--playpilot-genre-border-radius, margin(1));
|
|
28
|
+
padding: margin(0.25) margin(0.5);
|
|
29
29
|
font-family: var(--playpilot-genre-font-family, inherit);
|
|
30
30
|
font-weight: var(--playpilot-playlink-font-weight, inherit);
|
|
31
31
|
text-transform: var(--playpilot-genre-text-transform, none);
|
|
32
32
|
color: var(--playpilot-genre-text-color, var(--playpilot-text-color-alt));
|
|
33
33
|
line-height: 1;
|
|
34
34
|
font-size: inherit;
|
|
35
|
-
}
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
&:is(button):hover {
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
filter: var(--playpilot-genre-hover-filter, brightness(1.1));
|
|
39
|
+
background: var(--playpilot-genre-hover-background, var(--playpilot-genre-background));
|
|
40
|
+
}
|
|
41
41
|
}
|
|
42
42
|
</style>
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
<div class="backdrop" onclick={() => onclose()}></div>
|
|
47
47
|
</div>
|
|
48
48
|
|
|
49
|
-
<style>
|
|
49
|
+
<style lang="scss">
|
|
50
50
|
.modal {
|
|
51
51
|
z-index: 9999;
|
|
52
52
|
position: fixed;
|
|
@@ -58,14 +58,13 @@
|
|
|
58
58
|
width: 100%;
|
|
59
59
|
height: 100%;
|
|
60
60
|
background: var(--playpilot-detail-backdrop, rgba(0, 0, 0, 0.65));
|
|
61
|
-
}
|
|
62
61
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
padding: 2rem;
|
|
62
|
+
@media (min-width: 600px) {
|
|
63
|
+
padding: margin(2);
|
|
66
64
|
}
|
|
67
65
|
}
|
|
68
66
|
|
|
67
|
+
|
|
69
68
|
.dialog {
|
|
70
69
|
position: relative;
|
|
71
70
|
width: 100%;
|
|
@@ -73,18 +72,17 @@
|
|
|
73
72
|
max-height: 80vh;
|
|
74
73
|
overflow: auto;
|
|
75
74
|
margin-top: auto;
|
|
76
|
-
border-radius: var(--playpilot-detail-border-radius,
|
|
75
|
+
border-radius: var(--playpilot-detail-border-radius, margin(1) margin(1) 0 0);
|
|
77
76
|
background: var(--playpilot-detail-background, var(--playpilot-light));
|
|
78
|
-
}
|
|
79
77
|
|
|
80
|
-
|
|
81
|
-
.dialog {
|
|
78
|
+
@media (min-width: 600px) {
|
|
82
79
|
margin-top: 0;
|
|
83
|
-
border-radius: var(--playpilot-detail-border-radius,
|
|
80
|
+
border-radius: var(--playpilot-detail-border-radius, margin(1));
|
|
84
81
|
max-height: 100%;
|
|
85
82
|
}
|
|
86
83
|
}
|
|
87
84
|
|
|
85
|
+
|
|
88
86
|
.backdrop {
|
|
89
87
|
position: absolute;
|
|
90
88
|
top: 0;
|
|
@@ -96,11 +94,11 @@
|
|
|
96
94
|
.close {
|
|
97
95
|
z-index: 5;
|
|
98
96
|
position: absolute;
|
|
99
|
-
top:
|
|
100
|
-
right:
|
|
101
|
-
}
|
|
97
|
+
top: margin(1);
|
|
98
|
+
right: margin(1);
|
|
102
99
|
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
&:hover {
|
|
101
|
+
filter: brightness(1.1);
|
|
102
|
+
}
|
|
105
103
|
}
|
|
106
104
|
</style>
|
|
@@ -15,26 +15,28 @@
|
|
|
15
15
|
{/each}
|
|
16
16
|
</div>
|
|
17
17
|
|
|
18
|
-
<style>
|
|
18
|
+
<style lang="scss">
|
|
19
19
|
h2 {
|
|
20
|
-
margin: 1.
|
|
20
|
+
margin: margin(1.5) 0 margin(1);
|
|
21
21
|
font-size: var(--playpilot-cast-title-font-size, 18px);
|
|
22
|
+
line-height: normal;
|
|
22
23
|
font-weight: inherit;
|
|
24
|
+
color: var(--playpilot-cast-title-text-color, var(--playpilot-text-color));
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
.participants {
|
|
26
28
|
display: flex;
|
|
27
|
-
gap:
|
|
28
|
-
width: calc(100% +
|
|
29
|
-
padding: 0
|
|
30
|
-
margin: 0 -
|
|
29
|
+
gap: margin(1);
|
|
30
|
+
width: calc(100% + margin(2));
|
|
31
|
+
padding: 0 margin(1);
|
|
32
|
+
margin: 0 margin(-1);
|
|
31
33
|
overflow: auto;
|
|
32
34
|
white-space: nowrap;
|
|
33
35
|
scrollbar-width: none;
|
|
34
|
-
}
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
&::-webkit-scrollbar {
|
|
38
|
+
display: none;
|
|
39
|
+
}
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
.character {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { TrackingEvent } from '$lib/enums/TrackingEvent'
|
|
3
|
+
import { mergePlaylinks } from '$lib/playlink'
|
|
3
4
|
import { track } from '$lib/tracking'
|
|
4
5
|
import IconContinue from './Icons/IconContinue.svelte'
|
|
5
6
|
import { getContext } from 'svelte'
|
|
@@ -10,12 +11,14 @@
|
|
|
10
11
|
const isModal = getContext('scope') === 'modal'
|
|
11
12
|
|
|
12
13
|
// Remove any playlinks without logos, as these are likely sub providers.
|
|
13
|
-
|
|
14
|
+
const filteredPlaylinks = $derived(playlinks.filter(playlink => !!playlink.logo_url))
|
|
15
|
+
const mergedPlaylink = $derived(mergePlaylinks(filteredPlaylinks))
|
|
14
16
|
|
|
15
17
|
const categoryStrings = {
|
|
16
18
|
SVOD: 'Stream',
|
|
17
19
|
BUY: 'Buy',
|
|
18
20
|
RENT: 'Rent',
|
|
21
|
+
TVOD: 'Rent or Buy',
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
/**
|
|
@@ -29,7 +32,7 @@
|
|
|
29
32
|
<h2>Where to stream online</h2>
|
|
30
33
|
|
|
31
34
|
<div class="playlinks" class:list>
|
|
32
|
-
{#each
|
|
35
|
+
{#each mergedPlaylink as { name, url, logo_url, extra_info: { category } }}
|
|
33
36
|
<a href={url} target="_blank" class="playlink" onclick={() => onclick(name)} data-playlink={name} rel="sponsored">
|
|
34
37
|
<img src={logo_url} alt="" height="32" width="32" />
|
|
35
38
|
|
|
@@ -53,39 +56,33 @@
|
|
|
53
56
|
{/if}
|
|
54
57
|
</div>
|
|
55
58
|
|
|
56
|
-
<style>
|
|
59
|
+
<style lang="scss">
|
|
57
60
|
h2 {
|
|
58
61
|
margin: 0;
|
|
59
62
|
color: var(--playpilot-playlinks-title-color, var(--playpilot-text-color-alt));
|
|
60
63
|
font-family: var(--playpilot-playlinks-title-font-family, inherit);
|
|
61
64
|
font-weight: var(--playpilot-playlinks-title-font-weight, lighter);
|
|
62
65
|
font-size: var(--playpilot-playlinks-title-font-size, 14px);
|
|
66
|
+
line-height: normal;
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
img {
|
|
66
|
-
border-radius: 0.
|
|
70
|
+
border-radius: margin(0.5);
|
|
67
71
|
background: rgba(0, 0, 0, 0.25);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
@media (min-width: 640px) {
|
|
71
|
-
img {
|
|
72
|
-
height: 2.5rem;
|
|
73
|
-
width: 2.5rem;
|
|
74
|
-
}
|
|
75
72
|
|
|
76
|
-
|
|
77
|
-
height:
|
|
78
|
-
width:
|
|
73
|
+
@media (min-width: 640px) {
|
|
74
|
+
height: margin(2.5);
|
|
75
|
+
width: margin(2.5);
|
|
79
76
|
}
|
|
80
77
|
}
|
|
81
78
|
|
|
82
79
|
.playlinks {
|
|
83
80
|
box-sizing: border-box;
|
|
84
81
|
display: flex;
|
|
85
|
-
gap: 0.
|
|
86
|
-
width: calc(100% +
|
|
87
|
-
padding: 0.
|
|
88
|
-
margin: 0 -
|
|
82
|
+
gap: margin(0.5);
|
|
83
|
+
width: calc(100% + margin(2));
|
|
84
|
+
padding: margin(0.5) margin(1);
|
|
85
|
+
margin: 0 margin(-1);
|
|
89
86
|
overflow: auto;
|
|
90
87
|
scrollbar-width: none;
|
|
91
88
|
}
|
|
@@ -96,39 +93,47 @@
|
|
|
96
93
|
|
|
97
94
|
.list {
|
|
98
95
|
display: grid;
|
|
99
|
-
grid-template-columns: repeat(auto-fit, minmax(
|
|
96
|
+
grid-template-columns: repeat(auto-fit, minmax(margin(15), 1fr));
|
|
97
|
+
|
|
98
|
+
img {
|
|
99
|
+
@media (min-width: 640px) {
|
|
100
|
+
height: margin(2);
|
|
101
|
+
width: margin(2);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
100
104
|
}
|
|
101
105
|
|
|
102
106
|
.playlink {
|
|
103
107
|
display: flex;
|
|
104
108
|
align-items: center;
|
|
105
|
-
gap: 0.
|
|
106
|
-
padding: 0.
|
|
109
|
+
gap: margin(0.75);
|
|
110
|
+
padding: margin(0.75);
|
|
107
111
|
background: var(--playpilot-playlink-background, var(--playpilot-lighter));
|
|
108
112
|
box-shadow: var(--playpilot-playlink-shadow, var(--playpilot-shadow));
|
|
109
|
-
border-radius: var(--playpilot-playlink-border-radius, 0.
|
|
113
|
+
border-radius: var(--playpilot-playlink-border-radius, margin(0.5));
|
|
110
114
|
color: var(--playpilot-playlink-text-color, var(--playpilot-text-color-alt)) !important;
|
|
111
115
|
font-weight: var(--playpilot-playlink-font-weight, inherit);
|
|
116
|
+
font-style: var(--playpilot-playlink-font-style, normal);
|
|
112
117
|
text-decoration: none !important;
|
|
113
118
|
white-space: nowrap;
|
|
114
|
-
font-size: 0.
|
|
119
|
+
font-size: margin(0.75);
|
|
115
120
|
line-height: 1;
|
|
116
|
-
}
|
|
117
121
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
122
|
+
&:hover,
|
|
123
|
+
&:active {
|
|
124
|
+
filter: var(--playpilot-playlink-hover-filter, brightness(1.1));
|
|
125
|
+
background: var(--playpilot-playlink-hover-background, var(--playpilot-playlink-background, var(--playpilot-lighter)));
|
|
126
|
+
text-decoration: none !important;
|
|
127
|
+
}
|
|
121
128
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
129
|
+
img {
|
|
130
|
+
margin: 0;
|
|
131
|
+
}
|
|
126
132
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
text-decoration: none !important;
|
|
133
|
+
.list & {
|
|
134
|
+
padding: margin(0.5);
|
|
135
|
+
gap: margin(0.5);
|
|
136
|
+
}
|
|
132
137
|
}
|
|
133
138
|
|
|
134
139
|
.name {
|
|
@@ -137,8 +142,8 @@
|
|
|
137
142
|
}
|
|
138
143
|
|
|
139
144
|
.category {
|
|
140
|
-
margin-top: 0.
|
|
141
|
-
font-size: 0.
|
|
145
|
+
margin-top: margin(0.5);
|
|
146
|
+
font-size: margin(0.625);
|
|
142
147
|
color: var(--playpilot-playlink-category-text-color, var(--playpilot-text-color));
|
|
143
148
|
font-weight: var(--playpilot-playlink-category-font-weight, inherit);
|
|
144
149
|
font-family: var(--playpilot-playlink-category-font-family, inherit);
|
|
@@ -151,6 +156,6 @@
|
|
|
151
156
|
|
|
152
157
|
.arrow {
|
|
153
158
|
margin-left: auto;
|
|
154
|
-
padding: 0 0.
|
|
159
|
+
padding: 0 margin(0.5);
|
|
155
160
|
}
|
|
156
161
|
</style>
|
|
@@ -28,10 +28,11 @@
|
|
|
28
28
|
function positionElement() {
|
|
29
29
|
if (!element) return
|
|
30
30
|
|
|
31
|
-
const { top, right } = element.getBoundingClientRect()
|
|
31
|
+
const { top, right, bottom, height } = element.getBoundingClientRect()
|
|
32
32
|
const offset = getOffset()
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
// (If top of element is above top of page) && (If there's more space to the bottom of the link than the top)
|
|
35
|
+
flip = (top - offset < 0) && (window.innerHeight - bottom > top + height)
|
|
35
36
|
|
|
36
37
|
const fromRight = window.innerWidth - right - offset
|
|
37
38
|
if (right + offset > window.innerWidth) element.style.left = `${fromRight}px`
|
|
@@ -44,10 +45,11 @@
|
|
|
44
45
|
function setMaxHeight() {
|
|
45
46
|
if (!element) return
|
|
46
47
|
|
|
47
|
-
const { top } = element.getBoundingClientRect()
|
|
48
|
+
const { top, height } = element.getBoundingClientRect()
|
|
48
49
|
const offset = getOffset()
|
|
50
|
+
const availableSpace = flip ? (window.innerHeight - top - offset) : (top + height - offset)
|
|
49
51
|
|
|
50
|
-
maxHeight = Math.min(
|
|
52
|
+
maxHeight = Math.min(availableSpace, window.innerHeight * 0.8)
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
function getOffset() {
|
|
@@ -61,33 +63,33 @@
|
|
|
61
63
|
</div>
|
|
62
64
|
</div>
|
|
63
65
|
|
|
64
|
-
<style>
|
|
66
|
+
<style lang="scss">
|
|
65
67
|
.popover {
|
|
66
|
-
--offset: 0.
|
|
68
|
+
--offset: #{margin(0.5)};
|
|
67
69
|
position: absolute;
|
|
68
70
|
top: calc((var(--offset) - 1px) * -1); /* Add 1 pixel to account for rounding errors */
|
|
69
71
|
left: 0;
|
|
70
|
-
width: calc(100vw -
|
|
71
|
-
max-width:
|
|
72
|
+
width: calc(100vw - margin(2));
|
|
73
|
+
max-width: margin(20);
|
|
72
74
|
padding: var(--offset) 0;
|
|
73
75
|
transform: translateY(calc(-100% + var(--offset)));
|
|
74
76
|
z-index: 999;
|
|
75
|
-
}
|
|
76
77
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
&.flip {
|
|
79
|
+
top: auto;
|
|
80
|
+
bottom: calc(var(--offset) + 1px); /* Add 1 pixel to account for rounding errors */
|
|
81
|
+
transform: translateY(calc(100% + var(--offset)));
|
|
82
|
+
}
|
|
81
83
|
}
|
|
82
84
|
|
|
83
85
|
/* This is a separate element so that the parent can have an offset while still keeping the mouse inside */
|
|
84
86
|
.dialog {
|
|
85
87
|
cursor: default;
|
|
86
88
|
position: relative;
|
|
87
|
-
border-radius: var(--playpilot-popover-border-radius,
|
|
89
|
+
border-radius: var(--playpilot-popover-border-radius, margin(1));
|
|
88
90
|
background: var(--playpilot-popover-background, var(--playpilot-light));
|
|
89
91
|
box-shadow: var(--playpilot-popover-shadow, var(--playpilot-shadow-large));
|
|
90
|
-
max-height: min(var(--max-height),
|
|
92
|
+
max-height: min(var(--max-height), margin(35));
|
|
91
93
|
scrollbar-width: thin;
|
|
92
94
|
overflow-y: overlay;
|
|
93
95
|
overflow-x: hidden;
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
* @property {() => void} [onclick]
|
|
7
7
|
*/
|
|
8
8
|
/** @type {Props & { [key: string]: any }} */
|
|
9
|
-
const { children = null, size = '
|
|
9
|
+
const { children = null, size = 'margin(2)', onclick = () => null, ...rest } = $props()
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<svelte:element this={rest.href ? 'a' : 'button'} role={rest.href ? 'link' : 'button'} {onclick} class="button" style:--size={size} {...rest}>
|
|
13
13
|
{@render children?.()}
|
|
14
14
|
</svelte:element>
|
|
15
15
|
|
|
16
|
-
<style>
|
|
16
|
+
<style lang="scss">
|
|
17
17
|
.button {
|
|
18
18
|
display: flex;
|
|
19
19
|
align-items: center;
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
color: var(--playpilot-button-text-color, var(--playpilot-text-color-alt));
|
|
30
30
|
cursor: pointer;
|
|
31
31
|
transition: transform 50ms;
|
|
32
|
-
}
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
&:hover {
|
|
34
|
+
filter: brightness(1.2);
|
|
35
|
+
transform: scale(1.05);
|
|
36
|
+
}
|
|
37
37
|
}
|
|
38
38
|
</style>
|
|
@@ -8,26 +8,26 @@
|
|
|
8
8
|
<div class="skeleton" style:width="{Math.floor(Math.random() * (max - min) + min)}%"> </div>
|
|
9
9
|
{/each}
|
|
10
10
|
|
|
11
|
-
<style>
|
|
11
|
+
<style lang="scss">
|
|
12
12
|
.skeleton {
|
|
13
13
|
position: relative;
|
|
14
14
|
font-size: inherit;
|
|
15
15
|
line-height: inherit;
|
|
16
|
-
}
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
&:last-child {
|
|
18
|
+
margin-bottom: 0;
|
|
19
|
+
}
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
&::before {
|
|
22
|
+
display: block;
|
|
23
|
+
position: absolute;
|
|
24
|
+
top: 0;
|
|
25
|
+
left: 0;
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: calc(100% - margin(0.5));
|
|
28
|
+
border-radius: var(--playpilot-skeleton-border-radius, 2em);
|
|
29
|
+
background: var(--playpilot-lighter);
|
|
30
|
+
content: '';
|
|
31
|
+
}
|
|
32
32
|
}
|
|
33
33
|
</style>
|