This repository was archived by the owner on Apr 14, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
__docs__/4-custom-animations Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ module.exports = {
1515 test : / \. t s x $ / ,
1616 loader : 'ts-loader' ,
1717 include : path . resolve ( __dirname , '../packages' ) ,
18- exclude : [ ' node_modules' ] ,
18+ exclude : / n o d e _ m o d u l e s / ,
1919 options : {
2020 transpileOnly : true ,
2121 } ,
@@ -24,7 +24,7 @@ module.exports = {
2424 test : / \. ( j p g | g i f | p n g | j p e g | w e b p ) $ / ,
2525 loader : 'file-loader' ,
2626 include : path . resolve ( __dirname , '../packages' ) ,
27- exclude : [ ' node_modules' ] ,
27+ exclude : / n o d e _ m o d u l e s / ,
2828 } ,
2929 ] ,
3030 } ,
Original file line number Diff line number Diff line change 2424 },
2525 "size-limit" : [
2626 {
27- "limit" : " 5.82 KB" ,
27+ "limit" : " 6 KB" ,
2828 "path" : " dist/esm/packages/yubaba/src/index.js"
2929 }
3030 ],
Original file line number Diff line number Diff line change 11import * as React from 'react' ;
22import { ElementBoundingBox } from '../lib/dom' ;
33
4+ export type InlineStyles = React . CSSProperties ;
5+
46export interface TargetProps {
57 style : InlineStyles ;
68 className ?: string ;
@@ -64,10 +66,6 @@ export interface AnimationData {
6466 destination : ElementData ;
6567}
6668
67- export interface InlineStyles {
68- [ key : string ] : string | number | undefined ;
69- }
70-
7169export interface ElementData {
7270 element : HTMLElement ;
7371 elementBoundingBox : ElementBoundingBox ;
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export default class OneFullRotation extends React.Component<CollectorChildrenPr
1313 ...prevStyle ,
1414 opacity : 1 ,
1515 transformOrigin : 'center' ,
16- transform : combine ( ( prevStyle . transform as string ) || '' , '' ) ( 'rotate(360deg)' ) ,
16+ transform : combine ( prevStyle . transform , '' ) ( 'rotate(360deg)' ) ,
1717 } ) ,
1818 } ) ;
1919
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ export default class Move extends React.Component<MoveProps> {
8585 transformOrigin : '0 0' ,
8686 visibility : 'visible' ,
8787 willChange : combine ( 'transform' ) ( prevStyles . willChange ) ,
88- transform : combine ( ( prevStyles . transform as string ) || '' , '' ) (
88+ transform : combine ( prevStyles . transform , '' ) (
8989 `translate3d(${ toStartXOffset } px, ${ toStartYOffset } px, 0) scale3d(${ math . percentageDifference (
9090 originTarget . size . width ,
9191 destinationTarget . size . width
Original file line number Diff line number Diff line change @@ -219,4 +219,8 @@ starting from the [FocalTarget](/focal-target) element.
219219Because of this is trashes layout as well as affects other elements on the screen,
220220if the element you're revealing doesn't have a fixed width it will look _ bad_ .
221221
222- One way of getting around this is by using the ` useClipPath ` prop - however it is not supported in IE11.
222+ It will also mean that if the target elements are vertically or horizontally centered -
223+ they will affect the flow of the page and elements will start moving around.
224+ Not great!
225+
226+ One way of getting around both of these is by using the ` useClipPath ` prop - however it is not supported in IE11.
Original file line number Diff line number Diff line change 1- export const combine = ( t1 : string , delimeter = ',' ) => ( t2 ?: string | number ) => {
1+ export const combine = ( t1 : string = '' , delimeter = ',' ) => ( t2 ?: string | number ) => {
22 if ( t2 ) {
33 return `${ t1 } ${ delimeter } ${ t2 } ` ;
44 }
You can’t perform that action at this time.
0 commit comments