Skip to content

Commit

Permalink
File normalization regarding editorconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierfoucrier committed Jul 3, 2019
1 parent cda6e10 commit dfdf4d3
Show file tree
Hide file tree
Showing 38 changed files with 62 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .--eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "airbnb"
}
}
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
'transform-runtime',
["transform-react-jsx", { "pragma":"h" }]
]
}
}
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
app/build/mojs-curve-editor.js merge=ours
app/build/mojs-curve-editor.min.js merge=ours
*.postcss.css.json merge=ours
*.postcss.css.json merge=ours
2 changes: 1 addition & 1 deletion app/css/blocks/code-panel.postcss.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/*height: 0;*/
/*transition: height .2s ease-out;*/
/*transform: scale(0); */

&__inner {
border-radius: calc( 6 * $PX ) calc( 6 * $PX ) 0 0;
background: rgba( 61, 27, 60, 1 );
Expand Down
4 changes: 2 additions & 2 deletions app/css/blocks/little-handle.postcss.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
top: 50%;
width: 0;
height: 0;
$size: 6;

$size: 6;
&__point {
position: absolute;
z-index: 1;
Expand Down
10 changes: 5 additions & 5 deletions app/css/blocks/point-controls.postcss.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

.point-controls {
display: none;

&.is-show {
display: block;
}

[data-component="icon-button"] {
$width: 3;
$height: 2.5*$width;

&:after {
content: '';
position: absolute;
Expand All @@ -26,10 +26,10 @@
margin-top: calc( -($height/2)*$PX );
display: none;
}

&[class*="is-checked"] {
&:after {
display: block;
display: block;
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions app/css/blocks/point.postcss.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $size: 10;
z-index: 3;
box-shadow: calc(3*$PX) calc(3*$PX) 0 rgba(0,0,0,.5);
/*border: calc( 2*$PX ) solid $c-white;*/

&__touch {
position: absolute;
left: 50%;
Expand Down Expand Up @@ -43,7 +43,6 @@ $size: 10;
&.is-hide-handles {
& [data-component="little-handle"] {
display: none;
}
}
}
}

7 changes: 3 additions & 4 deletions app/css/blocks/resize-handle.postcss.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $radius: 16;
border-top-right-radius: calc( 3*$PX );
transform-origin: 50% 100%;
box-shadow: inset 0 0 0 calc( 1*$PX ) $c-light-purple;

&:after {
content: '';
position: absolute;
Expand All @@ -23,7 +23,7 @@ $radius: 16;
bottom: 0;
z-index: 2;
}

& [data-component="icon"] {
position: absolute;
left: 0;
Expand All @@ -43,10 +43,9 @@ $radius: 16;
transform: rotate(180deg);
cursor: s-resize;
}

/*position: absolute;
top: calc(-16*$PX);
left: 50%;
margin-left: calc( -16*$PX );*/
}

6 changes: 3 additions & 3 deletions app/css/blocks/ruler.postcss.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $size: 350;
left: auto;
right: 0;
}

$itemSize: 14;
&__item {
position: absolute;
Expand All @@ -25,10 +25,10 @@ $size: 350;
height: calc($itemSize*$PX);
text-align: center;
line-height: calc($itemSize*$PX);

margin-top: calc(3*$PX);
margin-left: calc((-$itemSize/4)*$PX);

&--0 {
top: calc(4*$size*$PX);
}
Expand Down
2 changes: 1 addition & 1 deletion app/js/actions/points.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export function reset (store) {
store.dispatch({ type: 'POINTS_REMOVE' });
store.dispatch({ type: 'POINT_ADD', data: { point: {x: 0, y: C.CURVE_SIZE, isLockedX: true}, index: 0 } });
store.dispatch({ type: 'POINT_ADD', data: { point: {x: 100, y: 0, isLockedX: true}, index: 1 } });
}
}
2 changes: 1 addition & 1 deletion app/js/helpers/active-pool.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ class ActivePool {
}
}

export default ActivePool;
export default ActivePool;
2 changes: 1 addition & 1 deletion app/js/helpers/add-pointer-down.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export default (el, fn) => {
} else {
el.addEventListener('mousedown', fn);
}
}
}
2 changes: 1 addition & 1 deletion app/js/helpers/angle-to-point.babel.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default (angle, radius) => {
return mojs.h.getRadialPoint({ angle, radius, center: { x: 0, y: 0 } })
}
}
4 changes: 2 additions & 2 deletions app/js/helpers/calculate-path.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export default (points) => {

const segment = calculateSegment( point, nextPoint, index );
segments.push(segment);

path += segment.string;
}

return { path, segments };
}
}
2 changes: 1 addition & 1 deletion app/js/helpers/calculate-point.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ export default (point, handleIndex = 1) => {
} else {
return `${CHAR}${x}, ${y/C.CURVE_PERCENT} `;
}
}
}
2 changes: 1 addition & 1 deletion app/js/helpers/calculate-segment.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ export default (point, nextPoint, index) => {
segmentString += part4;

return { string, segmentString, index };
}
}
2 changes: 1 addition & 1 deletion app/js/helpers/clamp.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default (value, min, max) => {
return (value < min)
? min
: (value > max) ? max : value;
}
}
2 changes: 1 addition & 1 deletion app/js/helpers/debounce.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export default (fn, time = 25) => {
clearTimeout( tm );
setTimeout( fn, time );
}
}
}
2 changes: 1 addition & 1 deletion app/js/helpers/defer.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

