@linear_non/stellar-libs 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -0
- package/package.json +2 -2
- package/src/SplitOnScroll/index.js +4 -3
- package/src/Sticky/index.js +1 -1
- package/src/index.js +2 -1
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# stellar-libs
|
|
2
|
+
|
|
3
|
+
A collection of lightweight, reusable frontend UI behavior modules — built to work seamlessly with [`stellar-kit`](https://www.npmjs.com/package/@linear_non/stellar-kit) and the [Stellar](https://github.com/nonlinearstudio/stellar) frontend system. Each library is self-contained, configurable, and designed to be dropped into modular websites.
|
|
4
|
+
|
|
5
|
+
## ✨ Features
|
|
6
|
+
|
|
7
|
+
- **Sticky**: Basic sticky logic for DOM elements
|
|
8
|
+
- **SplitOnScroll**: Text splitting + reveal synced to scroll
|
|
9
|
+
- **Smooth**: Smooth scroll instance using Virtual Scroll
|
|
10
|
+
- Designed for plug-and-play usage inside Stellar Template
|
|
11
|
+
- Works with `kitStore`, `Resize`, `Scroll`, `Raf`, and GSAP if needed
|
|
12
|
+
|
|
13
|
+
## 📦 Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @linear_non/stellar-libs
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
> Note: Some libraries rely on `stellar-kit` for shared events, scroll, or utilities. Be sure to install both if needed:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @linear_non/stellar-kit
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 📁 Folder Structure
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
stellar-libs/
|
|
29
|
+
├── src/
|
|
30
|
+
│ ├── Sticky/ # Sticky behavior module
|
|
31
|
+
│ ├── SplitOnScroll/ # Scroll-triggered text reveals
|
|
32
|
+
│ ├── Smooth/ # Smooth scrolling system
|
|
33
|
+
│ └── ScrollBar/ # Custom scrollbar component
|
|
34
|
+
├── dev/ # Dev playgrounds for each lib
|
|
35
|
+
├── index.js # Entry point for exports
|
|
36
|
+
└── vite.config.js # Vite config to run individual demos
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 🧪 Local Development
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install
|
|
43
|
+
npm run dev
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
> This launches a Vite server and scans `dev/*/index.html` to preview each module. You can open individual demos for testing.
|
|
47
|
+
|
|
48
|
+
## 🛠️ Usage Example
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
import { Sticky } from "@linear_non/stellar-libs";
|
|
52
|
+
|
|
53
|
+
const sticky = new Sticky({
|
|
54
|
+
el: qs(".sticky"),
|
|
55
|
+
sticky: qs(".sticky-content"),
|
|
56
|
+
});
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
> You can find usage examples in each library’s README file also an HTML markup example. You can see a live example inside the `dev/` folder.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
### ✅ TODO
|
|
64
|
+
|
|
65
|
+
- [ ] Implement `Marquee` module
|
|
66
|
+
- [ ] Implement `Dropdown` module
|
|
67
|
+
- [ ] Implement `Lenis` scroll
|
|
68
|
+
- [ ] Update Readme files for each component
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
Made with ❤️ by [Non-Linear Studio](https://non-linear.studio)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linear_non/stellar-libs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Reusable JavaScript libraries for Non-Linear Studio projects.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"author": "Non-Linear Studio",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@linear_non/stellar-kit": "^1.0
|
|
28
|
+
"@linear_non/stellar-kit": "^1.1.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@linear_non/prettier-config": "^1.0.6",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { splitText, reverseSplit } from "@linear_non/stellar-kit/utils";
|
|
2
|
-
import {
|
|
2
|
+
import { EVENTS } from "@linear_non/stellar-kit/events";
|
|
3
|
+
import { ScrollTrigger } from "@linear_non/stellar-kit/gsap";
|
|
3
4
|
|
|
4
5
|
export default class SplitonScroll {
|
|
5
6
|
constructor({
|
|
@@ -41,9 +42,9 @@ export default class SplitonScroll {
|
|
|
41
42
|
|
|
42
43
|
handleEnter() {
|
|
43
44
|
const split = splitText(this.splitText);
|
|
44
|
-
split.on(
|
|
45
|
+
split.on(EVENTS.APP_SPLITTEXT_READY, (splits) => {
|
|
45
46
|
this.splits = [...splits];
|
|
46
|
-
this.animateCallback();
|
|
47
|
+
this.animateCallback([...splits]);
|
|
47
48
|
});
|
|
48
49
|
}
|
|
49
50
|
|
package/src/Sticky/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Sticky.js
|
|
2
2
|
import { bounds } from "@linear_non/stellar-kit/utils";
|
|
3
|
-
import { gsap, ScrollTrigger } from "@linear_non/stellar-kit/
|
|
3
|
+
import { gsap, ScrollTrigger } from "@linear_non/stellar-kit/gsap";
|
|
4
4
|
|
|
5
5
|
export default class Sticky {
|
|
6
6
|
constructor(obj) {
|
package/src/index.js
CHANGED