├── .travis.yml ├── src ├── .eslintrc ├── up.png ├── test.js ├── components │ ├── ProgressWrapper.js │ ├── SeeMore.js │ ├── Header.js │ ├── ProgressArray.js │ ├── Progress.js │ ├── Story.js │ └── Container.js ├── index.js └── styles.css ├── .babelrc ├── .editorconfig ├── ghpage ├── README.md ├── src │ ├── index.js │ ├── SeeMoreForm.js │ ├── index.css │ └── App.js ├── public │ ├── manifest.json │ └── index.html └── package.json ├── .gitignore ├── .eslintrc ├── rollup.config.js ├── LICENSE ├── package.json └── README.md /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 9 4 | - 8 5 | -------------------------------------------------------------------------------- /src/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "jest": true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactrondev/react-stories/HEAD/src/up.png -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "modules": false 5 | }], 6 | "stage-0", 7 | "react" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /src/test.js: -------------------------------------------------------------------------------- 1 | import ExampleComponent from './' 2 | 3 | describe('ExampleComponent', () => { 4 | it('is truthy', () => { 5 | expect(ExampleComponent).toBeTruthy() 6 | }) 7 | }) 8 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /ghpage/README.md: -------------------------------------------------------------------------------- 1 | # @reactrondev/react-stories 2 | 3 | This is a demo implementing `@reactrondev/react-stories` component. See it in action here: [](https://reactrondev.github.io/@reactrondev/react-stories/) -------------------------------------------------------------------------------- /ghpage/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom' 3 | 4 | import './index.css' 5 | import App from './App' 6 | 7 | ReactDOM.render(, document.getElementById('root')) 8 | -------------------------------------------------------------------------------- /ghpage/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "@reactrondev/react-stories", 3 | "name": "@reactrondev/react-stories", 4 | "start_url": "./index.html", 5 | "display": "standalone", 6 | "theme_color": "#000000", 7 | "background_color": "#ffffff" 8 | } 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # See https://help.github.com/ignore-files/ for more about ignoring files. 3 | 4 | # dependencies 5 | node_modules 6 | 7 | # builds 8 | build 9 | dist 10 | .rpt2_cache 11 | 12 | # misc 13 | .DS_Store 14 | .env 15 | .env.local 16 | .env.development.local 17 | .env.test.local 18 | .env.production.local 19 | 20 | npm-debug.log* 21 | yarn-debug.log* 22 | yarn-error.log* 23 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "extends": [ 4 | "standard", 5 | "standard-react" 6 | ], 7 | "env": { 8 | "es6": true 9 | }, 10 | "plugins": [ 11 | "react" 12 | ], 13 | "parserOptions": { 14 | "sourceType": "module" 15 | }, 16 | "rules": { 17 | "space-before-function-paren": 0, 18 | "react/jsx-boolean-value": 0 19 | }, 20 | "globals": { 21 | "Image": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ghpage/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@reactrondev/react-stories-example", 3 | "homepage": "https://reactrondev.github.io/react-stories", 4 | "version": "0.0.0", 5 | "license": "MIT", 6 | "private": true, 7 | "dependencies": { 8 | "axios": "^0.18.0", 9 | "prop-types": "^15.6.2", 10 | "react": "^16.4.1", 11 | "react-dom": "^16.4.1", 12 | "@reactrondev/react-stories": "file:..", 13 | "react-scripts": "^1.1.4", 14 | "react-transition-group": "^2.6.1" 15 | }, 16 | "scripts": { 17 | "start": "react-scripts start", 18 | "build": "react-scripts build", 19 | "test": "react-scripts test --env=jsdom", 20 | "eject": "react-scripts eject" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/components/ProgressWrapper.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import PropTypes from 'prop-types' 3 | import style from './../styles.css' 4 | 5 | const ProgressWrapper = (props) => ( 6 |
7 | {props.children} 8 |
9 | ) 10 | 11 | const getProgressWrapperStyle = ({ width, pause, bufferAction }) => ({ 12 | width: `${width * 100}%`, 13 | opacity: pause && !bufferAction ? 0 : 1 14 | }) 15 | 16 | const styles = { 17 | progress: { 18 | height: 2, 19 | maxWidth: '100%', 20 | background: '#555', 21 | margin: 2 22 | } 23 | } 24 | 25 | ProgressWrapper.propTypes = { 26 | children: PropTypes.node 27 | } 28 | 29 | export default ProgressWrapper 30 | -------------------------------------------------------------------------------- /rollup.config.js: -------------------------------------------------------------------------------- 1 | import babel from 'rollup-plugin-babel' 2 | import commonjs from 'rollup-plugin-commonjs' 3 | import external from 'rollup-plugin-peer-deps-external' 4 | import postcss from 'rollup-plugin-postcss' 5 | import resolve from 'rollup-plugin-node-resolve' 6 | import url from 'rollup-plugin-url' 7 | import svgr from '@svgr/rollup' 8 | 9 | import pkg from './package.json' 10 | 11 | export default { 12 | input: 'src/index.js', 13 | output: [ 14 | { 15 | file: pkg.main, 16 | format: 'cjs', 17 | sourcemap: true 18 | }, 19 | { 20 | file: pkg.module, 21 | format: 'es', 22 | sourcemap: true 23 | } 24 | ], 25 | plugins: [ 26 | external(), 27 | postcss({ 28 | extensions: [ '.css' ], 29 | modules: true 30 | }), 31 | url(), 32 | svgr(), 33 | babel({ 34 | exclude: 'node_modules/**', 35 | plugins: [ 'external-helpers' ] 36 | }), 37 | resolve(), 38 | commonjs() 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /src/components/SeeMore.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import PropTypes from 'prop-types' 3 | import style from './../styles.css' 4 | import up from './../up.png' 5 | 6 | export default function seeMore(props) { 7 | return ( 8 | props.showContent 9 | ?
10 | {props.seeMoreContent} 11 |
{ 12 | props.toggleMore(false) 13 | props.action('play') 14 | }} className={style.seeMoreClose}>
15 |
16 | :
{ 17 | props.toggleMore(true) 18 | props.action('pause') 19 | }} className={style.seeMore}> 20 | 21 | Read more 22 |
23 | ) 24 | } 25 | 26 | seeMore.propTypes = { 27 | seeMoreContent: PropTypes.object, 28 | showContent: PropTypes.bool, 29 | action: PropTypes.func, 30 | toggleMore: PropTypes.func 31 | } 32 | -------------------------------------------------------------------------------- /ghpage/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | @reactrondev/react-stories 22 | 23 | 24 | 25 | 28 | 29 |
30 | 31 | 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Mohit Karekar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/components/Header.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import PropTypes from 'prop-types' 3 | 4 | const Header = ({ profileImage, heading, subheading }) => 5 |
6 | {profileImage && } 7 | 8 |