export default (fn) => {
setTimeout( fn, 1 );
}
}
2 changes: 1 addition & 1 deletion app/js/helpers/deselect-all.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export default (state) => {
}

return newState;
}
}
2 changes: 1 addition & 1 deletion app/js/helpers/fallback-to.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
*/
export default (prop, fallback) => {
return ( prop != null ) ? prop : fallback;
}
}
2 changes: 1 addition & 1 deletion app/js/helpers/find-selected-indecies.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export default (points) => {
}

return indecies;
}
}
2 changes: 1 addition & 1 deletion app/js/helpers/hash.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ export default (str) => {
hash |= 0; // Convert to 32bit integer
}
return Math.abs( hash );
}
}
4 changes: 2 additions & 2 deletions app/js/helpers/init-point.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default (point, sibPoint, handleIndex) => {

const dy = (sibPoint.y - point.y) / C.CURVE_PERCENT,
dx = sibPoint.x - point.x;

let angle = Math.atan( dy/dx ) * (180/Math.PI) - 90;
if ( dx > 0 ) { angle = angle - 180 };

Expand All @@ -29,4 +29,4 @@ export default (point, sibPoint, handleIndex) => {
}

return point;
}
}
2 changes: 1 addition & 1 deletion app/js/helpers/init-points.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export default (points) => {
newPoints.push( initPoint( point, sibPoint, handleIndex ) );
}
return newPoints;
}
}
2 changes: 1 addition & 1 deletion app/js/helpers/make-point.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ const makePoint = (o = {}) => {
};
}

export default makePoint;
export default makePoint;
2 changes: 1 addition & 1 deletion app/js/helpers/mod-deltas.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ export default (x, y, type, state) => {
} else if ( resize[type] + x < 0 ) { x = -resize[type]; }

return { x, y, type, resize };
}
}
2 changes: 1 addition & 1 deletion app/js/helpers/point-to-angle.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default (x, y) => {
if ( x > 0 ) { angle = angle - 180 };

return { radius, angle };
}
}
2 changes: 1 addition & 1 deletion app/js/helpers/resize-mod.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ const mod = ( tempResize_top, coef = 1 ) => {
return tempResize_top;
}

export default mod;
export default mod;
2 changes: 1 addition & 1 deletion app/js/helpers/round-to.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export default (value, base, snap) => {
const modified = Math.round(value/base)*base;

return ( Math.abs(value - modified) < snap ) ? modified : value;
}
}
2 changes: 1 addition & 1 deletion app/js/pool.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ class Pool {
}


export default new Pool;
export default new Pool;
2 changes: 1 addition & 1 deletion app/js/reducers/index-reducer.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ const reducer = recycleState(combineReducers({
progressLines: progressesReducer,
}), ['SET_STATE'], (state, action) => action.data );

export default reducer;
export default reducer;
4 changes: 2 additions & 2 deletions app/js/reducers/point-controls-reducer.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const pointControls = (state = INITIAL_STATE, action) => {
return { ...state, isShow: !action.isDeselect, type };
}
case 'POINT_CHANGE_TYPE': {
return { ...state, type: action.data };
return { ...state, type: action.data };
}
case 'POINT_DESELECT_ALL': {
return { ...state, isShow: false };
Expand All @@ -26,4 +26,4 @@ const pointControls = (state = INITIAL_STATE, action) => {
return state;
}

export default pointControls;
export default pointControls;
12 changes: 6 additions & 6 deletions app/js/reducers/points-reducer.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ const pointsReducer = (state = INITIAL_STATE, action) => {

return { ...state, points: newPoints, ...calculatePath( newPoints ) };
}

case 'POINT_SELECT': {
const {data} = action,
{index, isDeselect} = data,
newState = (isDeselect) ? deselectAll( state ) : { ...state },
{points} = newState;

const point = points[index];
point.isSelected = true;
return { ...state, points };
Expand All @@ -82,7 +82,7 @@ const pointsReducer = (state = INITIAL_STATE, action) => {

return { ...state, points, ...path };
}

case 'POINT_DELETE': {
const {points} = state,
selected = findSelectedIndecies(points);
Expand Down Expand Up @@ -112,7 +112,7 @@ const pointsReducer = (state = INITIAL_STATE, action) => {
sibHandleName = `handle${sibHandleIndex}`,
handle = { ...point[handleName] },
sibHandle = { ...point[sibHandleName] };

// move the opposite little handle with certain types
if ( type === 'mirrored' || type === 'asymmetric' ) {
sibHandle.angle = handle.angle - 180;
Expand All @@ -130,7 +130,7 @@ const pointsReducer = (state = INITIAL_STATE, action) => {

return { ...state, points: newPoints, ...calculatePath( newPoints ) };
}

case 'POINT_DESELECT_ALL': {
return { ...deselectAll( state ) };
}
Expand Down Expand Up @@ -199,4 +199,4 @@ const pointsReducer = (state = INITIAL_STATE, action) => {
return state;
}

export default pointsReducer;
export default pointsReducer;
Loading

0 comments on commit dfdf4d3

Please sign in to comment.