Skip to content

Commit 31cdfa6

Browse files
committed
Welcome to the Hog store
1 parent 72fbddf commit 31cdfa6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+11460
-39
lines changed

.gitignore

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Node modules
2-
node_modules
2+
/node_modules
33

44
# .env files
55
.env.*
@@ -21,7 +21,20 @@ node_modules
2121

2222
# Use either yarn.lock or package-lock.json
2323
# Uncomment one of them to mainain a single lockfile
24-
# package-lock.json
24+
package-lock.json
2525
# yarn.lock
2626

2727
## Project-specific files
28+
# dependencies
29+
/.pnp
30+
.pnp.js
31+
32+
# testing
33+
/coverage
34+
35+
# production
36+
/build
37+
38+
npm-debug.log*
39+
yarn-debug.log*
40+
yarn-error.log*

README.md

Lines changed: 23 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,49 @@
1-
# Project Name
1+
# Hog Store
22

33
[![MIT Licensed](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](./LICENSE)
4-
[![Powered by Modus_Create](https://img.shields.io/badge/powered_by-Modus_Create-blue.svg?longCache=true&style=flat&logo=data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMzIwIDMwMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNOTguODI0IDE0OS40OThjMCAxMi41Ny0yLjM1NiAyNC41ODItNi42MzcgMzUuNjM3LTQ5LjEtMjQuODEtODIuNzc1LTc1LjY5Mi04Mi43NzUtMTM0LjQ2IDAtMTcuNzgyIDMuMDkxLTM0LjgzOCA4Ljc0OS01MC42NzVhMTQ5LjUzNSAxNDkuNTM1IDAgMCAxIDQxLjEyNCAxMS4wNDYgMTA3Ljg3NyAxMDcuODc3IDAgMCAwLTcuNTIgMzkuNjI4YzAgMzYuODQyIDE4LjQyMyA2OS4zNiA0Ni41NDQgODguOTA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BmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KPC9zdmc+)](https://moduscreate.com)
4+
[![Powered by Modus_Create](https://img.shields.io/badge/powered_by-Modus_Create-blue.svg?longCache=true&style=flat&logo=data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMzIwIDMwMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNOTguODI0IDE0OS40OThjMCAxMi41Ny0yLjM1NiAyNC41ODItNi42MzcgMzUuNjM3LTQ5LjEtMjQuODEtODIuNzc1LTc1LjY5Mi04Mi43NzUtMTM0LjQ2IDAtMTcuNzgyIDMuMDkxLTM0LjgzOCA4Ljc0OS01MC42NzVhMTQ5LjUzNSAxNDkuNTM1IDAgMCAxIDQxLjEyNCAxMS4wNDYgMTA3Ljg3NyAxMDcuODc3IDAgMCAwLTcuNTIgMzkuNjI4YzAgMzYuODQyIDE4LjQyMyA2OS4zNiA0Ni41NDQgODguOTAzLjMyNiAzLjI2NS41MTUgNi41Ny41MTUgOS45MjF6TTY3LjgyIDE1LjAxOGM0OS4xIDI0LjgxMSA4Mi43NjggNzUuNzExIDgyLjc2OCAxMzQuNDggMCA4My4xNjgtNjcuNDIgMTUwLjU4OC0xNTAuNTg4IDE1MC41ODh2LTQyLjM1M2M1OS43NzggMCAxMDguMjM1LTQ4LjQ1OSAxMDguMjM1LTEwOC4yMzUgMC0zNi44NS0xOC40My02OS4zOC00Ni41NjItODguOTI3YTk5Ljk0OSA5OS45NDkgMCAwIDEtLjQ5Ny05Ljg5NyA5OC41MTIgOTguNTEyIDAgMCAxIDYuNjQ0LTM1LjY1NnptMTU1LjI5MiAxODIuNzE4YzE3LjczNyAzNS41NTggNTQuNDUgNTkuOTk3IDk2Ljg4OCA1OS45OTd2NDIuMzUzYy02MS45NTUgMC0xMTUuMTYyLTM3LjQyLTEzOC4yOC05MC44ODZhMTU4LjgxMSAxNTguODExIDAgMCAwIDQxLjM5Mi0xMS40NjR6bS0xMC4yNi02My41ODlhOTguMjMyIDk4LjIzMiAwIDAgMS00My40MjggMTQuODg5QzE2OS42NTQgNzIuMjI0IDIyNy4zOSA4Ljk1IDMwMS44NDUuMDAzYzQuNzAxIDEzLjE1MiA3LjU5MyAyNy4xNiA4LjQ1IDQxLjcxNC01MC4xMzMgNC40Ni05MC40MzMgNDMuMDgtOTcuNDQzIDkyLjQzem01NC4yNzgtNjguMTA1YzEyLjc5NC04LjEyNyAyNy41NjctMTMuNDA3IDQzLjQ1Mi0xNC45MTEtLjI0NyA4Mi45NTctNjcuNTY3IDE1MC4xMzItMTUwLjU4MiAxNTAuMTMyLTIuODQ2IDAtNS42NzMtLjA4OC04LjQ4LS4yNDNhMTU5LjM3OCAxNTkuMzc4IDAgMCAwIDguMTk4LTQyLjExOGMuMDk0IDAgLjE4Ny4wMDguMjgyLjAwOCA1NC41NTcgMCA5OS42NjUtNDAuMzczIDEwNy4xMy05Mi44Njh6IiBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KPC9zdmc+)](https://moduscreate.com?utm_source=labs&utm_medium=github&utm_campaign=hog-store)
55

6-
Project description - one or two paragraphs. The enemy is dark and creates major problems. The solution is now available and the World can rejoice.
7-
8-
- [Getting Started](#getting-started)
9-
- [How it Works](#how-it-works)
10-
- [Developing](#developing)
11-
- [Prerequisites](#prerequisites)
12-
- [Testing](#testing)
13-
- [Contributing](#contributing)
14-
- [Modus Create](#modus-create)
15-
- [Licensing](#licensing)
6+
Hog store is a sample application used for best-practice demonstrations on [Modus Create's YouTube Channel](https://youtube.com/moduscreate).
167

178
# Getting Started
189

19-
{Minimal steps required for a quick software trial.}
20-
21-
```js
22-
import { Fantastico } from '@modus/awesome-solution';
23-
24-
const amazing = new Fantastico();
10+
Use NPM or Yarn to install dependencies.
2511

26-
export default amazing;
12+
```bash
13+
npm install
2714
```
2815

29-
# How it works
30-
31-
{Describe how it works. Include images if possible.}
32-
33-
# Developing
34-
35-
{Show how engineers can set up a development environment and contribute.}
16+
```bash
17+
yarn
18+
```
3619

37-
## Prerequisites
20+
This app is bootstraped with Create React App (CRA). All the usual CRA commands work.
3821

39-
{Explain the prerequisites}
22+
Useful scripts (npm/yarn):
4023

41-
## Testing
24+
- `yarn start` - start dev server
25+
- `yarn build` - build the app
26+
- `yarn test` - test runner
4227

43-
{Notes on testing}
28+
# Running in production
4429

45-
## Contributing
30+
Ensure you have `serve` installed globally.
31+
You need to build before running in production.
4632

47-
{How can the community contribute}
33+
```bash
34+
serve -s build
35+
```
4836

4937
# Modus Create
5038

51-
{replace PROJECT_NAME in links below with the name of this project}
52-
5339
[Modus Create](https://moduscreate.com) is a digital product consultancy. We use a distributed team of the best talent in the world to offer a full suite of digital product design-build services; ranging from consumer facing apps, to digital migration, to agile development training, and business transformation.
5440

55-
<a href="https://moduscreate.com/?utm_source=labs&utm_medium=github&utm_campaign=PROJECT_NAME"><img src="https://res.cloudinary.com/modus-labs/image/upload/h_80/v1533109874/modus/logo-long-black.svg" height="80" alt="Modus Create"/></a>
41+
<a href="https://moduscreate.com/?utm_source=labs&utm_medium=github&utm_campaign=hog-store"><img src="https://res.cloudinary.com/modus-labs/image/upload/h_80/v1533109874/modus/logo-long-black.svg" height="80" alt="Modus Create"/></a>
5642
<br />
5743

58-
This project is part of [Modus Labs](https://labs.moduscreate.com/?utm_source=labs&utm_medium=github&utm_campaign=PROJECT_NAME).
44+
This project is part of [Modus Labs](https://labs.moduscreate.com/?utm_source=labs&utm_medium=github&utm_campaign=hog-store).
5945

60-
<a href="https://labs.moduscreate.com/?utm_source=labs&utm_medium=github&utm_campaign=PROJECT_NAME"><img src="https://res.cloudinary.com/modus-labs/image/upload/h_80/v1531492623/labs/logo-black.svg" height="80" alt="Modus Labs"/></a>
46+
<a href="https://labs.moduscreate.com/?utm_source=labs&utm_medium=github&utm_campaign=hog-store"><img src="https://res.cloudinary.com/modus-labs/image/upload/h_80/v1531492623/labs/logo-black.svg" height="80" alt="Modus Labs"/></a>
6147

6248
# Licensing
6349

package.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "chunky",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"framer-motion": "^1.6.8",
7+
"lodash-es": "^4.17.15",
8+
"react": "^16.10.2",
9+
"react-burger-menu": "^2.6.11",
10+
"react-dom": "^16.10.2",
11+
"react-lazy-named": "^1.0.0",
12+
"react-lorem-ipsum": "^1.4.3",
13+
"react-scripts": "3.2.0"
14+
},
15+
"scripts": {
16+
"start": "react-scripts start",
17+
"build": "react-scripts build",
18+
"test": "react-scripts test",
19+
"eject": "react-scripts eject"
20+
},
21+
"eslintConfig": {
22+
"extends": "react-app"
23+
},
24+
"browserslist": {
25+
"production": [
26+
">0.2%",
27+
"not dead",
28+
"not op_mini all"
29+
],
30+
"development": [
31+
"last 1 chrome version",
32+
"last 1 firefox version",
33+
"last 1 safari version"
34+
]
35+
}
36+
}

public/favicon.ico

3.78 KB
Binary file not shown.

public/index.html

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<!--
9+
manifest.json provides metadata used when your web app is installed on a
10+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
11+
-->
12+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
13+
<!--
14+
Notice the use of %PUBLIC_URL% in the tags above.
15+
It will be replaced with the URL of the `public` folder during the build.
16+
Only files inside the `public` folder can be referenced from the HTML.
17+
18+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
19+
work correctly both with client-side routing and a non-root public URL.
20+
Learn how to configure a non-root public URL by running `npm run build`.
21+
-->
22+
<title>The Hog Store</title>
23+
<link
24+
href="https://fonts.googleapis.com/css?family=Lato|Oswald&display=swap"
25+
rel="stylesheet"
26+
/>
27+
</head>
28+
<body>
29+
<noscript>You need to enable JavaScript to run this app.</noscript>
30+
<div id="root"></div>
31+
<!--
32+
This HTML file is a template.
33+
If you open it directly in the browser, you will see an empty page.
34+
35+
You can add webfonts, meta tags, or analytics to this file.
36+
The build step will place the bundled scripts into the <body> tag.
37+
38+
To begin the development, run `npm start` or `yarn start`.
39+
To create a production bundle, use `npm run build` or `yarn build`.
40+
-->
41+
</body>
42+
</html>

public/manifest.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"short_name": "React App",
3+
"name": "Create React App Sample",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
}
10+
],
11+
"start_url": ".",
12+
"display": "standalone",
13+
"theme_color": "#000000",
14+
"background_color": "#ffffff"
15+
}

src/App.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#main main {
2+
padding: 0.825rem;
3+
}

src/App.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// @ts-nocheck
2+
import React from 'react';
3+
import Menu from './components/Menu';
4+
import Hero from './components/Hero';
5+
import Sidebar from './components/Sidebar';
6+
import Products from './components/Products';
7+
import BoringContent from './components/BoringContent';
8+
import Footer from './components/Footer';
9+
import './App.css';
10+
11+
const App = () => (
12+
<>
13+
<Menu />
14+
<Sidebar />
15+
<div id="main">
16+
<Hero />
17+
<main>
18+
<Products />
19+
<BoringContent />
20+
</main>
21+
</div>
22+
<Footer />
23+
</>
24+
);
25+
26+
export default App;

src/App.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
import App from './App';
4+
5+
it('renders without crashing', () => {
6+
const div = document.createElement('div');
7+
ReactDOM.render(<App />, div);
8+
ReactDOM.unmountComponentAtNode(div);
9+
});
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export const delay = 1.6;
2+
3+
export const spring = {
4+
type: 'spring',
5+
damping: 20,
6+
stiffness: 300,
7+
};
8+
9+
export const logoAnimation = {
10+
scale: [0.5, 1, 1, 1, 0.5],
11+
rotate: [0, 0, 10, 270, 0],
12+
rotateX: [90, 0, 0, 0, 90],
13+
opacity: [0.5, 1, 1, 1, 0.5],
14+
};
15+
16+
export const logoTransition = {
17+
duration: delay + 0.1,
18+
times: [0, 0.09, 0.4, 0.95, 1],
19+
loop: Infinity,
20+
repeatDelay: delay,
21+
};

src/components/Animation/index.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// @ts-nocheck
2+
import React, { useState, useEffect } from 'react';
3+
import { motion } from 'framer-motion';
4+
import { shuffle } from 'lodash-es';
5+
import { ReactComponent as Logo } from './logo.svg';
6+
import {
7+
delay,
8+
spring,
9+
logoAnimation,
10+
logoTransition,
11+
} from './animation.config';
12+
import s from './styles.module.css';
13+
14+
const initialColors = [
15+
['#FF008C', '#FFF0FC'],
16+
['#D309E1', '#A3F9A1'],
17+
['#9C1AFF', '#F1FA0F'],
18+
['#7700FF', '#77E0FF'],
19+
];
20+
21+
function Animation() {
22+
const [colors, setColors] = useState(initialColors);
23+
24+
useEffect(() => {
25+
setTimeout(() => setColors(shuffle(colors)), delay * 1000);
26+
}, [colors]);
27+
28+
return (
29+
<section className={s.animated}>
30+
<ul>
31+
{colors.map(([background, fill], idx) => (
32+
<motion.li
33+
key={background}
34+
layoutTransition={spring}
35+
style={{ background, '--logo-color': fill }}
36+
>
37+
<motion.div
38+
animate={logoAnimation}
39+
transition={{ ...logoTransition, delay: idx * (delay / 2) }}
40+
>
41+
<Logo className={s.logo} />
42+
</motion.div>
43+
</motion.li>
44+
))}
45+
</ul>
46+
</section>
47+
);
48+
}
49+
50+
export default Animation;

src/components/Animation/logo.svg

Lines changed: 7 additions & 0 deletions
Loading
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
.logo {
2+
height: 5rem;
3+
pointer-events: none;
4+
}
5+
6+
.logo g {
7+
fill: var(--logo-color);
8+
}
9+
10+
.animated {
11+
display: flex;
12+
justify-content: center;
13+
align-items: center;
14+
margin-top: 2rem;
15+
}
16+
17+
.animated ul,
18+
.animated li {
19+
list-style: none;
20+
padding: 0;
21+
margin: 0;
22+
}
23+
24+
.animated ul {
25+
position: relative;
26+
display: flex;
27+
width: 300px;
28+
flex-wrap: wrap;
29+
}
30+
31+
.animated li {
32+
border-radius: 10px;
33+
margin-bottom: 10px;
34+
margin-right: 10px;
35+
width: 140px;
36+
height: 140px;
37+
display: flex;
38+
justify-content: center;
39+
align-items: center;
40+
}
41+
42+
.background {
43+
position: absolute;
44+
top: 0;
45+
left: 0;
46+
bottom: 0;
47+
width: 300px;
48+
background: #fff;
49+
}

src/components/BoringContent/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// @ts-nocheck
2+
import React from 'react';
3+
import { LoremIpsum } from 'react-lorem-ipsum';
4+
5+
const BoringContent = () => (
6+
<section>
7+
<h2>Terms and Conditions</h2>
8+
<LoremIpsum avgWordsPerSentence={12} p={10} />
9+
</section>
10+
);
11+
12+
export default BoringContent;

0 commit comments

Comments
 (0)