reacthub-pixitweenjs 0.2.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.
Files changed (45) hide show
  1. package/.storybook/main.js +23 -0
  2. package/.storybook/preview.jsx +24 -0
  3. package/CHANGELOG.md +21 -0
  4. package/LICENSE +21 -0
  5. package/README.md +91 -0
  6. package/index.html +13 -0
  7. package/package.json +75 -0
  8. package/public/vite.svg +1 -0
  9. package/src/App.css +42 -0
  10. package/src/App.jsx +35 -0
  11. package/src/assets/font/OpenSans-Light-webfont.eot +0 -0
  12. package/src/assets/font/OpenSans-Light-webfont.svg +252 -0
  13. package/src/assets/font/OpenSans-Light-webfont.ttf +0 -0
  14. package/src/assets/font/OpenSans-Light-webfont.woff +0 -0
  15. package/src/assets/font/OpenSans-Regular-webfont.eot +0 -0
  16. package/src/assets/font/OpenSans-Regular-webfont.svg +252 -0
  17. package/src/assets/font/OpenSans-Regular-webfont.ttf +0 -0
  18. package/src/assets/font/OpenSans-Regular-webfont.woff +0 -0
  19. package/src/assets/icon/percolate.eot +0 -0
  20. package/src/assets/icon/percolate.svg +139 -0
  21. package/src/assets/icon/percolate.ttf +0 -0
  22. package/src/assets/icon/percolate.woff +0 -0
  23. package/src/assets/react.svg +1 -0
  24. package/src/index.css +457 -0
  25. package/src/index.js +3 -0
  26. package/src/main.jsx +10 -0
  27. package/src/providers/ContextBridge.jsx +67 -0
  28. package/src/providers/GsapAnim.jsx +82 -0
  29. package/src/providers/GsapPixieContextProvider.jsx +162 -0
  30. package/src/providers/VideoSeekBar.jsx +186 -0
  31. package/src/providers/index.js +3 -0
  32. package/src/stories/Installation.mdx +40 -0
  33. package/src/stories/Introduction.mdx +239 -0
  34. package/src/stories/PixiImageSprite/PixiImageSprite.jsx +318 -0
  35. package/src/stories/PixiImageSprite/PixiImageSprite.stories.js +107 -0
  36. package/src/stories/PixiImageSprite/index.js +1 -0
  37. package/src/stories/assets/code-brackets.svg +1 -0
  38. package/src/stories/assets/colors.svg +1 -0
  39. package/src/stories/assets/comments.svg +1 -0
  40. package/src/stories/assets/direction.svg +1 -0
  41. package/src/stories/assets/flow.svg +1 -0
  42. package/src/stories/assets/plugin.svg +1 -0
  43. package/src/stories/assets/repo.svg +1 -0
  44. package/src/stories/assets/stackalt.svg +1 -0
  45. package/vite.config.js +24 -0
