├── .editorconfig ├── .gitignore ├── .prettierrc ├── .vscode └── settings.json ├── README.md ├── package-lock.json ├── package.json ├── src ├── .babelrc ├── App.js ├── App.test.js ├── actions │ ├── ColorsActions.js │ ├── GradientsActions.js │ ├── SettingsActions.js │ ├── __tests__ │ │ └── colors.test.js │ └── index.js ├── components │ ├── Icon.js │ ├── background.js │ ├── button.js │ ├── circle.js │ ├── color-picker.js │ ├── color-rendered.js │ ├── colors.js │ ├── copy.js │ ├── gradients.js │ ├── nav.js │ └── settings.js ├── constants │ ├── ActionTypes.js │ └── GlobalConstants.js ├── containers │ ├── ColorsContainer.js │ └── GradientsContainer.js ├── index.html ├── index.js ├── index.scss ├── layouts │ └── index.js ├── reducers │ ├── ColorsReducer.js │ ├── GradientsReducer.js │ ├── SettingsReducer.js │ ├── __tests__ │ │ └── colors.test.js │ └── index.js ├── routes.js ├── scss │ ├── _globals.scss │ ├── _mixins.scss │ ├── background.scss │ ├── button.scss │ ├── circle.scss │ ├── color-picker.scss │ ├── color-rendered.scss │ ├── colors.scss │ ├── copy.scss │ ├── nav.scss │ └── settings.scss ├── selectors │ ├── ColorsSelectors.js │ ├── GradientsSelectors.js │ └── SettingsSelectors.js ├── serviceWorker.js ├── store │ ├── configureStore.js │ └── mockStore.js └── utils │ ├── calculateStop.js │ ├── copyToClipboard.js │ ├── getRandomColor.js │ ├── index.js │ ├── localStorage.js │ ├── offset.js │ ├── preventClick.js │ └── setGradient.js ├── webpack.common.js ├── webpack.dev.js └── webpack.prod.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "useTabs": false, 3 | "tabWidth": 2, 4 | "arrowParens": "avoid", 5 | "bracketSpacing": true, 6 | "jsxBracketSameLine": false, 7 | "semi": true, 8 | "singleQuote": true, 9 | "trailingComma": "none" 10 | } 11 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.formatOnSave": true 3 | } 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # any-color-react 2 | ### React + Redux. 3 | #### Inspired by [ColorSpark](https://colorspark.app/) and [Grabient](https://www.grabient.com/) 4 | #### Live demo [here](https://nttanh6299.github.io/any-color-react/#/) 5 | #### Usage 6 | 1. `npm i` 7 | 2. `npm run start` or `npm run build` for production build 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "any-color-react", 3 | "version": "0.1.0", 4 | "homepage": "https://nttanh6299.github.io/any-color-react", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "webpack-dev-server --config webpack.dev.js --open", 8 | "build": "webpack --config webpack.prod.js", 9 | "deploy": "gh-pages -d build", 10 | "test": "jest" 11 | }, 12 | "dependencies": { 13 | "gh-pages": "^2.2.0", 14 | "prop-types": "^15.7.2", 15 | "react": "^16.13.1", 16 | "react-color": "^2.18.0", 17 | "react-dom": "^16.13.1", 18 | "react-redux": "^7.2.0", 19 | "react-router-dom": "^5.1.2", 20 | "redux": "^4.0.5", 21 | "redux-thunk": "^2.3.0", 22 | "reselect": "^4.0.0" 23 | }, 24 | "devDependencies": { 25 | "@babel/core": "^7.8.7", 26 | "@babel/polyfill": "^7.8.7", 27 | "@babel/preset-env": "^7.8.7", 28 | "@babel/preset-react": "^7.8.3", 29 | "autoprefixer": "^9.7.4", 30 | "babel-loader": "^8.1.0", 31 | "css-loader": "^3.4.2", 32 | "dotenv": "^8.2.0", 33 | "file-loader": "^6.0.0", 34 | "html-loader": "^1.0.0", 35 | "html-webpack-plugin": "^3.2.0", 36 | "jest": "^25.2.4", 37 | "mini-css-extract-plugin": "^0.9.0", 38 | "node-sass": "^4.13.1", 39 | "optimize-css-assets-webpack-plugin": "^5.0.3", 40 | "path": "^0.12.7", 41 | "postcss-loader": "^3.0.0", 42 | "redux-mock-store": "^1.5.4", 43 | "sass-loader": "^8.0.2", 44 | "style-loader": "^1.1.3", 45 | "webpack": "^4.42.0", 46 | "webpack-cli": "^3.3.11", 47 | "webpack-dev-server": "^3.10.3", 48 | "webpack-merge": "^4.2.2" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-env", "@babel/preset-react"] 3 | } 4 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import React, { useMemo } from 'react'; 2 | import { Switch } from 'react-router-dom'; 3 | import { PublicRoute } from './layouts'; 4 | import routes from './routes'; 5 | import Nav from './components/nav'; 6 | 7 | function App() { 8 | const renderRoutes = useMemo(() => { 9 | if (routes.length > 0) { 10 | return routes.map((route, index) => { 11 | return ( 12 | 19 | ); 20 | }); 21 | } 22 | return null; 23 | }, [routes]); 24 | 25 | const renderNav = useMemo(() =>