masoneffect 0.1.9 → 0.1.11

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.
Files changed (2) hide show
  1. package/README.md +65 -56
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,16 +1,16 @@
1
1
  # MasonEffect
2
2
 
3
- 파티클 모핑 효과를 제공하는 라이브러리입니다. React, Vue, 그리고 바닐라 JavaScript에서 사용할 수 있습니다.
3
+ A library that provides particle morphing effects. It can be used with React, Vue, and vanilla JavaScript.
4
4
 
5
- ## 설치
5
+ ## Installation
6
6
 
7
7
  ```bash
8
8
  npm install masoneffect
9
9
  ```
10
10
 
11
- ## 사용법
11
+ ## Usage
12
12
 
13
- ### 바닐라 JavaScript
13
+ ### Vanilla JavaScript
14
14
 
15
15
  ```javascript
16
16
  import { MasonEffect } from 'masoneffect';
@@ -22,17 +22,17 @@ const effect = new MasonEffect(container, {
22
22
  maxParticles: 2000,
23
23
  });
24
24
 
25
- // 텍스트 변경
25
+ // Change text
26
26
  effect.morph('New Text');
27
27
 
28
- // 텍스트와 함께 다른 속성도 변경
28
+ // Change text along with other properties
29
29
  effect.morph({
30
30
  text: 'New Text',
31
31
  particleColor: '#ff00ff',
32
32
  maxParticles: 3000,
33
33
  });
34
34
 
35
- // 파티클을 중앙에서 방사형으로 흩어지기
35
+ // Return particles to initial position
36
36
  effect.scatter();
37
37
  ```
38
38
 
@@ -78,7 +78,7 @@ function App() {
78
78
  }
79
79
  ```
80
80
 
81
- **⚠️ 주의**: React 컴포넌트 사용 컨테이너에 명시적인 크기를 지정해야 합니다. 자세한 내용은 [React 문제 해결 가이드](./REACT_TROUBLESHOOTING.md)를 참고하세요.
81
+ **⚠️ Note**: When using the React component, you must specify an explicit size for the container. For more details, see the [React Troubleshooting Guide](./REACT_TROUBLESHOOTING.md).
82
82
 
83
83
  ### Vue 3
84
84
 
@@ -93,6 +93,7 @@ function App() {
93
93
  @ready="onReady"
94
94
  />
95
95
  <button @click="handleMorph">Morph</button>
96
+ <button @click="handleMorphWithOptions">Morph with Options</button>
96
97
  <button @click="handleScatter">Scatter</button>
97
98
  </div>
98
99
  </template>
@@ -107,6 +108,14 @@ const handleMorph = () => {
107
108
  effectRef.value?.morph('New Text');
108
109
  };
109
110
 
111
+ const handleMorphWithOptions = () => {
112
+ effectRef.value?.morph({
113
+ text: 'Hello',
114
+ particleColor: '#ff00ff',
115
+ maxParticles: 3000,
116
+ });
117
+ };
118
+
110
119
  const handleScatter = () => {
111
120
  effectRef.value?.scatter();
112
121
  };
@@ -119,37 +128,37 @@ const onReady = (instance) => {
119
128
 
120
129
  ## API
121
130
 
122
- ### 옵션
123
-
124
- | 옵션 | 타입 | 기본값 | 설명 |
125
- |------|------|--------|------|
126
- | `text` | `string` | `'mason effect'` | 표시할 텍스트 |
127
- | `densityStep` | `number` | `2` | 파티클 샘플링 밀도 (작을수록 촘촘함) |
128
- | `maxParticles` | `number` | `3200` | 최대 파티클 |
129
- | `pointSize` | `number` | `0.5` | 파티클 크기 |
130
- | `ease` | `number` | `0.05` | 이동 가속도 |
131
- | `repelRadius` | `number` | `150` | 마우스 반발 범위 |
132
- | `repelStrength` | `number` | `1` | 마우스 반발 세기 |
133
- | `particleColor` | `string` | `'#fff'` | 파티클 색상 |
134
- | `fontFamily` | `string` | `'Inter, system-ui, Arial'` | 폰트 패밀리 |
135
- | `fontSize` | `number \| null` | `null` | 폰트 크기 (null이면 자동) |
136
- | `width` | `number \| null` | `null` | 캔버스 너비 (null이면 컨테이너 크기) |
137
- | `height` | `number \| null` | `null` | 캔버스 높이 (null이면 컨테이너 크기) |
138
- | `devicePixelRatio` | `number \| null` | `null` | 디바이스 픽셀 비율 (null이면 자동) |
139
- | `onReady` | `function` | `null` | 초기화 완료 콜백 |
140
- | `onUpdate` | `function` | `null` | 업데이트 콜백 |
141
-
142
- ### 메서드
131
+ ### Options
132
+
133
+ | Option | Type | Default | Description |
134
+ |--------|------|---------|-------------|
135
+ | `text` | `string` | `'mason effect'` | Text to display |
136
+ | `densityStep` | `number` | `2` | Particle sampling density (smaller = denser) |
137
+ | `maxParticles` | `number` | `3200` | Maximum number of particles |
138
+ | `pointSize` | `number` | `0.5` | Particle point size |
139
+ | `ease` | `number` | `0.05` | Movement acceleration |
140
+ | `repelRadius` | `number` | `150` | Mouse repel radius |
141
+ | `repelStrength` | `number` | `1` | Mouse repel strength |
142
+ | `particleColor` | `string` | `'#fff'` | Particle color |
143
+ | `fontFamily` | `string` | `'Inter, system-ui, Arial'` | Font family |
144
+ | `fontSize` | `number \| null` | `null` | Font size (auto if null) |
145
+ | `width` | `number \| null` | `null` | Canvas width (container size if null) |
146
+ | `height` | `number \| null` | `null` | Canvas height (container size if null) |
147
+ | `devicePixelRatio` | `number \| null` | `null` | Device pixel ratio (auto if null) |
148
+ | `onReady` | `function` | `null` | Initialization complete callback |
149
+ | `onUpdate` | `function` | `null` | Update callback |
150
+
151
+ ### Methods
143
152
 
144
153
  #### `morph(textOrOptions?: string | Partial<MasonEffectOptions>)`
145
- 텍스트 형태로 파티클을 모핑합니다.
154
+ Morphs particles into text form.
146
155
 
147
- **문자열 사용:**
156
+ **Using string:**
148
157
  ```javascript
