Skip to content

Commit c739e83

Browse files
✨ Add motion library
1 parent 502ead9 commit c739e83

File tree

3 files changed

+93
-1
lines changed

3 files changed

+93
-1
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"laravel-vite-plugin": "^1.2.0",
2222
"lodash": "^4.17.21",
2323
"minisearch": "^6.3.0",
24+
"motion": "^12.0.6",
2425
"postcss": "^8.5.1",
2526
"prettier": "^3.4.2",
2627
"prettier-plugin-blade": "^2.1.19",

resources/js/app.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import '../../docs/src/styles/docsearch.css'
1414
import 'swiper/css'
1515
import 'swiper/css/navigation'
1616
import 'swiper/css/pagination'
17+
import { animate, inView } from 'motion'
1718

1819
// Swiper
1920
Swiper.use([Navigation, Pagination])
@@ -39,9 +40,19 @@ window.reducedMotion = window.matchMedia(
3940
// Minisearch
4041
window.MiniSearch = MiniSearch
4142

43+
// Motion
44+
window.motion = {
45+
animate: animate,
46+
inView: inView,
47+
}
48+
4249
// Alpine
50+
Alpine.magic('refAll', (el) => {
51+
return (refName) => {
52+
return Array.from(el.querySelectorAll(`[x-ref="${refName}"]`))
53+
}
54+
})
4355
Alpine.store('sidebar', { isOpen: false })
44-
4556
Alpine.plugin(Tooltip)
4657

4758
// Docsearch

0 commit comments

Comments
 (0)