Skip to content
This repository was archived by the owner on Sep 17, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
73 changes: 8 additions & 65 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -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.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br />
You will also see any lint errors in the console.

### `yarn test`

Launches the test runner in the interactive watch mode.<br />
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.<br />
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.<br />
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
```
31 changes: 18 additions & 13 deletions client/src/Components/Home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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];
};
Expand All @@ -97,19 +103,18 @@ function Home() {
card.style.top = `${_mouseY}px`;
card.style.left = `${_mouseX - 200}px `;
}
console.log(_mouseX, _mouseY);
};
const dragOver = (e) => {
e.preventDefault();
};
const renderSidebarButton = (color, radius, id, label, type) => {
return (
<button
onClick={() =>{
if(id === "iconlist")
setIcons(!showIcons)
setProperties(`${color}`, `${radius}`, `${id}`, `${type}`)
}
}
onClick={() => {
if (id === "iconlist") setIcons(!showIcons);
setProperties(`${color}`, `${radius}`, `${id}`, `${type}`);
}}
>
{label}
</button>
Expand All @@ -122,9 +127,8 @@ function Home() {
contactUs: (
<ContactUsForm key={index} styles={element} toggle={toggleModal} />
),
icon: (
<IconGenerator key={index} styles = {element} toggle = {toggleModal} />
),
icon: <IconGenerator key={index} styles={element} toggle={toggleModal} />,
list: <ListItem key={index} styles={element} toggle={toggleModal} />,
};
return components[type];
};
Expand Down Expand Up @@ -161,7 +165,8 @@ function Home() {
"Social Icons",
"icons"
)}
{showIcons&&<Icons btn = {setProperties}/>}
{showIcons && <Icons btn={setProperties} />}
{renderSidebarButton("#fff", "30px", "list"+Date.now(), "list item", "list")}
</aside>
<div className="modal" id="add-modal">
<div className="modal__content">
Expand All @@ -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);
})}
</div>
Expand Down
55 changes: 35 additions & 20 deletions client/src/Components/IconGenerator.jsx
Original file line number Diff line number Diff line change
@@ -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(() => {
Expand All @@ -14,37 +14,52 @@ 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 (
<button
className="SocialIcons"
draggable="true"
onDragStart={this.dragStart}
onDragOver={this.dragOver}
id = {this.props.styles.aid}
style={{
// position:this.props.styles.position,
left: this.props.styles.left,
top: this.props.styles.top,

}}
onContextMenu = {this.handleContextMenu}
id={this.props.styles.aid}
style={this.getIconStyle()}
onContextMenu={this.handleContextMenu}
// toggle={this.props.styles.aid}
>
<FontAwesomeIcon
icon={["fab", name]}
size="5x"
style={{
color: this.props.styles.color
}}
>
{this.props.key}
</FontAwesomeIcon>
icon={["fab", name]}
size="5x"
style={{
color: this.props.styles.color,
}}
>
{this.props.key}
</FontAwesomeIcon>
</button>
);
}
Expand Down
9 changes: 7 additions & 2 deletions client/src/Components/Icons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,19 @@ export class Icons extends Component {
padding: "0",
}}
>
{iconTray.map((iconV,idx) => (
{iconTray.map((iconV, idx) => (
<li key={idx} style={{ padding: "2px" }} className={iconV}>
{/* <IconGenerator icon={iconV} />{" "} */}
<FontAwesomeIcon
icon={["fab", iconV]}
size="5x"
onClick={(event) => {
this.props.btn("black", null, iconV+"!"+ Math.random(), "icon");
this.props.btn(
"transparent",
null,
iconV + "!" + Math.random(),
"icon"
);
}}
>
{iconV}
Expand Down
57 changes: 57 additions & 0 deletions client/src/Components/ListItem.jsx
Original file line number Diff line number Diff line change
@@ -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 (
<div
className="listitem"
style={this.getStyles()}
id={this.props.styles.aid}
draggable="true"
onDragStart={this.dragStart}
onDragOver={this.dragover}
onContextMenu={this.handleContextMenu}
>
<li ><input/></li>
</div>
);
}
}

export default ListItem;
4 changes: 3 additions & 1 deletion client/src/scss/components/_aside.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
25 changes: 25 additions & 0 deletions client/src/scss/components/_listItem.scss
Original file line number Diff line number Diff line change
@@ -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;
}
4 changes: 2 additions & 2 deletions client/src/scss/components/_moving.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.Home #moving {
width: 750px;
height: 650px;
// width: 100vw;
height: 100vh;
margin-left: 200px;
position: relative;
}
Expand Down
1 change: 1 addition & 0 deletions client/src/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
@import "components/navbar";
@import "components/contactus";
@import "components/home";
@import "components/listItem";
11 changes: 11 additions & 0 deletions server/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
To install dependancies

```
npm install
```

To start Server

```
npm start
```