Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 74 additions & 75 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,39 +30,39 @@ npm install --save react-planet
import { Planet } from 'react-planet';

export function MyPlanet() {
return (
<Planet
centerContent={
<div
style={{
height: 100,
width: 100,
borderRadius: '50%',
backgroundColor: '#1da8a4',
}}
/>
}
open
autoClose
>
<div
style={{
height: 70,
width: 70,
borderRadius: '50%',
backgroundColor: '#9257ad',
}}
/>
<div
style={{
height: 70,
width: 70,
borderRadius: '50%',
backgroundColor: '#9257ad',
}}
/>
</Planet>
);
return (
<Planet
centerContent={
<div
style={{
height: 100,
width: 100,
borderRadius: '50%',
backgroundColor: '#1da8a4',
}}
/>
}
open
autoClose
>
<div
style={{
height: 70,
width: 70,
borderRadius: '50%',
backgroundColor: '#9257ad',
}}
/>
<div
style={{
height: 70,
width: 70,
borderRadius: '50%',
backgroundColor: '#9257ad',
}}
/>
</Planet>
);
}
```

Expand All @@ -71,11 +71,12 @@ export function MyPlanet() {
<img src="doc/example2.png" width="40%">

```jsx
<Planet centerContent={div style={...yourStlye}/>}
open
orbitRadius={120}
rotation={30}
...
<Planet
centerContent={<div style={yourStyle} />}
open
orbitRadius={120}
rotation={30}
...
>
```

Expand All @@ -85,18 +86,18 @@ export function MyPlanet() {

```jsx
<Planet
orbitStyle={(defaultStyle) => ({
...defaultStyle,
borderWidth: 4,
borderStyle: 'dashed',
borderColor: '#6f03fc',
})}
centerContent={<div className={classes.planetSmall} />}
open
orbitStyle={(defaultStyle) => ({
...defaultStyle,
borderWidth: 4,
borderStyle: 'dashed',
borderColor: '#6f03fc',
})}
centerContent={<div className={classes.planetSmall} />}
open
>
<div className={classes.satellite1} />
<div className={classes.satellite2} />
<div className={classes.satellite3} />
<div className={classes.satellite1} />
<div className={classes.satellite2} />
<div className={classes.satellite3} />
</Planet>
```

Expand All @@ -106,9 +107,8 @@ export function MyPlanet() {

```jsx
<Planet
// set one of the orientations
satelliteOrientation="INSIDE"

// set one of the orientations
satelliteOrientation="INSIDE"
```

## Bring it to life
Expand All @@ -117,9 +117,9 @@ export function MyPlanet() {

```jsx
<Planet
dragablePlanet
dragRadiusPlanet={20}
bounce
dragablePlanet
dragRadiusPlanet={20}
bounce
```

## Planetception
Expand All @@ -136,23 +136,23 @@ Code: [/src/stories/Planetception.stories.tsx](/src/stories/Planetception.storie

```jsx
<Planet
centerContent={<YourButton0 />}
hideOrbit
autoClose
orbitRadius={60}
bounceOnClose
rotation={105}
// the bounce direction is minimal visible
// but on close it seems the button wobbling a bit to the bottom
bounceDirection="BOTTOM"
centerContent={<YourButton0 />}
hideOrbit
autoClose
orbitRadius={60}
bounceOnClose
rotation={105}
// the bounce direction is minimal visible
// but on close it seems the button wobbling a bit to the bottom
bounceDirection="BOTTOM"
>
<YourButton1 />
<YourButton2 />
<YourButton3 />
<div />
<div />
<div />
<div />
<YourButton1 />
<YourButton2 />
<YourButton3 />
<div />
<div />
<div />
<div />
</Planet>
```

Expand All @@ -162,10 +162,9 @@ Code: [/src/stories/Planetception.stories.tsx](/src/stories/Planetception.storie

```jsx
<Planet
mass={4}
tension={500}
friction={19}

mass={4}
tension={500}
friction={19}
```

<br/>
Expand Down