Skip to content

Commit

Permalink
E-commerce Homepage +SASS setup
Browse files Browse the repository at this point in the history
  • Loading branch information
navin-moorthy committed Aug 9, 2019
1 parent 4220f87 commit 35902d1
Show file tree
Hide file tree
Showing 11 changed files with 838 additions and 207 deletions.
737 changes: 735 additions & 2 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"dependencies": { "dependencies": {
"node-sass": "^4.12.0",
"react": "^16.9.0", "react": "^16.9.0",
"react-dom": "^16.9.0", "react-dom": "^16.9.0",
"react-scripts": "3.0.1" "react-scripts": "3.0.1"
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
work correctly both with client-side routing and a non-root public URL. work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`. Learn how to configure a non-root public URL by running `npm run build`.
--> -->
<title>React App</title> <title>Crown Clothing</title>
</head> </head>
<body> <body>
<noscript>You need to enable JavaScript to run this app.</noscript> <noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
33 changes: 0 additions & 33 deletions src/App.css
Original file line number Original file line Diff line number Diff line change
@@ -1,33 +0,0 @@
.App {
text-align: center;
}

.App-logo {
animation: App-logo-spin infinite 20s linear;
height: 40vmin;
pointer-events: none;
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #61dafb;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
24 changes: 6 additions & 18 deletions src/App.js
Original file line number Original file line Diff line number Diff line change
@@ -1,24 +1,12 @@
import React from 'react'; import React from "react";
import logo from './logo.svg'; import "./App.css";
import './App.css';
import HomePage from "./homepage.component";


function App() { function App() {
return ( return (
<div className="App"> <div>
<header className="App-header"> <HomePage />
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div> </div>
); );
} }
Expand Down
41 changes: 41 additions & 0 deletions src/homepage.component.jsx
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from "react";
import "./homepage.styles.scss";

const HomePage = () => (
<div className="homepage">
<div className="directory-menu">
<div className="menu-item">
<div className="content">
<h1 className="title">HATS</h1>
<span className="subtitle">SHOP NOW</span>
</div>
</div>
<div className="menu-item">
<div className="content">
<h1 className="title">JACKETS</h1>
<span className="subtitle">SHOP NOW</span>
</div>
</div>
<div className="menu-item">
<div className="content">
<h1 className="title">SNEAKERS </h1>
<span className="subtitle">SHOP NOW</span>
</div>
</div>
<div className="menu-item">
<div className="content">
<h1 className="title">WOMENS</h1>
<span className="subtitle">SHOP NOW</span>
</div>
</div>
<div className="menu-item">
<div className="content">
<h1 className="title">MENS</h1>
<span className="subtitle">SHOP NOW</span>
</div>
</div>
</div>
</div>
);

export default HomePage;
54 changes: 54 additions & 0 deletions src/homepage.styles.scss
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,54 @@
.homepage {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px 80px;
}

.directory-menu {
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}

.menu-item {
min-width: 30%;
height: 240px;
flex: 1 1 auto;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid black;
margin: 0 7.5px 15px;

&:first-child {
margin-right: 7.5px;
}

&:last-child {
margin-left: 7.5px;
}

.content {
height: 90px;
padding: 0 25px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border: 1px solid black;

.title {
font-weight: bold;
margin-bottom: 6px;
font-size: 22px;
color: #4a4a4a;
}

.subtitle {
font-weight: lighter;
font-size: 16px;
}
}
}
5 changes: 0 additions & 5 deletions src/index.css
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,8 +6,3 @@ body {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}
6 changes: 0 additions & 6 deletions src/index.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,11 +2,5 @@ import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import './index.css'; import './index.css';
import App from './App'; import App from './App';
import * as serviceWorker from './serviceWorker';


ReactDOM.render(<App />, document.getElementById('root')); ReactDOM.render(<App />, document.getElementById('root'));

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
7 changes: 0 additions & 7 deletions src/logo.svg

This file was deleted.

135 changes: 0 additions & 135 deletions src/serviceWorker.js

This file was deleted.

0 comments on commit 35902d1

Please sign in to comment.