├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── public ├── _redirects ├── favicon.ico └── index.html └── src ├── App.js ├── assets ├── img │ ├── ada.jpg │ ├── bnb.jpg │ ├── colors.svg │ ├── doge.jpg │ ├── eth.jpg │ ├── shib.jpg │ ├── usdc.jpg │ └── usdt.jpg └── styles │ ├── components │ ├── _borderRadius.scss │ ├── _boxshadow.scss │ ├── _colorGenerator.scss │ ├── _imageFilter.scss │ └── _markdowm.scss │ ├── global │ ├── _common.scss │ ├── _fonts.scss │ ├── _reset.scss │ └── _scrollbar.scss │ └── index.scss ├── components ├── BorderRadius.js ├── ColorGenerator │ ├── SingleColor.js │ └── index.js ├── ColorPicker.js ├── Gradient.js ├── ImageFilter.js ├── MarkdownGenerator │ ├── Html.js │ ├── Text.js │ └── index.js ├── ShadowGenerator.js ├── Skew.js ├── TextEditor.js ├── TextShadowGenerator.js ├── donation │ ├── DonateCard.js │ └── index.js └── layout │ ├── Footer.js │ ├── Header.js │ └── index.js ├── constants ├── menuItems.js └── walletCards.js ├── hooks └── useTitle.js ├── index.js ├── routes └── index.js └── utils ├── ScrollTotop.js ├── colorFormat.js ├── copyToClipboard.js ├── theme.js └── toast.js /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Create React App 2 | 3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### `npm start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in your browser. 13 | 14 | The page will reload when you make changes.\ 15 | You may also see any lint errors in the console. 16 | 17 | ### `npm test` 18 | 19 | Launches the test runner in the interactive watch mode.\ 20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 21 | 22 | ### `npm run build` 23 | 24 | Builds the app for production to the `build` folder.\ 25 | It correctly bundles React in production mode and optimizes the build for the best performance. 26 | 27 | The build is minified and the filenames include the hashes.\ 28 | Your app is ready to be deployed! 29 | 30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 31 | 32 | ### `npm run eject` 33 | 34 | **Note: this is a one-way operation. Once you `eject`, you can't go back!** 35 | 36 | If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 37 | 38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own. 39 | 40 | You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it. 41 | 42 | ## Learn More 43 | 44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 45 | 46 | To learn React, check out the [React documentation](https://reactjs.org/). 47 | 48 | ### Code Splitting 49 | 50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) 51 | 52 | ### Analyzing the Bundle Size 53 | 54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) 55 | 56 | ### Making a Progressive Web App 57 | 58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) 59 | 60 | ### Advanced Configuration 61 | 62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) 63 | 64 | ### Deployment 65 | 66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) 67 | 68 | ### `npm run build` fails to minify 69 | 70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) 71 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magic-css", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@emotion/react": "^11.10.0", 7 | "@emotion/styled": "^11.10.0", 8 | "@mui/icons-material": "^5.8.4", 9 | "@mui/material": "^5.9.3", 10 | "@testing-library/jest-dom": "^5.16.5", 11 | "@testing-library/react": "^13.3.0", 12 | "@testing-library/user-event": "^13.5.0", 13 | "react": "^18.2.0", 14 | "react-awesome-button": "^6.5.1", 15 | "react-color": "^2.19.3", 16 | "react-dom": "^18.2.0", 17 | "react-icons": "^4.7.1", 18 | "react-markdown": "^8.0.4", 19 | "react-router-dom": "^6.3.0", 20 | "react-scripts": "5.0.1", 21 | "react-toastify": "^9.0.7", 22 | "sass": "^1.54.3", 23 | "uuid": "^9.0.0", 24 | "values.js": "^2.1.1", 25 | "web-vitals": "^2.1.4" 26 | }, 27 | "scripts": { 28 | "start": "react-scripts start", 29 | "build": "react-scripts build", 30 | "test": "react-scripts test", 31 | "eject": "react-scripts eject" 32 | }, 33 | "eslintConfig": { 34 | "extends": [ 35 | "react-app", 36 | "react-app/jest" 37 | ] 38 | }, 39 | "browserslist": { 40 | "production": [ 41 | ">0.2%", 42 | "not dead", 43 | "not op_mini all" 44 | ], 45 | "development": [ 46 | "last 1 chrome version", 47 | "last 1 firefox version", 48 | "last 1 safari version" 49 | ] 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /public/_redirects: -------------------------------------------------------------------------------- 1 | /* /index.html 200 -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parham-ab/React-magic-css/7e95c56ec2b038e9a789d9a5a7c465ef91caf876/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | Magic CSS 13 | 14 | 15 | 16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import { Route, Routes, Navigate } from "react-router-dom"; 2 | import LayOut from "./components/layout"; 3 | import ScrollToTop from "./utils/ScrollTotop"; 4 | import { ThemeProvider } from "@mui/material/styles"; 5 | import { theme } from "./utils/theme"; 6 | import { routes } from "./routes"; 7 | import { ToastContainer } from "react-toastify"; 8 | import "react-toastify/dist/ReactToastify.css"; 9 | 10 | const App = () => { 11 | return ( 12 | 13 | 14 | 15 | {routes.map((item) => ( 16 | } 20 | /> 21 | ))} 22 | } /> 23 | 24 | 25 | 26 | 27 | 28 | ); 29 | }; 30 | export default App; 31 | -------------------------------------------------------------------------------- /src/assets/img/ada.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parham-ab/React-magic-css/7e95c56ec2b038e9a789d9a5a7c465ef91caf876/src/assets/img/ada.jpg -------------------------------------------------------------------------------- /src/assets/img/bnb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parham-ab/React-magic-css/7e95c56ec2b038e9a789d9a5a7c465ef91caf876/src/assets/img/bnb.jpg -------------------------------------------------------------------------------- /src/assets/img/colors.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/assets/img/doge.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parham-ab/React-magic-css/7e95c56ec2b038e9a789d9a5a7c465ef91caf876/src/assets/img/doge.jpg -------------------------------------------------------------------------------- /src/assets/img/eth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parham-ab/React-magic-css/7e95c56ec2b038e9a789d9a5a7c465ef91caf876/src/assets/img/eth.jpg -------------------------------------------------------------------------------- /src/assets/img/shib.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parham-ab/React-magic-css/7e95c56ec2b038e9a789d9a5a7c465ef91caf876/src/assets/img/shib.jpg -------------------------------------------------------------------------------- /src/assets/img/usdc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parham-ab/React-magic-css/7e95c56ec2b038e9a789d9a5a7c465ef91caf876/src/assets/img/usdc.jpg -------------------------------------------------------------------------------- /src/assets/img/usdt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parham-ab/React-magic-css/7e95c56ec2b038e9a789d9a5a7c465ef91caf876/src/assets/img/usdt.jpg -------------------------------------------------------------------------------- /src/assets/styles/components/_borderRadius.scss: -------------------------------------------------------------------------------- 1 | .radiusbox { 2 | width: 200px; 3 | height: 200px; 4 | background-color: rgb(168, 168, 168); 5 | } 6 | -------------------------------------------------------------------------------- /src/assets/styles/components/_boxshadow.scss: -------------------------------------------------------------------------------- 1 | // styles 2 | .boxshadow-container { 3 | display: flex !important; 4 | flex-direction: column !important; 5 | .boxshadow-item { 6 | display: flex !important; 7 | justify-content: center !important; 8 | margin: 3rem 0 10rem !important; 9 | } 10 | } -------------------------------------------------------------------------------- /src/assets/styles/components/_colorGenerator.scss: -------------------------------------------------------------------------------- 1 | .colorListImg { 2 | display: flex; 3 | margin: auto; 4 | width: 700px; 5 | } -------------------------------------------------------------------------------- /src/assets/styles/components/_imageFilter.scss: -------------------------------------------------------------------------------- 1 | // media-queries for custom box 2 | $Xsmall: 588px; 3 | $small: 530px; 4 | $medium: 760px; 5 | @media screen and (max-width: $medium) { 6 | .filterimage-container { 7 | flex-direction: column !important; 8 | align-items: center !important; 9 | } 10 | } 11 | @media screen and (max-width: $small) { 12 | .filter-img { 13 | width: 80% !important; 14 | margin: 0 30px !important; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/assets/styles/components/_markdowm.scss: -------------------------------------------------------------------------------- 1 | .markdown-input { 2 | max-width: 400px; 3 | height: 400px; 4 | padding: 0.4rem; 5 | font-size: 1.2rem; 6 | border-radius: 12px; 7 | box-shadow: rgba(0, 0, 0, 0.25) 0px 25px 50px -12px; 8 | border: solid #dddddd 1px; 9 | resize: vertical; 10 | } -------------------------------------------------------------------------------- /src/assets/styles/global/_common.scss: -------------------------------------------------------------------------------- 1 | .active { 2 | background-color: #a1cbed !important; 3 | } 4 | .custom-box { 5 | width: 60rem; 6 | height: 15rem; 7 | border-radius: 10px; 8 | box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important; 9 | margin: 0 auto; 10 | } 11 | // media-queries for custom box 12 | $Xsmall: 588px; 13 | $small: 588px; 14 | $medium: 930px; 15 | $big: 1078px; 16 | @media screen and (max-width: $big) { 17 | .custom-box { 18 | width: 50rem !important; 19 | } 20 | } 21 | @media screen and (max-width: $medium) { 22 | .custom-box { 23 | width: 30rem !important; 24 | } 25 | } 26 | @media screen and (max-width: $small) { 27 | .custom-box { 28 | width: 20rem !important; 29 | } 30 | } 31 | @media screen and (max-width: $Xsmall) { 32 | .custom-box { 33 | width: 14rem !important; 34 | } 35 | } -------------------------------------------------------------------------------- /src/assets/styles/global/_fonts.scss: -------------------------------------------------------------------------------- 1 | // fonts 2 | @import url("https://fonts.googleapis.com/css2?family=Quicksand&family=Rubik:ital,wght@0,300;1,300&display=swap"); -------------------------------------------------------------------------------- /src/assets/styles/global/_reset.scss: -------------------------------------------------------------------------------- 1 | // CSS Reset 2 | *, 3 | *::before, 4 | *::after { 5 | margin: 0; 6 | padding: 0; 7 | box-shadow: none; 8 | text-decoration: none; 9 | outline: none; 10 | } 11 | a { 12 | color: inherit; 13 | } 14 | body { 15 | font-family: "Quicksand", sans-serif; 16 | font-family: "Rubik", sans-serif; 17 | } -------------------------------------------------------------------------------- /src/assets/styles/global/_scrollbar.scss: -------------------------------------------------------------------------------- 1 | // scroll bar 2 | ::-webkit-scrollbar { 3 | width: 6px; 4 | height: 6px; 5 | } 6 | ::-webkit-scrollbar-track { 7 | background-color: transparent; 8 | } 9 | ::-webkit-scrollbar-thumb { 10 | background-color: #1c2442; 11 | border-radius: 5px; 12 | } 13 | ::-webkit-scrollbar-thumb:hover { 14 | background-color: #334172; 15 | } 16 | ::-webkit-scrollbar-thumb:active { 17 | background-color: #192759; 18 | } -------------------------------------------------------------------------------- /src/assets/styles/index.scss: -------------------------------------------------------------------------------- 1 | @import "components/boxshadow"; 2 | @import "components/borderRadius"; 3 | @import "components/colorGenerator"; 4 | @import "components/imageFilter"; 5 | @import "components/markdowm"; 6 | @import "global/fonts"; 7 | @import "global/reset"; 8 | @import "global/scrollbar"; 9 | @import "global/common"; -------------------------------------------------------------------------------- /src/components/BorderRadius.js: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from "react"; 2 | import { 3 | Box, 4 | Button, 5 | FormControl, 6 | FormControlLabel, 7 | FormLabel, 8 | Grid, 9 | InputLabel, 10 | MenuItem, 11 | Radio, 12 | RadioGroup, 13 | Select, 14 | Slider, 15 | Typography, 16 | } from "@mui/material"; 17 | import { Container } from "@mui/system"; 18 | import AssignmentIcon from "@mui/icons-material/Assignment"; 19 | import UseTitle from "../hooks/useTitle"; 20 | import { copyToClipboard } from './../utils/copyToClipboard'; 21 | 22 | const BorderRadius = () => { 23 | const [type, setType] = useState("Same on all sides"); 24 | const [allRadius, setAllRadius] = useState(0); 25 | const [unit, setUnit] = useState("px"); 26 | const [topLeft, setTopLeft] = useState(0); 27 | const [topRight, setTopRight] = useState(0); 28 | const [bottomRight, setBottomRight] = useState(0); 29 | const [bottomLeft, setBottomLeft] = useState(0); 30 | const [finalSource, setFinalSource] = useState(""); 31 | 32 | useEffect(() => { 33 | // -----Same on all sides----- 34 | if (type === "Same on all sides" && unit === "%") { 35 | setFinalSource(`border-radius:${allRadius}%`); 36 | } else if (type === "Same on all sides" && unit === "px") { 37 | setFinalSource(`border-radius:${allRadius}px`); 38 | } 39 | // -----Different on all Sides----- 40 | if (type === "Different on all Sides" && unit === "px") { 41 | setFinalSource( 42 | `border-radius:${topLeft}px ${topRight}px ${bottomRight}px ${bottomLeft}px` 43 | ); 44 | } else if (type === "Different on all Sides" && unit === "%") { 45 | setFinalSource( 46 | `border-radius:${topLeft}% ${topRight}% ${bottomRight}% ${bottomLeft}%` 47 | ); 48 | } 49 | }, [type, allRadius, unit, topLeft, topRight, bottomRight, bottomLeft]); 50 | UseTitle("Magic CSS - Border radius"); 51 | 52 | return ( 53 | 54 | 60 | 61 | 62 | Type 63 | 75 | 76 | {/* same on all sides */} 77 | {type === "Same on all sides" ? ( 78 | <> 79 | 85 | Radius 86 | 87 | setAllRadius(e.target.value)} 97 | /> 98 | 99 | 100 | 101 | Unit 102 | 103 | setUnit(e.target.value)} 107 | > 108 | } 111 | label="PX" 112 | /> 113 | } 116 | label="%" 117 | /> 118 | 119 | 120 | 121 | ) : ( 122 | <> 123 | 129 | Top-left 130 | 131 | setTopLeft(e.target.value)} 141 | /> 142 | 148 | Top-right 149 | 150 | setTopRight(e.target.value)} 160 | /> 161 | 167 | Bottom-right 168 | 169 | setBottomRight(e.target.value)} 179 | /> 180 | 186 | Bottom-left 187 | 188 | setBottomLeft(e.target.value)} 198 | /> 199 | 200 | 201 | 202 | Unit 203 | 204 | setUnit(e.target.value)} 208 | > 209 | } 212 | label="PX" 213 | /> 214 | } 217 | label="%" 218 | /> 219 | 220 | 221 | 222 | )} 223 | 224 | {/* results */} 225 | 226 | 242 | 250 | 251 | 252 | 253 | ); 254 | }; 255 | 256 | export default BorderRadius; 257 | -------------------------------------------------------------------------------- /src/components/ColorGenerator/SingleColor.js: -------------------------------------------------------------------------------- 1 | import { Box } from "@mui/system"; 2 | import rgbToHex from "../../utils/colorFormat"; 3 | import { Typography } from "@mui/material"; 4 | import { copyToClipboard } from "./../../utils/copyToClipboard"; 5 | 6 | const SingleColor = ({ rgb }) => { 7 | const hex = rgbToHex(...rgb); 8 | return ( 9 | 18 | copyToClipboard(`background-color: rgb(${rgb.join(", ")})`) 19 | } 20 | display="flex" 21 | alignItems="center" 22 | justifyContent="center" 23 | > 24 | 34 | {hex} 35 | 36 | 37 | ); 38 | }; 39 | export default SingleColor; 40 | -------------------------------------------------------------------------------- /src/components/ColorGenerator/index.js: -------------------------------------------------------------------------------- 1 | import { v4 as uuidv4 } from "uuid"; 2 | import Values from "values.js"; 3 | import SearchIcon from "@mui/icons-material/Search"; 4 | import colorListImg from "../../assets/img/colors.svg"; 5 | import UseTitle from "../../hooks/useTitle"; 6 | import { Container } from "@mui/system"; 7 | import { Box, Grid, TextField } from "@mui/material"; 8 | import { useState } from "react"; 9 | import SingleColor from "./SingleColor"; 10 | import { notify } from "../../utils/toast"; 11 | 12 | const ColorGenerator = () => { 13 | const [color, setColor] = useState(""); 14 | const [error, setError] = useState(false); 15 | const [list, setList] = useState([]); 16 | const handleSubmit = (e) => { 17 | e.preventDefault(); 18 | try { 19 | let colors = new Values(color).all(10); 20 | setError(false); 21 | setList(colors); 22 | } catch (error) { 23 | setError(true); 24 | notify("error", "Please enter a valid color!"); 25 | } 26 | }; 27 | UseTitle("Magic CSS - Color Generator"); 28 | 29 | return ( 30 | 31 | 32 | 33 | setColor(e.target.value)} 42 | InputProps={{ 43 | endAdornment: ( 44 | 49 | ), 50 | }} 51 | /> 52 | 53 | {list.length ? ( 54 | list.map((item) => ) 55 | ) : ( 56 | colors 57 | )} 58 | 59 | 60 | 61 | 62 | ); 63 | }; 64 | 65 | export default ColorGenerator; 66 | -------------------------------------------------------------------------------- /src/components/ColorPicker.js: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from "react"; 2 | import { Button, Grid } from "@mui/material"; 3 | import { SketchPicker } from "react-color"; 4 | import UseTitle from "../hooks/useTitle"; 5 | import AssignmentIcon from "@mui/icons-material/Assignment"; 6 | import { Container } from "@mui/system"; 7 | import { copyToClipboard } from './../utils/copyToClipboard'; 8 | 9 | const ColorPicker = () => { 10 | const [firstColor, setFirstColor] = useState(""); 11 | const [finalSource, setFinalSource] = useState(); 12 | const changeHandle = (e) => { 13 | setFirstColor(e.hex); 14 | }; 15 | useEffect(() => { 16 | setFinalSource(firstColor); 17 | }, [firstColor]); 18 | UseTitle("Magic CSS - Color Picker"); 19 | 20 | return ( 21 | 22 | 23 | 24 | 25 | 33 | 34 | 35 | 36 | ); 37 | }; 38 | 39 | export default ColorPicker; 40 | -------------------------------------------------------------------------------- /src/components/Gradient.js: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from "react"; 2 | import { 3 | Button, 4 | Container, 5 | FormControl, 6 | FormControlLabel, 7 | FormLabel, 8 | Grid, 9 | Radio, 10 | RadioGroup, 11 | Slider, 12 | Typography, 13 | } from "@mui/material"; 14 | import { Box } from "@mui/system"; 15 | import AssignmentIcon from "@mui/icons-material/Assignment"; 16 | import { SketchPicker } from "react-color"; 17 | import UseTitle from "../hooks/useTitle"; 18 | import { copyToClipboard } from './../utils/copyToClipboard'; 19 | 20 | const Gradient = () => { 21 | const [firstColor, setFirstColor] = useState(""); 22 | const [secondColor, setSecondColor] = useState(""); 23 | const [angle, setAngle] = useState(0); 24 | const [gradientType, setGradientType] = useState("Linear"); 25 | const [finalSource, setFinalSource] = useState(); 26 | useEffect(() => { 27 | gradientType === "Linear" 28 | ? setFinalSource( 29 | `background:linear-gradient(${angle}deg,${firstColor},${secondColor})` 30 | ) 31 | : setFinalSource( 32 | `background:radial-gradient(circle,${firstColor},${secondColor})` 33 | ); 34 | }, [firstColor, secondColor, angle, gradientType]); 35 | UseTitle("Magic CSS - gradient"); 36 | 37 | return ( 38 | 39 | 40 | 41 | 52 | 53 | 54 | 63 | 64 | 65 | Type 66 | 67 | setGradientType(e.target.value)} 71 | > 72 | } 75 | label="Linear" 76 | /> 77 | } 80 | label="Radial" 81 | /> 82 | 83 | 84 | {gradientType === "Linear" && ( 85 | 86 | 91 | Angle 92 | 93 | setAngle(e.target.value)} 103 | /> 104 | 105 | )} 106 | 114 | 115 | 116 | 117 | 118 | setFirstColor(e.hex)} 123 | /> 124 | 125 | 126 | setSecondColor(e.hex)} 131 | /> 132 | 133 | 134 | 135 | 136 | 137 | 138 | ); 139 | }; 140 | 141 | export default Gradient; 142 | -------------------------------------------------------------------------------- /src/components/ImageFilter.js: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from "react"; 2 | import { 3 | Box, 4 | Button, 5 | Container, 6 | Grid, 7 | IconButton, 8 | Slider, 9 | Typography, 10 | } from "@mui/material"; 11 | import PhotoCamera from "@mui/icons-material/PhotoCamera"; 12 | import AssignmentIcon from "@mui/icons-material/Assignment"; 13 | import RestartAltIcon from "@mui/icons-material/RestartAlt"; 14 | import UseTitle from "../hooks/useTitle"; 15 | import { copyToClipboard } from './../utils/copyToClipboard'; 16 | 17 | const ImageFilter = () => { 18 | const [greyscaleVal, setGreyscaleVal] = useState(0); 19 | const [blurVal, setBlurVal] = useState(0); 20 | const [sepiaVal, setSepiaVal] = useState(0); 21 | const [saturateVal, setSaturateVal] = useState(1); 22 | const [opacityVal, setOpacityVal] = useState(1); 23 | const [brightnessVal, setBrightnessVal] = useState(100); 24 | const [contrastVal, setContrastVal] = useState(100); 25 | const [hueVal, setHueVal] = useState(0); 26 | const [invertVal, setInvertVal] = useState(0); 27 | const [img, setImg] = useState(); 28 | const [finalSource, setFinalSource] = useState(""); 29 | 30 | useEffect(() => { 31 | setFinalSource( 32 | `filter: grayscale(${greyscaleVal}%) blur(${blurVal}px) sepia(${sepiaVal}) saturate(${saturateVal}) opacity(${opacityVal}) brightness(${brightnessVal}%) contrast(${contrastVal}%) hue-rotate(${hueVal}deg) invert(${invertVal}%)` 33 | ); 34 | }, [ 35 | greyscaleVal, 36 | blurVal, 37 | sepiaVal, 38 | saturateVal, 39 | opacityVal, 40 | brightnessVal, 41 | contrastVal, 42 | hueVal, 43 | invertVal, 44 | ]); 45 | // upload image 46 | function onImageChange(e) { 47 | setImg(URL.createObjectURL(e.target.files[0])); 48 | } 49 | const resetBtn = () => { 50 | setGreyscaleVal(0); 51 | setBlurVal(0); 52 | setSepiaVal(0); 53 | setSaturateVal(1); 54 | setOpacityVal(1); 55 | setBrightnessVal(100); 56 | setContrastVal(100); 57 | setHueVal(0); 58 | setInvertVal(0); 59 | }; 60 | UseTitle("Magic CSS - Image filter"); 61 | return ( 62 | 63 | 69 | 70 | 71 | Grayscale 72 | 73 | setGreyscaleVal(e.target.value)} 83 | /> 84 | 85 | 86 | Blur 87 | 88 | setBlurVal(e.target.value)} 98 | /> 99 | 100 | 101 | Sepia 102 | 103 | setSepiaVal(e.target.value)} 114 | /> 115 | 116 | 117 | Saturate 118 | 119 | setSaturateVal(e.target.value)} 130 | /> 131 | 132 | 133 | Opacity 134 | 135 | setOpacityVal(e.target.value)} 146 | /> 147 | 148 | 149 | Brightness 150 | 151 | setBrightnessVal(e.target.value)} 161 | /> 162 | 163 | 164 | Contrast 165 | 166 | setContrastVal(e.target.value)} 176 | /> 177 | 178 | 179 | Hue-rotate 180 | 181 | setHueVal(e.target.value)} 191 | /> 192 | 193 | 194 | Invert 195 | 196 | setInvertVal(e.target.value)} 206 | /> 207 | 212 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 233 | 234 | 235 | 236 | Upload an img please! 245 | 246 | 247 | 248 | 249 | ); 250 | }; 251 | 252 | export default ImageFilter; 253 | -------------------------------------------------------------------------------- /src/components/MarkdownGenerator/Html.js: -------------------------------------------------------------------------------- 1 | import ReactMarkdown from "react-markdown"; 2 | 3 | const Html = ({ children }) => { 4 | return ( 5 | <> 6 | {children} 7 | 8 | ); 9 | }; 10 | 11 | export default Html; 12 | -------------------------------------------------------------------------------- /src/components/MarkdownGenerator/Text.js: -------------------------------------------------------------------------------- 1 | import { Grid } from "@mui/material"; 2 | import { Box } from "@mui/system"; 3 | import React, { useState } from "react"; 4 | import Html from "./Html"; 5 | 6 | const Text = () => { 7 | const [inputVal, setInputVal] = useState(""); 8 | 9 | return ( 10 | 11 | 12 | 13 |