Skip to content

Commit 0105dfb

Browse files
chore: cleaning up lazysizes and swiper configs (#751)
* fixing swiper in vanilla js, removing lazysizes * fixing init in swiperOptions * changeset * updating comment * fixing path to adjacent file
1 parent ef27ca4 commit 0105dfb

File tree

9 files changed

+46
-332
lines changed

9 files changed

+46
-332
lines changed

.changeset/bright-peaches-tan.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@explorer-1/common": patch
3+
"@explorer-1/html": patch
4+
"@nasa-jpl/explorer-1": patch
5+
---
6+
7+
Cleaning up dependencies, fixing swiperOptions for vanilla JS

packages/common/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
},
1818
"dependencies": {
1919
"@fancyapps/ui": "^4.0.26",
20-
"lazysizes": "^5.3.0",
21-
"tailwindcss": "^3.4.3",
2220
"@tailwindcss/forms": "^0.5.7",
21+
"swiper": "^11.1.3",
22+
"tailwindcss": "^3.4.3",
2323
"tailwindcss-themer": "^4.0.0"
2424
},
2525
"devDependencies": {

packages/common/src/js/scripts.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import '@fancyapps/ui'
2-
import 'lazysizes'
32
import { initMixinCarousel, initBlockImageCarousel } from './vendors/_swiper.js'
43
import initBlockAccordion from './components/_BlockAccordion.js'
54
import initBackToTop from './components/_BackToTop.js'
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
/* Swiper
2-
* Configured to use any modules that are needed site-wide (SwiperCore.use([]))
3-
* Custom options are defined in constants
2+
* Configured to use any modules that are needed site-wide (Swiper.use([]))
3+
* Custom options are defined in constants
44
*/
55
import Swiper from 'swiper'
66
import { A11y, Navigation, Pagination } from 'swiper/modules'
77
import swiperOptions from './_swiperOptions.js'
88

9+
// Register modules globally
10+
Swiper.use([A11y, Navigation, Pagination])
11+
912
export function initMixinCarousel() {
1013
return new Swiper('.MixinCarousel .swiper', {
11-
modules: [A11y, Navigation, Pagination],
1214
...swiperOptions.MixinCarousel
13-
}).init()
15+
})
1416
}
1517

1618
export function initBlockImageCarousel() {
1719
return new Swiper('.BlockImageCarousel .swiper', {
18-
modules: [A11y, Navigation, Pagination],
1920
...swiperOptions.BlockImageCarousel
2021
})
2122
}

packages/common/src/js/vendors/_swiperOptions.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
const swiperOptions = {
66
MixinCarousel: {
7-
init: false,
87
slidesPerView: 1.25,
98
speed: 500,
109
threshold: 20, // swipe threshold in px

packages/html/index.html

Lines changed: 28 additions & 310 deletions
Large diffs are not rendered by default.

packages/html/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"@explorer-1/common": "workspace:*",
4141
"@explorer-1/prettier-config": "workspace:*",
4242
"autoprefixer": "^10.4.19",
43-
"lazysizes": "^5.3.0",
4443
"postcss-import": "^16.1.0",
4544
"typescript": "^5.4.5",
4645
"vite": "^5.3.1"

packages/html/src/components/BaseImage/BaseImage.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import 'lazysizes'
21
export const BaseImageTemplate = ({
32
src,
43
srcset,

pnpm-lock.yaml

Lines changed: 3 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)