├── .prettierrc ├── .gitignore ├── .npmignore ├── tsconfig.node.json ├── __tests__ └── PixelsImage.test.tsx ├── src ├── index.ts ├── types.ts ├── portal.tsx ├── icons.tsx ├── ReactProfile.tsx └── language.ts ├── tsconfig.json ├── themes ├── minify.js ├── default.src.css └── dark.src.css ├── vite.config.ts ├── docs ├── GET_STARTED.md ├── getDoc.js └── README.md ├── package.json ├── README.md └── LICENSE /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 120 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | node_modules/ 3 | themes/*.min.css -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | __tests__/ 2 | src/ 3 | node_modules/ 4 | themes/*.src.css 5 | themes/minify.js 6 | docs/ -------------------------------------------------------------------------------- /tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "skipLibCheck": true, 5 | "module": "ESNext", 6 | "moduleResolution": "bundler", 7 | "allowSyntheticDefaultImports": true 8 | }, 9 | "include": ["vite.config.ts"] 10 | } -------------------------------------------------------------------------------- /__tests__/PixelsImage.test.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { render } from '@testing-library/react'; 3 | import { PixelsImage } from "../src" 4 | 5 | describe('PixelsImage', () => { 6 | 7 | it('just render', async () => { 8 | const element = render() 9 | expect(element.getByPlaceholderText("Test Image")).toBeDefined() 10 | }) 11 | 12 | }); -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import ReactProfile from "./ReactProfile"; 2 | 3 | export { openEditor } from './portal'; 4 | export type { ReactProfileProps, Change, SUPPORTED_LANGUAGES } from './types'; 5 | export type { ReactCropProps, Crop } from 'react-image-crop' 6 | export type { EXPORT_OBJECT } from 'react-pixels' 7 | export { FILTERS_LIST as ALL_FILTERS } from 'react-pixels'; 8 | 9 | export default ReactProfile 10 | export { ReactProfile } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "./dist/", 4 | "target": "es2020", 5 | "module": "es2020", 6 | "lib": ["dom", "dom.iterable", "esnext"], 7 | "skipLibCheck": true, 8 | "esModuleInterop": true, 9 | "allowSyntheticDefaultImports": true, 10 | "strict": true, 11 | "forceConsistentCasingInFileNames": true, 12 | "noFallthroughCasesInSwitch": true, 13 | "moduleResolution": "node", 14 | "resolveJsonModule": true, 15 | "isolatedModules": true, 16 | "declaration": true, 17 | "allowJs": true, 18 | "jsx": "react" 19 | }, 20 | "include": ["src/**/*.ts", "src/**/*.tsx"], 21 | "exclude": ["node_modules"] 22 | } 23 | -------------------------------------------------------------------------------- /themes/minify.js: -------------------------------------------------------------------------------- 1 | import path from "path" 2 | import fs from "fs" 3 | import postcss from "postcss" 4 | import cssnano from "cssnano" 5 | 6 | function minify(cssPath) { 7 | const basename = path.basename(cssPath); 8 | const newBasename = basename.split(".")[0] + ".min.css"; 9 | const css = fs.readFileSync(cssPath, 'utf-8'); 10 | postcss([cssnano]) 11 | .process(css, { from: cssPath }) 12 | .then(({ css }) => fs.writeFileSync(path.join(cssPath, '../', newBasename), css)) 13 | } 14 | 15 | fs.readdir('./themes', (_, files) => { 16 | if(files) { 17 | files = files.filter(name => name.endsWith(".src.css")) 18 | for(const file of files) { 19 | minify(path.join('./themes', file)) 20 | } 21 | } 22 | }) -------------------------------------------------------------------------------- /vite.config.ts: -------------------------------------------------------------------------------- 1 | import { resolve } from 'path' 2 | import { defineConfig } from 'vite' 3 | import react from '@vitejs/plugin-react' 4 | import dts from 'vite-plugin-dts' 5 | 6 | export default defineConfig({ 7 | build: { 8 | lib: { 9 | entry: resolve(__dirname, 'src/index.ts'), 10 | name: 'ReactProfile', 11 | fileName: 'index', 12 | }, 13 | rollupOptions: { 14 | external: ['react', 'react-dom'], 15 | output: { 16 | exports: "named", 17 | globals: { 18 | react: 'React', 19 | 'react-dom': 'ReactDOM', 20 | }, 21 | assetFileNames: chunkInfo => { 22 | return chunkInfo.name || '' 23 | }, 24 | }, 25 | }, 26 | }, 27 | plugins: [ 28 | react({ 29 | jsxRuntime: 'classic', 30 | }), 31 | dts(), 32 | ], 33 | }) -------------------------------------------------------------------------------- /docs/GET_STARTED.md: -------------------------------------------------------------------------------- 1 | ## Installation 2 | 3 | In your terminal, execute this command depending on your preferred package manager: 4 | 5 | ``` 6 | npm i react-profile 7 | yarn add react-profile 8 | pnpm add react-profile 9 | ``` 10 | 11 | ## Example 12 | 13 | One way to open the editor is passing the image path and rendering it. For example: 14 | 15 | ```javascript 16 | import React from "react"; 17 | import ReactProfile from "react-profile"; 18 | import "react-profile/themes/default.min.css"; 19 | 20 | function App() { 21 | return ; 22 | } 23 | 24 | export default App; 25 | ``` 26 | 27 | Additionally, you can open the editor directly in your code. For example: 28 | 29 | ```javascript 30 | import { openEditor } from "react-profile"; 31 | import "react-profile/themes/dark.min.css"; 32 | 33 | async function open() { 34 | const result = await openEditor({ src: "./your-image.jpg" }); 35 | } 36 | ``` 37 | 38 | Very important: Always import the corresponding style file for the desired theme when rendering/calling the editor. 39 | -------------------------------------------------------------------------------- /docs/getDoc.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | const fs = require("fs"); 3 | const postcss = require("postcss"); 4 | const cssnano = require("cssnano"); 5 | 6 | function minify(cssPath) { 7 | const basename = path.basename(cssPath); 8 | const newBasename = basename.split(".")[0] + ".min.css"; 9 | const css = fs.readFileSync(cssPath, "utf-8"); 10 | postcss([cssnano]) 11 | .process(css, { from: cssPath }) 12 | .then(({ css }) => fs.writeFileSync(path.join(cssPath, "../", newBasename), css)); 13 | } 14 | 15 | fs.readdir("./docs", (_, files) => { 16 | if (files) { 17 | files = files.filter((name) => name.endsWith(".md") || name !== "README.md"); 18 | const obj = {}; 19 | let readme = fs.readFileSync(path.join("./docs", "README.MD"), "utf-8"); 20 | for (const file of files) { 21 | const name = file.split(".")[0]; 22 | const content = fs.readFileSync(path.join("./docs", file), "utf-8"); 23 | obj[name] = content; 24 | } 25 | for (const [key, content] of Object.entries(obj)) { 26 | readme = readme.replace(`{{${key}}}`, content); 27 | } 28 | fs.writeFileSync("./README.MD", readme, "utf-8"); 29 | } 30 | }); 31 | -------------------------------------------------------------------------------- /src/types.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | import { ReactCropProps, type Crop } from 'react-image-crop' 4 | import { EXPORT_OBJECT, FILTERS } from 'react-pixels'; 5 | 6 | export type MODULES = "crop" | "colors" | "filter" 7 | 8 | export type SUPPORTED_LANGUAGES = "es" | "en" | "zh" | "ja" | "it" | "fr" | "hin" 9 | 10 | export interface ReactProfileProps { 11 | src: string | File | HTMLImageElement; 12 | initCrop?: Crop; 13 | cropOptions?: Omit; 14 | square?: boolean; 15 | onCancel?: () => void; 16 | onDone?: (editedImage?: EXPORT_OBJECT) => void; 17 | filtersEnabled?: FILTERS[], 18 | maxWidth?: number, 19 | maxHeight?: number, 20 | quality?: number, 21 | maxImageSize?: number, 22 | modules?: MODULES[], 23 | language?: SUPPORTED_LANGUAGES 24 | type?: 'image/jpeg'|'image/png' 25 | } 26 | 27 | export interface Change { 28 | brightness: number; 29 | contrast: number; 30 | crop?: Crop; 31 | filter?: string | undefined; 32 | saturation: number; 33 | verticalFlip: boolean; 34 | horizontalFlip: boolean; 35 | lastChangeTime: number; 36 | } 37 | 38 | 39 | export interface SendChange { 40 | brightness?: number; 41 | contrast?: number; 42 | crop?: Crop; 43 | filter?: string | undefined; 44 | saturation?: number; 45 | verticalFlip?: boolean; 46 | horizontalFlip?: boolean; 47 | } -------------------------------------------------------------------------------- /src/portal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import ReactDOM18 from 'react-dom/client' 4 | import { ReactProfileProps } from './types'; 5 | import ReactProfile from './ReactProfile'; 6 | import { EXPORT_OBJECT } from 'react-pixels'; 7 | 8 | export const openEditor = async (props: ReactProfileProps) => { 9 | 10 | return await new Promise<{ done: boolean, cancel: boolean, editedImage?: EXPORT_OBJECT }>((resolve, reject) => { 11 | try { 12 | const [reactVersion] = React.version.split(".") 13 | 14 | const root = document.createElement("div"); 15 | root.className = "rp-root"; 16 | document.body.append(root); 17 | 18 | const onCancel = () => { 19 | resolve({ cancel: true, done: false }); 20 | cleanUp(); 21 | }; 22 | 23 | const onDone = (editedImage?: EXPORT_OBJECT) => { 24 | resolve({ cancel: false, done: true, editedImage }); 25 | cleanUp(); 26 | }; 27 | 28 | const cleanUp = () => { 29 | ReactDOM.unmountComponentAtNode(root); 30 | root.remove(); 31 | }; 32 | 33 | if(!props.src) props = { src: props as any } 34 | 35 | if(Number(reactVersion) >= 18 && ReactDOM18.createRoot) { 36 | const reactRoot = ReactDOM18.createRoot(root); 37 | reactRoot.render() 38 | } else { 39 | ReactDOM.render( 40 | , 41 | root 42 | ); 43 | } 44 | } catch (err) { 45 | reject(err); 46 | } 47 | }); 48 | }; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-profile", 3 | "version": "1.3.3", 4 | "description": "React Profile Editor, crop, upload, apply filters and adjust colors for your avatar image. Optimize the image size for your application", 5 | "repository": "https://github.com/mdjfs/react-profile", 6 | "homepage": "https://react-image-editor.com", 7 | "author": "Marcos Fuenmayor", 8 | "license": "Apache-2.0 license", 9 | "main": "dist/index.js", 10 | "types": "dist/index.d.ts", 11 | "type": "module", 12 | "scripts": { 13 | "dev": "vite", 14 | "build": "node themes/minify.js && vite build", 15 | "lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0", 16 | "preview": "vite preview", 17 | "prepare": "npm run build" 18 | }, 19 | "exports": { 20 | ".": { 21 | "import": "./dist/index.js", 22 | "require": "./dist/index.umd.cjs" 23 | }, 24 | "./themes/": "./themes/", 25 | "./themes/*": "./themes/*.min.css", 26 | "./themes/default": "./themes/default.min.css", 27 | "./themes/dark": "./themes/dark.min.css", 28 | "./themes/default.min.css": "./themes/default.min.css", 29 | "./themes/dark.min.css": "./themes/dark.min.css", 30 | "./package.json": "./package.json" 31 | }, 32 | "jest": { 33 | "preset": "ts-jest", 34 | "testEnvironment": "jsdom" 35 | }, 36 | "devDependencies": { 37 | "@babel/register": "^7.22.5", 38 | "@testing-library/jest-dom": "^6.1.2", 39 | "@testing-library/react": "^14.0.0", 40 | "@testing-library/react-hooks": "^8.0.1", 41 | "@types/jest": "^29.5.4", 42 | "@types/react": "^18.2.21", 43 | "@types/react-dom": "^18.2.7", 44 | "@vitejs/plugin-react": "^4.0.4", 45 | "cssnano": "^6.0.1", 46 | "jest": "^29.6.4", 47 | "jest-environment-jsdom": "^29.6.4", 48 | "postcss": "^8.4.29", 49 | "react": "^18.2.0", 50 | "react-dom": "^18.2.0", 51 | "ts-jest": "^29.1.1", 52 | "typescript": "^5.2.2", 53 | "vite": "^4.4.9", 54 | "vite-plugin-dts": "^3.5.3" 55 | }, 56 | "peerDependencies": { 57 | "react": "*", 58 | "react-dom": "*" 59 | }, 60 | "dependencies": { 61 | "react-image-crop": "^10.1.5", 62 | "react-pixels": "^0.5.8" 63 | }, 64 | "keywords": [ 65 | "react", 66 | "profile", 67 | "image", 68 | "image editor", 69 | "image crop", 70 | "crop image", 71 | "image filter", 72 | "filter image", 73 | "filter", 74 | "adjust", 75 | "brightness", 76 | "saturation", 77 | "contrast", 78 | "crop", 79 | "flip", 80 | "flip image", 81 | "flip image horizontal", 82 | "horizontal", 83 | "flip image vertical", 84 | "vertical", 85 | "editor", 86 | "avatar", 87 | "canvas", 88 | "react image editor", 89 | "react avatar editor", 90 | "react profile editor", 91 | "react image crop", 92 | "react avatar crop", 93 | "react profile crop" 94 | ] 95 | } 96 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | ![React Profile Icon](https://imgur.com/jqkjGad.png) 2 | 3 | # React Profile 4 | 5 | [![npm version](https://badge.fury.io/js/react-profile.svg)](https://www.npmjs.com/package/react-profile) 6 | 7 | A simple and open-source React component for editing photos. 8 | 9 | [Demo](https://react-profile-page-coral.vercel.app/demo) 10 | 11 | [Homepage](https://react-profile-page-coral.vercel.app/) 12 | 13 | ## Table of Contents 14 | 15 | 1. [Installation](#installation) 16 | 2. [Example](#example) 17 | 3. [Options](#options) 18 | 4. [Props](#props) 19 | 5. [Contributing / Developing](#contributing--developing) 20 | 21 | {{GET_STARTED}} 22 | 23 | ## Options 24 | 25 | You can change the editor's language with the 'language' property. For example: 26 | 27 | ```javascript 28 | import React from "react"; 29 | import ReactProfile from "react-profile"; 30 | import "react-profile/themes/default.min.css"; 31 | 32 | function App() { 33 | return ; 34 | } 35 | 36 | export default App; 37 | ``` 38 | 39 | You can request an image in square format. For example: 40 | 41 | ```javascript 42 | import React from "react"; 43 | import ReactProfile from "react-profile"; 44 | import "react-profile/themes/default.min.css"; 45 | 46 | function App() { 47 | return ; 48 | } 49 | 50 | export default App; 51 | ``` 52 | 53 | You can enable only the modules you want using the 'modules' property. For example: 54 | 55 | ```javascript 56 | import React from "react"; 57 | import ReactProfile from "react-profile"; 58 | import "react-profile/themes/default.min.css"; 59 | 60 | function App() { 61 | return ; 62 | } 63 | 64 | export default App; 65 | ``` 66 | 67 | You can add more filters or even all available filters. For example: 68 | 69 | ```javascript 70 | import React from "react"; 71 | import ReactProfile, { ALL_FILTERS } from "react-profile"; 72 | import "react-profile/themes/default.min.css"; 73 | 74 | function App() { 75 | return ; 76 | } 77 | 78 | export default App; 79 | ``` 80 | 81 | Warning: Adding many filters could potentially slow down the editor depending on the image's size 82 | 83 | To explore all the filters, you can visit the [Pixels.js](https://silvia-odwyer.github.io/pixels.js/) website 84 | 85 | You can initialize the component with an HTMLImageElement object specifying the type. For Example: 86 | 87 | ```javascript 88 | import React from "react"; 89 | import ReactProfile from "react-profile"; 90 | import "react-profile/themes/default.min.css"; 91 | 92 | function App() { 93 | return ; 94 | } 95 | 96 | export default App; 97 | ``` 98 | 99 | You can change some options to crop the image. The ['react-image-crop'](https://github.com/DominicTobias/react-image-crop) library specifies all the options. For Example: 100 | 101 | ```javascript 102 | import React from "react"; 103 | import ReactProfile from "react-profile"; 104 | import "react-profile/themes/default.min.css"; 105 | 106 | function App() { 107 | return ; 108 | } 109 | 110 | export default App; 111 | ``` 112 | 113 | You can change how the crop object is initialized in the editor. The ['react-image-crop'](https://github.com/DominicTobias/react-image-crop) library specifies all the options. For Example: 114 | 115 | ```javascript 116 | import React from "react"; 117 | import ReactProfile from "react-profile"; 118 | import "react-profile/themes/default.min.css"; 119 | 120 | function App() { 121 | return ( 122 | 132 | ); 133 | } 134 | 135 | export default App; 136 | ``` 137 | 138 | ## Props 139 | 140 | **`src?: string | HTMLImageObject`** 141 | 142 | Source of the image 143 | 144 | **`initCrop?: Crop`** 145 | 146 | react-image-crop init crop 147 | 148 | **`cropOptions?: CropOptions`** 149 | 150 | react-image-crop crop options 151 | 152 | **`square?: boolean`** 153 | 154 | Square Image 155 | 156 | **`onCancel?: () => void`** 157 | 158 | Handler when the user cancels edit 159 | 160 | **`onDone?: (exportObject?: EXPORT_OBJECT) => void`** 161 | 162 | Handler when the user finishes editing. The EXPORT_OBJECT has the following methods: 163 | 164 | - getCanvas() -> get canvas object 165 | - getBlob() (async) -> get blob 166 | - getDataURL() -> get data url 167 | - getImageFromBlob() (async) -> get HTMLImageElement from blob 168 | - getImageFromDataURL() (async) -> get HTMLImageElement from blob 169 | 170 | **`maxWidth?: number`** 171 | 172 | It refers to the maximum resolution (in width) of the image. Note: This is different from the size rendered on the screen. It is done for image optimization. The default maximum is '1000'. Try not to use very high resolutions to avoid slowdowns. 173 | 174 | **`maxHeight?: number`** 175 | 176 | It refers to the maximum resolution (in height) of the image. Note: This is different from the size rendered on the screen. It is done for image optimization. The default maximum is '1000'. Try not to use very high resolutions to avoid slowdowns. 177 | 178 | **`quality?: number`** 179 | 180 | Image quality for optimization purposes. Default is '0.8'. Only affects JPEG format images. Range of values 0-1 181 | 182 | **`maxImageSize?: number`** 183 | 184 | Maximum image size in bytes. The default maximum size is '3MB' (1024 \* 1024 \* 3). If you want to work with larger images, you should specify it here. Note: Working with very large images can overload the canvas object and may cause the editor to fail. 185 | 186 | **`modules?: MODULES[]`** 187 | 188 | An array that specifies which modules the developer wants to be rendered in the editor. 189 | 190 | **`type?: 'image/jpeg|image/png'`** 191 | 192 | This property declares the type of the image for the editor 193 | 194 | ## Contributing / Developing 195 | 196 | In your project, navigate to the 'node_modules' folder and look for the 'react-profile' package 197 | 198 | Clone the repository 199 | 200 | `git clone https://github.com/mdjfs/react-profile` 201 | 202 | Install and build 203 | 204 | `yarn && yarn run build` 205 | 206 | Now. inside src/ you can _change everything about logics, languages, icons, etc_ 207 | 208 | And inside themes/ you can _change all the styles, add new themes, etc_ 209 | 210 | After each change. Remember run builds again. 211 | 212 | When you're ready, open a pull request. 213 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![React Profile Icon](https://imgur.com/jqkjGad.png) 2 | 3 | # React Profile 4 | 5 | [![npm version](https://badge.fury.io/js/react-profile.svg)](https://www.npmjs.com/package/react-profile) 6 | 7 | A simple and open-source React component for editing photos. 8 | 9 | [Demo](https://react-profile-page-coral.vercel.app/demo) 10 | 11 | [Homepage](https://react-profile-page-coral.vercel.app/) 12 | 13 | ## Table of Contents 14 | 15 | 1. [Installation](#installation) 16 | 2. [Example](#example) 17 | 3. [Options](#options) 18 | 4. [Props](#props) 19 | 5. [Contributing / Developing](#contributing--developing) 20 | 21 | ## Installation 22 | 23 | In your terminal, execute this command depending on your preferred package manager: 24 | 25 | ``` 26 | npm i react-profile 27 | yarn add react-profile 28 | pnpm add react-profile 29 | ``` 30 | 31 | ## Example 32 | 33 | One way to open the editor is passing the image path and rendering it. For example: 34 | 35 | ```javascript 36 | import React from "react"; 37 | import ReactProfile from "react-profile"; 38 | import "react-profile/themes/default.min.css"; 39 | 40 | function App() { 41 | return ; 42 | } 43 | 44 | export default App; 45 | ``` 46 | 47 | Additionally, you can open the editor directly in your code. For example: 48 | 49 | ```javascript 50 | import { openEditor } from "react-profile"; 51 | import "react-profile/themes/dark.min.css"; 52 | 53 | async function open() { 54 | const result = await openEditor({ src: "./your-image.jpg" }); 55 | } 56 | ``` 57 | 58 | Very important: Always import the corresponding style file for the desired theme when rendering/calling the editor. 59 | 60 | 61 | ## Options 62 | 63 | You can change the editor's language with the 'language' property. For example: 64 | 65 | ```javascript 66 | import React from "react"; 67 | import ReactProfile from "react-profile"; 68 | import "react-profile/themes/default.min.css"; 69 | 70 | function App() { 71 | return ; 72 | } 73 | 74 | export default App; 75 | ``` 76 | 77 | You can request an image in square format. For example: 78 | 79 | ```javascript 80 | import React from "react"; 81 | import ReactProfile from "react-profile"; 82 | import "react-profile/themes/default.min.css"; 83 | 84 | function App() { 85 | return ; 86 | } 87 | 88 | export default App; 89 | ``` 90 | 91 | You can enable only the modules you want using the 'modules' property. For example: 92 | 93 | ```javascript 94 | import React from "react"; 95 | import ReactProfile from "react-profile"; 96 | import "react-profile/themes/default.min.css"; 97 | 98 | function App() { 99 | return ; 100 | } 101 | 102 | export default App; 103 | ``` 104 | 105 | You can add more filters or even all available filters. For example: 106 | 107 | ```javascript 108 | import React from "react"; 109 | import ReactProfile, { ALL_FILTERS } from "react-profile"; 110 | import "react-profile/themes/default.min.css"; 111 | 112 | function App() { 113 | return ; 114 | } 115 | 116 | export default App; 117 | ``` 118 | 119 | Warning: Adding many filters could potentially slow down the editor depending on the image's size 120 | 121 | To explore all the filters, you can visit the [Pixels.js](https://silvia-odwyer.github.io/pixels.js/) website 122 | 123 | You can initialize the component with an HTMLImageElement object specifying the type. For Example: 124 | 125 | ```javascript 126 | import React from "react"; 127 | import ReactProfile from "react-profile"; 128 | import "react-profile/themes/default.min.css"; 129 | 130 | function App() { 131 | return ; 132 | } 133 | 134 | export default App; 135 | ``` 136 | 137 | You can change some options to crop the image. The ['react-image-crop'](https://github.com/DominicTobias/react-image-crop) library specifies all the options. For Example: 138 | 139 | ```javascript 140 | import React from "react"; 141 | import ReactProfile from "react-profile"; 142 | import "react-profile/themes/default.min.css"; 143 | 144 | function App() { 145 | return ; 146 | } 147 | 148 | export default App; 149 | ``` 150 | 151 | You can change how the crop object is initialized in the editor. The ['react-image-crop'](https://github.com/DominicTobias/react-image-crop) library specifies all the options. For Example: 152 | 153 | ```javascript 154 | import React from "react"; 155 | import ReactProfile from "react-profile"; 156 | import "react-profile/themes/default.min.css"; 157 | 158 | function App() { 159 | return ( 160 | 170 | ); 171 | } 172 | 173 | export default App; 174 | ``` 175 | 176 | ## Props 177 | 178 | **`src?: string | File | HTMLImageObject`** 179 | 180 | Source of the image 181 | 182 | **`initCrop?: Crop`** 183 | 184 | react-image-crop init crop 185 | 186 | **`cropOptions?: CropOptions`** 187 | 188 | react-image-crop crop options 189 | 190 | **`square?: boolean`** 191 | 192 | Square Image 193 | 194 | **`onCancel?: () => void`** 195 | 196 | Handler when the user cancels edit 197 | 198 | **`onDone?: (exportObject?: EXPORT_OBJECT) => void`** 199 | 200 | Handler when the user finishes editing. The EXPORT_OBJECT has the following methods: 201 | 202 | - getCanvas() -> get canvas object 203 | - getBlob() (async) -> get blob 204 | - getDataURL() -> get data url 205 | - getImageFromBlob() (async) -> get HTMLImageElement from blob 206 | - getImageFromDataURL() (async) -> get HTMLImageElement from blob 207 | 208 | **`maxWidth?: number`** 209 | 210 | It refers to the maximum resolution (in width) of the image. Note: This is different from the size rendered on the screen. It is done for image optimization. The default maximum is '1000'. Try not to use very high resolutions to avoid slowdowns. 211 | 212 | **`maxHeight?: number`** 213 | 214 | It refers to the maximum resolution (in height) of the image. Note: This is different from the size rendered on the screen. It is done for image optimization. The default maximum is '1000'. Try not to use very high resolutions to avoid slowdowns. 215 | 216 | **`quality?: number`** 217 | 218 | Image quality for optimization purposes. Default is '0.8'. Only affects JPEG format images. Range of values 0-1 219 | 220 | **`maxImageSize?: number`** 221 | 222 | Maximum image size in bytes. The default maximum size is '10MB' (1024 \* 1024 \* 10). If you want to work with larger images, you should specify it here. Note: Working with very large images can overload the canvas object and may cause the editor to fail. 223 | 224 | **`modules?: MODULES[]`** 225 | 226 | An array that specifies which modules the developer wants to be rendered in the editor. 227 | 228 | **`type?: 'image/jpeg|image/png'`** 229 | 230 | This property declares the type of the image for the editor 231 | 232 | ## Contributing / Developing 233 | 234 | In your project, navigate to the 'node_modules' folder and look for the 'react-profile' package 235 | 236 | Clone the repository 237 | 238 | `git clone https://github.com/mdjfs/react-profile` 239 | 240 | Install and build 241 | 242 | `yarn && yarn run build` 243 | 244 | Now. inside src/ you can _change everything about logics, languages, icons, etc_ 245 | 246 | And inside themes/ you can _change all the styles, add new themes, etc_ 247 | 248 | After each change. Remember run builds again. 249 | 250 | When you're ready, open a pull request. 251 | -------------------------------------------------------------------------------- /src/icons.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const ICON_SATURATION = ( 4 |
5 | 6 | 7 | 8 |
9 | ); 10 | 11 | const ICON_CONTRAST = ( 12 |
13 | 14 | 15 | 16 |
17 | ); 18 | 19 | const ICON_BRIGHTNESS = ( 20 |
21 | 22 | 23 | 24 |
25 | ); 26 | 27 | const ICON_FLIP = ( 28 |
29 | 30 | 31 | 32 |
33 | ); 34 | 35 | const ICON_CROP = ( 36 |
37 | 38 | 39 | 40 |
41 | ); 42 | 43 | const ICON_UNDO = ( 44 |
45 | 46 | 47 | 48 |
49 | ); 50 | 51 | const ICON_SPINNER = ( 52 |
53 | 54 | 55 | 56 |
57 | ); 58 | 59 | const ICON_COLORS = ( 60 |
61 | 62 | 63 | 64 |
65 | ); 66 | 67 | const ICON_FILTER = ( 68 |
69 | 70 | 71 | 72 |
73 | ); 74 | 75 | 76 | export { 77 | ICON_SATURATION, 78 | ICON_CONTRAST, 79 | ICON_BRIGHTNESS, 80 | ICON_FLIP, 81 | ICON_CROP, 82 | ICON_UNDO, 83 | ICON_SPINNER, 84 | ICON_FILTER, 85 | ICON_COLORS 86 | }; 87 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /src/ReactProfile.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useMemo, useState } from "react"; 2 | import { Change, MODULES, ReactProfileProps, SUPPORTED_LANGUAGES, SendChange } from "./types"; 3 | import { EDITOR_TEXT } from "./language"; 4 | import { PixelsImage, getExportObject, getImageSource, EXPORT_OBJECT, FILTERS, PixelsImageSource } from "react-pixels"; 5 | import ReactCrop, { ReactCropProps, type Crop, centerCrop, makeAspectCrop } from "react-image-crop"; 6 | import { 7 | ICON_BRIGHTNESS, 8 | ICON_COLORS, 9 | ICON_CONTRAST, 10 | ICON_CROP, 11 | ICON_FILTER, 12 | ICON_FLIP, 13 | ICON_SATURATION, 14 | ICON_SPINNER, 15 | ICON_UNDO, 16 | } from "./icons"; 17 | 18 | const DEFAULT_LANGUAGE: SUPPORTED_LANGUAGES = "en"; 19 | 20 | const INIT_STATE: Change = { 21 | brightness: 0, 22 | contrast: 0, 23 | saturation: 0, 24 | verticalFlip: false, 25 | horizontalFlip: false, 26 | crop: undefined, 27 | filter: undefined, 28 | lastChangeTime: Date.now(), 29 | }; 30 | 31 | const INIT_CROP: Crop = { 32 | unit: "%", 33 | width: 50, 34 | height: 50, 35 | x: 25, 36 | y: 25, 37 | }; 38 | 39 | const MAX_IMAGE_WIDTH = 1000; 40 | const MAX_IMAGE_HEIGHT = 1000; 41 | const DEFAULT_OPTIMIZE = 0.8; 42 | const MAX_IMAGE_SIZE = 1024 * 1024 * 10; // 10MB 43 | 44 | const LAST_CHANGE_DELAY_MS = 1000; 45 | 46 | const DEFAULT_FILTERS_ENABLED: FILTERS[] = [ 47 | "vintage", 48 | "perfume", 49 | "sunset", 50 | "wood", 51 | "greyscale", 52 | "coral", 53 | "lemon", 54 | "haze", 55 | "radio", 56 | "grime", 57 | "red_effect", 58 | "rgbSplit", 59 | ]; 60 | 61 | const DEFAULT_MODULES: MODULES[] = ["crop", "filter", "colors"]; 62 | 63 | const ReactProfile: React.FC = ({ 64 | src, 65 | initCrop, 66 | cropOptions, 67 | square, 68 | filtersEnabled = DEFAULT_FILTERS_ENABLED, 69 | onCancel, 70 | onDone, 71 | maxWidth = MAX_IMAGE_WIDTH, 72 | maxHeight = MAX_IMAGE_HEIGHT, 73 | maxImageSize = MAX_IMAGE_SIZE, 74 | quality = DEFAULT_OPTIMIZE, 75 | modules = DEFAULT_MODULES, 76 | language = DEFAULT_LANGUAGE, 77 | type 78 | }) => { 79 | const moduleSet = [...new Set(modules)]; 80 | 81 | INIT_STATE.crop = initCrop || INIT_CROP; 82 | cropOptions = square ? ({ ...cropOptions, aspect: 1 } as ReactCropProps) : cropOptions; 83 | 84 | const text = EDITOR_TEXT[language]; 85 | 86 | const [close, setClose] = useState(false); 87 | const [actual, setActual] = useState(moduleSet[0]); 88 | const [history, setHistory] = useState([INIT_STATE]); 89 | const [edit, setEdit] = useState(INIT_STATE); 90 | const [exportObject, setExportObject] = useState(); 91 | const [isExporting, setIsExporting] = useState(false); 92 | const [img, setImg] = useState(); 93 | const [croppedSource, setCroppedSource] = useState(); 94 | const [source, setSource] = useState(); 95 | const [cropEdit, setCropEdit] = useState(INIT_STATE.crop); 96 | const pushHistory = (changes: SendChange) => { 97 | const last = history[history.length - 1]; 98 | const change = { ...edit, ...changes, lastChangeTime: Date.now() }; 99 | if (change.lastChangeTime - last.lastChangeTime > LAST_CHANGE_DELAY_MS) { 100 | setHistory([...history, change]); 101 | } 102 | setEdit(change); 103 | }; 104 | const undo = () => { 105 | if (history.length > 1) { 106 | history.pop(); 107 | setHistory(history); 108 | setEdit(history[history.length - 1]); 109 | setCropEdit(history[history.length - 1].crop as Crop); 110 | } else { 111 | setEdit(history[0]); 112 | } 113 | }; 114 | const setFilter = (filter: string | undefined) => pushHistory({ filter }); 115 | const setBrightness = (brightness: number) => pushHistory({ brightness }); 116 | const setContrast = (contrast: number) => pushHistory({ contrast }); 117 | const setSaturation = (saturation: number) => pushHistory({ saturation }); 118 | const setVerticalFlip = (verticalFlip: boolean) => pushHistory({ verticalFlip }); 119 | const setHorizontalFlip = (horizontalFlip: boolean) => pushHistory({ horizontalFlip }); 120 | const setCrop = (crop: Crop) => pushHistory({ crop }); 121 | 122 | const cancel = () => { 123 | setClose(true); 124 | if (onCancel) onCancel(); 125 | else console.warn("ReactProfile: Missing onCancel handler"); 126 | }; 127 | 128 | const done = async () => { 129 | if (onDone) { 130 | setIsExporting(true); 131 | const sendCanvas = (canvas: HTMLCanvasElement, type: string) => { 132 | setIsExporting(false); 133 | setClose(true); 134 | onDone(getExportObject(canvas, type)); 135 | }; 136 | 137 | try { 138 | if (exportObject) { 139 | const canvas = getCroppedCanvas(true); 140 | if (!canvas) onDone(); 141 | else sendCanvas(canvas, exportObject.getInferedMimetype()); 142 | } else if (onDone) onDone(); 143 | } catch (err) { 144 | console.error("ReactProfile: ", err); 145 | } 146 | } else { 147 | setClose(true); 148 | console.warn("ReactProfile: Missing onDone handler"); 149 | } 150 | }; 151 | 152 | const createCanvas = (): [HTMLCanvasElement, CanvasRenderingContext2D] => { 153 | const canvas = document.createElement("canvas"); 154 | const ctx = canvas.getContext("2d"); 155 | if (!ctx) throw new Error("ReactProfile: Error obtaining context"); 156 | return [canvas, ctx]; 157 | }; 158 | 159 | const sourceToCanvas = (source: PixelsImageSource) => { 160 | if (source) { 161 | const [canvas, ctx] = createCanvas(); 162 | canvas.width = source.width; 163 | canvas.height = source.height; 164 | ctx.putImageData(source.data, 0, 0); 165 | return canvas; 166 | } 167 | }; 168 | 169 | const hasCrop = (crop?: Crop) => crop && crop.width > 0 && crop.height > 0; 170 | 171 | const getCroppedCanvas = (withChanges = false) => { 172 | const cr = edit.crop; 173 | if (cr && hasCrop(cr) && exportObject && source) { 174 | const sourceCanvas = withChanges ? exportObject.getCanvas() : sourceToCanvas(source); 175 | if (withChanges && actual !== "crop") return exportObject.getCanvas(); 176 | if (sourceCanvas) { 177 | const [croppedCanvas, croppedContext] = createCanvas(); 178 | const width = cr.unit === "%" ? sourceCanvas.width * (cr.width / 100) : cr.width; 179 | const height = cr.unit === "%" ? sourceCanvas.height * (cr.height / 100) : cr.height; 180 | const x = cr.unit === "%" ? sourceCanvas.width * (cr.x / 100) : cr.x; 181 | const y = cr.unit === "%" ? sourceCanvas.height * (cr.y / 100) : cr.y; 182 | croppedCanvas.width = width; 183 | croppedCanvas.height = height; 184 | croppedContext.drawImage(sourceCanvas, x, y, width, height, 0, 0, width, height); 185 | return croppedCanvas; 186 | } 187 | } else if (!hasCrop(cr) && exportObject && withChanges) return exportObject.getCanvas(); 188 | else if (!hasCrop(cr) && !withChanges && source) return sourceToCanvas(source); 189 | }; 190 | 191 | const getCroppedSource = async () => { 192 | if (exportObject) { 193 | if (!hasCrop(edit.crop)) return source; 194 | const canvas = getCroppedCanvas(); 195 | if (canvas) return await getImageSource(canvas, exportObject.getInferedMimetype() || ("image/jpeg" as any)); 196 | } 197 | }; 198 | 199 | const loadImage = (image: HTMLImageElement, type: string) => { 200 | const [canvas, context] = createCanvas(); 201 | let loadWidth = image.width; 202 | let loadHeight = image.height; 203 | const aspect = image.width / image.height; 204 | if (loadWidth > maxWidth) { 205 | loadWidth = maxWidth; 206 | loadHeight = loadWidth / aspect; 207 | } 208 | if (loadHeight > maxHeight) { 209 | loadHeight = maxHeight; 210 | loadWidth = loadHeight * aspect; 211 | } 212 | canvas.width = loadWidth; 213 | canvas.height = loadHeight; 214 | context.drawImage(image, 0, 0, loadWidth, loadHeight); 215 | canvas.toBlob( 216 | (blob) => { 217 | if (!blob) return console.error("ReactProfile: Error loading image"); 218 | const pixelImage = new Image(); 219 | pixelImage.src = URL.createObjectURL(blob); 220 | pixelImage.onload = () => setImg(pixelImage); 221 | pixelImage.onerror = () => console.error("ReactProfile: Error loading image"); 222 | }, 223 | type, 224 | quality 225 | ); 226 | } 227 | 228 | useEffect(() => { 229 | if (src) { 230 | if(typeof src === "string") { 231 | const png = src.includes("png"); 232 | const image = new Image(); 233 | image.crossOrigin = "anonymous"; 234 | image.src = src; 235 | image.onerror = () => console.error("ReactProfile: Error fetching image"); 236 | image.onload = () => loadImage(image, type || png ? 'image/png' : 'image/jpeg') 237 | } else if (src instanceof HTMLImageElement) { 238 | loadImage(src, type || 'image/jpeg') 239 | } else if (src instanceof File) { 240 | if(src.type.startsWith("image/")) { 241 | const reader = new FileReader(); 242 | reader.onload = (e) => { 243 | const img = new Image(); 244 | if(e.target) { 245 | img.src = e.target.result as any; 246 | img.onload = () => loadImage(img, src.type); 247 | } 248 | } 249 | reader.readAsDataURL(src) 250 | } 251 | } 252 | } 253 | }, [src]); 254 | 255 | useEffect(() => { 256 | if (actual !== "crop") getCroppedSource().then((s) => s && setCroppedSource(s)); 257 | }, [edit.crop, actual]); 258 | 259 | useEffect(() => { 260 | if(cropOptions && cropOptions.aspect === 1) { 261 | if(edit.crop && cropEdit && source && history) { 262 | if(source.width !== source.height && history.length === 1) { 263 | const newCrop: Crop = centerCrop( 264 | makeAspectCrop( 265 | { 266 | unit: '%', 267 | width: 50 268 | }, 269 | 1, 270 | source.width, 271 | source.height 272 | ), 273 | source.width, 274 | source.height 275 | ) 276 | setCropEdit(newCrop) 277 | const newEdit = { ...edit, crop: newCrop }; 278 | history[0] = newEdit; 279 | setHistory(history); 280 | setEdit(newEdit); 281 | } 282 | } 283 | } 284 | }, [source]); 285 | 286 | useEffect(() => { 287 | if (img) 288 | getImageSource(img).then((source) => { 289 | if (source.data.data.byteLength >= maxImageSize) { 290 | const toMB = (len: number) => (len / (1024 * 1024)).toFixed(2); 291 | const err = `ReactProfile: Max Image Size Supported (>${toMB(maxImageSize)} MB). Image size: (${toMB( 292 | source.data.data.byteLength 293 | )} MB).`; 294 | console.error(err); 295 | console.warn( 296 | "ReactProfile: You can modify the maximum size with the 'maxImageSize' property, but be careful. Very large images can lead to errors or overloads." 297 | ); 298 | throw new Error(err); 299 | } else { 300 | setSource(source); 301 | } 302 | }); 303 | }, [img]); 304 | 305 | const IMAGE = useMemo( 306 | () => 307 | source && ( 308 | 319 | ), 320 | [ 321 | edit.horizontalFlip, 322 | edit.verticalFlip, 323 | edit.filter, 324 | edit.contrast, 325 | edit.brightness, 326 | edit.saturation, 327 | actual, 328 | source, 329 | croppedSource, 330 | ] 331 | ); 332 | 333 | const FILTERS = useMemo( 334 | () => 335 | source && 336 | actual === "filter" && ( 337 |
338 |
setFilter(undefined)}> 339 | 348 |

