diff --git a/README.md b/README.md index 0833cde..aab240d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,8 @@ # Wix-clone A react and nodejs based site that will allow user to create their own website even if they don't know how to code + +**Prerequisites** + +* Node + +* Yarn diff --git a/client/README.md b/client/README.md index 9c40dcd..d9530a6 100644 --- a/client/README.md +++ b/client/README.md @@ -1,68 +1,11 @@ -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). +To install dependancies -## Available Scripts +``` +yarn install +``` -In the project directory, you can run: +To run client server -### `yarn start` - -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. - -### `yarn 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. - -### `yarn 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. - -### `yarn eject` - -**Note: this is a one-way operation. Once you `eject`, you can’t go back!** - -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. - -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. - -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. - -## Learn More - -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 - -This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app - -### Advanced Configuration - -This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration - -### Deployment - -This section has moved here: https://facebook.github.io/create-react-app/docs/deployment - -### `yarn build` fails to minify - -This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify +``` +yarn start +``` diff --git a/client/src/Components/Home/Home.js b/client/src/Components/Home/Home.js index 5da3ad6..ae4bd52 100644 --- a/client/src/Components/Home/Home.js +++ b/client/src/Components/Home/Home.js @@ -7,6 +7,7 @@ import IconGenerator from "../IconGenerator"; import "../../scss/main.scss"; import DarkNav from "./DarkNavBar"; import ContactUsForm from "./contactUs"; +import ListItem from "../ListItem"; library.add(fab); function Home() { @@ -78,10 +79,15 @@ function Home() { height: "600px", padding: "50px", }, - icon : { + icon: { // position: "initial", color: "blue", - } + }, + list: { + position: "absolute", + width: "800px", + height: "80px", + }, }; return properties[type]; }; @@ -97,6 +103,7 @@ function Home() { card.style.top = `${_mouseY}px`; card.style.left = `${_mouseX - 200}px `; } + console.log(_mouseX, _mouseY); }; const dragOver = (e) => { e.preventDefault(); @@ -104,12 +111,10 @@ function Home() { const renderSidebarButton = (color, radius, id, label, type) => { return ( @@ -122,9 +127,8 @@ function Home() { contactUs: ( ), - icon: ( - - ), + icon: , + list: , }; return components[type]; }; @@ -161,7 +165,8 @@ function Home() { "Social Icons", "icons" )} - {showIcons&&} + {showIcons && } + {renderSidebarButton("#fff", "30px", "list"+Date.now(), "list item", "list")}
@@ -178,7 +183,7 @@ function Home() { onClick={getPositions} > {arr.map((element, index) => { - console.log(element.type,index) + console.log(element.type, index); return getComponent(element.type, element, index); })}
diff --git a/client/src/Components/IconGenerator.jsx b/client/src/Components/IconGenerator.jsx index d85dfe6..aa486fd 100644 --- a/client/src/Components/IconGenerator.jsx +++ b/client/src/Components/IconGenerator.jsx @@ -1,8 +1,8 @@ import React, { Component } from "react"; -import "../scss/main.scss" +import "../scss/main.scss"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; export class IconGenerator extends Component { - dragStart = (e) => { + dragStart = (e) => { const target = e.target; e.dataTransfer.setData("card_id", target.id); setTimeout(() => { @@ -14,11 +14,31 @@ export class IconGenerator extends Component { const { toggle, styles } = this.props; toggle(styles.aid); }; - dragover = (e) => { + dragover = (e) => { e.stopPropagation(); }; + getIconStyle = () => { + const icn = this.props.styles; + const style = {}; + const properties = [ + "width", + "height", + "backgroundColor", + "top", + "left", + "borderRadius", + "position", + ]; + for (const property of properties) { + style[property] = icn[property]; + } + return style; + }; render() { - console.log(this.props.styles) + console.log(this.props); + console.log(this.props.key); + // console.log(this.props.styles.position); + console.log(this.props.styles); const name = this.props.styles.aid.split("!")[0]; return ( ); } diff --git a/client/src/Components/Icons.jsx b/client/src/Components/Icons.jsx index f2ee66a..80d2717 100644 --- a/client/src/Components/Icons.jsx +++ b/client/src/Components/Icons.jsx @@ -26,14 +26,19 @@ export class Icons extends Component { padding: "0", }} > - {iconTray.map((iconV,idx) => ( + {iconTray.map((iconV, idx) => (
  • {/* {" "} */} { - this.props.btn("black", null, iconV+"!"+ Math.random(), "icon"); + this.props.btn( + "transparent", + null, + iconV + "!" + Math.random(), + "icon" + ); }} > {iconV} diff --git a/client/src/Components/ListItem.jsx b/client/src/Components/ListItem.jsx new file mode 100644 index 0000000..74860c8 --- /dev/null +++ b/client/src/Components/ListItem.jsx @@ -0,0 +1,57 @@ +import React, { Component } from "react"; + +export class ListItem extends Component { + dragStart = (e) => { + const target = e.target; + e.dataTransfer.setData("card_id", target.id); + setTimeout(() => { + target.style.display = "none"; + }, 0); + }; + handleContextMenu = (e) => { + e.preventDefault(); + const { toggle, styles } = this.props; + toggle(styles.aid); + }; + dragover = (e) => { + e.stopPropagation(); + }; + getStyles = () => { + const lst = this.props.styles; + const style = {}; + const properties = [ + "width", + "height", + "backgroundColor", + "top", + "left", + "borderRadius", + "position", + ]; + for (const property of properties) { + style[property] = lst[property]; + } + return style; + }; + render() { + console.log(this.props); + // console.log(this.props.key); + console.log(this.props.styles); + // console.log(this.props.styles.position); + return ( +
    +
  • +
    + ); + } +} + +export default ListItem; diff --git a/client/src/scss/components/_aside.scss b/client/src/scss/components/_aside.scss index 52dde6e..7d88e68 100644 --- a/client/src/scss/components/_aside.scss +++ b/client/src/scss/components/_aside.scss @@ -3,10 +3,12 @@ .Home aside { // display: inline-flex; float: left; - width: 200px; + width: 210px; height: 650px; border-right: 1px dashed #000; flex-flow: column; + overflow-y: scroll; + overflow-x: hidden; } .sidebar { display: flexbox; diff --git a/client/src/scss/components/_listItem.scss b/client/src/scss/components/_listItem.scss new file mode 100644 index 0000000..6f29a06 --- /dev/null +++ b/client/src/scss/components/_listItem.scss @@ -0,0 +1,25 @@ +.listitem { + // text-align: center; + + // padding: 10px; + align-items: center; +} +.listitem input { + border: none; + height: 90%; + width: 90%; + // margin: 5px; + padding: 0; + // box-shadow: 5px 10px 15px rgba(0, 0, 0, 0.5); + font-size: 30px; + background-color: transparent; +} + +.listitem li { + margin: 5px; + padding: 0px; + width: 100%; + height: 100%; + font-size: 30px; + background-color: transparent; +} \ No newline at end of file diff --git a/client/src/scss/components/_moving.scss b/client/src/scss/components/_moving.scss index e5ad210..bde9fd6 100644 --- a/client/src/scss/components/_moving.scss +++ b/client/src/scss/components/_moving.scss @@ -1,6 +1,6 @@ .Home #moving { - width: 750px; - height: 650px; + // width: 100vw; + height: 100vh; margin-left: 200px; position: relative; } diff --git a/client/src/scss/main.scss b/client/src/scss/main.scss index baa07ab..d75b254 100644 --- a/client/src/scss/main.scss +++ b/client/src/scss/main.scss @@ -16,3 +16,4 @@ @import "components/navbar"; @import "components/contactus"; @import "components/home"; +@import "components/listItem"; diff --git a/server/Readme.md b/server/Readme.md new file mode 100644 index 0000000..ae2467f --- /dev/null +++ b/server/Readme.md @@ -0,0 +1,11 @@ +To install dependancies + +``` +npm install +``` + +To start Server + +``` +npm start +```