File tree 3 files changed +15
-7
lines changed
3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -35,18 +35,20 @@ export default function Exercise(props: ExerciseProps) {
35
35
const handleChange = ( event : React . ChangeEvent < HTMLTextAreaElement > ) => {
36
36
setNote ( event . target . value ) ;
37
37
} ;
38
+ const width : number = 382 ;
39
+ const height : number = Math . floor ( width / 16 * 9 ) ;
38
40
39
41
return (
40
42
< div className = { 'w-full max-w-96 flex flex-col rounded-lg border border-neutral-300 dark:border-neutral-600' } >
41
- < div className = { 'relative aspect-video rounded-t-lg cursor-pointer' }
43
+ < div className = { 'relative rounded-t-lg cursor-pointer' }
42
44
onClick = { ( ) => setDisplayVideoPlayer ( ! displayVideoPlayer ) } >
43
45
{ hasPreviewImage ? (
44
46
< Image
45
- src = { props . exercise . previewImageUrl ! }
47
+ src = { `https://wsrv.nl/?url= ${ props . exercise . previewImageUrl ! } &w= ${ width } &h= ${ height } &dpr=2` }
46
48
alt = { 'Woman holding dumbbell in white crew neck t-shirt' }
47
- width = { 1080 }
48
- height = { 721 }
49
- className = { 'rounded-t-lg object-cover w-96 h-auto ' } />
49
+ width = { width }
50
+ height = { height }
51
+ className = { 'rounded-t-lg object-cover' } />
50
52
) : (
51
53
< div className = 'w-full h-auto' >
52
54
< PreviewImagePlaceholder />
Original file line number Diff line number Diff line change @@ -33,10 +33,11 @@ export default function WorkoutPreview(props: WorkoutPreviewProps) {
33
33
const exercises = topUpPreviewImages ( exercisesWithImages )
34
34
. map ( ( exercise , index ) => {
35
35
const width = 128 ;
36
+ const height = Math . floor ( width / 16 * 9 ) ;
36
37
return < Image key = { `${ exercise . id } -${ index } ` }
37
- src = { exercise . previewImageUrl ! }
38
+ src = { `https://wsrv.nl/?url= ${ exercise . previewImageUrl ! } &w= ${ width } &h= ${ height } &dpr=2` }
38
39
width = { width }
39
- height = { width / 16 * 9 }
40
+ height = { height }
40
41
alt = { exercise . exerciseName }
41
42
/>
42
43
} )
Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ const nextConfig = {
7
7
hostname : '*.public.blob.vercel-storage.com' ,
8
8
port : '' ,
9
9
} ,
10
+ {
11
+ protocol : 'https' ,
12
+ hostname : 'wsrv.nl' ,
13
+ port : '' ,
14
+ } ,
10
15
] ,
11
16
} ,
12
17
} ;
You can’t perform that action at this time.
0 commit comments