@playpilot/tpi 8.0.0 → 8.1.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/editorial.mount.js +7 -7
- package/dist/link-injections.js +1 -1
- package/dist/mount.js +7 -7
- package/package.json +1 -1
- package/src/routes/components/Modals/Modal.svelte +7 -2
- package/src/routes/components/Modals/RailModal.svelte +1 -1
- package/src/routes/components/Title.svelte +14 -15
- package/src/routes/components/YouTubeEmbedBackground.svelte +2 -0
- package/src/tests/routes/components/Modals/Modal.test.js +12 -0
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
prepend?: Snippet | null
|
|
19
19
|
tall?: boolean
|
|
20
20
|
wide?: boolean
|
|
21
|
-
|
|
21
|
+
blur?: boolean
|
|
22
22
|
closeButtonStyle?: 'shadow' | 'flat'
|
|
23
23
|
initialScrollPosition?: number
|
|
24
24
|
onscroll?: () => void
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
dialog,
|
|
33
33
|
tall = false,
|
|
34
34
|
wide = false,
|
|
35
|
+
blur = false,
|
|
35
36
|
closeButtonStyle = 'shadow',
|
|
36
37
|
initialScrollPosition = 0,
|
|
37
38
|
onscroll = () => null,
|
|
@@ -119,6 +120,7 @@
|
|
|
119
120
|
class="modal"
|
|
120
121
|
class:wide
|
|
121
122
|
class:tall
|
|
123
|
+
class:background-blur={blur}
|
|
122
124
|
class:has-bubble={!!bubble}
|
|
123
125
|
class:has-prepend={!!prepend}
|
|
124
126
|
style:--dialog-offset="{dialogOffset}px"
|
|
@@ -195,7 +197,6 @@
|
|
|
195
197
|
bottom: 0;
|
|
196
198
|
left: 0;
|
|
197
199
|
background: theme(detail-backdrop, rgba(0, 0, 0, 0.65));
|
|
198
|
-
backdrop-filter: blur(1.5rem);
|
|
199
200
|
|
|
200
201
|
@include desktop() {
|
|
201
202
|
overflow-y: auto;
|
|
@@ -207,6 +208,10 @@
|
|
|
207
208
|
&.has-bubble {
|
|
208
209
|
--playpilot-detail-background-border-radius: 0;
|
|
209
210
|
}
|
|
211
|
+
|
|
212
|
+
&.background-blur {
|
|
213
|
+
backdrop-filter: blur(1.5rem);
|
|
214
|
+
}
|
|
210
215
|
}
|
|
211
216
|
|
|
212
217
|
.dialog,
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
})
|
|
30
30
|
</script>
|
|
31
31
|
|
|
32
|
-
<Modal>
|
|
32
|
+
<Modal blur>
|
|
33
33
|
{#snippet dialog()}
|
|
34
34
|
<div class="rail-modal" style:--transition-duration="{transitionDuration}ms">
|
|
35
35
|
<TinySlider threshold={40} moveThreshold={40} transitionDuration={initialized ? transitionDuration : 0} bind:this={slider}>
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
useVideoBackground?: boolean
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
const { title, small = false, useVideoBackground =
|
|
29
|
+
const { title, small = false, useVideoBackground = true }: Props = $props()
|
|
30
30
|
|
|
31
31
|
const noAffiliate = !!window.PlayPilotLinkInjections?.no_affiliate
|
|
32
32
|
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
</div>
|
|
97
97
|
</div>
|
|
98
98
|
|
|
99
|
-
<div class="background">
|
|
99
|
+
<div class="background" class:small>
|
|
100
100
|
{#if useVideoBackground && hasYouTubeVideoAvailable}
|
|
101
101
|
<YouTubeEmbedBackground embeddable_url={title.embeddable_url!} />
|
|
102
102
|
{:else}
|
|
@@ -248,10 +248,21 @@
|
|
|
248
248
|
|
|
249
249
|
@include desktop() {
|
|
250
250
|
height: margin(12);
|
|
251
|
-
aspect-ratio: unset;
|
|
252
251
|
mask-image: linear-gradient(to bottom, black 60%, transparent);
|
|
253
252
|
}
|
|
254
253
|
|
|
254
|
+
@include mobile {
|
|
255
|
+
:global(.video-background) {
|
|
256
|
+
width: 225%;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
&.small {
|
|
261
|
+
:global(.video-background) {
|
|
262
|
+
width: 150%;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
255
266
|
img {
|
|
256
267
|
width: 100%;
|
|
257
268
|
height: 100%;
|
|
@@ -271,18 +282,6 @@
|
|
|
271
282
|
filter: blur(0.75rem);
|
|
272
283
|
}
|
|
273
284
|
}
|
|
274
|
-
|
|
275
|
-
@include mobile {
|
|
276
|
-
:global(.video-background) {
|
|
277
|
-
width: 225%;
|
|
278
|
-
margin-left: 50%;
|
|
279
|
-
transform: translateX(-50%);
|
|
280
|
-
|
|
281
|
-
:global(> iframe) {
|
|
282
|
-
transform: translateX(-50%) translateY(-50%);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
285
|
}
|
|
287
286
|
|
|
288
287
|
.capitalize {
|
|
@@ -121,6 +121,18 @@ describe('Modal.svelte', () => {
|
|
|
121
121
|
expect(getByTestId('modal').classList).toContain('wide')
|
|
122
122
|
})
|
|
123
123
|
|
|
124
|
+
it('Should not have blur class by default', () => {
|
|
125
|
+
const { getByTestId } = render(Modal, { children })
|
|
126
|
+
|
|
127
|
+
expect(getByTestId('modal').classList).not.toContain('background-blur')
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
it('Should have blur class when prop is given', () => {
|
|
131
|
+
const { getByTestId } = render(Modal, { children, blur: true })
|
|
132
|
+
|
|
133
|
+
expect(getByTestId('modal').classList).toContain('background-blur')
|
|
134
|
+
})
|
|
135
|
+
|
|
124
136
|
it('Should not show back button by default', () => {
|
|
125
137
|
const { queryByLabelText } = render(Modal, { children })
|
|
126
138
|
|