From a2854c0a89acd1516548cbb737b87b6aaa1983b5 Mon Sep 17 00:00:00 2001 From: Anvay Date: Wed, 8 Jul 2020 11:36:18 +0530 Subject: [PATCH 1/4] fixed disappearing of elements --- client/src/Components/Home/Home.js | 23 +++++------ client/src/Components/IconGenerator.jsx | 54 ++++++++++++++++--------- client/src/Components/Icons.jsx | 9 ++++- client/src/scss/components/_moving.scss | 4 +- 4 files changed, 53 insertions(+), 37 deletions(-) diff --git a/client/src/Components/Home/Home.js b/client/src/Components/Home/Home.js index 5da3ad6..ce4cad4 100644 --- a/client/src/Components/Home/Home.js +++ b/client/src/Components/Home/Home.js @@ -78,10 +78,10 @@ function Home() { height: "600px", padding: "50px", }, - icon : { + icon: { // position: "initial", color: "blue", - } + }, }; return properties[type]; }; @@ -97,6 +97,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 +105,10 @@ function Home() { const renderSidebarButton = (color, radius, id, label, type) => { return ( @@ -122,9 +121,7 @@ function Home() { contactUs: ( ), - icon: ( - - ), + icon: , }; return components[type]; }; @@ -161,7 +158,7 @@ function Home() { "Social Icons", "icons" )} - {showIcons&&} + {showIcons && }
@@ -178,7 +175,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..b292da0 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,30 @@ 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); 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/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; } From 01142058a72f9367aac2df31d75f6a58ca091769 Mon Sep 17 00:00:00 2001 From: Anvay Date: Wed, 8 Jul 2020 12:31:06 +0530 Subject: [PATCH 2/4] added scroll to aside --- client/src/scss/components/_aside.scss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; From 156f618e6ead59a109a3b302a34b8f49e26ba133 Mon Sep 17 00:00:00 2001 From: Aditya Prakash <42460356+pAditya198@users.noreply.github.com> Date: Wed, 5 Aug 2020 08:50:00 +0530 Subject: [PATCH 3/4] Create Readme.md (#15) * Create Readme.md * Update README.md * Update README.md --- README.md | 6 ++++ client/README.md | 73 ++++++------------------------------------------ server/Readme.md | 11 ++++++++ 3 files changed, 25 insertions(+), 65 deletions(-) create mode 100644 server/Readme.md 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/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 +``` From 959170c71c7a80a08601996d4ee5abfdcbe9f86d Mon Sep 17 00:00:00 2001 From: Anvay Date: Fri, 7 Aug 2020 12:46:34 +0530 Subject: [PATCH 4/4] list added --- client/src/Components/Home/Home.js | 8 ++++ client/src/Components/IconGenerator.jsx | 1 + client/src/Components/ListItem.jsx | 57 +++++++++++++++++++++++ client/src/scss/components/_listItem.scss | 25 ++++++++++ client/src/scss/main.scss | 1 + 5 files changed, 92 insertions(+) create mode 100644 client/src/Components/ListItem.jsx create mode 100644 client/src/scss/components/_listItem.scss diff --git a/client/src/Components/Home/Home.js b/client/src/Components/Home/Home.js index ce4cad4..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() { @@ -82,6 +83,11 @@ function Home() { // position: "initial", color: "blue", }, + list: { + position: "absolute", + width: "800px", + height: "80px", + }, }; return properties[type]; }; @@ -122,6 +128,7 @@ function Home() { ), icon: , + list: , }; return components[type]; }; @@ -159,6 +166,7 @@ function Home() { "icons" )} {showIcons && } + {renderSidebarButton("#fff", "30px", "list"+Date.now(), "list item", "list")}
    diff --git a/client/src/Components/IconGenerator.jsx b/client/src/Components/IconGenerator.jsx index b292da0..aa486fd 100644 --- a/client/src/Components/IconGenerator.jsx +++ b/client/src/Components/IconGenerator.jsx @@ -37,6 +37,7 @@ export class IconGenerator extends Component { render() { 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/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/_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/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";