package/src/index.css ADDED
@@ -0,0 +1,457 @@
1
+ * {
2
+ box-sizing: border-box;
3
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
4
+ -webkit-tap-highlight-color: transparent;
5
+ }
6
+
7
+ html,
8
+ body {
9
+ margin: 0;
10
+ padding: 0;
11
+ font-size: 100%;
12
+ outline: none;
13
+ font-family: "Nunito Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
14
+ font-style: 400;
15
+ color: #333;
16
+ font-size: 16px;
17
+ background-color: #26c6da;
18
+ -webkit-text-size-adjust: 100%;
19
+ -ms-text-size-adjust: 100%;
20
+ -webkit-font-smoothing: antialiased;
21
+ -moz-osx-font-smoothing: grayscale;
22
+ }
23
+
24
+ h1,
25
+ p,
26
+ label {
27
+ margin: 0;
28
+ padding: 0;
29
+ border: 0;
30
+ font-weight: normal;
31
+ font-style: normal;
32
+ font-size: 100%;
33
+ line-height: 1;
34
+ font-family: inherit;
35
+ vertical-align: baseline;
36
+ line-height: normal;
37
+ font-family: "Nunito Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
38
+ }
39
+
40
+ button::-moz-focus-inner,
41
+ input::-moz-focus-inner {
42
+ border: 0;
43
+ padding: 0;
44
+ }
45
+
46
+ button,
47
+ input[type="button"],
48
+ input[type="reset"],
49
+ input[type="submit"] {
50
+ cursor: pointer;
51
+ }
52
+
53
+ @keyframes spin {
54
+ 0% {
55
+ transform: rotate(0deg);
56
+ }
57
+
58
+ 100% {
59
+ transform: rotate(359deg);
60
+ }
61
+ }
62
+
63
+ @keyframes glow {
64
+ 0%,
65
+ 100% {
66
+ opacity: 1;
67
+ }
68
+
69
+ 50% {
70
+ opacity: 0.5;
71
+ }
72
+ }
73
+
74
+ @font-face {
75
+ font-family: "Nunito Sans";
76
+ font-style: italic;
77
+ font-weight: 400;
78
+ src: url(https://fonts.gstatic.com/s/nunitosans/v6/pe0oMImSLYBIv1o4X1M8cce4E9lKcw.ttf)
79
+ format("truetype");
80
+ }
81
+
82
+ @font-face {
83
+ font-family: "Nunito Sans";
84
+ font-style: normal;
85
+ font-weight: 400;
86
+ src: url(https://fonts.gstatic.com/s/nunitosans/v6/pe0qMImSLYBIv1o4X1M8cce9I94.ttf)
87
+ format("truetype");
88
+ }
89
+
90
+ @font-face {
91
+ font-family: "Nunito Sans";
92
+ font-style: normal;
93
+ font-weight: 800;
94
+ src: url(https://fonts.gstatic.com/s/nunitosans/v6/pe03MImSLYBIv1o4X1M8cc8aBc5tU1Q.ttf)
95
+ format("truetype");
96
+ }
97
+
98
+ .type-light {
99
+ font-family: "Nunito Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
100
+ font-weight: 300;
101
+ }
102
+
103
+ .type-bold {
104
+ font-family: "Nunito Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
105
+ font-weight: 800;
106
+ }
107
+
108
+ .type-italic {
109
+ font-family: "Nunito Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
110
+ font-weight: 400;
111
+ font-style: italic;
112
+ }
113
+
114
+ input[type="text"],
115
+ input[type="email"],
116
+ input[type="password"],
117
+ textarea {
118
+ font-size: 14px;
119
+ line-height: 20px;
120
+ font-family: "Nunito Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
121
+ font-style: 400;
122
+ padding: 0.75rem 0;
123
+ line-height: 1.5rem !important;
124
+ border: none;
125
+ border-radius: 0;
126
+ box-sizing: border-box;
127
+ color: #333;
128
+ outline: none;
129
+ }
130
+
131
+ .checkbox {
132
+ display: inline-block;
133
+ height: 3rem;
134
+ position: relative;
135
+ vertical-align: middle;
136
+ width: 44px;
137
+ }
138
+
139
+ .checkbox input[type="checkbox"] {
140
+ font-size: 1em;
141
+ visibility: hidden;
142
+ }
143
+
144
+ .checkbox input[type="checkbox"] + span:before {
145
+ position: absolute;
146
+ top: 50%;
147
+ right: auto;
148
+ bottom: auto;
149
+ left: 50%;
150
+ width: 0.85em;
151
+ height: 0.85em;
152
+ transform: translate3d(-50%, -50%, 0);
153
+ background: transparent;
154
+ box-shadow: #2cc5d2 0 0 0 1px inset;
155
+ content: "";
156
+ display: block;
157
+ }
158
+
159
+ .checkbox input[type="checkbox"]:checked + span:before {
160
+ font-size: 16px;
161
+ line-height: 24px;
162
+ box-shadow: none;
163
+ color: #2cc5d2;
164
+ margin-top: -1px;
165
+ font-family: "percolate";
166
+ font-style: normal;
167
+ font-weight: normal;
168
+ font-variant: normal;
169
+ text-transform: none;
170
+ line-height: 1;
171
+
172
+ content: "\e65e";
173
+ }
174
+
175
+ .input-symbol {
176
+ display: inline-block;
177
+ position: relative;
178
+ }
179
+
180
+ .input-symbol.error [class^="icon-"],
181
+ .input-symbol.error [class*=" icon-"] {
182
+ color: #ff4400;
183
+ }
184
+
185
+ .input-symbol [class^="icon-"],
186
+ .input-symbol [class*=" icon-"] {
187
+ left: 1em;
188
+ }
189
+
190
+ .input-symbol input {
191
+ padding-left: 3em;
192
+ }
193
+
194
+ .input-symbol input {
195
+ width: 100%;
196
+ }
197
+
198
+ .input-symbol input:focus + [class^="icon-"],
199
+ .input-symbol input:focus + [class*=" icon-"] {
200
+ color: #2cc5d2;
201
+ }
202
+
203
+ .input-symbol [class^="icon-"],
204
+ .input-symbol [class*=" icon-"] {
205
+ transition: all 300ms ease-in;
206
+ transform: translate3d(0, -50%, 0);
207
+ background: transparent;
208
+ color: #aaa;
209
+ font-size: 1em;
210
+ height: 1em;
211
+ position: absolute;
212
+ top: 50%;
213
+ width: 1em;
214
+ }
215
+
216
+ @font-face {
217
+ font-family: "percolate";
218
+ src: url("./assets/icon/percolate.eot?-5w3um4");
219
+ src: url("./assets/icon/percolate.eot?#iefix5w3um4")
220
+ format("embedded-opentype"),
221
+ url("./assets/icon/percolate.woff?5w3um4") format("woff"),
222
+ url("./assets/icon/percolate.ttf?5w3um4") format("truetype"),
223
+ url("./assets/icon/percolate.svg?5w3um4") format("svg");
224
+ font-weight: normal;
225
+ font-style: normal;
226
+ }
227
+
228
+ [class^="icon-"],
229
+ [class*=" icon-"] {
230
+ font-family: "percolate";
231
+
232
+ font-style: normal;
233
+ font-weight: normal;
234
+ font-variant: normal;
235
+ text-transform: none;
236
+ line-height: 1;
237
+ }
238
+
239
+ .icon-star:before {
240
+ content: "\e608";
241
+ }
242
+
243
+ .icon-face-sad:before {
244
+ content: "\e60f";
245
+ }
246
+
247
+ .icon-check:before {
248
+ content: "\e65e";
249
+ }
250
+
251
+ .list-heading {
252
+ letter-spacing: 0.3em;
253
+ text-indent: 0.3em;
254
+ text-transform: uppercase;
255
+ font-family: "Nunito Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
256
+ font-weight: 800;
257
+ font-size: 11px;
258
+ padding-left: 15px;
259
+ line-height: 40px;
260
+ background: #f8f8f8;
261
+ color: #aaa;
262
+ }
263
+
264
+ .list-heading .icon-sync {
265
+ opacity: 1;
266
+ animation: spin 2s infinite linear;
267
+ display: inline-block;
268
+ margin-right: 4px;
269
+ }
270
+
271
+ .list-item {
272
+ font-size: 14px;
273
+ line-height: 20px;
274
+ display: flex;
275
+ flex-wrap: wrap;
276
+ height: 3rem;
277
+ width: 100%;
278
+ background: white;
279
+ transition: all ease-out 150ms;
280
+ }
281
+
282
+ .list-item .title {
283
+ overflow: hidden;
284
+ text-overflow: ellipsis;
285
+ white-space: nowrap;
286
+ flex: 1;
287
+ }
288
+
289
+ .list-item input[type="text"] {
290
+ background: transparent;
291
+ width: 100%;
292
+ }
293
+
294
+ .list-item input[type="text"]:focus {
295
+ cursor: text;
296
+ }
297
+
298
+ .pin-button {
299
+ width: 3rem;
300
+ height: 3rem;
301
+ background: transparent;
302
+ border: none;
303
+ text-align: center;
304
+ transition: all 200ms ease-in;
305
+ color: #eee;
306
+ font-size: 16px;
307
+ line-height: 3rem;
308
+ outline: none;
309
+ }
310
+
311
+ .pin-button:hover {
312
+ color: #2cc5d2;
313
+ }
314
+ .pin-button:focus {
315
+ outline-color: transparent;
316
+ }
317
+
318
+ .pin-button:active {
319
+ color: #555;
320
+ }
321
+
322
+ .list-item.TASK_PINNED .icon-star {
323
+ color: #2cc5d2;
324
+ }
325
+
326
+ .list-item.TASK_ARCHIVED input[type="text"] {
327
+ color: #a0aec0;
328
+ text-decoration: line-through;
329
+ }
330
+
331
+ .list-item:hover {
332
+ background-image: linear-gradient(to bottom, #e5f9f7 0%, #f0fffd 100%);
333
+ }
334
+
335
+ .list-item:hover .checkbox {
336
+ cursor: pointer;
337
+ }
338
+
339
+ .list-item + .list-item {
340
+ border-top: 1px solid #f0f9fb;
341
+ }
342
+
343
+ .list-item.checked input[type="text"] {
344
+ color: #ccc;
345
+ text-decoration: line-through;
346
+ }
347
+
348
+ .list-item.checked .delete-item {
349
+ display: inline-block;
350
+ }
351
+
352
+ .loading-item {
353
+ height: 3rem;
354
+ width: 100%;
355
+ background: white;
356
+ display: flex;
357
+ align-items: center;
358
+ line-height: 1rem;
359
+ padding-left: 16px;
360
+ }
361
+
362
+ .loading-item .glow-checkbox,
363
+ .loading-item .glow-text span {
364
+ animation: glow 1.5s ease-in-out infinite;
365
+ background: #eee;
366
+ color: transparent;
367
+ cursor: progress;
368
+ display: inline-block;
369
+ }
370
+
371
+ .loading-item .glow-checkbox {
372
+ margin-right: 16px;
373
+ width: 12px;
374
+ height: 12px;
375
+ }
376
+
377
+ .loading-item + .loading-item {
378
+ border-top: 1px solid #f0f9fb;
379
+ }
380
+
381
+ .list-items {
382
+ position: relative;
383
+ background: white;
384
+ min-height: 288px;
385
+ }
386
+
387
+ .list-items .select-placeholder {
388
+ border: none;
389
+ width: 48px;
390
+ }
391
+
392
+ .wrapper-message {
393
+ position: absolute;
394
+ top: 45%;
395
+ right: 0;
396
+ bottom: auto;
397
+ left: 0;
398
+ width: auto;
399
+ height: auto;
400
+ transform: translate3d(0, -50%, 0);
401
+ text-align: center;
402
+ }
403
+
404
+ .wrapper-message [class^="icon-"],
405
+ .wrapper-message [class*=" icon-"] {
406
+ font-size: 48px;
407
+ line-height: 56px;
408
+ color: #2cc5d2;
409
+ display: block;
410
+ }
411
+
412
+ .wrapper-message .title-message {
413
+ font-size: 16px;
414
+ line-height: 24px;
415
+ font-family: "Nunito Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
416
+ font-weight: 800;
417
+ color: #4a5568;
418
+ }
419
+
420
+ .wrapper-message .subtitle-message {
421
+ font-size: 14px;
422
+ line-height: 20px;
423
+ color: #4a5568;
424
+ }
425
+
426
+ .page.lists-show {
427
+ min-height: 100vh;
428
+ background: white;
429
+ }
430
+
431
+ .page.lists-show nav {
432
+ background: #d3edf4;
433
+ padding: 1.5rem 1.25rem;
434
+ text-align: center;
435
+ }
436
+
437
+ @media screen and (min-width: 40em) {
438
+ .page.lists-show nav {
439
+ text-align: left;
440
+ }
441
+ }
442
+
443
+ .page.lists-show nav .title-page {
444
+ font-size: 20px;
445
+ line-height: 24px;
446
+ line-height: 2rem;
447
+ cursor: pointer;
448
+ white-space: nowrap;
449
+ font-family: "Nunito Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
450
+ overflow: hidden;
451
+ text-overflow: ellipsis;
452
+ font-weight: 800;
453
+ color: #1c3f53;
454
+ display: inline-block;
455
+ vertical-align: top;
456
+ max-width: 100%;
457
+ }
package/src/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from "./stories/PixiImageSprite";
2
+ // Path: src\index.js
3
+ export * from './providers';
package/src/main.jsx ADDED
@@ -0,0 +1,10 @@
1
+ import React from 'react'
2
+ import ReactDOM from 'react-dom/client'
3
+ import App from './App'
4
+ import './index.css'
5
+
6
+ ReactDOM.createRoot(document.getElementById('root')).render(
7
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>,
10
+ )
@@ -0,0 +1,67 @@
1
+ // your Stage:
2
+ import { Stage as PixiStage } from "@pixi/react";
3
+ import React from "react";
4
+ import { Flex, Icon, Text, Box, Button } from "@chakra-ui/react";
5
+ import * as PIXI from "pixi.js";
6
+ import { ChakraProvider } from "@chakra-ui/react";
7
+ import {
8
+ GsapPixieContext,
9
+ GsapPixieContextProvider,
10
+ } from "./GsapPixieContextProvider";
11
+
12
+ import { VideoSeekBar } from "./VideoSeekBar";
13
+
14
+ // the context bridge:
15
+ const ContextBridge = ({ children, Context, render }) => {
16
+ return (
17
+ <Context.Consumer>
18
+ {(value) => {
19
+ console.log("value", value);
20
+ return render(
21
+ <Context.Provider value={value}>{children}</Context.Provider>,
22
+ );
23
+ }}
24
+ </Context.Consumer>
25
+ );
26
+ };
27
+
28
+ const Stage = ({ children, ...props }) => {
29
+ return (
30
+ <ContextBridge
31
+ Context={GsapPixieContext}
32
+ render={(children) => <PixiStage {...props}>{children}</PixiStage>}
33
+ >
34
+ {children}
35
+ </ContextBridge>
36
+ );
37
+ };
38
+
39
+ export const App = ({ children, backgroundColor, ...props }) => {
40
+ const backgroundColorx = PIXI.utils.string2hex(backgroundColor || "#2D2E3C");
41
+ const width = 600;
42
+ const height = 500;
43
+
44
+ /// color: 0x1099bb,
45
+ return (
46
+ <div className="App">
47
+ <GsapPixieContextProvider>
48
+ <ChakraProvider>
49
+ <Flex flexDir={"column"}>
50
+ <Stage
51
+ width={width}
52
+ height={height}
53
+ // options={{ background: backgroundColor }}
54
+ options={{ backgroundColor: backgroundColorx, resolution: 2 }}
55
+ >
56
+ {children}
57
+ </Stage>
58
+
59
+ <Box mt={5} w={600}>
60
+ <VideoSeekBar />
61
+ </Box>
62
+ </Flex>
63
+ </ChakraProvider>
64
+ </GsapPixieContextProvider>
65
+ </div>
66
+ );
67
+ };
@@ -0,0 +1,82 @@
1
+ /// import { Elastic } from "gsap";
2
+ // import BezierEasing from 'bezier-easing';
3
+
4
+ export const getAnimByName = (animate, stageWidth, stageHeight, x, y) => {
5
+ let ease = {};
6
+ switch (animate) {
7
+ case "NONE":
8
+ case "none":
9
+ break;
10
+ case "BOUNCE_IN":
11
+ ease.from = {
12
+ duration: 2,
13
+ ease: "bounce.out",
14
+ y: -1500,
15
+ };
16
+ break;
17
+ case "BOUNCE_IN_DOWN":
18
+ ease.from = { ease: "bounce.out", y: -1500, duration: 2 };
19
+ break;
20
+ case "BOUNCE_IN_LEFT":
21
+ ease.from = { ease: "bounce.out", x: -1500, duration: 2 };
22
+ break;
23
+ case "BOUNCE_IN_RIGHT":
24
+ ease.from = { ease: "bounce.out", x: 1500, duration: 2 };
25
+ break;
26
+ case "BOUNCE_IN_UP":
27
+ ease.from = { ease: "bounce.out", y: 1500, duration: 2 };
28
+ break;
29
+ case "BOUNCE_OUT":
30
+ ease.from = { ease: "bounce.in", y: 2, duration: 2 };
31
+ break;
32
+ case "BOUNCE_OUT_DOWN":
33
+ break;
34
+ case "BOUNCE_OUT_LEFT":
35
+ break;
36
+ case "BOUNCE_OUT_RIGHT":
37
+ break;
38
+ case "BOUNCE_OUT_UP":
39
+ break;
40
+ case "FADE_IN":
41
+ ease.to = { ease: "power4.in", alpha: 1, duration: 0.5 };
42
+ break;
43
+ case "FADE_IN_DOWN":
44
+ ease.fromTo = {
45
+ from: { y: -1000, alpha: 0 },
46
+ to: { ease: "power4.in", y: 0, alpha: 1, duration: 1 },
47
+ };
48
+ break;
49
+ case "FADE_IN_LEFT":
50
+ ease.fromTo = {
51
+ from: { x: -1000, alpha: 0 },
52
+ to: { ease: "power4.in", x: 0, alpha: 1, duration: 1 },
53
+ };
54
+ break;
55
+ case "FADE_IN_RIGHT":
56
+ ease.fromTo = {
57
+ from: { x: 2000, alpha: 0 },
58
+ to: { ease: "power4.in", x: 0, alpha: 1, duration: 1 },
59
+ };
60
+ break;
61
+ case "FADE_IN_UP":
62
+ ease.fromTo = {
63
+ from: { y: 2000, alpha: 0 },
64
+ to: { ease: "power4.in", y: 0, alpha: 1, duration: 1 },
65
+ };
66
+ break;
67
+ case "FADE_OUT":
68
+ break;
69
+ case "FADE_OUT_DOWN":
70
+ break;
71
+ case "FADE_OUT_LEFT":
72
+ break;
73
+ case "FADE_OUT_RIGHT":
74
+ break;
75
+ case "FADE_OUT_UP":
76
+ break;
77
+ default:
78
+ break;
79
+ }
80
+
81
+ return ease;
82
+ };