react-fancy-circular-carousel 0.0.1 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/FancyCarousel.css CHANGED
@@ -9,8 +9,6 @@
9
9
 
10
10
  .fancy-carousel {
11
11
  position: relative;
12
- width: 800px;
13
- height: 800px;
14
12
  border-radius: 50%;
15
13
  transition: 0.5s;
16
14
  transform-origin: center center;
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- <div align="center"><p align="center"><a href="https://www.npmjs.com/package/react-fancy-circular-carousel"><img src="./assets/React.webp" alt="React Logo - Carousel UI Component" width="140px" /></a></p></div>
1
+ <div align="center"><p align="center"><a href="https://www.npmjs.com/package/react-fancy-circular-carousel"><img src="https://github.com/ninadsutrave/react-fancy-circular-carousel/blob/master/dist/assets/React.webp?raw=true" alt="React Logo - Carousel UI Component" width="140px" /></a></p></div>
2
2
 
3
- <h1 align="center">React Fancy Image Carousel</h1>
3
+ <h1 align="center">React Circular Carousel Component</h1>
4
4
 
5
5
  ## Features
6
6
 
@@ -13,15 +13,15 @@
13
13
 
14
14
  $ npm install react-fancy-circular-carousel
15
15
 
16
- Include the styles by importing node_modules/react-fancy-circular-carousel/FancyCarousel.css
16
+ Include the styles by importing FancyCarousel.css
17
17
 
18
18
  ```jsx
19
- import '../node_modules/react-fancy-circular-carousel/FancyCarousel.css';
19
+ import '../node_modules/react-fancy-circular-carousel/FancyCarousel.css';
20
20
  ```
21
21
 
22
22
  ## Quickstart
23
23
 
24
- #### Parameters
24
+ ### Parameters
25
25
 
26
26
  | **Parameter** | **Type** | **Description** |
27
27
  |:---|:---|:---|
@@ -46,7 +46,10 @@
46
46
  | navigationButtonStyling | React.CSSProperties | `optional` Custom styling for navigation buttons |
47
47
 
48
48
 
49
+ ### Usage
50
+
49
51
  ```jsx
52
+
50
53
  import React from "react";
51
54
 
52
55
  import FancyCarousel from "react-fancy-circular-carousel";
@@ -57,22 +60,22 @@ import image2 from './assets/image2.png';
57
60
  import image3 from './assets/image3.png';
58
61
  import image4 from './assets/image4.png';
59
62
 
60
-
61
63
  const YourComponent = () => (
62
64
 
63
- const imageSourcesUrl = [image1, image2, image3, image4];
65
+ const images = [image1, image2, image3, image4];
64
66
 
65
67
  return <div className="carousel">
66
- <FancyCarousel images={imageSourcesUrl} />
68
+ <FancyCarousel images={images} />
67
69
  </div>
68
70
  );
69
71
 
70
72
  export default YourComponent;
71
73
  ```
72
74
 
73
- #### Retrieve focus element
75
+ ### Retrieve focus element
74
76
 
75
77
  Utility using which one can know which element is currently at focus and may add relevant components around it.
78
+
76
79
  For eg. if the carousel portrays images of cities, this feature may help you update the description in the information box along side the carousel.
77
80
 
78
81
  ```jsx
@@ -91,11 +94,11 @@ const YourComponent = () => (
91
94
  // the focus element would be the array index of the currently image at focus
92
95
  const [focusElement, setFocusElement] = useState(0);
93
96
 
94
- const imageSourcesUrl = [image1, image2, image3, image4];
97
+ const images = [image1, image2, image3, image4];
95
98
  const info = ['Delhi', 'Mumbai', 'Bengaluru', 'Kolkata'];
96
99
 
97
100
  return <div className="carousel">
98
- <FancyCarousel images={imageSourcesUrl} />
101
+ <FancyCarousel images={images} setFocusElement={setFocusElement}/>
99
102
  <div className="info-box-wrapper">
100
103
  <p> {info[focusElement]} </p>
101
104
  </div>
@@ -105,9 +108,10 @@ const YourComponent = () => (
105
108
  export default YourComponent;
106
109
  ```
107
110
 
108
- #### Customisations
111
+ ### Customisations
109
112
 
110
113
  Customise the carousel to your needs such as modifying the carousel size, image size, adding styling such as drop shadow, adding auto rotate, etc
114
+
111
115
  The focusElementStyling and navigationButtonStyling props are of type React.CSSProperties, which is essentially a JavaScript object containing camelcased CSS properties and their corresponding values.
112
116
 
113
117
  To know more check the official documentation [here](https://legacy.reactjs.org/docs/dom-elements.html#style).
@@ -125,11 +129,11 @@ import image4 from './assets/image4.png';
125
129
 
126
130
  const YourComponent = () => (
127
131
 
128
- const imageSourcesUrl = [image1, image2, image3, image4];
132
+ const images = [image1, image2, image3, image4];
129
133
 
130
134
  return <div className="carousel">
131
135
  <FancyCarousel
132
- images={imageSourcesUrl}
136
+ images={images}
133
137
  carouselRadius={400}
134
138
  peripheralImageRadius={100}
135
139
  centralImageRadius={200}
@@ -146,14 +150,18 @@ export default YourComponent;
146
150
 
147
151
  ## Preview
148
152
 
149
- ![Preview Image](assets/preview1.png)
153
+ With navigators
154
+
155
+ ![Preview Image](https://github.com/ninadsutrave/react-fancy-circular-carousel/blob/master/dist/assets/preview1.png?raw=true)
156
+
157
+ With auto rotation
150
158
 
151
- ![Preview Gif](assets/preview2.gif)
159
+ ![Preview Gif](https://github.com/ninadsutrave/react-fancy-circular-carousel/blob/master/dist/assets/preview2.gif?raw=true)
152
160
 
153
- ## NPM Module
161
+ ## Github Repo
154
162
 
155
- [Npm Page](https://www.npmjs.com/package/react-fancy-circular-carousel)
156
- Try it out for yourselves and ⭐ this repo if you like it!
163
+ [Github Repo](https://github.com/ninadsutrave/react-fancy-circular-carousel)
164
+ Try it out for yourselves and ⭐ the repo if you like it!
157
165
 
158
166
  ## License
159
167
 
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-fancy-circular-carousel",
3
- "version": "0.0.1",
3
+ "version": "1.0.1",
4
4
  "description": "Interactive circular carousel with image elements highly customisable as per the developer's needs",
5
5
  "main": "index.js",
6
6
  "scripts": {