File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed
Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 1313 < div class ="gallery ">
1414 < div class ="img-container ">
1515 < img
16- src ="https://source .unsplash.com/tzSLATuyZzM/640x853 "
16+ src ="https://images .unsplash.com/photo-1690790427878-ecf29d8b686b?q=80&w=640 "
1717 alt ="No elegance is possible without perfume "
18- data-original ="tzSLATuyZzM/1920x2560 "
18+ data-original ="1887 "
1919 />
2020 </ div >
2121 < div class ="img-container ">
2222 < img
23- src ="https://source .unsplash.com/GWQ2KmCXrQA/640x1137 "
23+ src ="https://images .unsplash.com/photo-1696218614256-b74c0bcde0d5?q=80&w=640 "
2424 alt ="It is the unseen, unforgettable, ultimate accessory "
25- data-original ="GWQ2KmCXrQA/1920x3413 "
25+ data-original ="1887 "
2626 />
2727 </ div >
2828 < div class ="img-container ">
2929 < img
30- src ="https://source .unsplash.com/nkWnc-W_GP8/640x853 "
30+ src ="https://images .unsplash.com/photo-1696218359361-b088f32f86b8?q=80&w=640 "
3131 alt ="A perfume is like a piece of clothing, a message "
32- data-original ="nkWnc-W_GP8/1920x2560 "
32+ data-original ="1887 "
3333 />
3434 </ div >
3535 < div class ="img-container ">
3636 < img
37- src ="https://source .unsplash.com/Ou00pmFFPKA/640x853 "
37+ src ="https://images .unsplash.com/photo-1690790591188-3503c1a4dcb6?q=80&w=640 "
3838 alt ="Perfume is like a parenthesis, a moment of freedom "
39- data-original ="Ou00pmFFPKA/1920x2560 "
39+ data-original ="1887 "
4040 />
4141 </ div >
4242 </ div >
Original file line number Diff line number Diff line change @@ -7,8 +7,10 @@ previews.forEach((preview) => {
77 preview . addEventListener ( "click" , ( ) => {
88 modal . classList . add ( "open" ) ;
99 original . classList . add ( "open" ) ;
10+ const originalUrl = new URL ( preview . src ) ;
1011 const originalSize = preview . getAttribute ( "data-original" ) ;
11- original . src = `https://source.unsplash.com/${ originalSize } ` ;
12+ originalUrl . searchParams . set ( "w" , originalSize ) ;
13+ original . src = originalUrl . toString ( ) ;
1214 caption . textContent = preview . alt ;
1315 // Reference: https://stackoverflow.com/questions/35213147/difference-between-textcontent-vs-innertext
1416 } ) ;
You can’t perform that action at this time.
0 commit comments