{heading}

9 |

{subheading}

10 |
11 |
12 | 13 | const styles = { 14 | main: { 15 | display: 'flex', 16 | alignItems: 'center' 17 | }, 18 | img: { 19 | width: 40, 20 | height: 40, 21 | borderRadius: 40, 22 | marginRight: 10, 23 | filter: 'drop-shadow(0 0px 2px rgba(0, 0, 0, 0.5))', 24 | border: '2px solid rgba(255, 255, 255, 0.8)' 25 | }, 26 | text: { 27 | display: 'flex', 28 | flexDirection: 'column', 29 | filter: 'drop-shadow(0 0px 3px rgba(0, 0, 0, 0.9))' 30 | }, 31 | heading: { 32 | fontSize: '1rem', 33 | color: 'rgba(255, 255, 255, 0.9)' 34 | }, 35 | subheading: { 36 | fontSize: '0.6rem', 37 | color: 'rgba(255, 255, 255, 0.8)' 38 | } 39 | } 40 | 41 | Header.propTypes = { 42 | heading: PropTypes.string, 43 | subheading: PropTypes.string, 44 | profileImage: PropTypes.string 45 | } 46 | 47 | export default Header 48 | -------------------------------------------------------------------------------- /src/components/ProgressArray.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Progress from './Progress' 3 | import PropTypes from 'prop-types' 4 | 5 | export default class ProgressArray extends React.Component { 6 | render() { 7 | return ( 8 |
9 | {this.props.length.map((i, index) => 10 | )} 21 |
22 | ) 23 | } 24 | } 25 | 26 | const styles = { 27 | progressArr: { 28 | display: 'flex', 29 | justifyContent: 'center', 30 | maxWidth: '100%', 31 | flexWrap: 'row', 32 | position: 'absolute', 33 | width: '98%', 34 | padding: 5, 35 | paddingTop: 7, 36 | alignSelf: 'center', 37 | zIndex: 99, 38 | filter: 'drop-shadow(0 1px 8px #000)' 39 | } 40 | } 41 | 42 | ProgressArray.propTypes = { 43 | length: PropTypes.array, 44 | progress: PropTypes.object, 45 | pause: PropTypes.bool, 46 | next: PropTypes.func, 47 | currentStory: PropTypes.oneOfType([ 48 | PropTypes.string, 49 | PropTypes.object 50 | ]), 51 | defaultInterval: PropTypes.number, 52 | videoDuration: PropTypes.number, 53 | bufferAction: PropTypes.bool 54 | } 55 | -------------------------------------------------------------------------------- /ghpage/src/SeeMoreForm.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import axios from 'axios' 3 | 4 | export default class SeeMoreForm extends React.Component { 5 | constructor(props) { 6 | super(props) 7 | this.state = { 8 | name: '', 9 | email: '', 10 | description: '', 11 | submitting: false, 12 | submitted: false 13 | } 14 | } 15 | onSubmit = () => { 16 | this.setState({ submitting: true }) 17 | axios.get('https://script.google.com/macros/s/AKfycbyhz4QuT_PQLgM1rMc6v-guOz0HPUpuPKKQ287RmSen_K8NGN0/exec', { params: { 18 | name: this.state.name, 19 | email: this.state.email, 20 | description: this.state.description 21 | }}).then(res => { 22 | this.setState({ submitting: false, submitted: true }) 23 | }) 24 | } 25 | onChange = e => { 26 | this.setState({ [e.target.name]: e.target.value }) 27 | } 28 | render() { 29 | const { props } = this 30 | return ( 31 |
32 |

Want to implement this stories format on your website, but don't want to code?

33 |

Contact me here:

34 | 35 | 36 |