Skip to content

Commit 3ff0ef5

Browse files
authored
Merge pull request #12 from Lemoncode/feature/#11-update-readme
Feature/#11 update readme
2 parents 68349d1 + a7450f7 commit 3ff0ef5

File tree

4 files changed

+144
-12
lines changed

4 files changed

+144
-12
lines changed

README.md

Lines changed: 133 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,133 @@
1-
# @lemoncode/react-image-focal-point
1+
<div align="center">
2+
<h1>React Image Focal Point</h1>
3+
<a href="https://lemoncode.github.io/react-image-focal-point">
4+
<img
5+
height="100"
6+
width="100"
7+
alt="logo"
8+
src="https://raw.githubusercontent.com/lemoncode/react-image-focal-point/main/website/static/img/logo.svg"
9+
/>
10+
</a>
11+
12+
<br/>
13+
14+
<p>Let the user set the picture focal point just by visually dragging and dropping on top of the selected image.</p>
15+
16+
<h2>Live Demo</h2>
17+
<br/>
18+
<a target="_blank" href="https://stackblitz.com/github/Lemoncode/react-image-focal-point/tree/main/examples/basic">
19+
<img
20+
src="https://developer.stackblitz.com/img/open_in_stackblitz.svg"
21+
alt="Edit on StackBlitz"
22+
title="Edit on StackBlitz"
23+
height="36"
24+
/>
25+
</a> <a target="_blank" href="https://codesandbox.io/s/github/Lemoncode/react-image-focal-point/tree/main/examples/basic">
26+
<img
27+
src="https://codesandbox.io/static/img/play-codesandbox.svg"
28+
alt="Edit on Codesandbox"
29+
title="Edit on Codesandbox"
30+
height="36"
31+
/>
32+
</a>
33+
34+
<br />
35+
<br />
36+
37+
Video tutorial comming soon
38+
39+
</div>
40+
41+
<hr />
42+
43+
![npm](https://img.shields.io/npm/v/@lemoncode/react-image-focal-point?style=plastic) ![npm bundle size](https://img.shields.io/bundlephobia/min/@lemoncode/react-image-focal-point?style=plastic) ![npm downloads](https://img.shields.io/npm/dw/@lemoncode/react-image-focal-point?style=plastic) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/lemoncode/react-image-focal-point/ci.yml?branch=main&style=plastic)
44+
45+
![GitHub license](https://img.shields.io/github/license/lemoncode/react-image-focal-point?style=plastic) ![GitHub issues](https://img.shields.io/github/issues/lemoncode/react-image-focal-point?style=plastic) ![GitHub pull requests](https://img.shields.io/github/issues-pr/lemoncode/react-image-focal-point?style=plastic) ![GitHub last commit](https://img.shields.io/github/last-commit/lemoncode/react-image-focal-point?style=plastic)
46+
47+
![GitHub stars](https://img.shields.io/github/stars/lemoncode/react-image-focal-point?style=social) ![GitHub watchers](https://img.shields.io/github/watchers/lemoncode/react-image-focal-point?style=social) ![Twitter Follow](https://img.shields.io/twitter/follow/lemoncoders?style=social)
48+
49+
## Table of Contents
50+
51+
- [Installation](#installation)
52+
- [Quickstart](#quickstart)
53+
- [Docs](#docs)
54+
- [Examples](#examples)
55+
- [Key Features](#key-features)
56+
57+
## Installation
58+
59+
Install _React Image Focal Point_ using your favorite package manager like [npm](https://www.npmjs.com/):
60+
61+
```bash
62+
npm install @lemoncode/react-image-focal-point
63+
64+
```
65+
66+
or via [yarn](https://classic.yarnpkg.com/lang/en/):
67+
68+
```bash
69+
yarn add @lemoncode/react-image-focal-point
70+
71+
```
72+
73+
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.
74+
75+
## Quickstart
76+
77+
Import the library styles and the component:
78+
79+
```jsx
80+
import '@lemoncode/react-image-focal-point/style.css';
81+
import { ImageFocalPoint } from '@lemoncode/react-image-focal-point';
82+
83+
const App = () => {
84+
return (
85+
// Your app code
86+
);
87+
};
88+
89+
```
90+
91+
Then use the component:
92+
93+
```jsx
94+
import '@lemoncode/react-image-focal-point/style.css';
95+
import { ImageFocalPoint } from '@lemoncode/react-image-focal-point';
96+
97+
const App = () => {
98+
return (
99+
<ImageFocalPoint
100+
src="your-image-src" // Same src as <img> HTML element
101+
onChange={focalPoint => {
102+
// Add here your code to do whatever you want to when the user drags on the focal point
103+
}}
104+
/>
105+
);
106+
};
107+
```
108+
109+
## Docs
110+
111+
Check out our official [documentation](https://lemoncode.github.io/react-image-focal-point)
112+
113+
## Examples
114+
115+
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).
116+
117+
## Key Features
118+
119+
- Let the user set the picture focal point just by visually dragging and dropping on top of the selected image.
120+
121+
- You can use it as a controlled or uncontrolled component.
122+
123+
- 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)).
124+
125+
# About Lemoncode + Basefactor
126+
127+
We are an innovating team of Javascript experts, passionate about turning your ideas into robust products.
128+
129+
[Lemoncode](http://lemoncode.net/services/en/#en-home) provides training services.
130+
131+
[Basefactor, consultancy by Lemoncode](http://www.basefactor.com) provides consultancy and coaching services.
132+
133+
For the LATAM/Spanish audience we are running an Online Front End Master degree, more info: http://lemoncode.net/master-frontend

packages/react-image-focal-point/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/react-image-focal-point/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
"react image focal point"
4747
],
4848
"peerDependencies": {
49-
"react": ">=16.8.0"
49+
"react": ">=16.8.0",
50+
"react-dom": ">=16.8.0"
5051
},
5152
"devDependencies": {
5253
"@lemoncode/config": "*",

website/docusaurus.config.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ const projectName = 'react-image-focal-point';
1010
/** @type {import('@docusaurus/types').Config} */
1111
const config = {
1212
title: 'React Image Focal Point',
13-
tagline: 'Image focal point component for React',
13+
tagline: 'Let the user set the picture focal point just by visually dragging and dropping on top of the selected image.',
1414
favicon: 'img/favicon.ico',
15-
1615
url: `https://${organizationName}.github.io`,
1716
baseUrl: `/${projectName}`,
1817
organizationName,
@@ -106,15 +105,18 @@ const config = {
106105
{
107106
title: 'More',
108107
items: [
109-
{
110-
// TODO: Update blog link
111-
label: 'Blog',
112-
to: '/',
113-
},
114108
{
115109
label: 'GitHub',
116110
href: 'https://github.com/Lemoncode/react-image-focal-point',
117111
},
112+
{
113+
label: 'Blog (ES)',
114+
href: 'https://lemoncode.net/lemoncode-blog',
115+
},
116+
{
117+
label: 'Blog (EN)',
118+
href: 'https://www.basefactor.com/blog',
119+
},
118120
],
119121
},
120122
],

0 commit comments

Comments
 (0)