File tree 1 file changed +14
-13
lines changed
1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,6 @@ import cloudinary from '~/utils/cloudinary'
3
3
4
4
const ID = 'in-roermond.jpg'
5
5
const VERSION = 1
6
- // approxiamte px value of w-40
7
- const SM_WIDTH_PX = 160
8
6
9
7
interface Props {
10
8
className ?: string
@@ -26,30 +24,30 @@ export default function ProfilePhoto({ className }: Props) {
26
24
version : VERSION ,
27
25
transformations : [
28
26
{
29
- width : SM_WIDTH_PX ,
27
+ width : 160 ,
30
28
aspectRatio : '4:5' ,
31
29
crop : 'fill' ,
32
30
gravity : 'face' ,
33
31
format : 'auto' ,
34
32
quality : 'auto' ,
35
33
} ,
36
34
] ,
37
- } ) } ${ SM_WIDTH_PX } w,
35
+ } ) } ${ 160 } w,
38
36
${ cloudinary ( ID , {
39
37
version : VERSION ,
40
38
transformations : [
41
39
{
42
- width : SM_WIDTH_PX * 2 ,
40
+ width : 160 * 2 ,
43
41
aspectRatio : '4:5' ,
44
42
crop : 'fill' ,
45
43
gravity : 'face' ,
46
44
format : 'auto' ,
47
45
quality : 'auto' ,
48
46
} ,
49
47
] ,
50
- } ) } ${ SM_WIDTH_PX * 2 } w
48
+ } ) } ${ 260 * 2 } w
51
49
` }
52
- sizes = { `${ SM_WIDTH_PX } px` }
50
+ sizes = { `${ 160 } px` }
53
51
/>
54
52
< img
55
53
alt = ""
@@ -58,7 +56,7 @@ export default function ProfilePhoto({ className }: Props) {
58
56
version : VERSION ,
59
57
transformations : [
60
58
{
61
- width : 450 ,
59
+ width : 160 ,
62
60
aspectRatio : '2:1' ,
63
61
crop : 'fill' ,
64
62
gravity : 'face' ,
@@ -72,30 +70,33 @@ export default function ProfilePhoto({ className }: Props) {
72
70
version : VERSION ,
73
71
transformations : [
74
72
{
75
- width : 450 ,
73
+ width : 360 ,
76
74
aspectRatio : '2:1' ,
77
75
crop : 'fill' ,
78
76
gravity : 'face' ,
79
77
format : 'auto' ,
80
78
quality : 'auto' ,
81
79
} ,
82
80
] ,
83
- } ) } 450w ,
81
+ } ) } ${ 360 } w ,
84
82
${ cloudinary ( ID , {
85
83
version : VERSION ,
86
84
transformations : [
87
85
{
88
- width : 900 ,
86
+ width : 360 * 2 ,
89
87
aspectRatio : '2:1' ,
90
88
crop : 'fill' ,
91
89
gravity : 'face' ,
92
90
format : 'auto' ,
93
91
quality : 'auto' ,
94
92
} ,
95
93
] ,
96
- } ) } 900w
94
+ } ) } ${ 360 * 2 } w
97
95
` }
98
- sizes = "100vw"
96
+ sizes = { [
97
+ `(min-width: ${ import . meta. env . SCREEN_SM } ) 160px` ,
98
+ 'min(360px, calc(100vw - var(--page-padding) * 2 - 0.75rem * 2))' ,
99
+ ] . join ( ', ' ) }
99
100
/>
100
101
</ picture >
101
102
</ div >
You can’t perform that action at this time.
0 commit comments