Skip to content

Commit

Permalink
Revamped the styling: changed color palette, adjusted padding and margin
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio-Riccelli committed Jan 14, 2022
1 parent c44ad32 commit ee7b644
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 32 deletions.
19 changes: 16 additions & 3 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
.App {
margin: 0 auto;
padding: 0;
text-align: center;
width: 75vw;
width: 90vw;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-family: monospace;
margin-top: 20px;
}

#title, #editor-title, #previewer-title {
background-color: #373D49;
color: white;
padding: 10px;
border-radius: 30px;
}

#wrapper {
display: flex;
flex-direction: row;
justify-content: space-between;
}


44 changes: 37 additions & 7 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,50 @@ import './App.css';
import Editor from './Components/Editor/index';
import Previewer from './Components/Previewer/index';

const initialRendering = `# Hello There
## Hello
[Google](https://www.google.com)
Heres some code, \`<div></div>\`, between 2 __backticks__.
const initialRendering = `
# Welcome to my React Markdown Previewer!
## This is a sub-heading...
### And here's some other cool stuff:
Heres some code, \`<div></div>\`, between 2 backticks.
\`\`\`
// this is multi-line code:
function anotherExample(firstLine, lastLine) {
if (firstLine == '\`\`\`' && lastLine == '\`\`\`') {
if (firstLine == '\`\`\`\\' && lastLine == '\`\`\`') {
return multiLineCode;
}
}
\`\`\`
- to-do item
You can also make text **bold**... whoa!
Or _italic_.
Or... wait for it... **_both!_**
And feel free to go crazy ~~crossing stuff out~~.
There's also [links](https://www.freecodecamp.org), and
> Block Quotes!
And if you want to get really crazy, even tables:
Wild Header | Crazy Header | Another Header?
------------ | ------------- | -------------
Your content can | be here, and it | can be here....
And here. | Okay. | I think we get it.
- And of course there are lists.
- Some are bulleted.
- With different indentation levels.
- That look like this.
1. And there are numbered lists too.
1. Use just 1s if you want!
1. And last but not least, let's not forget embedded images:
![weird medieval image](https://64.media.tumblr.com/513dcf6a91fc4b6feb2bd71b5dff1856/tumblr_npjeybLLfI1qdm7pqo1_500.jpg)
`

Expand All @@ -40,10 +68,12 @@ setPreviewerText(editorText);

return (
<div className="App">
<h1>Markdown Previewer</h1>
<h1 id="title">Markdown Previewer</h1>
<div id="wrapper">
<Editor value={initialRendering} onChange={handleChange} />
<Previewer text={previewerText} />
</div>
</div>
);
}

Expand Down
20 changes: 15 additions & 5 deletions src/Components/Editor/index.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
#editor-wrapper {
width: 45%;
border-radius: 20px;
height: 500px;
margin-top: 25px;
}

#editor {
width: 50vw;
min-height: 100px;
margin-top: 25px;
width: 100%;
border-radius: 10px;
padding: 15px;
padding-left: 15px;
padding-top: 15px;
box-shadow: 0px 0px 15px 2px #000;
margin-bottom: 20px;
height: 500px;
border: 2px solid black;
}
overflow:scroll;
}

6 changes: 3 additions & 3 deletions src/Components/Editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import './index.css';
export default function Editor(props) {

return (
<div>
<h2>Editor</h2>
<section id="editor-wrapper">
<h2 id="editor-title">Editor</h2>
<textarea id="editor" defaultValue={props.value} name="editor" onChange={props.onChange}>
</textarea>
</div>
</section>
)
}
13 changes: 9 additions & 4 deletions src/Components/Previewer/index.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
#preview-wrapper {
width: 60vw;
min-height: 20px;
width: 45%;
border-radius: 20px;
height: 500px;
margin-top: 25px;
}

#preview {
margin-top: 25px;
border: 2px solid black;
width: 100%;
min-height: 200px;
border-radius: 20px;
box-shadow: 0px 0px 15px 1px #000;
text-align: left;
padding-left: 20px;
padding-left: 30px;
padding-top: 15px;
background-color: #FFF;
height: 500px;
overflow:scroll;
line-height: 1.8rem;
}


2 changes: 1 addition & 1 deletion src/Components/Previewer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let finalString = marked.parse(props.text)

return (
<section id="preview-wrapper" >
<h1>Previewer</h1>
<h2 id="previewer-title">Previewer</h2>
<div id="preview" dangerouslySetInnerHTML={{__html: finalString}} >
</div>
</section>
Expand Down
26 changes: 17 additions & 9 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
html {
* {
margin: 0;
padding: 0;
box-sizing: content-box;
background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
background-size: 400% 400%;
animation: gradient 15s ease infinite;
height: 100vh;

}

html {
box-sizing: border-box;
scroll-behavior: smooth;
}

*,
*:before,
*:after {
box-sizing: inherit;
}

body {
Expand All @@ -16,16 +23,17 @@ body {
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
width: 100vw;
height: 100vh;
/* width: 100vw;
height: 100vh; */
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
background-color: lightgrey;
padding: 5px;
padding: 1px;
border-radius: 5px;

}

@keyframes gradient {
Expand Down
10 changes: 10 additions & 0 deletions vanilla-js-version/css/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
html {
box-sizing: border-box;
}

*,
*:before,
*:after {
box-sizing: inherit;
}

12 changes: 12 additions & 0 deletions vanilla-js-version/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Markdown previewer</title>
</head>
<body>

</body>
</html>
Empty file added vanilla-js-version/js/index.js
Empty file.

0 comments on commit ee7b644

Please sign in to comment.