{text.noFilter}

349 |
350 | {Object.entries(text.filters) 351 | .filter(([_, filter]) => filtersEnabled.includes(filter as FILTERS)) 352 | .map(([name, filter]) => ( 353 |
setFilter(filter)} 357 | > 358 | 368 |

{name}

369 |
370 | ))} 371 |
372 | ), 373 | [ 374 | actual, 375 | edit.horizontalFlip, 376 | edit.verticalFlip, 377 | edit.filter, 378 | edit.brightness, 379 | edit.saturation, 380 | edit.contrast, 381 | source, 382 | croppedSource, 383 | ] 384 | ); 385 | 386 | if (!img) return <>; 387 | 388 | if (close) return <>; 389 | 390 | return ( 391 |
392 |
393 |
394 | 397 | 400 |
401 |
402 | {moduleSet.map((module) => ( 403 |
setActual(module)} 407 | > 408 | {module === "crop" ? ICON_CROP : module === "filter" ? ICON_FILTER : ICON_COLORS} 409 |

{module === "crop" ? text.cropButton : module === "filter" ? text.filterButton : text.colorsButton}

410 |
411 | ))} 412 |
413 |
414 | 418 |
419 |
420 |
421 |
422 | {actual === "crop" && ( 423 |
426 | 429 | 432 |
433 | )} 434 | {actual === "colors" && ( 435 |
436 | 439 | setBrightness(Number(e.currentTarget.value) / 100)} 447 | /> 448 | 451 | setContrast(Number(e.currentTarget.value) / 100)} 459 | /> 460 | 463 | setSaturation(Number(e.currentTarget.value) / 100)} 471 | /> 472 |
473 | )} 474 | {actual === "filter" && text.filters && FILTERS} 475 |
476 |
477 | {(actual === "filter" || actual === "colors") && IMAGE} 478 | {actual === "crop" && ( 479 | setCropEdit(c)} 483 | onComplete={(_: any, c: any) => setCrop(c)} 484 | > 485 | {IMAGE} 486 | 487 | )} 488 |
489 |
490 |
491 | ); 492 | }; 493 | 494 | export default ReactProfile; 495 | -------------------------------------------------------------------------------- /themes/default.src.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css2?family=Montserrat&display=swap"); 2 | 3 | .rp-root { 4 | position: absolute; 5 | z-index: 99; 6 | } 7 | 8 | :root { 9 | --rp-background: #f1f2f3; 10 | } 11 | 12 | .rp-editor, 13 | .rp-editor * { 14 | font-family: "Montserrat", sans-serif; 15 | color: black; 16 | } 17 | 18 | .rp-editor { 19 | background-color: var(--rp-background); 20 | position: fixed; 21 | width: 100vw; 22 | height: 100vh; 23 | top: 0; 24 | left: 0; 25 | } 26 | 27 | .rp-navigation { 28 | display: flex; 29 | margin-bottom: 10px; 30 | } 31 | 32 | .rp-navigation .rp-back { 33 | margin-left: 5px; 34 | display: inline-flex; 35 | justify-items: flex-start; 36 | align-items: center; 37 | width: 15%; 38 | } 39 | 40 | .rp-navigation .rp-back .rp-cancel-button { 41 | cursor: pointer; 42 | padding: 10px 20px; 43 | border-radius: 20px; 44 | border: none; 45 | background-color: #e5e6e7; 46 | font-weight: bold; 47 | margin-left: 5px; 48 | margin-right: 5px; 49 | transition: all 0.2s; 50 | } 51 | 52 | .rp-navigation .rp-back .rp-cancel-button:hover { 53 | background-color: #e1e2e4; 54 | } 55 | 56 | .rp-navigation .rp-back .rp-back-button { 57 | border: none; 58 | border-radius: 100%; 59 | background-color: #e5e6e7; 60 | margin-left: 5px; 61 | margin-right: 5px; 62 | margin-top: 3px; 63 | cursor: pointer; 64 | display: flex; 65 | align-items: center; 66 | justify-content: center; 67 | padding: 0px 2px; 68 | align-self: center; 69 | transition: all 0.2s; 70 | } 71 | 72 | .rp-navigation .rp-back .rp-back-button:hover { 73 | background-color: #e1e2e4; 74 | } 75 | 76 | .rp-navigation .rp-back .rp-back-button svg { 77 | width: 30px; 78 | height: 30px; 79 | } 80 | 81 | .rp-navigation .rp-back .rp-back-button:disabled { 82 | opacity: 0; 83 | pointer-events: none; 84 | } 85 | 86 | .rp-navigation .rp-buttons { 87 | display: flex; 88 | align-items: center; 89 | justify-content: center; 90 | width: 70%; 91 | } 92 | 93 | .rp-navigation .rp-buttons > div { 94 | height: 60px; 95 | padding: 10px 30px; 96 | transition: all 0.2s; 97 | font-size: 14px; 98 | display: flex; 99 | flex-direction: column; 100 | align-items: center; 101 | justify-content: center; 102 | border-radius: 10px; 103 | margin-top: 5px; 104 | } 105 | 106 | .rp-navigation .rp-buttons > div.selected { 107 | font-weight: bold; 108 | pointer-events: none; 109 | } 110 | 111 | .rp-navigation .rp-buttons > div.selected svg { 112 | stroke-width: 10px; 113 | stroke: black; 114 | } 115 | 116 | .rp-navigation .rp-buttons > div > p { 117 | margin: 0; 118 | } 119 | 120 | .rp-navigation .rp-buttons > div svg { 121 | width: 35px; 122 | height: 35px; 123 | } 124 | 125 | .rp-navigation .rp-buttons > div:hover { 126 | cursor: pointer; 127 | box-shadow: 0px 4px 5px rgba(0, 0, 0, 0.1); 128 | } 129 | 130 | .rp-next { 131 | width: 15%; 132 | display: flex; 133 | justify-content: flex-end; 134 | align-items: center; 135 | margin-right: 5px; 136 | } 137 | 138 | .rp-next .rp-done-button { 139 | cursor: pointer; 140 | padding: 10px 20px; 141 | border-radius: 20px; 142 | border: none; 143 | background-color: hsl(206, 100%, 52%); 144 | color: white; 145 | font-weight: bold; 146 | margin-left: 5px; 147 | margin-right: 5px; 148 | transition: all 0.2s; 149 | } 150 | 151 | .rp-next .rp-done-button:hover { 152 | background-color: hsla(206, 100%, 52%, 0.856); 153 | } 154 | 155 | .rp-image-section.crop .rp-controls { 156 | display: flex; 157 | width: 100vw; 158 | justify-content: center; 159 | align-items: center; 160 | margin-bottom: 10px; 161 | } 162 | 163 | .rp-image-section.crop .rp-controls .rp-crop { 164 | width: 100%; 165 | display: flex; 166 | justify-content: center; 167 | align-items: center; 168 | gap: 40px; 169 | } 170 | 171 | .rp-image-section.crop .rp-controls .rp-crop > button { 172 | display: flex; 173 | justify-content: center; 174 | align-items: center; 175 | background: none; 176 | border: none; 177 | font-size: 13px; 178 | transition: all 0.2s; 179 | } 180 | 181 | .rp-image-section.crop .rp-controls .rp-crop.vertical-flip .flip-vertical-button::before { 182 | content: " "; 183 | width: 3px; 184 | height: 3px; 185 | background-color: black; 186 | border-radius: 100%; 187 | margin-right: 5px; 188 | } 189 | 190 | .rp-image-section.crop .rp-controls .rp-crop.horizontal-flip .flip-horizontal-button::before { 191 | content: " "; 192 | width: 3px; 193 | height: 3px; 194 | background-color: black; 195 | border-radius: 100%; 196 | margin-right: 5px; 197 | } 198 | 199 | .rp-image-section.crop .rp-controls .rp-crop > button svg { 200 | margin-right: 10px; 201 | width: 30px; 202 | height: 30px; 203 | } 204 | 205 | .rp-image-section.crop .rp-controls .rp-crop .flip-vertical-button svg { 206 | transform: rotateZ(-90deg); 207 | } 208 | 209 | .rp-image-section.crop .rp-controls .rp-crop > button:hover { 210 | opacity: 0.8; 211 | cursor: pointer; 212 | } 213 | 214 | .rp-image-section { 215 | height: calc(100vh - 95px); 216 | } 217 | 218 | .rp-preview { 219 | width: 100vw; 220 | display: flex; 221 | justify-content: center; 222 | align-items: flex-start; 223 | height: 100%; 224 | } 225 | 226 | @media only screen and (min-width: 800px) { 227 | /* Styles for smaller screens */ 228 | .rp-image-preview { 229 | max-height: 360px; 230 | } 231 | } 232 | 233 | @media only screen and (min-width: 1366px) { 234 | .rp-image-preview { 235 | max-height: 450px; 236 | } 237 | } 238 | 239 | @media only screen and (min-width: 1600px) { 240 | .rp-preview { 241 | margin-top: 15px; 242 | } 243 | .rp-image-preview { 244 | max-height: 550px; 245 | } 246 | } 247 | 248 | @media only screen and (min-width: 1920px) { 249 | .rp-preview { 250 | margin-top: 30px; 251 | } 252 | .rp-image-preview { 253 | max-height: 600px; 254 | } 255 | } 256 | 257 | .rp-image-section.filter { 258 | display: flex; 259 | flex-direction: row-reverse; 260 | } 261 | 262 | .rp-image-section.filter .rp-image-preview { 263 | box-shadow: 0px 4px 13px rgba(0, 0, 0, 0.4); 264 | } 265 | 266 | .rp-image-section.filter .rp-controls { 267 | max-height: 100%; 268 | } 269 | 270 | .rp-image-section.filter .rp-preview { 271 | display: flex; 272 | justify-content: center; 273 | align-items: center; 274 | } 275 | 276 | .rp-image-section.filter .rp-filter-preview { 277 | max-width: 100px; 278 | border: 3px solid #e1e2e4; 279 | cursor: pointer; 280 | transition: all 0.2s; 281 | } 282 | 283 | .rp-image-section.filter .rp-filter.selected .rp-filter-preview { 284 | border-width: 5px; 285 | border-color: hsl(206, 100%, 52%); 286 | pointer-events: none; 287 | } 288 | 289 | .rp-image-section.filter .rp-filter.selected p { 290 | color: hsl(206, 100%, 52%); 291 | } 292 | 293 | .rp-image-section.filter .rp-filter p { 294 | margin: 0; 295 | font-size: 12px; 296 | margin-bottom: 5px; 297 | } 298 | 299 | .rp-image-section.filter .rp-filter-preview:hover { 300 | transform: scale(1.05); 301 | } 302 | 303 | .rp-image-section.filter .rp-filters { 304 | padding: 10px; 305 | margin: 0px 10px; 306 | border-radius: 10px; 307 | height: 96%; 308 | overflow: auto; 309 | } 310 | 311 | .rp-editor *::-webkit-scrollbar { 312 | width: 0px; 313 | } 314 | 315 | .rp-editor *::-webkit-scrollbar-track { 316 | background: #e1e2e4; 317 | border-radius: 10px; 318 | } 319 | 320 | .rp-editor *::-webkit-scrollbar-thumb { 321 | background: hsl(206, 100%, 52%); 322 | border-radius: 10px; 323 | } 324 | 325 | .rp-editor *::-webkit-scrollbar-thumb:hover { 326 | background: hsla(206, 100%, 52%, 0.842); 327 | } 328 | 329 | .rp-image-section.colors { 330 | display: flex; 331 | flex-direction: row-reverse; 332 | } 333 | 334 | .rp-image-section.colors .rp-image-preview { 335 | box-shadow: 0px 4px 13px rgba(0, 0, 0, 0.4); 336 | } 337 | 338 | .rp-image-section.colors .rp-controls { 339 | max-height: 100%; 340 | } 341 | 342 | .rp-image-section.colors .rp-preview { 343 | display: flex; 344 | justify-content: center; 345 | align-items: center; 346 | } 347 | 348 | .rp-image-section.colors .rp-colors { 349 | margin-right: 30px; 350 | display: flex; 351 | flex-direction: column; 352 | justify-content: center; 353 | align-items: center; 354 | height: 100%; 355 | width: 300px; 356 | } 357 | 358 | .rp-image-section.colors .rp-colors label { 359 | display: flex; 360 | margin: 0; 361 | justify-content: flex-start; 362 | width: 100%; 363 | gap: 10px; 364 | margin-top: 50px; 365 | margin-bottom: 5px; 366 | } 367 | 368 | .rp-image-section.colors .rp-colors label:nth-child(1) { 369 | margin-top: 0px; 370 | } 371 | 372 | .rp-image-section.colors .rp-colors label svg { 373 | width: 20px; 374 | height: 20px; 375 | } 376 | 377 | .rp-editor input[type="range"] { 378 | -webkit-appearance: none; 379 | appearance: none; 380 | width: 100%; 381 | cursor: pointer; 382 | outline: none; 383 | border-radius: 15px; 384 | height: 6px; 385 | background: #ccc; 386 | } 387 | 388 | .rp-editor input[type="range"]::-webkit-slider-thumb { 389 | -webkit-appearance: none; 390 | appearance: none; 391 | height: 15px; 392 | width: 15px; 393 | background-color: hsl(206, 100%, 52%); 394 | border-radius: 50%; 395 | border: none; 396 | 397 | transition: 0.2s ease-in-out; 398 | } 399 | 400 | .rp-editor input[type="range"]::-moz-range-thumb { 401 | height: 15px; 402 | width: 15px; 403 | background-color: hsl(206, 100%, 52%); 404 | border-radius: 50%; 405 | border: none; 406 | 407 | transition: 0.2s ease-in-out; 408 | } 409 | 410 | .rp-editor input[type="range"]::-webkit-slider-thumb:hover { 411 | box-shadow: 0 0 0 10px hsla(206, 100%, 52%, 0.13); 412 | } 413 | .rp-editor input[type="range"]:active::-webkit-slider-thumb { 414 | box-shadow: 0 0 0 13px hsla(206, 100%, 52%, 0.24); 415 | } 416 | 417 | .rp-editor input[type="range"]::-moz-range-thumb:hover { 418 | box-shadow: 0 0 0 10px hsla(206, 100%, 52%, 0.13); 419 | } 420 | .rp-editor input[type="range"]:active::-moz-range-thumb { 421 | box-shadow: 0 0 0 13px hsla(206, 100%, 52%, 0.24); 422 | } 423 | 424 | @media only screen and (max-width: 767px) { 425 | .rp-navigation .rp-back { 426 | margin-left: 5px; 427 | z-index: 20; 428 | } 429 | 430 | .rp-navigation .rp-back .rp-cancel-button { 431 | padding: 5px 10px; 432 | border-radius: 15px; 433 | margin-left: 2px; 434 | margin-right: 2px; 435 | font-size: 12px; 436 | } 437 | 438 | .rp-navigation .rp-back .rp-back-button { 439 | margin-left: 12px; 440 | margin-right: 2px; 441 | margin-top: 3px; 442 | padding: 0px; 443 | height: 25px; 444 | display: grid; 445 | align-items: center; 446 | justify-content: center; 447 | } 448 | 449 | .rp-navigation .rp-back .rp-back-button svg { 450 | width: 25px; 451 | height: 25px; 452 | } 453 | 454 | .rp-navigation .rp-buttons > div { 455 | height: 60px; 456 | padding: 10px 8px; 457 | font-size: 10px; 458 | border-radius: 10px; 459 | margin-top: 5px; 460 | } 461 | 462 | .rp-navigation .rp-buttons > div.selected svg { 463 | stroke-width: 10px; 464 | } 465 | 466 | .rp-navigation .rp-buttons > div svg { 467 | width: 25px; 468 | height: 25px; 469 | } 470 | 471 | .rp-navigation .rp-buttons > div:hover { 472 | box-shadow: none; 473 | } 474 | 475 | .rp-next { 476 | margin-right: 5px; 477 | } 478 | 479 | .rp-next .rp-done-button { 480 | padding: 5px 10px; 481 | border-radius: 15px; 482 | margin-left: 2px; 483 | margin-right: 2px; 484 | font-size: 12px; 485 | } 486 | 487 | .rp-image-preview { 488 | margin-top: 0px; 489 | max-width: 80vw; 490 | } 491 | 492 | .rp-preview { 493 | align-items: center; 494 | } 495 | 496 | .rp-image-section.crop .rp-preview { 497 | height: 500px; 498 | } 499 | 500 | .rp-image-section.filter { 501 | flex-direction: column-reverse; 502 | justify-content: space-around; 503 | } 504 | 505 | .rp-image-section.filter .rp-preview { 506 | height: auto; 507 | } 508 | 509 | .rp-image-section.filter .rp-filters { 510 | width: 90%; 511 | height: fit-content; 512 | overflow: auto; 513 | display: flex; 514 | } 515 | 516 | .rp-editor *::-webkit-scrollbar { 517 | display: none; 518 | } 519 | 520 | .rp-image-section.colors { 521 | flex-direction: column-reverse; 522 | justify-content: center; 523 | } 524 | 525 | .rp-image-section.colors .rp-preview { 526 | height: auto; 527 | } 528 | 529 | .rp-image-section.colors .rp-colors { 530 | margin-top: 20px; 531 | margin-right: 0px; 532 | justify-content: flex-start; 533 | align-items: flex-start; 534 | height: auto; 535 | width: 80vw; 536 | margin-left: 10vw; 537 | } 538 | 539 | .rp-image-section.colors .rp-colors label { 540 | margin: 0; 541 | justify-content: flex-start; 542 | align-items: center; 543 | width: 100%; 544 | gap: 3px; 545 | margin-top: 10px; 546 | margin-bottom: 5px; 547 | font-size: 12px; 548 | } 549 | 550 | .rp-image-section.colors .rp-colors label:nth-child(1) { 551 | margin-top: 0px; 552 | } 553 | 554 | .rp-image-section.colors .rp-colors label svg { 555 | width: 20px; 556 | height: 20px; 557 | } 558 | } 559 | 560 | /* -- REACT IMAGE CROP CSS --*/ 561 | 562 | .ReactCrop { 563 | position: relative; 564 | display: inline-block; 565 | cursor: crosshair; 566 | overflow: hidden; 567 | max-width: 100%; 568 | background-color: transparent; 569 | } 570 | .ReactCrop *, 571 | .ReactCrop *:before, 572 | .ReactCrop *:after { 573 | box-sizing: border-box; 574 | } 575 | .ReactCrop--disabled, 576 | .ReactCrop--locked { 577 | cursor: inherit; 578 | } 579 | .ReactCrop__child-wrapper { 580 | max-height: inherit; 581 | border: 3px solid #dcdddf; 582 | background-color: #dcdddf; 583 | box-shadow: 0px 4px 13px rgba(0, 0, 0, 0.4); 584 | } 585 | .ReactCrop__child-wrapper > img, 586 | .ReactCrop__child-wrapper > video { 587 | display: block; 588 | max-width: 100%; 589 | max-height: inherit; 590 | } 591 | .ReactCrop:not(.ReactCrop--disabled) .ReactCrop__child-wrapper > img, 592 | .ReactCrop:not(.ReactCrop--disabled) .ReactCrop__child-wrapper > video { 593 | touch-action: none; 594 | } 595 | .ReactCrop:not(.ReactCrop--disabled) .ReactCrop__crop-selection { 596 | touch-action: none; 597 | } 598 | .ReactCrop__crop-selection { 599 | position: absolute; 600 | top: 0; 601 | left: 0; 602 | transform: translateZ(0); 603 | cursor: move; 604 | box-shadow: 0 0 0 9999em #f1f2f3cc; 605 | } 606 | .ReactCrop--disabled .ReactCrop__crop-selection { 607 | cursor: inherit; 608 | } 609 | .ReactCrop--circular-crop .ReactCrop__crop-selection { 610 | border-radius: 50%; 611 | } 612 | .ReactCrop--no-animate .ReactCrop__crop-selection { 613 | outline: 1px dashed white; 614 | } 615 | .ReactCrop__crop-selection:not(.ReactCrop--no-animate .ReactCrop__crop-selection) { 616 | border: black 2px solid; 617 | } 618 | .ReactCrop__crop-selection:focus { 619 | outline: none; 620 | border-color: #00f; 621 | border-style: solid; 622 | } 623 | .ReactCrop--invisible-crop .ReactCrop__crop-selection { 624 | display: none; 625 | } 626 | .ReactCrop__rule-of-thirds-vt:before, 627 | .ReactCrop__rule-of-thirds-vt:after, 628 | .ReactCrop__rule-of-thirds-hz:before, 629 | .ReactCrop__rule-of-thirds-hz:after { 630 | content: ""; 631 | display: block; 632 | position: absolute; 633 | background-color: rgba(0, 0, 0, 0.137); 634 | } 635 | .ReactCrop__rule-of-thirds-vt:before, 636 | .ReactCrop__rule-of-thirds-vt:after { 637 | width: 1px; 638 | height: 100%; 639 | } 640 | .ReactCrop__rule-of-thirds-vt:before { 641 | left: 33.3333%; 642 | left: 33.3333333333%; 643 | } 644 | .ReactCrop__rule-of-thirds-vt:after { 645 | left: 66.6666%; 646 | left: 66.6666666667%; 647 | } 648 | .ReactCrop__rule-of-thirds-hz:before, 649 | .ReactCrop__rule-of-thirds-hz:after { 650 | width: 100%; 651 | height: 1px; 652 | } 653 | .ReactCrop__rule-of-thirds-hz:before { 654 | top: 33.3333%; 655 | top: 33.3333333333%; 656 | } 657 | .ReactCrop__rule-of-thirds-hz:after { 658 | top: 66.6666%; 659 | top: 66.6666666667%; 660 | } 661 | .ReactCrop__drag-handle { 662 | position: absolute; 663 | } 664 | .ReactCrop__drag-handle:after { 665 | position: absolute; 666 | content: ""; 667 | display: block; 668 | width: 15px; 669 | height: 15px; 670 | background-color: black; 671 | border-radius: 50%; 672 | outline: 1px solid transparent; 673 | } 674 | .ReactCrop__drag-handle:focus:after { 675 | border-color: #00f; 676 | background: #2dbfff; 677 | } 678 | .ReactCrop .ord-nw { 679 | top: 0; 680 | left: 0; 681 | margin-top: -7.5px; 682 | margin-left: -7.5px; 683 | cursor: nw-resize; 684 | } 685 | .ReactCrop .ord-nw:after { 686 | top: 0; 687 | left: 0; 688 | } 689 | .ReactCrop .ord-n { 690 | top: 0; 691 | left: 50%; 692 | margin-top: -7.5px; 693 | margin-left: -7.5px; 694 | cursor: n-resize; 695 | } 696 | .ReactCrop .ord-n:after { 697 | top: 0; 698 | } 699 | .ReactCrop .ord-ne { 700 | top: 0; 701 | right: 0; 702 | margin-top: -7.5px; 703 | margin-right: -7.5px; 704 | cursor: ne-resize; 705 | } 706 | .ReactCrop .ord-ne:after { 707 | top: 0; 708 | right: 0; 709 | } 710 | .ReactCrop .ord-e { 711 | top: 50%; 712 | right: 0; 713 | margin-top: -7.5px; 714 | margin-right: -7.5px; 715 | cursor: e-resize; 716 | } 717 | .ReactCrop .ord-e:after { 718 | right: 0; 719 | } 720 | .ReactCrop .ord-se { 721 | bottom: 0; 722 | right: 0; 723 | margin-bottom: -7.5px; 724 | margin-right: -7.5px; 725 | cursor: se-resize; 726 | } 727 | .ReactCrop .ord-se:after { 728 | bottom: 0; 729 | right: 0; 730 | } 731 | .ReactCrop .ord-s { 732 | bottom: 0; 733 | left: 50%; 734 | margin-bottom: -7.5px; 735 | margin-left: -7.5px; 736 | cursor: s-resize; 737 | } 738 | .ReactCrop .ord-s:after { 739 | bottom: 0; 740 | } 741 | .ReactCrop .ord-sw { 742 | bottom: 0; 743 | left: 0; 744 | margin-bottom: -7.5px; 745 | margin-left: -7.5px; 746 | cursor: sw-resize; 747 | } 748 | .ReactCrop .ord-sw:after { 749 | bottom: 0; 750 | left: 0; 751 | } 752 | .ReactCrop .ord-w { 753 | top: 50%; 754 | left: 0; 755 | margin-top: -7.5px; 756 | margin-left: -7.5px; 757 | cursor: w-resize; 758 | } 759 | .ReactCrop .ord-w:after { 760 | left: 0; 761 | } 762 | .ReactCrop__disabled .ReactCrop__drag-handle { 763 | cursor: inherit; 764 | } 765 | .ReactCrop__drag-bar { 766 | position: absolute; 767 | } 768 | .ReactCrop__drag-bar.ord-n { 769 | top: 0; 770 | left: 0; 771 | width: 100%; 772 | height: 6px; 773 | margin-top: -3px; 774 | } 775 | .ReactCrop__drag-bar.ord-e { 776 | right: 0; 777 | top: 0; 778 | width: 6px; 779 | height: 100%; 780 | margin-right: -3px; 781 | } 782 | .ReactCrop__drag-bar.ord-s { 783 | bottom: 0; 784 | left: 0; 785 | width: 100%; 786 | height: 6px; 787 | margin-bottom: -3px; 788 | } 789 | .ReactCrop__drag-bar.ord-w { 790 | top: 0; 791 | left: 0; 792 | width: 6px; 793 | height: 100%; 794 | margin-left: -3px; 795 | } 796 | .ReactCrop--new-crop .ReactCrop__drag-bar, 797 | .ReactCrop--new-crop .ReactCrop__drag-handle, 798 | .ReactCrop--fixed-aspect .ReactCrop__drag-bar, 799 | .ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-n, 800 | .ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-e, 801 | .ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-s, 802 | .ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-w { 803 | display: none; 804 | } 805 | @media (pointer: coarse) { 806 | .ReactCrop .ord-n, 807 | .ReactCrop .ord-e, 808 | .ReactCrop .ord-s, 809 | .ReactCrop .ord-w { 810 | display: none; 811 | } 812 | .ReactCrop__drag-handle { 813 | width: 24px; 814 | height: 24px; 815 | } 816 | } 817 | -------------------------------------------------------------------------------- /themes/dark.src.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css2?family=Montserrat&display=swap"); 2 | 3 | .rp-root { 4 | position: absolute; 5 | z-index: 99; 6 | } 7 | 8 | canvas { 9 | transition: all 0.2s; 10 | } 11 | 12 | :root { 13 | --rp-background: #121212; 14 | } 15 | 16 | .rp-editor, 17 | .rp-editor * { 18 | font-family: "Montserrat", sans-serif; 19 | color: #dcdddf; 20 | } 21 | 22 | .rp-editor .rp-buttons svg, 23 | .rp-editor .rp-controls svg { 24 | fill: #dcdddf; 25 | } 26 | 27 | .rp-editor { 28 | background-color: var(--rp-background); 29 | position: fixed; 30 | width: 100vw; 31 | height: 100vh; 32 | top: 0; 33 | left: 0; 34 | } 35 | 36 | .rp-navigation { 37 | display: flex; 38 | margin-bottom: 10px; 39 | } 40 | 41 | .rp-navigation .rp-back { 42 | margin-left: 5px; 43 | display: inline-flex; 44 | justify-items: flex-start; 45 | align-items: center; 46 | width: 15%; 47 | } 48 | 49 | .rp-navigation .rp-back .rp-cancel-button { 50 | cursor: pointer; 51 | padding: 10px 20px; 52 | border-radius: 20px; 53 | border: none; 54 | background-color: #1a1a1a; 55 | font-weight: bold; 56 | margin-left: 5px; 57 | margin-right: 5px; 58 | transition: all 0.2s; 59 | } 60 | 61 | .rp-navigation .rp-back .rp-cancel-button:hover { 62 | background-color: #1a1a1aa2; 63 | } 64 | 65 | .rp-navigation .rp-back .rp-back-button { 66 | border: none; 67 | border-radius: 100%; 68 | background-color: #1a1a1a; 69 | margin-left: 5px; 70 | margin-right: 5px; 71 | margin-top: 3px; 72 | cursor: pointer; 73 | display: flex; 74 | align-items: center; 75 | justify-content: center; 76 | padding: 0px 2px; 77 | align-self: center; 78 | transition: all 0.2s; 79 | } 80 | 81 | .rp-navigation .rp-back .rp-back-button:hover { 82 | background-color: #1a1a1aa2; 83 | } 84 | 85 | .rp-navigation .rp-back .rp-back-button svg { 86 | width: 30px; 87 | height: 30px; 88 | fill: #dcdddf; 89 | } 90 | 91 | .rp-navigation .rp-back .rp-back-button:disabled { 92 | opacity: 0; 93 | pointer-events: none; 94 | } 95 | 96 | .rp-navigation .rp-buttons { 97 | display: flex; 98 | align-items: center; 99 | justify-content: center; 100 | width: 70%; 101 | } 102 | 103 | .rp-navigation .rp-buttons > div { 104 | height: 60px; 105 | padding: 10px 30px; 106 | transition: all 0.2s; 107 | font-size: 14px; 108 | display: flex; 109 | flex-direction: column; 110 | align-items: center; 111 | justify-content: center; 112 | border-radius: 10px; 113 | margin-top: 5px; 114 | } 115 | 116 | .rp-navigation .rp-buttons > div.selected { 117 | font-weight: bold; 118 | pointer-events: none; 119 | } 120 | 121 | .rp-navigation .rp-buttons > div.selected svg { 122 | stroke-width: 10px; 123 | stroke: #dcdddf; 124 | } 125 | 126 | .rp-navigation .rp-buttons > div > p { 127 | margin: 0; 128 | } 129 | 130 | .rp-navigation .rp-buttons > div svg { 131 | width: 35px; 132 | height: 35px; 133 | } 134 | 135 | .rp-navigation .rp-buttons > div:hover { 136 | cursor: pointer; 137 | box-shadow: 0px 4px 5px #dcdddf10; 138 | } 139 | 140 | .rp-next { 141 | width: 15%; 142 | display: flex; 143 | justify-content: flex-end; 144 | align-items: center; 145 | margin-right: 5px; 146 | } 147 | 148 | .rp-next .rp-done-button { 149 | cursor: pointer; 150 | padding: 10px 20px; 151 | border-radius: 20px; 152 | border: none; 153 | background-color: hsla(206, 100%, 52%, 0.788); 154 | color: white; 155 | font-weight: bold; 156 | margin-left: 5px; 157 | margin-right: 5px; 158 | transition: all 0.2s; 159 | } 160 | 161 | .rp-next .rp-done-button:hover { 162 | background-color: hsla(206, 100%, 52%, 0.9); 163 | } 164 | 165 | .rp-image-section.crop .rp-controls { 166 | display: flex; 167 | width: 100vw; 168 | justify-content: center; 169 | align-items: center; 170 | margin-bottom: 10px; 171 | } 172 | 173 | .rp-image-section.crop .rp-controls .rp-crop { 174 | width: 100%; 175 | display: flex; 176 | justify-content: center; 177 | align-items: center; 178 | gap: 40px; 179 | } 180 | 181 | .rp-image-section.crop .rp-controls .rp-crop > button { 182 | display: flex; 183 | justify-content: center; 184 | align-items: center; 185 | background: none; 186 | border: none; 187 | font-size: 13px; 188 | transition: all 0.2s; 189 | } 190 | 191 | .rp-image-section.crop .rp-controls .rp-crop.vertical-flip .flip-vertical-button::before { 192 | content: " "; 193 | width: 3px; 194 | height: 3px; 195 | background-color: black; 196 | border-radius: 100%; 197 | margin-right: 5px; 198 | } 199 | 200 | .rp-image-section.crop .rp-controls .rp-crop.horizontal-flip .flip-horizontal-button::before { 201 | content: " "; 202 | width: 3px; 203 | height: 3px; 204 | background-color: black; 205 | border-radius: 100%; 206 | margin-right: 5px; 207 | } 208 | 209 | .rp-image-section.crop .rp-controls .rp-crop > button svg { 210 | margin-right: 10px; 211 | width: 30px; 212 | height: 30px; 213 | } 214 | 215 | .rp-image-section.crop .rp-controls .rp-crop .flip-vertical-button svg { 216 | transform: rotateZ(-90deg); 217 | } 218 | 219 | .rp-image-section.crop .rp-controls .rp-crop > button:hover { 220 | opacity: 0.8; 221 | cursor: pointer; 222 | } 223 | 224 | .rp-image-section { 225 | height: calc(100vh - 95px); 226 | } 227 | 228 | .rp-preview { 229 | width: 100vw; 230 | display: flex; 231 | justify-content: center; 232 | align-items: flex-start; 233 | height: 100%; 234 | } 235 | 236 | @media only screen and (min-width: 800px) { 237 | .rp-image-preview { 238 | max-height: 360px; 239 | } 240 | } 241 | 242 | @media only screen and (min-width: 1366px) { 243 | .rp-image-preview { 244 | max-height: 450px; 245 | } 246 | } 247 | 248 | @media only screen and (min-width: 1600px) { 249 | .rp-preview { 250 | margin-top: 15px; 251 | } 252 | .rp-image-preview { 253 | max-height: 550px; 254 | } 255 | } 256 | 257 | @media only screen and (min-width: 1920px) { 258 | .rp-preview { 259 | margin-top: 30px; 260 | } 261 | .rp-image-preview { 262 | max-height: 600px; 263 | } 264 | } 265 | 266 | .rp-image-section.filter { 267 | display: flex; 268 | flex-direction: row-reverse; 269 | } 270 | 271 | .rp-image-section.filter .rp-image-preview { 272 | box-shadow: 0px 4px 13px rgba(0, 0, 0, 0.4); 273 | } 274 | 275 | .rp-image-section.filter .rp-controls { 276 | max-height: 100%; 277 | } 278 | 279 | .rp-image-section.filter .rp-preview { 280 | display: flex; 281 | justify-content: center; 282 | align-items: center; 283 | } 284 | 285 | .rp-image-section.filter .rp-filter-preview { 286 | max-width: 100px; 287 | border: 2px solid #dcdddf6b; 288 | cursor: pointer; 289 | transition: all 0.2s; 290 | } 291 | 292 | .rp-image-section.filter .rp-filter.selected .rp-filter-preview { 293 | border-width: 3px; 294 | border-color: hsla(206, 100%, 52%, 0.788); 295 | pointer-events: none; 296 | } 297 | 298 | .rp-image-section.filter .rp-filter.selected p { 299 | color: #dcdddf; 300 | } 301 | 302 | .rp-image-section.filter .rp-filter { 303 | max-width: 100px; 304 | } 305 | 306 | .rp-image-section.filter .rp-filter p { 307 | margin: 0; 308 | font-size: 12px; 309 | margin-bottom: 5px; 310 | } 311 | 312 | .rp-image-section.filter .rp-filter-preview:hover { 313 | transform: scale(1.05); 314 | } 315 | 316 | .rp-image-section.filter .rp-filters { 317 | padding: 10px; 318 | margin: 0px 10px; 319 | border-radius: 10px; 320 | height: 96%; 321 | overflow: auto; 322 | } 323 | 324 | .rp-editor *::-webkit-scrollbar { 325 | width: 0px; 326 | } 327 | 328 | .rp-editor *::-webkit-scrollbar-track { 329 | background: #e1e2e4; 330 | border-radius: 10px; 331 | } 332 | 333 | .rp-editor *::-webkit-scrollbar-thumb { 334 | background: hsl(206, 100%, 52%); 335 | border-radius: 10px; 336 | } 337 | 338 | .rp-editor *::-webkit-scrollbar-thumb:hover { 339 | background: hsla(206, 100%, 52%, 0.842); 340 | } 341 | 342 | .rp-image-section.colors { 343 | display: flex; 344 | flex-direction: row-reverse; 345 | } 346 | 347 | .rp-image-section.colors .rp-image-preview { 348 | box-shadow: 0px 4px 13px rgba(0, 0, 0, 0.4); 349 | } 350 | 351 | .rp-image-section.colors .rp-controls { 352 | max-height: 100%; 353 | } 354 | 355 | .rp-image-section.colors .rp-preview { 356 | display: flex; 357 | justify-content: center; 358 | align-items: center; 359 | } 360 | 361 | .rp-image-section.colors .rp-colors { 362 | margin-right: 30px; 363 | display: flex; 364 | flex-direction: column; 365 | justify-content: center; 366 | align-items: center; 367 | height: 100%; 368 | width: 300px; 369 | } 370 | 371 | .rp-image-section.colors .rp-colors label { 372 | display: flex; 373 | margin: 0; 374 | justify-content: flex-start; 375 | width: 100%; 376 | gap: 10px; 377 | margin-top: 50px; 378 | margin-bottom: 5px; 379 | } 380 | 381 | .rp-image-section.colors .rp-colors label:nth-child(1) { 382 | margin-top: 0px; 383 | } 384 | 385 | .rp-image-section.colors .rp-colors label svg { 386 | width: 20px; 387 | height: 20px; 388 | } 389 | 390 | .rp-editor input[type="range"] { 391 | -webkit-appearance: none; 392 | appearance: none; 393 | width: 100%; 394 | cursor: pointer; 395 | outline: none; 396 | border-radius: 15px; 397 | height: 6px; 398 | background: #ccc; 399 | } 400 | 401 | .rp-editor input[type="range"]::-webkit-slider-thumb { 402 | -webkit-appearance: none; 403 | appearance: none; 404 | height: 15px; 405 | width: 15px; 406 | background-color: hsl(206, 100%, 52%); 407 | border-radius: 50%; 408 | border: none; 409 | 410 | transition: 0.2s ease-in-out; 411 | } 412 | 413 | .rp-editor input[type="range"]::-moz-range-thumb { 414 | height: 15px; 415 | width: 15px; 416 | background-color: hsl(206, 100%, 52%); 417 | border-radius: 50%; 418 | border: none; 419 | 420 | transition: 0.2s ease-in-out; 421 | } 422 | 423 | .rp-editor input[type="range"]::-webkit-slider-thumb:hover { 424 | box-shadow: 0 0 0 10px hsla(206, 100%, 52%, 0.13); 425 | } 426 | .rp-editor input[type="range"]:active::-webkit-slider-thumb { 427 | box-shadow: 0 0 0 13px hsla(206, 100%, 52%, 0.24); 428 | } 429 | 430 | .rp-editor input[type="range"]::-moz-range-thumb:hover { 431 | box-shadow: 0 0 0 10px hsla(206, 100%, 52%, 0.13); 432 | } 433 | .rp-editor input[type="range"]:active::-moz-range-thumb { 434 | box-shadow: 0 0 0 13px hsla(206, 100%, 52%, 0.24); 435 | } 436 | 437 | @media only screen and (max-width: 767px) { 438 | .rp-navigation .rp-back { 439 | z-index: 20; 440 | margin-top: 5px; 441 | } 442 | 443 | .rp-navigation .rp-back .rp-cancel-button { 444 | padding: 5px 10px; 445 | border-radius: 15px; 446 | margin-left: 2px; 447 | margin-right: 2px; 448 | font-size: 8px; 449 | } 450 | 451 | .rp-navigation .rp-back .rp-back-button { 452 | margin-left: 12px; 453 | margin-right: 2px; 454 | margin-top: 3px; 455 | padding: 0px; 456 | height: 25px; 457 | display: grid; 458 | align-items: center; 459 | justify-content: center; 460 | } 461 | 462 | .rp-navigation .rp-back .rp-back-button svg { 463 | width: 25px; 464 | height: 25px; 465 | } 466 | 467 | .rp-navigation .rp-buttons > div { 468 | height: 60px; 469 | padding: 10px 8px; 470 | font-size: 10px; 471 | border-radius: 10px; 472 | margin-top: 5px; 473 | } 474 | 475 | .rp-navigation .rp-buttons > div.selected svg { 476 | stroke-width: 10px; 477 | } 478 | 479 | .rp-navigation .rp-buttons > div svg { 480 | width: 25px; 481 | height: 25px; 482 | } 483 | 484 | .rp-navigation .rp-buttons > div:hover { 485 | box-shadow: none; 486 | } 487 | 488 | .rp-next { 489 | margin-right: 5px; 490 | } 491 | 492 | .rp-next .rp-done-button { 493 | padding: 5px 10px; 494 | border-radius: 15px; 495 | margin-left: 2px; 496 | margin-right: 2px; 497 | font-size: 8px; 498 | } 499 | 500 | .rp-image-preview { 501 | margin-top: 0px; 502 | max-width: 80vw; 503 | } 504 | 505 | .rp-preview { 506 | align-items: center; 507 | } 508 | 509 | .rp-image-section.crop .rp-preview { 510 | height: 500px; 511 | } 512 | 513 | .rp-image-section.crop .rp-controls .rp-crop > button { 514 | font-size: 10px; 515 | } 516 | 517 | .rp-image-section.crop .rp-controls .rp-crop > button svg { 518 | height: 20px; 519 | width: 20px; 520 | margin-right: 3px; 521 | } 522 | 523 | .rp-image-section.filter { 524 | flex-direction: column-reverse; 525 | justify-content: space-around; 526 | } 527 | 528 | .rp-image-section.filter .rp-preview { 529 | height: auto; 530 | } 531 | 532 | .rp-image-section.filter .rp-filters { 533 | width: 90%; 534 | height: fit-content; 535 | overflow: auto; 536 | display: flex; 537 | } 538 | 539 | .rp-editor *::-webkit-scrollbar { 540 | display: none; 541 | } 542 | 543 | .rp-image-section.colors { 544 | flex-direction: column-reverse; 545 | justify-content: center; 546 | } 547 | 548 | .rp-image-section.colors .rp-preview { 549 | height: auto; 550 | } 551 | 552 | .rp-image-section.colors .rp-colors { 553 | margin-top: 20px; 554 | margin-right: 0px; 555 | justify-content: flex-start; 556 | align-items: flex-start; 557 | height: auto; 558 | width: 80vw; 559 | margin-left: 10vw; 560 | } 561 | 562 | .rp-image-section.colors .rp-colors label { 563 | margin: 0; 564 | justify-content: flex-start; 565 | align-items: center; 566 | width: 100%; 567 | gap: 3px; 568 | margin-top: 10px; 569 | margin-bottom: 5px; 570 | font-size: 12px; 571 | } 572 | 573 | .rp-image-section.colors .rp-colors label:nth-child(1) { 574 | margin-top: 0px; 575 | } 576 | 577 | .rp-image-section.colors .rp-colors label svg { 578 | width: 20px; 579 | height: 20px; 580 | } 581 | 582 | .rp-image-section.filter .rp-filter p { 583 | font-size: 10px; 584 | } 585 | 586 | .rp-image-section.filter .rp-filter { 587 | max-width: none; 588 | } 589 | } 590 | 591 | /* -- REACT IMAGE CROP CSS --*/ 592 | 593 | .ReactCrop { 594 | position: relative; 595 | display: inline-block; 596 | cursor: crosshair; 597 | overflow: hidden; 598 | max-width: 100%; 599 | background-color: transparent; 600 | } 601 | .ReactCrop *, 602 | .ReactCrop *:before, 603 | .ReactCrop *:after { 604 | box-sizing: border-box; 605 | } 606 | .ReactCrop--disabled, 607 | .ReactCrop--locked { 608 | cursor: inherit; 609 | } 610 | .ReactCrop__child-wrapper { 611 | max-height: inherit; 612 | background-color: #121212; 613 | box-shadow: 0px 4px 13px rgba(0, 0, 0, 0.4); 614 | } 615 | .ReactCrop__child-wrapper > img, 616 | .ReactCrop__child-wrapper > video { 617 | display: block; 618 | max-width: 100%; 619 | max-height: inherit; 620 | } 621 | .ReactCrop:not(.ReactCrop--disabled) .ReactCrop__child-wrapper > img, 622 | .ReactCrop:not(.ReactCrop--disabled) .ReactCrop__child-wrapper > video { 623 | touch-action: none; 624 | } 625 | .ReactCrop:not(.ReactCrop--disabled) .ReactCrop__crop-selection { 626 | touch-action: none; 627 | } 628 | .ReactCrop__crop-selection { 629 | position: absolute; 630 | top: 0; 631 | left: 0; 632 | transform: translateZ(0); 633 | cursor: move; 634 | box-shadow: 0 0 0 9999em #121212ad; 635 | } 636 | .ReactCrop--disabled .ReactCrop__crop-selection { 637 | cursor: inherit; 638 | } 639 | .ReactCrop--circular-crop .ReactCrop__crop-selection { 640 | border-radius: 50%; 641 | } 642 | .ReactCrop--no-animate .ReactCrop__crop-selection { 643 | outline: 1px solid #dcdddf; 644 | } 645 | .ReactCrop__crop-selection:focus { 646 | outline: none; 647 | border-color: #00f; 648 | border-style: solid; 649 | } 650 | .ReactCrop--invisible-crop .ReactCrop__crop-selection { 651 | display: none; 652 | } 653 | .ReactCrop__rule-of-thirds-vt:before, 654 | .ReactCrop__rule-of-thirds-vt:after, 655 | .ReactCrop__rule-of-thirds-hz:before, 656 | .ReactCrop__rule-of-thirds-hz:after { 657 | content: ""; 658 | display: block; 659 | position: absolute; 660 | background-color: #dcdddf65; 661 | } 662 | .ReactCrop__rule-of-thirds-vt:before, 663 | .ReactCrop__rule-of-thirds-vt:after { 664 | width: 1px; 665 | height: 100%; 666 | } 667 | .ReactCrop__rule-of-thirds-vt:before { 668 | left: 33.3333%; 669 | left: 33.3333333333%; 670 | } 671 | .ReactCrop__rule-of-thirds-vt:after { 672 | left: 66.6666%; 673 | left: 66.6666666667%; 674 | } 675 | .ReactCrop__rule-of-thirds-hz:before, 676 | .ReactCrop__rule-of-thirds-hz:after { 677 | width: 100%; 678 | height: 1px; 679 | } 680 | .ReactCrop__rule-of-thirds-hz:before { 681 | top: 33.3333%; 682 | top: 33.3333333333%; 683 | } 684 | .ReactCrop__rule-of-thirds-hz:after { 685 | top: 66.6666%; 686 | top: 66.6666666667%; 687 | } 688 | .ReactCrop__drag-handle { 689 | position: absolute; 690 | } 691 | .ReactCrop__drag-handle:after { 692 | position: absolute; 693 | content: ""; 694 | display: block; 695 | width: 12px; 696 | height: 12px; 697 | background-color: #dcdddf; 698 | border-radius: 50%; 699 | outline: 1px solid transparent; 700 | } 701 | .ReactCrop__drag-handle:focus:after { 702 | border-color: #00f; 703 | background: #2dbfff; 704 | } 705 | .ReactCrop .ord-nw { 706 | top: 0; 707 | left: 0; 708 | margin-top: -6.5px; 709 | margin-left: -6.5px; 710 | cursor: nw-resize; 711 | } 712 | .ReactCrop .ord-nw:after { 713 | top: 0; 714 | left: 0; 715 | } 716 | .ReactCrop .ord-n { 717 | top: 0; 718 | left: 50%; 719 | margin-top: -6.5px; 720 | margin-left: -6.5px; 721 | cursor: n-resize; 722 | } 723 | .ReactCrop .ord-n:after { 724 | top: 0; 725 | } 726 | .ReactCrop .ord-ne { 727 | top: 0; 728 | right: 0; 729 | margin-top: -6.5px; 730 | margin-right: -6.5px; 731 | cursor: ne-resize; 732 | } 733 | .ReactCrop .ord-ne:after { 734 | top: 0; 735 | right: 0; 736 | } 737 | .ReactCrop .ord-e { 738 | top: 50%; 739 | right: 0; 740 | margin-top: -6.5px; 741 | margin-right: -6.5px; 742 | cursor: e-resize; 743 | } 744 | .ReactCrop .ord-e:after { 745 | right: 0; 746 | } 747 | .ReactCrop .ord-se { 748 | bottom: 0; 749 | right: 0; 750 | margin-bottom: -6.5px; 751 | margin-right: -6.5px; 752 | cursor: se-resize; 753 | } 754 | .ReactCrop .ord-se:after { 755 | bottom: 0; 756 | right: 0; 757 | } 758 | .ReactCrop .ord-s { 759 | bottom: 0; 760 | left: 50%; 761 | margin-bottom: -6.5px; 762 | margin-left: -6.5px; 763 | cursor: s-resize; 764 | } 765 | .ReactCrop .ord-s:after { 766 | bottom: 0; 767 | } 768 | .ReactCrop .ord-sw { 769 | bottom: 0; 770 | left: 0; 771 | margin-bottom: -6.5px; 772 | margin-left: -6.5px; 773 | cursor: sw-resize; 774 | } 775 | .ReactCrop .ord-sw:after { 776 | bottom: 0; 777 | left: 0; 778 | } 779 | .ReactCrop .ord-w { 780 | top: 50%; 781 | left: 0; 782 | margin-top: -6.5px; 783 | margin-left: -6.5px; 784 | cursor: w-resize; 785 | } 786 | .ReactCrop .ord-w:after { 787 | left: 0; 788 | } 789 | .ReactCrop__disabled .ReactCrop__drag-handle { 790 | cursor: inherit; 791 | } 792 | .ReactCrop__drag-bar { 793 | background-color: #dcdddf; 794 | position: absolute; 795 | } 796 | .ReactCrop__drag-bar.ord-n { 797 | top: 0; 798 | left: 0; 799 | width: 100%; 800 | height: 2px; 801 | margin-top: -2px; 802 | margin-left: -1px; 803 | } 804 | .ReactCrop__drag-bar.ord-e { 805 | right: 0; 806 | top: 0; 807 | width: 2px; 808 | height: 100%; 809 | margin-right: -2px; 810 | margin-top: 1px; 811 | } 812 | .ReactCrop__drag-bar.ord-s { 813 | bottom: 0; 814 | left: 0; 815 | width: 100%; 816 | height: 2px; 817 | margin-bottom: -2px; 818 | margin-left: 1px; 819 | } 820 | .ReactCrop__drag-bar.ord-w { 821 | top: 0; 822 | left: 0; 823 | width: 2px; 824 | height: 100%; 825 | margin-left: -2px; 826 | margin-top: 1px; 827 | } 828 | .ReactCrop--new-crop .ReactCrop__drag-bar, 829 | .ReactCrop--new-crop .ReactCrop__drag-handle, 830 | .ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-n, 831 | .ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-e, 832 | .ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-s, 833 | .ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-w { 834 | display: none; 835 | } 836 | @media (pointer: coarse) { 837 | /*.ReactCrop__drag-handle { 838 | width: 354px; 839 | height: 354px; 840 | }*/ 841 | } 842 | -------------------------------------------------------------------------------- /src/language.ts: -------------------------------------------------------------------------------- 1 | export const EDITOR_TEXT = { 2 | en: { 3 | cropButton: 'Crop', 4 | filterButton: 'Filter', 5 | colorsButton: 'Colors', 6 | cancelButton: 'Cancel', 7 | doneButton: 'Done', 8 | sliderBrightness: 'Brightness', 9 | sliderContrast: 'Contrast', 10 | sliderSaturation: 'Saturation', 11 | flipHorizontal: 'Flip horizontal', 12 | flipVertical: 'Flip vertical', 13 | noFilter: 'No Filter', 14 | filters: { 15 | "Horizontal Lines": "horizontal_lines", 16 | "Extreme Offset Blue": "extreme_offset_blue", 17 | "Ocean": "ocean", 18 | "Extreme Offset Green": "extreme_offset_green", 19 | "Offset Green": "offset_green", 20 | "Extra Offset Blue": "extra_offset_blue", 21 | "Extra Offset Red": "extra_offset_red", 22 | "Extra Offset Green": "extra_offset_green", 23 | "Extreme Offset Red": "extreme_offset_red", 24 | "Specks Redscale": "specks_redscale", 25 | "Vintage": "vintage", 26 | "Perfume": "perfume", 27 | "Serenity": "serenity", 28 | "Eclectic": "eclectic", 29 | "Diagonal Lines": "diagonal_lines", 30 | "Green Specks": "green_specks", 31 | "Warmth": "warmth", 32 | "Casino": "casino", 33 | "Green Diagonal Lines": "green_diagonal_lines", 34 | "Offset": "offset", 35 | "Offset Blue": "offset_blue", 36 | "Neue": "neue", 37 | "Sunset": "sunset", 38 | "Specks": "specks", 39 | "Wood": "wood", 40 | "Lix": "lix", 41 | "Ryo": "ryo", 42 | "Bluescale": "bluescale", 43 | "Solange": "solange", 44 | "Evening": "evening", 45 | "Crimson": "crimson", 46 | "Teal Min Noise": "teal_min_noise", 47 | "Phase": "phase", 48 | "Dark Purple Min Noise": "dark_purple_min_noise", 49 | "Coral": "coral", 50 | "Darkify": "darkify", 51 | "Brightness": "incbrightness", 52 | "Brightness Second": "incbrightness2", 53 | "Yellow Casino": "yellow_casino", 54 | "Invert": "invert", 55 | "Saturation": "sat_adj", 56 | "Lemon": "lemon", 57 | "Pink Min Noise": "pink_min_noise", 58 | "Frontward": "frontward", 59 | "Pink Aura": "pink_aura", 60 | "Haze": "haze", 61 | "Cool Twilight": "cool_twilight", 62 | "Blues": "blues", 63 | "Mellow": "mellow", 64 | "Solange Dark": "solange_dark", 65 | "Solange Grey": "solange_grey", 66 | "Zapt": "zapt", 67 | "Eon": "eon", 68 | "Aeon": "aeon", 69 | "Matrix": "matrix", 70 | "Cosmic": "cosmic", 71 | "Min Noise": "min_noise", 72 | "Red Min Noise": "red_min_noise", 73 | "Matrix2": "matrix2", 74 | "Purplescale": "purplescale", 75 | "Radio": "radio", 76 | "Twenties": "twenties", 77 | "Pixel Blue": "pixel_blue", 78 | "Greyscale": "greyscale", 79 | "Grime": "grime", 80 | "Red Greyscale": "redgreyscale", 81 | "Retroviolet": "retroviolet", 82 | "Greengreyscale": "greengreyscale", 83 | "Green Med Noise": "green_med_noise", 84 | "Green Min Noise": "green_min_noise", 85 | "Blue Min Noise": "blue_min_noise", 86 | "Rosetint": "rosetint", 87 | "Purple Min Noise": "purple_min_noise", 88 | "Red Effect": "red_effect", 89 | "Gamma": "gamma", 90 | "Teal Gamma": "teal_gamma", 91 | "Purple Gamma": "purple_gamma", 92 | "Yellow Gamma": "yellow_gamma", 93 | "Bluered Gamma": "bluered_gamma", 94 | "Green Gamma": "green_gamma", 95 | "Red Gamma": "red_gamma", 96 | "Black Specks": "black_specks", 97 | "White Specks": "white_specks", 98 | "Salt and Pepper": "salt_and_pepper", 99 | "RGB Split": "rgbSplit", 100 | "Threshold": "threshold", 101 | "Threshold 75": "threshold75", 102 | "Threshold 125": "threshold125", 103 | "Pixelate": "pixelate", 104 | "Pixelate 16": "pixelate16" 105 | } 106 | }, 107 | es: { 108 | cropButton: 'Recortar', 109 | filterButton: 'Filtro', 110 | colorsButton: 'Colores', 111 | cancelButton: 'Cancelar', 112 | doneButton: 'Listo', 113 | sliderBrightness: 'Brillo', 114 | sliderContrast: 'Contraste', 115 | sliderSaturation: 'Saturación', 116 | flipHorizontal: 'Voltear horizontalmente', 117 | flipVertical: 'Voltear verticalmente', 118 | noFilter: 'Sin filtro', 119 | filters: { 120 | "Líneas Horizontales": "horizontal_lines", 121 | "Azul Extremo Desplazado": "extreme_offset_blue", 122 | "Océano": "ocean", 123 | "Verde Extremo Desplazado": "extreme_offset_green", 124 | "Verde Desplazado": "offset_green", 125 | "Azul Extra Desplazado": "extra_offset_blue", 126 | "Rojo Extra Desplazado": "extra_offset_red", 127 | "Verde Extra Desplazado": "extra_offset_green", 128 | "Rojo Extremo Desplazado": "extreme_offset_red", 129 | "Efecto Manchas Rojas": "specks_redscale", 130 | "Vintage": "vintage", 131 | "Perfume": "perfume", 132 | "Serenidad": "serenity", 133 | "Ecléctico": "eclectic", 134 | "Líneas Diagonales": "diagonal_lines", 135 | "Manchas Verdes": "green_specks", 136 | "Calidez": "warmth", 137 | "Casino": "casino", 138 | "Líneas Diagonales Verdes": "green_diagonal_lines", 139 | "Desplazado": "offset", 140 | "Azul Desplazado": "offset_blue", 141 | "Neue": "neue", 142 | "Atardecer": "sunset", 143 | "Manchas": "specks", 144 | "Madera": "wood", 145 | "Lix": "lix", 146 | "Ryo": "ryo", 147 | "Escala Azul": "bluescale", 148 | "Solange": "solange", 149 | "Noche": "evening", 150 | "Carmesí": "crimson", 151 | "Ruido Mínimo Teal": "teal_min_noise", 152 | "Fase": "phase", 153 | "Ruido Mínimo Morado Oscuro": "dark_purple_min_noise", 154 | "Coral": "coral", 155 | "Oscurecer": "darkify", 156 | "Brillo": "incbrightness", 157 | "Segundo Brillo": "incbrightness2", 158 | "Casino Amarillo": "yellow_casino", 159 | "Invertir": "invert", 160 | "Saturación": "sat_adj", 161 | "Limón": "lemon", 162 | "Ruido Mínimo Rosa": "pink_min_noise", 163 | "Hacia Adelante": "frontward", 164 | "Aura Rosa": "pink_aura", 165 | "Neblina": "haze", 166 | "Anochecer Fresco": "cool_twilight", 167 | "Azules": "blues", 168 | "Suave": "mellow", 169 | "Solange Oscuro": "solange_dark", 170 | "Solange Gris": "solange_grey", 171 | "Zapt": "zapt", 172 | "Eon": "eon", 173 | "Aeon": "aeon", 174 | "Matriz": "matrix", 175 | "Cósmico": "cosmic", 176 | "Ruido Mínimo": "min_noise", 177 | "Ruido Mínimo Rojo": "red_min_noise", 178 | "Matriz2": "matrix2", 179 | "Escala Morada": "purplescale", 180 | "Radio": "radio", 181 | "Años Veinte": "twenties", 182 | "Azul Pixelado": "pixel_blue", 183 | "Escala de Grises": "greyscale", 184 | "Suciedad": "grime", 185 | "Escala de Grises Roja": "redgreyscale", 186 | "Retrovioleta": "retroviolet", 187 | "Escala de Grises Verde": "greengreyscale", 188 | "Ruido Medio Verde": "green_med_noise", 189 | "Ruido Mínimo Verde": "green_min_noise", 190 | "Ruido Mínimo Azul": "blue_min_noise", 191 | "Tinte Rosa": "rosetint", 192 | "Ruido Mínimo Morado": "purple_min_noise", 193 | "Efecto Rojo": "red_effect", 194 | "Gamma": "gamma", 195 | "Gamma Teal": "teal_gamma", 196 | "Gamma Morado": "purple_gamma", 197 | "Gamma Amarillo": "yellow_gamma", 198 | "Gamma Azul-Rojo": "bluered_gamma", 199 | "Gamma Verde": "green_gamma", 200 | "Gamma Rojo": "red_gamma", 201 | "Manchas Negras": "black_specks", 202 | "Manchas Blancas": "white_specks", 203 | "Sal y Pimienta": "salt_and_pepper", 204 | "Separación RGB": "rgbSplit", 205 | "Umbral": "threshold", 206 | "Umbral 75": "threshold75", 207 | "Umbral 125": "threshold125", 208 | "Pixelado": "pixelate", 209 | "Pixelado 16": "pixelate16" 210 | } 211 | }, 212 | zh: { 213 | cropButton: '裁剪', 214 | filterButton: '滤镜', 215 | colorsButton: '颜色', 216 | cancelButton: '取消', 217 | doneButton: '完成', 218 | sliderBrightness: '亮度', 219 | sliderContrast: '对比度', 220 | sliderSaturation: '饱和度', 221 | flipHorizontal: '水平翻转', 222 | flipVertical: '垂直翻转', 223 | noFilter: '无滤镜', 224 | filters: { 225 | "水平线": "horizontal_lines", 226 | "极端偏移蓝色": "extreme_offset_blue", 227 | "海洋": "ocean", 228 | "极端偏移绿色": "extreme_offset_green", 229 | "偏移绿色": "offset_green", 230 | "额外偏移蓝色": "extra_offset_blue", 231 | "额外偏移红色": "extra_offset_red", 232 | "额外偏移绿色": "extra_offset_green", 233 | "极端偏移红色": "extreme_offset_red", 234 | "斑点红色": "specks_redscale", 235 | "复古": "vintage", 236 | "香水": "perfume", 237 | "宁静": "serenity", 238 | "折衷": "eclectic", 239 | "对角线": "diagonal_lines", 240 | "绿斑点": "green_specks", 241 | "温暖": "warmth", 242 | "赌场": "casino", 243 | "绿色对角线": "green_diagonal_lines", 244 | "偏移": "offset", 245 | "偏移蓝色": "offset_blue", 246 | "新": "neue", 247 | "日落": "sunset", 248 | "斑点": "specks", 249 | "木材": "wood", 250 | "蜡": "lix", 251 | "瑞奥": "ryo", 252 | "蓝调": "blues", 253 | "索兰吉": "solange", 254 | "傍晚": "evening", 255 | "深红": "crimson", 256 | "青绿最小噪音": "teal_min_noise", 257 | "阶段": "phase", 258 | "深紫色最小噪音": "dark_purple_min_noise", 259 | "珊瑚": "coral", 260 | "变暗": "darkify", 261 | "亮度": "incbrightness", 262 | "亮度第二": "incbrightness2", 263 | "黄色赌场": "yellow_casino", 264 | "反转": "invert", 265 | "饱和度": "sat_adj", 266 | "柠檬": "lemon", 267 | "粉色最小噪音": "pink_min_noise", 268 | "前进": "frontward", 269 | "粉色光环": "pink_aura", 270 | "阴霾": "haze", 271 | "酷傍晚": "cool_twilight", 272 | "温和": "mellow", 273 | "索兰吉黑": "solange_dark", 274 | "索兰吉灰": "solange_grey", 275 | "扎普特": "zapt", 276 | "永恒": "eon", 277 | "时光矩阵": "aeon", 278 | "宇宙的": "cosmic", 279 | "最小噪音": "min_noise", 280 | "红色最小噪音": "red_min_noise", 281 | "矩阵2": "matrix2", 282 | "紫红色调": "purplescale", 283 | "电台": "radio", 284 | "二十年代": "twenties", 285 | "像素蓝": "pixel_blue", 286 | "灰度": "greyscale", 287 | "污垢": "grime", 288 | "红色灰度": "redgreyscale", 289 | "复古紫色": "retroviolet", 290 | "绿色灰度": "greengreyscale", 291 | "绿色最小噪音": "green_min_noise", 292 | "蓝色最小噪音": "blue_min_noise", 293 | "玫瑰色调": "rosetint", 294 | "紫色最小噪音": "purple_min_noise", 295 | "红色效果": "red_effect", 296 | "伽马": "gamma", 297 | "青绿伽马": "teal_gamma", 298 | "紫色伽马": "purple_gamma", 299 | "黄色伽马": "yellow_gamma", 300 | "蓝红伽马": "bluered_gamma", 301 | "绿色伽马": "green_gamma", 302 | "红色伽马": "red_gamma", 303 | "黑斑点": "black_specks", 304 | "白斑点": "white_specks", 305 | "盐和胡椒": "salt_and_pepper", 306 | "RGB分离": "rgbSplit", 307 | "阈值": "threshold", 308 | "阈值 75": "threshold75", 309 | "阈值 125": "threshold125", 310 | "像素化": "pixelate", 311 | "像素化 16": "pixelate16" 312 | } 313 | }, 314 | hin: { 315 | "cropButton": "कटाई करें", 316 | "filterButton": "फ़िल्टर", 317 | "colorsButton": "रंग", 318 | "cancelButton": "रद्द करें", 319 | "doneButton": "हो गया", 320 | "sliderBrightness": "चमक", 321 | "sliderContrast": "ताकत", 322 | "sliderSaturation": "रंगता", 323 | "flipHorizontal": "क्षैतिज उलटो", 324 | "flipVertical": "ऊर्ध्वाधर उलटो", 325 | "noFilter": "कोई फ़िल्टर नहीं", 326 | filters: { 327 | "क्षैतिज रेखाएं": "horizontal_lines", 328 | "अत्यधिक ऑफसेट नीला": "extreme_offset_blue", 329 | "महासागर": "ocean", 330 | "अत्यधिक ऑफसेट हरा": "extreme_offset_green", 331 | "ऑफसेट हरा": "offset_green", 332 | "अतिरिक्त ऑफसेट नीला": "extra_offset_blue", 333 | "अतिरिक्त ऑफसेट लाल": "extra_offset_red", 334 | "अतिरिक्त ऑफसेट हरा": "extra_offset_green", 335 | "अत्यधिक ऑफसेट लाल": "extreme_offset_red", 336 | "स्पेक रेडस्केल": "specks_redscale", 337 | "विंटेज": "vintage", 338 | "इत्र": "perfume", 339 | "शांति": "serenity", 340 | "एक्लेक्टिक": "eclectic", 341 | "विकर्ण रेखाएं": "diagonal_lines", 342 | "हरा स्पेक": "green_specks", 343 | "गर्माहट ": "warmth", 344 | "कैसीनो": "casino", 345 | "हरी विकर्ण रेखाएं": "green_diagonal_lines", 346 | "ऑफसेट": "offset", 347 | "ऑफसेट नीला": "offset_blue", 348 | "नीयू": "neue", 349 | "सूर्यास्त": "sunset", 350 | "स्पेक्स": "specks", 351 | "लकड़ी": "wood", 352 | "लिक्स": "lix", 353 | "रियो": "ryo", 354 | "ब्लूस्केल": "bluescale", 355 | "सोलेंज": "solange", 356 | "शाम": "evening", 357 | "क्रिमसन": "crimson", 358 | "चैती न्यूनतम शोर": "teal_min_noise", 359 | "चरण": "phase", 360 | "गहरा बैंगनी न्यूनतम शोर": "dark_purple_min_noise", 361 | "मूंगा": "coral", 362 | "अंधेरा": "darkify", 363 | "चमक": "incbrightness", 364 | "चमक दूसरा": "incbrightness2", 365 | "पीला कैसीनो": "yellow_casino", 366 | "उलटा": "invert", 367 | "संतृप्ति": "sat_adj", 368 | "नींबू": "lemon", 369 | "गुलाबी न्यूनतम शोर": "pink_min_noise", 370 | "सामने की ओर": "frontward", 371 | "गुलाबी आभा": "pink_aura", 372 | "धुंध": "haze", 373 | "ठंडा गोधूलि": "cool_twilight", 374 | "नीला": "blues", 375 | "मधुर": "mellow", 376 | "सोलेंज डार्क": "solange_dark", 377 | "सोलेंज ग्रे": "solange_grey", 378 | "जैप्ट": "zapt", 379 | "ईऑन": "eon", 380 | "एयॉन": "aeon", 381 | "मैट्रिक्स": "matrix", 382 | "कॉस्मिक": "cosmic", 383 | "न्यूनतम शोर": "min_noise", 384 | "लाल न्यूनतम नॉइज़": "red_min_noise", 385 | "मैट्रिक्स2": "matrix2", 386 | "पर्पलस्केल": "purplescale", 387 | "रेडियो": "radio", 388 | "ट्वेंटीज़": "twenties", 389 | "पिक्सेल ब्लू": "pixel_blue", 390 | "ग्रेस्केल": "greyscale", 391 | "ग्राइम": "grime", 392 | "रेड ग्रेस्केल": "redgreyscale", 393 | "रेट्रोवॉयलेट": "retroviolet", 394 | "ग्रीनग्रेस्केल": "greengreyscale", 395 | "ग्रीन मेड नॉइज़": "green_med_noise", 396 | "ग्रीन मिन नॉइज़": "green_min_noise", 397 | "ब्लू मिन नॉइज़": "blue_min_noise", 398 | "रोज़ेटिंट": "rosetint", 399 | "पर्पल मिन नॉइज़": "purple_min_noise", 400 | "रेड इफ़ेक्ट": "red_effect", 401 | "गामा": "gamma", 402 | "टील गामा": "teal_gamma", 403 | "बैंगनी गामा": "purple_gamma", 404 | "पीला गामा": "yellow_gamma", 405 | "नीला गामा": "bluered_gamma", 406 | "हरा गामा": "green_gamma", 407 | "लाल गामा": "red_gamma", 408 | "काले धब्बे": "black_specks", 409 | "सफेद धब्बे": "white_specks", 410 | "नमक और काली मिर्च": "salt_and_pepper", 411 | "आरजीबी स्प्लिट": "rgbSplit", 412 | "थ्रेशोल्ड": "threshold", 413 | "थ्रेशोल्ड 75": "threshold75", 414 | "थ्रेशोल्ड 125": "threshold125", 415 | "पिक्सलेट": "pixelate", 416 | "पिक्सलेट 16": "pixelate16" 417 | } 418 | }, 419 | ja: { 420 | "cropButton": "切り取り", 421 | "filterButton": "フィルター", 422 | "colorsButton": "カラー", 423 | "cancelButton": "キャンセル", 424 | "doneButton": "完了", 425 | "sliderBrightness": "明るさ", 426 | "sliderContrast": "コントラスト", 427 | "sliderSaturation": "彩度", 428 | "flipHorizontal": "水平反転", 429 | "flipVertical": "垂直反転", 430 | "noFilter": "フィルターなし", 431 | filters: { 432 | "水平線": "horizontal_lines", 433 | "エクストリーム オフセット ブルー": "extreme_offset_blue", 434 | "オーシャン": "ocean", 435 | "エクストリーム オフセット グリーン": "extreme_offset_green", 436 | "オフセット グリーン": "offset_green", 437 | "エクストラ オフセット ブルー": "extra_offset_blue", 438 | "エクストラ オフセット レッド": "extra_offset_red", 439 | "エクストラ オフセット グリーン": "extra_offset_green", 440 | "エクストリーム オフセット レッド": "extreme_offset_red", 441 | "スペック レッドスケール": "specks_redscale", 442 | "ヴィンテージ": "vintage", 443 | "香水": "perfume", 444 | "静寂": "serenity", 445 | "折衷": "eclectic", 446 | "斜線": "diagonal_lines", 447 | "グリーンスペック": "green_specks", 448 | "暖かさ": "warmth", 449 | "カジノ": "casino", 450 | "緑色の斜線": "green_diagonal_lines", 451 | "オフセット": "offset", 452 | "オフセットブルー": "offset_blue", 453 | "ノイエ": "neue", 454 | "サンセット": "sunset", 455 | "斑点": "specks", 456 | "木": "wood", 457 | "リックス": "lix", 458 | "リョウ": "ryo", 459 | "ブルースケール": "bluescale", 460 | "ソランジュ": "solange", 461 | "イブニング": "evening", 462 | "クリムゾン": "crimson", 463 | "ティール最小ノイズ": "teal_min_noise", 464 | "フェーズ": "phase", 465 | "ダークパープル最小ノイズ": "dark_purple_min_noise", 466 | "コーラル": "coral", 467 | "暗化": "darkify", 468 | "明るさ": "incbrightness", 469 | "明るさセカンド": "incbrightness2", 470 | "イエローカジノ": "yellow_casino", 471 | "反転": "invert", 472 | "彩度": "sat_adj", 473 | "レモン": "lemon", 474 | "ピンクミンノイズ": "pink_min_noise", 475 | "前方": "frontward", 476 | "ピンクオーラ": "pink_aura", 477 | "ヘイズ": "haze", 478 | "クールトワイライト": "cool_twilight", 479 | "ブルース": "blues", 480 | "メロウ": "mellow", 481 | "ソランジュダーク": "solange_dark", 482 | "ソランジュグレー": "solange_grey", 483 | "ザプト": "zapt", 484 | "イオン": "aeon", 485 | "マトリックス": "matrix", 486 | "コズミック": "cosmic", 487 | "ミンノイズ": "min_noise", 488 | "レッドミンノイズ": "red_min_noise", 489 | "マトリックス2": "matrix2", 490 | "パープルスケール": "purplescale", 491 | "ラジオ": "radio", 492 | "20代": "twenties", 493 | "ピクセルブルー": "pixel_blue", 494 | "グレースケール": "greyscale", 495 | "グライム": "grime", 496 | "レッドグレースケール": "redgreyscale", 497 | "レトロバイオレット": "retroviolet", 498 | "グリーングレースケール": "greengreyscale", 499 | "グリーンメッドノイズ": "green_med_noise", 500 | "グリーン最小ノイズ": "green_min_noise", 501 | "ブルー最小ノイズ": "blue_min_noise", 502 | "ローゼティント": "rosetint", 503 | "パープル最小ノイズ": "purple_min_noise", 504 | "レッドエフェクト": "red_effect", 505 | "ガンマ": "gamma", 506 | "ティールガンマ": "teal_gamma", 507 | "紫ガンマ": "purple_gamma", 508 | "黄ガンマ": "yellow_gamma", 509 | "青赤ガンマ": "bluered_gamma", 510 | "緑ガンマ": "green_gamma", 511 | "赤ガンマ": "red_gamma", 512 | "黒斑点": "black_specks", 513 | "白斑点": "white_specks", 514 | "ソルト&ペッパー": "salt_and_pepper", 515 | "RGB 分割": "rgbSplit", 516 | "しきい値": "threshold", 517 | "しきい値 75 ": "threshold75", 518 | "しきい値 125 ": "threshold125", 519 | "ピクセル化 ": "pixelate", 520 | "ピクセル化 16": "pixelate16" 521 | } 522 | }, 523 | it: { 524 | "cropButton": "Taglia", 525 | "filterButton": "Filtro", 526 | "colorsButton": "Colori", 527 | "cancelButton": "Annulla", 528 | "doneButton": "Fatto", 529 | "sliderBrightness": "Luminosità", 530 | "sliderContrast": "Contrasto", 531 | "sliderSaturation": "Saturazione", 532 | "flipHorizontal": "Capovolgi orizzontalmente", 533 | "flipVertical": "Capovolgi verticalmente", 534 | "noFilter": "Nessun filtro", 535 | filters: { 536 | "Linee orizzontali": "horizontal_lines", 537 | "Blu offset estremo": "extreme_offset_blue", 538 | "Oceano": "ocean", 539 | "Verde offset estremo": "extreme_offset_green", 540 | "Verde offset": "offset_green", 541 | "Blu offset extra": "extra_offset_blue", 542 | "Rosso offset extra": "extra_offset_red", 543 | "Verde offset extra": "extra_offset_green", 544 | "Rosso offset estremo": "extreme_offset_red", 545 | "Scala rossa a granelli": "specks_redscale", 546 | "Vintage": "vintage", 547 | "Profumo": "perfume", 548 | "Serenità": "serenity", 549 | "Eclettico": "eclectic", 550 | "Linee diagonali": "diagonal_lines", 551 | "Macchie verdi": "green_specks", 552 | "Calore ": "warmth", 553 | "Casinò": "casino", 554 | "Linee diagonali verdi": "green_diagonal_lines", 555 | "Offset": "offset", 556 | "Offset Blu": "offset_blue", 557 | "Neue": "neue", 558 | "Tramonto": "sunset", 559 | "Macchie": "specks", 560 | "Legno": "wood", 561 | "Lix": "lix", 562 | "Ryo": "ryo", 563 | "Scala blu": "bluescale", 564 | "Solange": "solange", 565 | "Sera": "evening", 566 | "Cremisi": "crimson", 567 | "Alzavola Rumore minimo": "teal_min_noise", 568 | "Fase": "phase", 569 | "Rumore minimo viola scuro": "dark_purple_min_noise", 570 | "Corallo": "coral", 571 | "Darkify": "darkify", 572 | "Luminosità": "incbrightness", 573 | "Luminosità Secondo": "incbrightness2", 574 | "Casinò Giallo": "yellow_casino", 575 | "Inverti": "invert", 576 | "Saturazione": "sat_adj", 577 | "Limone": "lemon", 578 | "Rosa Rumore Min": "pink_min_noise", 579 | "In avanti": "frontward", 580 | "Aura Rosa": "pink_aura", 581 | "Foschia": "haze", 582 | "Crepuscolo Fresco": "cool_twilight", 583 | "Blues": "blues", 584 | "Molto": "mellow", 585 | "Solange Scuro": "solange_dark", 586 | "Grigio Solange": "solange_grey", 587 | "Zapt": "zapt", 588 | "Eon": "eon", 589 | "Aeon": "aeon", 590 | "Matrix": "matrix", 591 | "Cosmico": "cosmic", 592 | "Rumore Min": "min_noise", 593 | "Rosso Min Rumore": "red_min_noise", 594 | "Matrice2": "matrix2", 595 | "Scala viola": "purplescale", 596 | "Radio": "radio", 597 | "Anni '20": "twenties", 598 | "Pixel Blu": "pixel_blue", 599 | "Scala di grigi": "greyscale", 600 | "Sporco": "grime", 601 | "Scala di grigi rosso": "redgreyscale", 602 | "Retrovioletto": "retroviolet", 603 | "Scala di grigioverde": "greengreyscale", 604 | "Rumore medio verde": "green_med_noise", 605 | "Rumore minimo verde": "green_min_noise", 606 | "Rumore minimo blu": "blue_min_noise", 607 | "Rosentino": "rosetint", 608 | "Rumore minimo viola": "purple_min_noise", 609 | "Effetto rosso": "red_effect", 610 | "Gamma": "gamma", 611 | "Gamma verde acqua": "teal_gamma", 612 | "Gamma viola": "purple_gamma", 613 | "Gamma giallo": "yellow_gamma", 614 | "Gamma blu": "bluered_gamma", 615 | "Gamma verde": "green_gamma", 616 | "Gamma rosso": "red_gamma", 617 | "Macchi neri": "black_specks", 618 | "Macchi bianchi": "white_specks", 619 | "Sale e pepe": "salt_and_pepper", 620 | "Divisione RGB": "rgbSplit", 621 | "Soglia": "threshold", 622 | "Soglia 75": "threshold75", 623 | "Soglia 125": "threshold125", 624 | "Pixellato": "pixelate", 625 | "Pixellato 16": "pixelate16" 626 | } 627 | }, 628 | fr: { 629 | "cropButton": "Recadrer", 630 | "filterButton": "Filtre", 631 | "colorsButton": "Couleurs", 632 | "cancelButton": "Annuler", 633 | "doneButton": "Terminé", 634 | "sliderBrightness": "Luminosité", 635 | "sliderContrast": "Contraste", 636 | "sliderSaturation": "Saturation", 637 | "flipHorizontal": "Retourner horizontalement", 638 | "flipVertical": "Retourner verticalement", 639 | "noFilter": "Pas de filtre", 640 | filters: { 641 | "Lignes horizontales": "horizontal_lines", 642 | "Bleu décalé extrême": "extreme_offset_blue", 643 | "Océan": "ocean", 644 | "Vert décalé extrême": "extreme_offset_green", 645 | "Vert décalé": "offset_green", 646 | "Bleu décalé supplémentaire": "extra_offset_blue", 647 | "Rouge décalé supplémentaire": "extra_offset_red", 648 | "Vert décalé supplémentaire": "extra_offset_green", 649 | "Rouge décalé extrême": "extreme_offset_red", 650 | "Échelle rouge de taches": "specks_redscale", 651 | "Vintage": "vintage", 652 | "Parfum": "perfume", 653 | "Sérénité": "serenity", 654 | "Éclectique": "eclectic", 655 | "Lignes diagonales": "diagonal_lines", 656 | "Points verts": "green_specks", 657 | "Chaleur ": "warmth", 658 | "Casino": "casino", 659 | "Lignes diagonales vertes": "green_diagonal_lines", 660 | "Décalage": "offset", 661 | "Décalage bleu": "offset_blue", 662 | "Neue": "neue", 663 | "Coucher de soleil": "sunset", 664 | "Points": "specks", 665 | "Bois": "wood", 666 | "Lix": "lix", 667 | "Ryo": "ryo", 668 | "Échelle bleue": "bluescale", 669 | "Solange": "solange", 670 | "Soirée": "evening", 671 | "Crimson": "crimson", 672 | "Sarcelle Min Bruit": "teal_min_noise", 673 | "Phase": "phase", 674 | "Violet foncé Min Bruit": "dark_purple_min_noise", 675 | "Corail": "coral", 676 | "Darkify": "darkify", 677 | "Luminosité": "incbrightness", 678 | "Luminosité Deuxièmement": "incbrightness2", 679 | "Yellow Casino": "yellow_casino", 680 | "Inverser": "invert", 681 | "Saturation": "sat_adj", 682 | "Citron": "lemon", 683 | "Bruit rose min": "pink_min_noise", 684 | "Frontward": "frontward", 685 | "Aura rose": "pink_aura", 686 | "Haze": "haze", 687 | "Crépuscule frais": "cool_twilight", 688 | "Blues": "blues", 689 | "Moelleux": "mellow", 690 | "Solange Dark": "solange_dark", 691 | "Solange Grey": "solange_grey", 692 | "Zapt": "zapt", 693 | "Eon": "eon", 694 | "Aeon": "aeon", 695 | "Matrix": "matrix", 696 | "Cosmic": "cosmic", 697 | "Min Noise": "min_noise", 698 | "Red Min Bruit": "red_min_noise", 699 | "Matrix2": "matrix2", 700 | "échelle de violet": "purplescale", 701 | "radio": "radio", 702 | "vingtaine": "twenties", 703 | "pixel bleu": "pixel_blue", 704 | "niveaux de gris": "greyscale", 705 | "crasse": "grime", 706 | "niveaux de gris rouges": "redgreyscale", 707 | "rétroviolet": "retroviolet", 708 | "niveaux de gris verts": "greengreyscale", 709 | "bruit vert moyen": "green_med_noise", 710 | "bruit minimum vert": "green_min_noise", 711 | "bruit minimum bleu": "blue_min_noise", 712 | "rosetinte": "rosetint", 713 | "bruit minimum violet": "purple_min_noise", 714 | "effet rouge": "red_effect", 715 | "Gamma": "gamma", 716 | "Gamma sarcelle": "teal_gamma", 717 | "Gamma violet": "purple_gamma", 718 | "Gamma jaune": "yellow_gamma", 719 | "Gamma bleuté": "bluered_gamma", 720 | "Gamma vert": "green_gamma", 721 | "Gamma rouge": "red_gamma", 722 | "Points noirs": "black_specks", 723 | "Points blancs": "white_specks", 724 | "Sel et poivre": "salt_and_pepper", 725 | "Split RVB": "rgbSplit", 726 | "Seuil": "threshold", 727 | "Seuil 75": "threshold75", 728 | "Seuil 125": "threshold125", 729 | "Pixelate": "pixelate", 730 | "Pixelate 16": "pixelate16" 731 | } 732 | } 733 | } --------------------------------------------------------------------------------