@playpilot/tpi 8.34.2 → 8.34.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playpilot/tpi",
3
- "version": "8.34.2",
3
+ "version": "8.34.4",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -79,3 +79,9 @@
79
79
  @content;
80
80
  }
81
81
  }
82
+
83
+ @mixin reduced-motion() {
84
+ @media (prefers-reduced-motion: "reduce") {
85
+ @content;
86
+ }
87
+ }
@@ -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 TinySlider from 'svelte-tiny-slider'
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 })}
@@ -35,7 +35,7 @@
35
35
  &:hover {
36
36
  filter: brightness(1.2);
37
37
  transform: scale(1.05);
38
- outline: 1px solid theme(button-hover-border-color, text-color-alt);
38
+ outline: 2px solid theme(button-hover-border-color, text-color-alt);
39
39
  }
40
40
  }
41
41
  </style>
@@ -47,7 +47,7 @@
47
47
  trackViaPixel(MetaEvent.GenreInterest, { genre: genreData.find(g => g.slug === genre)?.name, source: MetaSource.Link })
48
48
  })
49
49
 
50
- participants?.slice(0, 10).forEach(participant => {
50
+ participants?.slice(0, 20).forEach(participant => {
51
51
  trackViaPixel(MetaEvent.ParticipantInterest, { participant: participant.name, source: MetaSource.Link })
52
52
  })
53
53
 
@@ -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
- <button class="close" onclick={onclose} aria-label="Close">
28
- <IconClose size={24} />
29
- </button>
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
- appearance: none;
77
+ --playpilot-button-background: transparent;
78
+ --playpilot-button-text-color: white;
75
79
  z-index: 1;
76
80
  position: fixed;
77
- top: margin(2);
78
- right: margin(2);
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>