File tree 4 files changed +9
-9
lines changed
shared-components/scrubber
4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 72
72
IMAGE_THUMBNAIL : { THUMBHASH_FADE_DURATION },
73
73
} = TUNABLES ;
74
74
75
- let isTouchDevice = $derived (mobileDevice .hoverNone );
75
+ let usingMobileDevice = $derived (mobileDevice .pointerCoarse );
76
76
let focussableElement: HTMLElement | undefined = $state ();
77
77
let mouseOver = $state (false );
78
78
let loaded = $state (false );
112
112
};
113
113
114
114
const onMouseEnter = () => {
115
- if (isTouchDevice ) {
115
+ if (usingMobileDevice ) {
116
116
return ;
117
117
}
118
118
mouseOver = true ;
191
191
onfocus ={handleFocus }
192
192
data-testid =" container-with-tabindex"
193
193
>
194
- {#if ! isTouchDevice && mouseOver && ! disableMouseOver }
194
+ {#if ! usingMobileDevice && mouseOver && ! disableMouseOver }
195
195
<!-- lazy show the url on mouse over-->
196
196
<a
197
197
class ="absolute z-30 {className } top-[41px]"
238
238
class:rounded-xl ={selected }
239
239
>
240
240
<!-- Gradient overlay on hover -->
241
- {#if ! isTouchDevice }
241
+ {#if ! usingMobileDevice }
242
242
<div
243
243
class =" absolute z-10 h-full w-full bg-gradient-to-b from-black/25 via-[transparent_25%] opacity-0 transition-opacity group-hover:opacity-100"
244
244
class:rounded-xl ={selected }
Original file line number Diff line number Diff line change 83
83
let bottomSectionHeight = 60 ;
84
84
let leadout = $state (false );
85
85
86
- const usingMobileDevice = $derived (mobileDevice .hoverNone );
86
+ const usingMobileDevice = $derived (mobileDevice .pointerCoarse );
87
87
88
88
const scrollTo = (top : number ) => {
89
89
element ?.scrollTo ({ top });
Original file line number Diff line number Diff line change 268
268
globalThis .removeEventListener (' touchmove' , onTouchMove );
269
269
};
270
270
});
271
- const usingMobileDevice = $derived (mobileDevice .hoverNone );
271
+ const usingMobileDevice = $derived (mobileDevice .pointerCoarse );
272
272
</script >
273
273
274
274
<svelte:window
Original file line number Diff line number Diff line change 1
1
import { MediaQuery } from 'svelte/reactivity' ;
2
2
3
- const hoverNone = new MediaQuery ( 'hover: none ' ) ;
3
+ const pointerCoarse = new MediaQuery ( 'pointer:coarse ' ) ;
4
4
const maxMd = new MediaQuery ( 'max-width: 767px' ) ;
5
5
6
6
export const mobileDevice = {
7
- get hoverNone ( ) {
8
- return hoverNone . current ;
7
+ get pointerCoarse ( ) {
8
+ return pointerCoarse . current ;
9
9
} ,
10
10
get maxMd ( ) {
11
11
return maxMd . current ;
You can’t perform that action at this time.
0 commit comments