149
158
  effect.morph('New Text');
150
159
  ```
151
160
 
152
- **객체 사용 (텍스트와 함께 다른 속성도 변경):**
161
+ **Using object (change text along with other properties):**
153
162
  ```javascript
154
163
  effect.morph({
155
164
  text: 'New Text',
@@ -161,51 +170,51 @@ effect.morph({
161
170
  ```
162
171
 
163
172
  #### `scatter()`
164
- 파티클을 중앙에서 방사형으로 흩어지게 합니다. 캔버스 중앙을 기준으로 원형으로 퍼집니다.
173
+ Returns particles to their initial position. Each particle returns to the position where it was first created.
165
174
 
166
175
  #### `updateConfig(config: Partial<MasonEffectOptions>)`
167
- 설정을 업데이트합니다.
176
+ Updates the configuration.
168
177
 
169
178
  #### `destroy()`
170
- 인스턴스를 파괴하고 리소스를 정리합니다.
179
+ Destroys the instance and cleans up resources.
171
180
 
172
- ## 특징
181
+ ## Features
173
182
 
174
- - 🎨 텍스트를 파티클로 변환하는 모핑 효과
175
- - 🖱️ 마우스 인터랙션 지원 (반발/흡입)
176
- - 📱 반응형 디자인
177
- - ⚡ 고성능 Canvas 렌더링
178
- - 🔧 React, Vue, 바닐라 JS 모두 지원
179
- - 🎯 TypeScript 타입 정의 포함
180
- - 💾 프로덕션 빌드 자동 난독화 최적화
181
- - 🎯 중앙에서 방사형으로 퍼지는 scatter 효과
183
+ - 🎨 Morphing effect that converts text into particles
184
+ - 🖱️ Mouse interaction support (repel/attract)
185
+ - 📱 Responsive design
186
+ - ⚡ High-performance Canvas rendering
187
+ - 🔧 Supports React, Vue, and vanilla JS
188
+ - 🎯 Includes TypeScript type definitions
189
+ - 💾 Automatic obfuscation and optimization in production builds
190
+ - 🔄 Scatter effect that returns to initial position
182
191
 
183
- ## 개발
192
+ ## Development
184
193
 
185
194
  ```bash
186
- # 의존성 설치
195
+ # Install dependencies
187
196
  npm install
188
197
 
189
- # 개발 모드 (watch)
198
+ # Development mode (watch)
190
199
  npm run dev
191
200
 
192
- # 빌드 (프로덕션용 min 파일 생성)
201
+ # Build (generate production min files)
193
202
  npm run build
194
203
 
195
- # 예제 테스트 서버
204
+ # Example test server
196
205
  npm run serve
197
206
  ```
198
207
 
199
- ## 빌드 결과물
208
+ ## Build Output
200
209
 
201
- 빌드를 실행하면 다음 파일들이 생성됩니다:
210
+ Running the build will generate the following files:
202
211
 
203
- - **개발용**: `dist/index.js`, `dist/index.esm.js` (소스맵 포함)
204
- - **프로덕션용**: `dist/index.min.js`, `dist/index.esm.min.js` (난독화 최적화)
205
- - **React 컴포넌트**: `dist/react/MasonEffect.min.js` (난독화)
212
+ - **Development**: `dist/index.js`, `dist/index.esm.js` (with source maps)
213
+ - **Production**: `dist/index.min.js`, `dist/index.esm.min.js` (obfuscated and optimized)
214
+ - **React component**: `dist/react/MasonEffect.min.js` (obfuscated)
206
215
 
207
- npm으로 설치하면 자동으로 min 파일이 사용됩니다. 자세한 내용은 [빌드 가이드](./BUILD.md)를 참고하세요.
216
+ When installed via npm, min files are automatically used. For more details, see the [Build Guide](./BUILD.md).
208
217
 
209
- ## 라이선스
218
+ ## License
210
219
 
211
220
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "masoneffect",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "파티클 모핑 효과를 제공하는 라이브러리 - React, Vue, 바닐라 JS 지원",
5
5
  "main": "dist/index.min.js",
6
6
  "module": "dist/index.esm.min.js",
@@ -47,7 +47,7 @@
47
47
  "type": "git",
48
48
  "url": "https://github.com/fe-hyunsu/masoneffect.git"
49
49
  },
50
- "homepage": "https://github.com/fe-hyunsu/masoneffect#readme",
50
+ "homepage": "https://masoneffect.com",
51
51
  "bugs": {
52
52
  "url": "https://github.com/fe-hyunsu/masoneffect/issues"
53
53
  },