diff --git a/package.json b/package.json
index e0b7db5..7c4d9e0 100644
--- a/package.json
+++ b/package.json
@@ -10,6 +10,7 @@
"font-picker-react": "^3.4.1",
"react": "^16.10.2",
"react-color": "^2.17.3",
+ "react-copy-to-clipboard": "^5.0.2",
"react-dom": "^16.10.2",
"react-dragula": "^1.1.17",
"react-redux": "^7.1.3",
@@ -17,6 +18,7 @@
"react-router-dom": "^5.1.2",
"react-scripts": "3.2.0",
"react-select": "^3.0.8",
+ "react-syntax-highlighter": "^12.2.1",
"redux": "^4.0.5",
"styled-components": "^4.4.1"
},
diff --git a/src/Components/Modal/index.js b/src/Components/Modal/index.js
index acb1155..8c18ab8 100644
--- a/src/Components/Modal/index.js
+++ b/src/Components/Modal/index.js
@@ -4,7 +4,7 @@ import {
ModalWrapper,
CodeModalWrapper,
ModalHeading,
- ModalBody
+ ModalBody,
} from './styles';
export default class Modal extends React.Component {
@@ -12,7 +12,7 @@ export default class Modal extends React.Component {
super(props);
this.state = {
- active: false
+ active: false,
};
this.modal = React.createRef();
@@ -22,11 +22,11 @@ export default class Modal extends React.Component {
document.addEventListener('mousedown', this.handleClickOutside);
}
- toggleModal = status => {
+ toggleModal = (status) => {
this.setState({ active: status });
};
- handleClickOutside = e => {
+ handleClickOutside = (e) => {
if (this.modal.current && !this.modal.current.contains(e.target)) {
this.setState({ active: false });
}
diff --git a/src/reset.css.js b/src/reset.css.js
index 921789d..3d2e0bd 100644
--- a/src/reset.css.js
+++ b/src/reset.css.js
@@ -7,6 +7,11 @@ export default createGlobalStyle`
-webkit-text-size-adjust: 100%;
}
+ pre{
+ background-color: white !important;
+ margin: 0;
+ }
+
.fzZQDB.active {
z-index: 3;
}
diff --git a/src/store/premadeSchemes.js b/src/store/premadeSchemes.js
index e76cf28..15438ae 100644
--- a/src/store/premadeSchemes.js
+++ b/src/store/premadeSchemes.js
@@ -17,7 +17,7 @@ export const premadeSchemes = {
colorFive: '#FFEB8C',
colorSix: '#FFF4C1',
colorSeven: '#D4D4D4',
- colorEight: '#EFF3EF'
+ colorEight: '#EFF3EF',
},
one: {
colorOne: '#222831',
@@ -27,7 +27,7 @@ export const premadeSchemes = {
colorFive: '#f6c89f',
colorSix: '#ffe7d1',
colorSeven: '#e5dfdf',
- colorEight: '#f8f8f8'
+ colorEight: '#f8f8f8',
},
two: {
colorOne: '#EE8572',
@@ -37,7 +37,7 @@ export const premadeSchemes = {
colorFive: '#347474',
colorSix: '#489393',
colorSeven: '#E9E2D0',
- colorEight: '#FEF8E8'
+ colorEight: '#FEF8E8',
},
three: {
colorOne: '#364F6B',
@@ -47,7 +47,7 @@ export const premadeSchemes = {
colorFive: '#E5E5E5',
colorSix: '#F5F5F5',
colorSeven: '#FC5185',
- colorEight: '#FF7AA3'
+ colorEight: '#FF7AA3',
},
four: {
colorOne: '#FF8364',
@@ -57,6 +57,6 @@ export const premadeSchemes = {
colorFive: '#5F6CAF',
colorSix: '#7C88CA',
colorSeven: '#E4EDEF',
- colorEight: '#EDF7FA'
- }
+ colorEight: '#EDF7FA',
+ },
};
diff --git a/src/store/typeData.js b/src/store/typeData.js
index df1aeba..539f3e9 100644
--- a/src/store/typeData.js
+++ b/src/store/typeData.js
@@ -1,189 +1,268 @@
const typeData = {
nav: {
- html: ` `,
- css: `.nav {
- width: 100%;
- height: 200px;
- padding: 30px;
-}`
+ html: `
Nav
`,
+ css: `.nav {
+ background-color: white;
+ height: 100px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}`,
},
header: {
- html: ``,
- css: `.header {
- width: 100%;
- height: 400px;
- padding: 30px;
-}`
+ html: ``,
+ css: '',
},
article: {
- html: ` `,
- css: `.article {
- width: 100%;
- height: 500px;
- padding: 30px;
-}`
+ html: `Article `,
+ css: '',
},
section: {
- html: ``,
- css: `.section {
- width: 100%;
- height: 400px;
- padding: 30px;
-}`
+ html: ``,
+ css: '',
},
table: {
- html: ``,
- css: `.table {
- width: 100%;
- height: 400px;
- padding: 30px;
-}`
+ html: `
+
+ Title
+ Title
+ Title
+
+
+ Value
+ Value
+ Value
+
+
+ Value
+ Value
+ Value
+
+
+ Value
+ Value
+ Value
+
+
`,
+ css: `th, td {
+ padding: 0px 25px;
+}`,
},
footer: {
- html: ``,
- css: `.footer {
- width: 100%;
- height: 200px;
- padding: 30px;
-}`
+ html: ``,
+ css: '',
},
div: {
- html: `
`,
- css: `div {
- width: 100%;
- height: 400px;
- padding: 30px;
-}`
+ html: `Div
`,
+ css: `.div {
+ background-color: white;
+ height: 100px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+ `,
},
splitDiv: {
- html: `
-
Left Content
-
Right Content
+ html: `
`,
- css: `.splitDiv {
- width: 100%;
- height: 400px;
- padding: 30px;
+ css: `.split-div{
display: flex;
- justify-content: center;
+ flex-direction: row;
align-items: center;
-
- .splitDiv > div {
- width: 50%;
- }
-}`
+ justify-content: space-between;
+}
+
+.split-div > .div{
+ width: 47%;
+}`,
},
triDiv: {
- html: `
-
Left Content
-
Center Content
-
Right Content
-
`,
- css: `.triDiv {
- width: 100%;
- height: 400px;
- padding: 30px;
+ html: `
`,
+ css: `.tri-div{
display: flex;
- justify-content: center;
+ flex-direction: row;
align-items: center;
-
- .triDiv > div {
- width: 30%;
- }
-}`
+ justify-content: space-between;
+ }
+
+.tri-div > .div{
+ width: 29%;
+}`,
},
image: {
- html: `
`,
- css: `img {
- width: 100%;
- height: 400px;
- padding: 30px;
- background-image: url(IMAGEURL);
-}`
+ html: `
+
+
`,
+ css: `.image{
+ height: auto !important;
+ padding: 10px 0;
+}
+
+.image > img{
+ height: 200px;
+}`,
},
cta: {
- html: `
-
Heading Text
-
Description Text
-
Click Me!
+ html: `
+
Title
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean iaculis gravida dui, sed convallis nunc commodo vel. Nulla in orci ligula. Vivamus eu aliquet magna.
+
+
Click me
+
`,
+ css: `.text{
+ flex-direction: column;
+ height: auto;
+}
+
+.text > p{
+ margin-top: 0;
+ max-width: 500px;
+}
+
+button{
+ margin: 10px 0 30px 0;
+}`,
+ },
+ imageText: {
+ html: `
+
+
+
+
Title
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean iaculis gravida dui, sed convallis nunc commodo vel. Nulla in orci ligula. Vivamus eu aliquet magna.
+
+
+
`,
+ css: `.image{
+ height: auto !important;
+ padding: 10px 0;
+}
+
+.image > img{
+ height: 200px;
+}`,
+ },
+ navContent: {
+ html: `
`,
- css: `.cta {
- width: 100%;
- height: 400px;
- padding: 30px;
+ css: `.nav {
+ background-color: white;
+ height: 100px;
display: flex;
- flex-direction: row;
align-items: center;
justify-content: center;
+}
- .cta > h1{
- font-size: 20px;
- padding: 20px;
- }
-
- .cta > p{
- font-size: 15px;
- padding: 20px;
- margin: 10px;
- }
-}`
- },
- imageText: {
- html: `
`,
- css: `.imageText {
- width: 100%;
- height: 400px;
- padding: 30px;
+.nav > ul {
+ width: 100%;
+ height: 100%;
+ display: flex;
+ flex-direction: row;
+ padding: 0;
+ margin: 0;
+}
+
+ul > .left,
+ul > .right {
+ width: 50%;
+ height: 100%;
display: flex;
- justify-content: space-evently;
+ justify-content: center;
align-items: center;
+}
+
+ul > .left {
+ justify-content: flex-start;
+}
- .imageText > .flexLeft{
- width: 50%;
- background-image: url(URLHERE);
- height: 100%;
- }
+ul > .right {
+ justify-content: flex-end;
+}
- .imageText > .flexRight{
- width: 50%;
- }
-}`
+li {
+ list-style-type: none;
+ margin: 0 20px;
+}
+
+.logo {
+ font-size: 30px;
+}`,
},
- navContent: {
- html: 'code',
- css: `.navContent {
- width: 100%;
- height: 200px;
- padding: 30px;
+ footerContent: {
+ html: ``,
+ css: `.nav > ul {
+ width: 100%;
+ height: 100%;
display: flex;
- justify-content: space-between;
+ flex-direction: row;
+ padding: 0;
+ margin: 0;
+}
+
+ul > .left,
+ul > .right {
+ width: 50%;
+ height: 100%;
+ display: flex;
+ justify-content: center;
align-items: center;
+}
- .navContent > .logo {
- width: 50px;
- height: 50px;
- }
-
- .navContent > .link {
- width: 20%;
- height: 50px;
+ul > .left {
+ justify-content: flex-start;
+}
- }
-}`
+ul > .right {
+ justify-content: flex-end;
+}
+
+li {
+ list-style-type: none;
+ margin: 0 20px;
+}
+
+.logo {
+ font-size: 30px;
+}
+
+.footer > ul {
+ flex-direction: column;
+}
+
+.footer > ul > .right{
+ justify-content: flex-start;
+}`,
},
- footerContent: {
- html: 'code',
- css: `.footerContent {
- width: 100%;
- height: 200px;
- padding: 30px;
-}`
- }
};
export default typeData;
diff --git a/src/views/Builder/index.js b/src/views/Builder/index.js
index bbf6947..040b61d 100644
--- a/src/views/Builder/index.js
+++ b/src/views/Builder/index.js
@@ -13,17 +13,23 @@ import {
SettingType,
SettingVal,
SettingInput,
- SettingTextArea
+ SettingTextArea,
+ Export,
} from './styles';
import { FlexLeft, FlexRight } from '../../Components/FlexSplit/FlexSplit';
import { Button, Paragraph } from '../../Styling';
+import { CopyToClipboard } from 'react-copy-to-clipboard';
+import SyntaxHighlighter from 'react-syntax-highlighter';
+import { tomorrow } from 'react-syntax-highlighter/dist/esm/styles/hljs';
class Builder extends React.Component {
constructor(props) {
super(props);
const items = JSON.parse(localStorage.getItem('items')); // gets item listing from local storage
this.state = {
- code: { items }
+ code: { items },
+ value: 'hi',
+ copied: false,
};
this.titleInput = React.createRef();
@@ -38,7 +44,7 @@ class Builder extends React.Component {
this.settingsModal.current.toggleModal(true);
};
- handleSettingsChange = event => {
+ handleSettingsChange = (event) => {
const { settings } = { ...this.state };
const currentState = settings;
@@ -53,6 +59,7 @@ class Builder extends React.Component {
this.codeModal.current.toggleModal(true);
const items = JSON.parse(localStorage.getItem('items')); // gets item listing from local storage
this.setState({ code: { items } });
+ this.setState({ value: { items } });
};
handleCodeChange = () => {
@@ -61,7 +68,7 @@ class Builder extends React.Component {
this.setState({ settings: currentState });
};
- handleInput = e => {
+ handleInput = (e) => {
const { dispatch } = this.props;
const { name, value } = e.target;
e.persist();
@@ -69,7 +76,7 @@ class Builder extends React.Component {
dispatch(changePreference(name, value));
};
- addBuilderElem = elem => {
+ addBuilderElem = (elem) => {
if (this.editor.current) {
this.editor.current.addNewElem(elem);
}
@@ -152,74 +159,98 @@ class Builder extends React.Component {
HTML
-
-
- {`
-
-
- ${preferences.projectTitle}
-
-
-
-
-`}{' '}
- {code.items &&
- code.items.map(
- ({ uniqueID, type }, index) => {
- return (
-
-
- {
- typeData[
- type
- ].html
- }
-
-
- );
- }
- )}
- {`
-
-
-