@playpilot/tpi 8.34.2 → 8.34.3
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 +8 -8
- package/dist/link-injections.js +1 -1
- package/dist/mount.js +5 -5
- package/package.json +1 -1
- package/src/lib/scss/_mixins.scss +6 -0
- package/src/routes/components/Explore/Filter/Dropdown.svelte +2 -1
- package/src/routes/components/Modals/RailModal.svelte +7 -2
- package/src/routes/components/Rails/Rail.svelte +2 -1
- package/src/routes/components/RoundButton.svelte +1 -1
- package/src/routes/components/YouTubeEmbedOverlay.svelte +10 -20
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { scale } from 'svelte/transition'
|
|
3
3
|
import { tick, type Snippet } from 'svelte'
|
|
4
|
+
import { prefersReducedMotion } from 'svelte/motion'
|
|
4
5
|
|
|
5
6
|
interface Props {
|
|
6
7
|
button: Snippet<[{ toggle: (event: MouseEvent) => void }]>,
|
|
@@ -72,7 +73,7 @@
|
|
|
72
73
|
style:--max-height={maxHeight ? `${maxHeight}px` : null}
|
|
73
74
|
style:--offset={offset ? `${offset}px` : null}
|
|
74
75
|
bind:this={contentElement}
|
|
75
|
-
transition:scale={{ start: 0.85, duration: 100 }}>
|
|
76
|
+
transition:scale={{ start: prefersReducedMotion.current ? 1 : 0.85, duration: 100 }}>
|
|
76
77
|
{@render content()}
|
|
77
78
|
</div>
|
|
78
79
|
{/if}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount, type Snippet } from 'svelte'
|
|
3
|
-
import
|
|
3
|
+
import { prefersReducedMotion } from 'svelte/motion'
|
|
4
4
|
import { fade } from 'svelte/transition'
|
|
5
5
|
import { t } from '$lib/localization'
|
|
6
6
|
import { getFirstAdOfType } from '$lib/api/ads'
|
|
7
|
+
import TinySlider from 'svelte-tiny-slider'
|
|
7
8
|
import Modal from './Modal.svelte'
|
|
8
9
|
import IconArrow from '../Icons/IconArrow.svelte'
|
|
9
10
|
import ModalCloseOverlay from './ModalCloseOverlay.svelte'
|
|
@@ -19,10 +20,10 @@
|
|
|
19
20
|
|
|
20
21
|
const { items, initialIndex = 0, onchange = () => null, onclose = () => null, each, ...restProps }: Props = $props()
|
|
21
22
|
|
|
22
|
-
const transitionDuration = 300
|
|
23
23
|
|
|
24
24
|
let slider: TinySlider
|
|
25
25
|
let initialized = $state(false)
|
|
26
|
+
let transitionDuration = $state(prefersReducedMotion.current ? 0 : 300)
|
|
26
27
|
let availableHeight: number | null = $state(null)
|
|
27
28
|
let element: HTMLElement | null = $state(null)
|
|
28
29
|
let displayAd = $state(getFirstAdOfType('card'))
|
|
@@ -140,6 +141,10 @@
|
|
|
140
141
|
width: $size;
|
|
141
142
|
transition: opacity var(--transition-duration), transform var(--transition-duration);
|
|
142
143
|
|
|
144
|
+
@include reduced-motion {
|
|
145
|
+
transition: opacity 500ms;
|
|
146
|
+
}
|
|
147
|
+
|
|
143
148
|
&.active {
|
|
144
149
|
transform: none;
|
|
145
150
|
opacity: 1;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import TinySlider from 'svelte-tiny-slider'
|
|
4
4
|
import IconArrow from '../Icons/IconArrow.svelte'
|
|
5
5
|
import { heading as _heading } from '$lib/actions/heading'
|
|
6
|
+
import { prefersReducedMotion } from 'svelte/motion'
|
|
6
7
|
|
|
7
8
|
interface Props {
|
|
8
9
|
heading?: string
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
{/if}
|
|
29
30
|
|
|
30
31
|
<div class="rail">
|
|
31
|
-
<TinySlider bind:this={slider} {onchange} {onresize} bind:shown allowWheel>
|
|
32
|
+
<TinySlider bind:this={slider} {onchange} {onresize} transitionDuration={prefersReducedMotion.current ? 0 : 300} bind:shown allowWheel>
|
|
32
33
|
{@render children()}
|
|
33
34
|
|
|
34
35
|
{#snippet controls({ setIndex, currentIndex, reachedEnd })}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { fade } from 'svelte/transition'
|
|
3
3
|
import IconClose from './Icons/IconClose.svelte'
|
|
4
4
|
import YouTubeEmbed from './YouTubeEmbed.svelte'
|
|
5
|
+
import RoundButton from './RoundButton.svelte'
|
|
5
6
|
|
|
6
7
|
interface Props {
|
|
7
8
|
embeddable_url: string,
|
|
@@ -24,9 +25,11 @@
|
|
|
24
25
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
25
26
|
<div class="backdrop" onclick={onclose} data-testid="backdrop"></div>
|
|
26
27
|
|
|
27
|
-
<
|
|
28
|
-
<
|
|
29
|
-
|
|
28
|
+
<div class="close">
|
|
29
|
+
<RoundButton size="42px" onclick={onclose} aria-label="Close">
|
|
30
|
+
<IconClose size={24} />
|
|
31
|
+
</RoundButton>
|
|
32
|
+
</div>
|
|
30
33
|
</div>
|
|
31
34
|
|
|
32
35
|
<style lang="scss">
|
|
@@ -71,24 +74,11 @@
|
|
|
71
74
|
}
|
|
72
75
|
|
|
73
76
|
.close {
|
|
74
|
-
|
|
77
|
+
--playpilot-button-background: transparent;
|
|
78
|
+
--playpilot-button-text-color: white;
|
|
75
79
|
z-index: 1;
|
|
76
80
|
position: fixed;
|
|
77
|
-
top: margin(
|
|
78
|
-
right: margin(
|
|
79
|
-
padding: 0;
|
|
80
|
-
margin: 0;
|
|
81
|
-
border: 0;
|
|
82
|
-
background: transparent;
|
|
83
|
-
color: white;
|
|
84
|
-
cursor: pointer;
|
|
85
|
-
|
|
86
|
-
&:hover {
|
|
87
|
-
transform: scale(1.1);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
&:active {
|
|
91
|
-
transform: scale(1);
|
|
92
|
-
}
|
|
81
|
+
top: margin(1);
|
|
82
|
+
right: margin(1);
|
|
93
83
|
}
|
|
94
84
|
</style>
|