Skip to content

Commit 2f6239a

Browse files
Merge branch 'source' into mojs-next
2 parents dd2189c + 4c111e1 commit 2f6239a

File tree

14 files changed

+1742
-1693
lines changed

14 files changed

+1742
-1693
lines changed

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Sandstedt
3+
Copyright (c) 2021 Jonas Sandstedt, Xavier Foucrier
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

docs/.vuepress/config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ module.exports = {
6262
title: 'Modules',
6363
collapsable: false,
6464
children: [
65-
'/api/html/',
66-
'/api/shape/',
67-
'/api/shape-swirl/',
68-
'/api/burst/',
65+
'/api/modules/html/',
66+
'/api/modules/shape/',
67+
'/api/modules/shape-swirl/',
68+
'/api/modules/burst/',
6969
]
7070
},
7171
{

docs/.vuepress/styles/index.styl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ blockquote {
229229
margin: 0
230230
}
231231

232+
// MoJs curve editor
233+
._curve-editor_10g8s_3 {
234+
z-index: 200 !important;
235+
}
232236

233237
// Some helpclasses
234238
:root {

docs/api/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ sidebarDepth: 0
88
---
99

1010
## Modules
11-
- [Html](html/README.md)
12-
- [Shape](shape/README.md)
13-
- [ShapeSwirl](shape-swirl/README.md)
14-
- [Burst](burst/README.md)
11+
- [Html](modules/html/README.md)
12+
- [Shape](modules/shape/README.md)
13+
- [ShapeSwirl](modules/shape-swirl/README.md)
14+
- [Burst](modules/burst/README.md)
1515
- MotionPath *(soon)*
1616
- Spriter *(soon)*
1717
- Radial Spring *(soon)*

docs/api/burst/README.md renamed to docs/api/modules/burst/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Burst
22

33
- [CodePen Example](https://codepen.io/sol0mka/pen/JKWKVR?editors=0010)
4-
- [ShapeSwirl API](../shape-swirl.md)
5-
- [Stagger Strings API](../syntax/stagger.md)
6-
- [Property Maps API](../syntax/property-maps.md)
7-
- [Tween API](../tweens/tween.md)
8-
- [Timeline API](../tweens/timeline.md)
4+
- [ShapeSwirl API](/api/modules/shape-swirl/)
5+
- [Stagger Strings API](/api/utils/stagger.md)
6+
- [Property Maps API](/api/syntax/property-maps.md)
7+
- [Tween API](/api/tweens/tween.md)
8+
- [Timeline API](/api/tweens/timeline.md)
99

1010
Full API reference:
1111

@@ -164,8 +164,8 @@ const burst = new mojs.Burst({
164164
```
165165

166166
- [CodePen Example](https://codepen.io/sol0mka/pen/JKWKVR?editors=0010)
167-
- [ShapeSwirl API](../shape-swirl.md)
168-
- [Stagger Strings API](../syntax/stagger.md)
169-
- [Property Maps API](../syntax/property-maps.md)
170-
- [Tween API](../tweens/tween.md)
171-
- [Timeline API](../tweens/timeline.md)
167+
- [ShapeSwirl API](/api/modules/shape-swirl/)
168+
- [Stagger Strings API](/api/utils/stagger.md)
169+
- [Property Maps API](/api/syntax/property-maps.md)
170+
- [Tween API](/api/tweens/tween.md)
171+
- [Timeline API](/api/tweens/timeline.md)

docs/api/html/README.md renamed to docs/api/modules/html/README.md

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
## References:
66

77
- [CodePen Example](https://codepen.io/sol0mka/pen/b8831849500f0d5cd0ab5691ebe17873?editors=0010)
8-
- [Tween API](../tweens/tween.md)
8+
- [Tween API](/api/tweens/tween.md)
99

1010
## Contents:
1111

12-
- [Full API Reference](#full-api-reference)
13-
- [Other CSS properties](#other-css-properties)
14-
- [Teach mojs with customProperties](#teach-mojs-with-customproperties)
15-
- [Independent deltas](#independent-deltas)
12+
- [Full API Reference](#full-api-reference)
13+
- [Other CSS properties](#other-css-properties)
14+
- [Teach mojs with customProperties](#teach-mojs-with-customproperties)
15+
- [Independent deltas](#independent-deltas)
1616

1717
## Full API Reference:
1818

@@ -198,48 +198,56 @@ Other `CSS` properties would be inferred automatically, please set them in `came
198198

199199
```javascript
200200
const html = new mojs.Html({
201-
el: '#js-el',
202-
borderColor: { 'cyan': '#FA3204' },
203-
borderWidth: { 2: 12 }
201+
el: "#js-el",
202+
borderColor: { cyan: "#FA3204" },
203+
borderWidth: { 2: 12 },
204204
});
205205
```
206206

207-
- [CodePen Example](https://codepen.io/sol0mka/pen/14bcdfac6a89b918ac0292b35c0f156e?editors=0010)
207+
- [CodePen Example](https://codepen.io/sandstedt/pen/vYyazRm)
208208

209209
### Teach mojs with customProperties
210210

211211
If property doesn't work as expected you can teach `mojs` with a `customProperties` definition:
212212

213213
```javascript
214214
const html = new mojs.Html({
215-
el: '#js-el',
215+
el: "#js-el",
216216
customProperties: {
217217
originY: 50,
218218
anotherCustomProp: 0,
219-
draw (el, props) {
220-
el.style['transformOrigin'] = `50% ${props.originY}%`;
221-
}
222-
}
219+
draw(el, props) {
220+
el.style["transformOrigin"] = `50% ${props.originY}%`;
221+
},
222+
},
223223
});
224224
```
225225

226226
`customProperties` object should have
227-
- list of custom properties names with their `default` value (`originY: 50, anotherCustomProp: 0`).
228-
- `draw` function that will be responsible for rendering that custom properties. It will be called on each animation frame and will be provided with `el` and `props` object that contain current states for all custom properties (`props.originY, props.anotherCustomProp`). Feel free to apply that state to the `el` any way that works for you.
227+
228+
- list of custom properties names with their `default` value (`originY: 50, anotherCustomProp: 0`).
229+
- `draw` function that will be responsible for rendering that custom properties. It will be called on each animation frame and will be provided with `el` and `props` object that contain current states for all custom properties (`props.originY, props.anotherCustomProp`). Feel free to apply that state to the `el` any way that works for you.
229230

230231
All custom properties are expected to be plain `numbers`, you can define `units` in the `draw` function.
231232

232-
- [CodePen Example](https://codepen.io/sol0mka/pen/08ed252eed451c270e49882b08cbbd41?editors=0010)
233+
- [CodePen Example](https://codepen.io/sandstedt/pen/LYbMqqN?editors=0010)
233234

234235
### Independent deltas
235236

236237
All `delta` values of the `Html` module could have entire set of `Tween` properties and can be animated individually:
237238

238239
```javascript
239240
const html = new mojs.Html({
240-
el: '#js-el',
241-
x: { 200: 0, delay: 200, duration: 2000, easing: 'cubic.in' },
242-
y: { 0: 200, duration: 2000, easing: 'cubic.out', onComplete () { /* ... */ } }
241+
el: "#js-el",
242+
x: { 200: 0, delay: 200, duration: 2000, easing: "cubic.in" },
243+
y: {
244+
0: 200,
245+
duration: 2000,
246+
easing: "cubic.out",
247+
onComplete() {
248+
/* ... */
249+
},
250+
},
243251
});
244252
```
245253

@@ -249,4 +257,4 @@ This makes `mojs` animations ultimately flexible.
249257

250258
References:
251259

252-
- [Tween API](../tweens/tween.md)
260+
- [Tween API](/api/tweens/tween.md)

docs/api/shape-swirl/README.md renamed to docs/api/modules/shape-swirl/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# ShapeSwirl
22

33
- [CodePen Example](https://codepen.io/sol0mka/pen/pbebwQ?editors=0010)
4-
- [Shape API](../shape/README.md)
5-
- [Tween API](../tweens/tween.md)
4+
- [Shape API](/api/modules/shape/README.md)
5+
- [Tween API](/api/tweens/tween.md)
66

77
Full API reference:
88

@@ -94,5 +94,5 @@ const shapeSwirl = new mojs.ShapeSwirl({
9494
```
9595

9696
- [CodePen Example](https://codepen.io/sol0mka/pen/pbebwQ?editors=0010)
97-
- [Shape API](shape.md)
98-
- [Tween API](../tweens/tween.md)
97+
- [Shape API](/api/modules/shape/README.md)
98+
- [Tween API](/api/tweens/tween.md)

docs/api/shape/README.md renamed to docs/api/modules/shape/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Shape
22

33
- [CodePen Example](https://codepen.io/sol0mka/pen/bbd4fe6c1ac8519c76bc18828844e2c3)
4-
- [Tween API](../tweens/tween.md)
4+
- [Tween API](/api/tweens/tween.md)
55

66
Full API reference:
77

@@ -235,4 +235,4 @@ const shape = new mojs.Shape({
235235
```
236236

237237
- [CodePen Example](https://codepen.io/sol0mka/pen/bbd4fe6c1ac8519c76bc18828844e2c3)
238-
- [Tween API](./tweens/tween.md)
238+
- [Tween API](/api/tweens/tween.md)

docs/api/tweens/timeline.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Timeline
22

33
- [CodePen Example](https://codepen.io/sandstedt/pen/bGeMqzw?editors=0011)
4-
- [Tween API](tween.md)
4+
- [Tween API](/api/tweens/tween.md)
55

66
`Timeline` inherits all properties, callbacks and public methods from `Tween`, the only difference between `Tween` and `Timeline` is that the later doesn't have the `duration` property - it gets calculated from durations/delays of children. Also `Timeline` add two public methods that can recieve children. Please check the Tween API for reference.
77

@@ -39,4 +39,4 @@ const timeline = new mojs.Timeline({
3939
```
4040

4141
- [CodePen Example](https://codepen.io/sandstedt/pen/bGeMqzw?editors=0011)
42-
- [Tween API](tween.md)
42+
- [Tween API](/api/tweens/tween.md)

docs/api/tweens/tween.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Tween
22

33
- [CodePen Example](https://codepen.io/sandstedt/pen/ZEOoePr?editors=0011)
4-
- [Timeline](timeline.md)
4+
- [Timeline](/api/tweens/timeline.md)
55

66
Full API reference:
77

@@ -136,4 +136,4 @@ const tween = new mojs.Tween({
136136
```
137137

138138
- [CodePen Example](https://codepen.io/sandstedt/pen/ZEOoePr?editors=0011)
139-
- [Timeline](timeline.md)
139+
- [Timeline](/api/tweens/timeline.md)

0 commit comments

Comments
 (0)