diff --git a/README.md b/README.md index 54ef094..16af675 100644 --- a/README.md +++ b/README.md @@ -1,68 +1,53 @@ -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). +

Markdown Editor

+
+

A React app which can preview and edit markdown.

+
-## Available Scripts -In the project directory, you can run: +## 🍫 Requirements -### `npm start` +* Node.js +* Git -Runs the app in the development mode.
-Open [http://localhost:3000](http://localhost:3000) to view it in the browser. - -The page will reload if you make edits.
-You will also see any lint errors in the console. - -### `npm test` - -Launches the test runner in the interactive watch mode.
-See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. - -### `npm run build` - -Builds the app for production to the `build` folder.
-It correctly bundles React in production mode and optimizes the build for the best performance. - -The build is minified and the filenames include the hashes.
-Your app is ready to be deployed! - -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. +## ⚒ Common setup -### `npm run eject` +Clone the repo and install the dependencies. -**Note: this is a one-way operation. Once you `eject`, you can’t go back!** +```bash +git clone https://github.com/aromalanil/Markdown-Editor.git +cd Markdown-Editor +``` -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. +```bash +npm install +``` -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. +## 💻 Run -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. +### Run in development mode 🧪 -## Learn More +Execute the following command to run the app in the development mode.
+``` +npm start +``` +
-You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). - -To learn React, check out the [React documentation](https://reactjs.org/). - -### Code Splitting - -This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting - -### Analyzing the Bundle Size - -This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size - -### Making a Progressive Web App +Open [http://localhost:3000](http://localhost:3000) to view it in the browser. -This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app +The page will reload if you make edits.
-### Advanced Configuration +You will also see any lint errors in the console. -This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration +### Generate a Build 📦 -### Deployment +``` +npm run build +``` +
+Builds the app for production to the `build` folder.
-This section has moved here: https://facebook.github.io/create-react-app/docs/deployment +It correctly bundles React in production mode and optimizes the build for the best performance. -### `npm run build` fails to minify +The build is minified and the filenames include the hashes.
-This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify +Now the app is ready to be deployed! \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index fe346db..0cba043 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "markdown-editor", - "version": "1.0.0", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -8528,6 +8528,11 @@ "object-visit": "^1.0.0" } }, + "marked": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.8.2.tgz", + "integrity": "sha512-EGwzEeCcLniFX51DhTpmTom+dSA/MG/OBUDjnWtHbEnjAH180VzUeAw+oE4+Zv+CoYBWyRlYOTR0N8SO9R1PVw==" + }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -12596,101 +12601,6 @@ "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==" }, - "showdown": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/showdown/-/showdown-1.9.1.tgz", - "integrity": "sha512-9cGuS382HcvExtf5AHk7Cb4pAeQQ+h0eTr33V1mu+crYWV4KvWAw6el92bDrqGEk5d46Ai/fhbEUwqJ/mTCNEA==", - "requires": { - "yargs": "^14.2" - }, - "dependencies": { - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "requires": { - "locate-path": "^3.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "yargs": { - "version": "14.2.3", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", - "integrity": "sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==", - "requires": { - "cliui": "^5.0.0", - "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^15.0.1" - } - }, - "yargs-parser": { - "version": "15.0.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.1.tgz", - "integrity": "sha512-0OAMV2mAZQrs3FkNpDQcBk1x5HXb8X4twADss4S0Iuk+2dGnLOE/fRHrsYm542GduMveyA77OF4wrNJuanRCWw==", - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } - }, "side-channel": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.2.tgz", diff --git a/package.json b/package.json index 4d2b6c4..f15707f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "markdown-editor", - "version": "1.0.2", + "version": "1.1.0", "description": "A react app to preview and edit Markdown", "private": true, "author": { @@ -12,12 +12,12 @@ "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.5.0", "@testing-library/user-event": "^7.2.1", + "marked": "^0.8.2", "node-sass": "^4.13.1", "react": "^16.13.1", "react-dom": "^16.13.1", "react-scripts": "3.4.1", - "react-split": "^2.0.7", - "showdown": "^1.9.1" + "react-split": "^2.0.7" }, "scripts": { "start": "react-scripts start", diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index bcd5dfd..0000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/public/favicon/android-chrome-192x192.png b/public/favicon/android-chrome-192x192.png new file mode 100644 index 0000000..8a02119 Binary files /dev/null and b/public/favicon/android-chrome-192x192.png differ diff --git a/public/favicon/android-chrome-512x512.png b/public/favicon/android-chrome-512x512.png new file mode 100644 index 0000000..daf315f Binary files /dev/null and b/public/favicon/android-chrome-512x512.png differ diff --git a/public/favicon/apple-touch-icon.png b/public/favicon/apple-touch-icon.png new file mode 100644 index 0000000..5d0e958 Binary files /dev/null and b/public/favicon/apple-touch-icon.png differ diff --git a/public/favicon/favicon-16x16.png b/public/favicon/favicon-16x16.png new file mode 100644 index 0000000..bed844d Binary files /dev/null and b/public/favicon/favicon-16x16.png differ diff --git a/public/favicon/favicon-32x32.png b/public/favicon/favicon-32x32.png new file mode 100644 index 0000000..fa91155 Binary files /dev/null and b/public/favicon/favicon-32x32.png differ diff --git a/public/favicon/favicon.ico b/public/favicon/favicon.ico new file mode 100644 index 0000000..f051bab Binary files /dev/null and b/public/favicon/favicon.ico differ diff --git a/public/index.html b/public/index.html index 362113d..fb26ab9 100644 --- a/public/index.html +++ b/public/index.html @@ -1,21 +1,21 @@ - - - - - - - - - - - Markdown Editor - - - -
- - - + + + \ No newline at end of file diff --git a/public/logo192.png b/public/logo192.png deleted file mode 100644 index fc44b0a..0000000 Binary files a/public/logo192.png and /dev/null differ diff --git a/public/logo512.png b/public/logo512.png deleted file mode 100644 index a4e47a6..0000000 Binary files a/public/logo512.png and /dev/null differ diff --git a/public/manifest.json b/public/manifest.json index 67d6062..0e5868b 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -3,23 +3,18 @@ "name": "Markdown Editor", "icons": [ { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - }, - { - "src": "logo192.png", - "type": "image/png", - "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" - } + "src": "favicon/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "favicon/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } ], "start_url": ".", "display": "standalone", - "theme_color": "#000000", + "theme_color": "#339989", "background_color": "#ffffff" } diff --git a/src/App.scss b/src/App.scss index b014d47..989ca43 100644 --- a/src/App.scss +++ b/src/App.scss @@ -8,8 +8,8 @@ $primary-accent: #7de2d1; $primary-text: #131515; $text-accent: #2b2c28; $white: #fffafb; -$source-code-font: "Open Sans", sans-serif; -$open-sans-font: "Source Code Pro", monospace; +$source-code-font: "Source Code Pro", monospace; +$open-sans-font: "Open Sans", sans-serif; // General Styling * { @@ -19,22 +19,46 @@ $open-sans-font: "Source Code Pro", monospace; body { margin: 0; color: $primary-text; - font-family: $source-code-font; + font-family: $open-sans-font; } -//Custom Scrollbar -/* width */ ::-webkit-scrollbar { width: 0%; } +.btn{ + cursor: pointer; + font-size: .9rem; + padding: .2rem 1rem; + border-radius: .2rem; + color: $white; + background-color: $primary-color; + border:none; + transition: filter 200ms ease; + + &:hover{ + filter: brightness(.9); + } +} + + .navbar { margin: 0; background-color: $primary-color; color: $white; - padding: 1rem 5vw; + height: 60px; + padding-left: 1.5rem; + display: flex; + align-items: center; + justify-content: space-between; .title { margin: 0; + line-height: 30px; + display: flex; + align-items: center; + img{ + height: 30px; + } } } @@ -48,14 +72,14 @@ body { } .wrapper-card { - width: 95%; - height: 90%; + width: 100%; + height: 100%; display: flex; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24); } .markdown-edit, .markdown-preview { - padding: 1.5rem; + padding: 2rem; display: flex; flex-direction: column; position: relative; @@ -68,10 +92,12 @@ body { display: flex; align-items: center; justify-content: space-between; - padding:0 1rem; + font-size: 0.8rem; + padding: 0 1rem; height: 2.5rem; width: 100%; - background-color: green; + background-color: $primary-accent; + color: $text-accent; text-transform: uppercase; h3 { font-weight: 600; @@ -82,6 +108,7 @@ body { .markdown-edit { width: 100%; textarea { + border: none; background-color: $white; font-size: 1rem; font-weight: 400; @@ -90,6 +117,9 @@ body { width: 100%; resize: none; height: 100%; + &:focus { + outline: none; + } } } @@ -117,8 +147,8 @@ body { } .markdown-edit, .markdown-preview { + padding:1rem 1.3rem; width: 100% !important; - padding: 1rem; display: flex; flex-direction: column; position: relative; diff --git a/src/components/MarkdownEdit.jsx b/src/components/MarkdownEdit.jsx index d765a06..eca7929 100644 --- a/src/components/MarkdownEdit.jsx +++ b/src/components/MarkdownEdit.jsx @@ -6,15 +6,21 @@ function MarkdownEdit({ content, changeContent }) { changeContent(event.target.value); }; + const handleClearButton=()=>{ + changeContent(""); + document.getElementById("editor").focus(); + } + return (

Markdown

-