|
12 | 12 |
|
13 | 13 | <br/>
|
14 | 14 |
|
| 15 | + <h2>Live Demo</h2> |
| 16 | + <br/> |
15 | 17 | <a target="_blank" href="https://stackblitz.com/github/Lemoncode/react-image-focal-point/tree/main/examples/basic">
|
16 | 18 | <img
|
17 | 19 | src="https://developer.stackblitz.com/img/open_in_stackblitz.svg"
|
|
27 | 29 | height="36"
|
28 | 30 | />
|
29 | 31 | </a>
|
30 |
| -</div> |
| 32 | + |
| 33 | +<br /> |
31 | 34 |
|
32 | 35 | <hr />
|
33 | 36 |
|
| 37 | +<br /> |
| 38 | + |
34 | 39 | Video tutorial comming soon
|
35 | 40 |
|
36 |
| -[![Code Coverage][coverage-badge]][coverage] |
| 41 | +<br /> |
| 42 | + |
| 43 | +</div> |
| 44 | + |
| 45 | +<hr /> |
| 46 | + |
| 47 | + |
| 48 | +<!-- https://github.com/badges/shields --> |
| 49 | + |
| 50 | +    |
| 51 | + |
| 52 | +    |
| 53 | + |
| 54 | +   |
| 55 | + |
| 56 | +## Table of Contents |
| 57 | + |
| 58 | +- [Installation](#installation) |
| 59 | +- [Quickstart](#quickstart) |
| 60 | +- [Docs](#docs) |
| 61 | +- [Examples](#examples) |
| 62 | +- [Key Features](#key-features) |
| 63 | + |
| 64 | +## Installation |
| 65 | + |
| 66 | +Install _React Image Focal Point_ using your favorite package manager like [npm](https://www.npmjs.com/): |
| 67 | + |
| 68 | +```bash |
| 69 | +npm install @lemoncode/react-image-focal-point |
| 70 | + |
| 71 | +``` |
| 72 | + |
| 73 | +or via [yarn](https://classic.yarnpkg.com/lang/en/): |
| 74 | + |
| 75 | +```bash |
| 76 | +yarn add @lemoncode/react-image-focal-point |
| 77 | + |
| 78 | +``` |
| 79 | + |
| 80 | +This library has `peerDependencies` listings for `react` and `react-dom`. You will need to install these packages in your project in order to use this library. |
| 81 | + |
| 82 | +## Quickstart |
| 83 | + |
| 84 | +Import the library styles and the component: |
| 85 | + |
| 86 | +```jsx |
| 87 | +import '@lemoncode/react-image-focal-point/style.css'; |
| 88 | +import { ImageFocalPoint } from '@lemoncode/react-image-focal-point'; |
| 89 | + |
| 90 | +const App = () => { |
| 91 | + return ( |
| 92 | + // Your app code |
| 93 | + ); |
| 94 | +}; |
| 95 | + |
| 96 | +``` |
| 97 | + |
| 98 | +Then use the component: |
| 99 | + |
| 100 | +```jsx |
| 101 | +import '@lemoncode/react-image-focal-point/style.css'; |
| 102 | +import { ImageFocalPoint } from '@lemoncode/react-image-focal-point'; |
| 103 | + |
| 104 | +const App = () => { |
| 105 | + return ( |
| 106 | + <ImageFocalPoint |
| 107 | + src="your-image-src" // Same src as <img> HTML element |
| 108 | + onChange={focalPoint => { |
| 109 | + // Add here your code to do whatever you want to when the user drags on the focal point |
| 110 | + }} |
| 111 | + /> |
| 112 | + ); |
| 113 | +}; |
| 114 | +``` |
| 115 | + |
| 116 | +## Docs |
| 117 | + |
| 118 | +Check out our official [documentation](https://lemoncode.github.io/react-image-focal-point) |
| 119 | + |
| 120 | +## Examples |
| 121 | + |
| 122 | +You'll find runnable examples in the [docs site](https://lemoncode.github.io/react-image-focal-point/docs/examples/basic) and in the [examples folder](https://github.com/Lemoncode/react-image-focal-point/tree/main/examples). |
| 123 | + |
| 124 | +## Key Features |
| 125 | + |
| 126 | +- You can just drag and drop a focal point button on top of your image and enhance your cropped images. |
| 127 | + |
| 128 | +- You can use it as a controlled or uncontrolled component. |
| 129 | + |
| 130 | +- You can style the component at any component's level (check out the [docs site CSS section](https://lemoncode.github.io/react-image-focal-point/docs/api/image-focal-point#classesprops)). |
| 131 | + |
| 132 | +# About Lemoncode + Basefactor |
| 133 | + |
| 134 | +We are an innovating team of Javascript experts, passionate about turning your ideas into robust products. |
| 135 | + |
| 136 | +[Lemoncode](http://lemoncode.net/services/en/#en-home) provides training services. |
| 137 | + |
| 138 | +[Basefactor, consultancy by Lemoncode](http://www.basefactor.com) provides consultancy and coaching services. |
| 139 | + |
| 140 | +For the LATAM/Spanish audience we are running an Online Front End Master degree, more info: http://lemoncode.net/master-frontend |
0 commit comments