Add documentation for scrolling-carousel

master
Hasan Genc 5 years ago
parent a83bc6cfae
commit 180627a57a
  1. 2
      README.md
  2. 49
      website/docs/scrollingCarousel.md
  3. 17
      website/docs/scrollingCarouselApi.md
  4. 4
      website/sidebars.js
  5. 61
      website/src/css/custom.css
  6. 140
      website/src/pages/index.js

@ -33,5 +33,5 @@ ReactDOM.render(
```
# License
Distributed under the MIT License. See `LICENSE` for more information.
Distributed under the MIT License. See `LICENSE` for more information.

File diff suppressed because one or more lines are too long

@ -0,0 +1,17 @@
---
id: scrolling-carousel-api
title: Scrolling Carousel
---
Scrollable carousel like google's web component `g-scrolling-carousel`
```jsx
<ScrollingCarousel />
```
### Props
| Name | type | required | default | descripiton |
| --------- | :----: | -------: | ------: | -------------------------------------------: |
| children | Node[] | true | [] | Child items that will be wrapped by carousel |
| className | string | false | "" | same as react's className property |

@ -1,7 +1,7 @@
module.exports = {
someSidebar: {
Docusaurus: ['installation', 'usage'],
API: ['carousel'],
Examples: ['infinity', 'swipible'],
API: ['carousel', 'scrolling-carousel-api'],
Examples: ['infinity', 'swipible', 'scrolling-carousel'],
},
};

@ -48,3 +48,64 @@
.exampleCarousel1 div:first-child {
text-align: center;
}
.scrolling-carousel-example1-container {
width: 660px;
}
.scrolling-carousel-example1 > [data-arrow='left'] {
background: linear-gradient(90deg, #fff 10%, rgba(255, 255, 255, 0));
top: 0px;
left: 0;
opacity: 1;
height: 42px;
width: 88px;
position: absolute;
cursor: pointer;
bottom: 0;
margin-bottom: auto;
margin-top: auto;
}
.scrolling-carousel-example1 > [data-arrow='left'] > button {
background: url('https://cdn.dsmcdn.com/web/production/slick-arrow.svg') no-repeat
center;
transform: rotateZ(180deg) scale(0.5);
height: 40px;
left: -13px;
border: none;
outline: none;
cursor: pointer;
}
.scrolling-carousel-example1 > [data-arrow='right'] {
background: linear-gradient(270deg, #fff 10%, rgba(255, 255, 255, 0));
right: 0;
opacity: 1;
height: 42px;
width: 88px;
position: absolute;
cursor: pointer;
top: 0;
bottom: 0;
margin-bottom: auto;
margin-top: auto;
}
.scrolling-carousel-example1 > [data-arrow='right'] > button {
background: url('https://cdn.dsmcdn.com/web/production/slick-arrow.svg') no-repeat;
height: 40px;
transform: scale(0.5);
border: none;
outline: none;
position: absolute;
right: -16px;
cursor: pointer;
}
[data-theme='dark'] .scrolling-carousel-example1 > [data-arrow='right'] {
background: linear-gradient(270deg, #121212 10%, rgba(255, 255, 255, 0));
}
[data-theme='dark'] .scrolling-carousel-example1 > [data-arrow='left'] {
background: linear-gradient(90deg, #121212 10%, rgba(255, 255, 255, 0));
top: 0px;
}

@ -4,10 +4,112 @@ import Layout from '@theme/Layout';
import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import useBaseUrl from '@docusaurus/useBaseUrl';
import { Carousel } from '@trendyol-js/react-carousel';
import { Carousel, ScrollingCarousel } from '@trendyol-js/react-carousel';
import styles from './styles.module.css';
import { Redirect } from '@docusaurus/router';
const slideData = [
{
text: 'skyline',
img:
'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAdHx8kKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD84QzQ5OjcBCgoKDQwNGg8PGjclHyU3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3N//AABEIACAAIAMBIgACEQEDEQH/xAAZAAADAQEBAAAAAAAAAAAAAAAEBQcDAgH/xAAvEAACAQIEAwUIAwAAAAAAAAABAgMEEQAFEiETMVFBYXGBkRQjMoKxssLwBiJC/8QAFgEBAQEAAAAAAAAAAAAAAAAAAwQC/8QAIREAAQQBAwUAAAAAAAAAAAAAAQACAxEEEjHwBSFBYYH/2gAMAwEAAhEDEQA/AFYz3KA0UbVjI8jBNSxEqvifHp64fSURSxNSQOw8K3nzxNeLC2oVWX00hIKkoNPnZS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KPppi40IrbLfi/XDN0DGLkObdpcrWoiphKZDIyLrKC3i69Bb3HWx1qqWvoqerpphoqNZjjOzFVYi9vb9XtjNAIFO+oSBiFHkdsHy+YUFbC5P8ZCozHmMFvEVA5Nr+pxmRT80MOQuI2jYWJB4OL5I6dqerf6ZHNQSZABu5t/fXCLl1RJ9IwgnhWU/aTKLj0OA1NTmUjBnmMZQaQBokv15J3xll4EpKCKhhTvLGokH+ymMRm3ALWBPHGIQhqhWRxV8EwQfcAASAeLHAJ6upmCPMkSvGPxhCaz5kAAHn4xYp2rrYY0iENNaInT3cdgDvuPj2xLvgsIwe7o//9k=',
},
{
text: 'blue',
img:
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR7vhDBHGcYfgGumwP_JdDsWdbmRBJrO822ayjYBWnUeOpg4mvv5HBrUCHh&s',
},
{
text: 'r32',
img:
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTcedysoUHEN5Pu8C5gy1_H_-fwbYUbZTqHhLblNaFvYGMlDVdQ6r0d3T5n&s',
},
{
text: 'gold',
img:
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRVUpJPnUV2JjON_U8j_GsNfpzB1TE_1YSPTFB4ElJX3-e7BPB_Dz0WJLvZ&s',
},
{
text: 'white',
img:
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQawL7bAfO-DV0rY3XlWnkm2cJcAAB9JQsZw4P9k8R0RElWDOhPyJ06WEMO&s',
},
{
text: 'nissan',
img:
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR-3a4aW0nL4gsFvceXOcqfFT5qlrOwHU0DySevbEo8-45XzIJJxu4x5ZeB&s',
},
{
text: 'modified',
img:
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSXsPphsOHUfc10c5bCr6VkCDK2d0YYYc7PkjiA527xIMsJZw7x5qqt3GZZ&s',
},
{
text: 'red',
img:
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSoJnGchkU3zwrTdq4WbFSjd5E-ehy9gtEaaxiuOE9-LHZnh8PYhANsp3D_&s',
},
{
text: 'rocket bunny',
img:
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRYefgcSyvUOC_qcNY9yZV7AX8yPaDlnZ3BU5eH794jT3AQH6AiTVXPDl5S&s',
},
{
text: 'r33',
img:
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRA2ZYkl0giWGtaNXKwr2z8HbJszowxKEQTDATCJMLvJ7kpGsRl9dr8CBnD&s',
},
{
text: 'chrome',
img:
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRFtKFD8Oalc6HqSrkWVMtPTitLO0mXpV9ofKYxgusg8zjfZdlaA4wX3KVv&s',
},
{
text: 'car',
img:
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQdTsdEjLHkQIYipiaZcLUP9LG2GsplKl7MQSuawbDbOgtQ_5ygK46i_3xc&s',
},
{
text: 'cool',
img:
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQfhHP8XoQ0X3eL4J_Xy0BJ0pnvrkINkKR78N6yhfXa7eWXn3UBh1ZzMep8&s',
},
{
text: 'widebody',
img:
'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRlGGm-Hh5so6PtScyr7lXrB9V13dFr7mtMJC5YlO9aaDPHfPQNRvzsFPK_&s',
},
];
const features = [
{
title: <>Easy to Use</>,
@ -92,6 +194,42 @@ function Home() {
</div>
</header>
<main>
<section className={styles.features}>
<div className="container">
<div className="row" style={{ width: '660px', margin: 'auto' }}>
<ScrollingCarousel>
{slideData.map((d) => (
<div
style={{
cursor: 'pointer',
display: 'flex',
border: '1px solid #DFE1E5',
borderRadius: '20px',
height: '40px',
lineHeight: '38px',
paddingRight: '12px',
margin: '14px 8px 14px 0',
}}
>
<img
style={{
borderRadius: '16px',
height: '32px',
marginBottom: '3px',
marginLeft: '3px',
marginRight: '8px',
marginTop: '3px',
width: '32px',
}}
src={d.img}
/>
<span style={{ fontSize: '12px' }}>{d.text}</span>
</div>
))}
</ScrollingCarousel>
</div>
</div>
</section>
<section className={styles.features}>
<div className="container">
<div className="row">

Loading…
Cancel
Save