Pārlūkot izejas kodu

first_react_project

Iryna Bolbat 2 gadi atpakaļ
revīzija
1122d04c56
22 mainītis faili ar 16536 papildinājumiem un 0 dzēšanām
  1. 23 0
      .gitignore
  2. 70 0
      README.md
  3. 16091 0
      package-lock.json
  4. 38 0
      package.json
  5. BIN
      public/coffee-2.png
  6. BIN
      public/coffee.png
  7. BIN
      public/favicon.ico
  8. 43 0
      public/index.html
  9. BIN
      public/logo192.png
  10. BIN
      public/logo512.png
  11. 25 0
      public/manifest.json
  12. 3 0
      public/robots.txt
  13. 3 0
      src/App.css
  14. 18 0
      src/App.js
  15. 28 0
      src/Footer.css
  16. 13 0
      src/Footer.js
  17. 44 0
      src/Header.css
  18. 28 0
      src/Header.js
  19. 51 0
      src/Main.css
  20. 42 0
      src/Main.js
  21. 0 0
      src/index.css
  22. 16 0
      src/index.js

+ 23 - 0
.gitignore

@@ -0,0 +1,23 @@
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# dependencies
+/node_modules
+/.pnp
+.pnp.js
+
+# testing
+/coverage
+
+# production
+/build
+
+# misc
+.DS_Store
+.env.local
+.env.development.local
+.env.test.local
+.env.production.local
+
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*

+ 70 - 0
README.md

@@ -0,0 +1,70 @@
+# Getting Started with Create React App
+
+This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
+
+## Available Scripts
+
+In the project directory, you can run:
+
+### `npm 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.
+
+### `npm 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.
+
+### `npm run 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.
+
+### `npm run 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](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](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](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](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](https://facebook.github.io/create-react-app/docs/deployment)
+
+### `npm run build` fails to minify
+
+This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 16091 - 0
package-lock.json


+ 38 - 0
package.json

@@ -0,0 +1,38 @@
+{
+  "name": "my-first-project",
+  "version": "0.1.0",
+  "private": true,
+  "dependencies": {
+    "@testing-library/jest-dom": "^5.14.1",
+    "@testing-library/react": "^11.2.7",
+    "@testing-library/user-event": "^12.8.3",
+    "react": "^17.0.2",
+    "react-dom": "^17.0.2",
+    "react-scripts": "4.0.3",
+    "web-vitals": "^1.1.2"
+  },
+  "scripts": {
+    "start": "react-scripts start",
+    "build": "react-scripts build",
+    "test": "react-scripts test",
+    "eject": "react-scripts eject"
+  },
+  "eslintConfig": {
+    "extends": [
+      "react-app",
+      "react-app/jest"
+    ]
+  },
+  "browserslist": {
+    "production": [
+      ">0.2%",
+      "not dead",
+      "not op_mini all"
+    ],
+    "development": [
+      "last 1 chrome version",
+      "last 1 firefox version",
+      "last 1 safari version"
+    ]
+  }
+}

BIN
public/coffee-2.png


BIN
public/coffee.png


BIN
public/favicon.ico


+ 43 - 0
public/index.html

@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="utf-8" />
+    <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
+    <meta name="viewport" content="width=device-width, initial-scale=1" />
+    <meta name="theme-color" content="#000000" />
+    <meta
+      name="description"
+      content="Web site created using create-react-app"
+    />
+    <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
+    <!--
+      manifest.json provides metadata used when your web app is installed on a
+      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
+    -->
+    <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
+    <!--
+      Notice the use of %PUBLIC_URL% in the tags above.
+      It will be replaced with the URL of the `public` folder during the build.
+      Only files inside the `public` folder can be referenced from the HTML.
+
+      Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
+      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`.
+    -->
+    <title>React App</title>
+  </head>
+  <body>
+    <noscript>You need to enable JavaScript to run this app.</noscript>
+    <div id="root"></div>
+    <!--
+      This HTML file is a template.
+      If you open it directly in the browser, you will see an empty page.
+
+      You can add webfonts, meta tags, or analytics to this file.
+      The build step will place the bundled scripts into the <body> tag.
+
+      To begin the development, run `npm start` or `yarn start`.
+      To create a production bundle, use `npm run build` or `yarn build`.
+    -->
+  </body>
+</html>

BIN
public/logo192.png


BIN
public/logo512.png


+ 25 - 0
public/manifest.json

@@ -0,0 +1,25 @@
+{
+  "short_name": "React App",
+  "name": "Create React App Sample",
+  "icons": [
+    {
+      "src": "favicon.ico",
+      "sizes": "64x64 32x32 24x24 16x16",
+      "type": "image/x-icon"
+    },
+    {
+      "src": "logo192.png",
+      "type": "image/png",
+      "sizes": "192x192"
+    },
+    {
+      "src": "logo512.png",
+      "type": "image/png",
+      "sizes": "512x512"
+    }
+  ],
+  "start_url": ".",
+  "display": "standalone",
+  "theme_color": "#000000",
+  "background_color": "#ffffff"
+}

+ 3 - 0
public/robots.txt

@@ -0,0 +1,3 @@
+# https://www.robotstxt.org/robotstxt.html
+User-agent: *
+Disallow:

+ 3 - 0
src/App.css

@@ -0,0 +1,3 @@
+body {
+    background-color: whitesmoke;
+}

+ 18 - 0
src/App.js

@@ -0,0 +1,18 @@
+import React from 'react';
+// import ReactDOM from 'react-dom';
+import Header from './Header';
+import Main from './Main';
+import Footer from './Footer';
+import './App.css';
+
+function App() {
+  return (
+    <>
+      <Header />
+      <Main />
+      <Footer />
+    </>
+  );
+}
+
+export default App;

+ 28 - 0
src/Footer.css

@@ -0,0 +1,28 @@
+.footer {
+    background-color: rgb(44, 43, 43);
+    text-align: center;
+    padding-top: 7px;
+    height: 50px;
+    min-width: 1200px;
+}
+.footer p {
+    color: white;
+}
+
+@media (max-width:1200px) {
+    footer {
+        max-width: 970px;
+    }
+}
+
+@media (max-width:992px) {
+    footer {
+        max-width: 750px;
+    }
+}
+
+@media (max-width:767px) {
+    footer {
+        max-width: none;
+    }
+}

+ 13 - 0
src/Footer.js

@@ -0,0 +1,13 @@
+import App from './App';
+import './Footer.css';
+
+const Footer = () =>
+<footer>
+    <>
+        <div className="footer">
+                    <p>Copyright &copy; Your Website 2019</p>
+        </div>
+    </>
+</footer>
+
+export default Footer;

+ 44 - 0
src/Header.css

@@ -0,0 +1,44 @@
+header {
+    font-family: "Helvetica Neue";
+    text-align: center;
+    margin-bottom: 30px;
+    min-width: 1200px;
+}
+
+.menu {
+    background-color: rgb(44, 43, 43);
+    height: 50px;
+}
+
+.menu-list {
+    color: white;
+    list-style-type:none;
+    padding-top: 15px;
+    display: flex;
+    justify-content: space-between;
+    margin-left: 300px;
+    margin-right: 300px;
+}
+
+a {
+    text-decoration: none;
+    color: white;
+}
+
+@media (max-width:1200px) {
+    header {
+        max-width: 970px;
+    }
+}
+
+@media (max-width:992px) {
+    header {
+        max-width: 750px;
+    }
+}
+
+@media (max-width:767px) {
+    header {
+        max-width: none;
+    }
+}

+ 28 - 0
src/Header.js

@@ -0,0 +1,28 @@
+import App from './App';
+import './Header.css';
+
+const Header = () =>
+<header>
+    <>
+    <h1 className="brand">Business Casual</h1>
+    <div>3481 Melrose Place | Beverly Hills, CA 90210 | 123.456.7890</div>
+            <div className='menu'>
+                <ul className="menu-list">
+                    <li>
+                        <a href="Header.js">Home</a>
+                    </li>
+                    <li>
+                        <a href="https://www.google.com.ua">About</a>
+                    </li>
+                    <li>
+                        <a href="https://www.blogger.com/about/?bpli=1">Blog</a>
+                    </li>
+                    <li>
+                        <a href="https://www.instagram.com/trendcoffee_/">Contact</a>
+                    </li>
+                </ul>
+            </div>
+    </>
+</header>
+
+export default Header;

+ 51 - 0
src/Main.css

@@ -0,0 +1,51 @@
+main {
+    font-family: "Helvetica Neue";
+    padding-top: 15px;
+    padding-bottom: 15px;
+    margin-top: 30px;
+    margin-bottom: 30px;
+    min-width: 1200px;
+}
+
+.welcoming-img {
+    width: 500px;
+}
+
+.intro-img {
+    width: 200px;
+    padding-left: 15px;
+    float: left;
+}
+.welcoming {
+    text-align: center;
+}
+
+.intro {
+    text-align: center;
+}
+
+hr {
+    width: 500px;
+}
+
+.text {
+    display:block;
+}
+
+@media (max-width:1200px) {
+    main {
+        max-width: 970px;
+    }
+}
+
+@media (max-width:992px) {
+    main {
+        max-width: 750px;
+    }
+}
+
+@media (max-width:767px) {
+    main {
+        max-width: none;
+    }
+}

+ 42 - 0
src/Main.js

@@ -0,0 +1,42 @@
+import App from './App';
+import './Main.css';
+
+const Main = () =>
+<main>
+    <>
+        <div className="welcoming">
+            <img className="welcoming-img" src="coffee.png" alt="Coffee" title="Coffee" /> 
+            <p>Welcome to</p>
+            <h2>Business Casual</h2>
+            <hr />
+        </div>
+        <div className='intro'>
+            <h3>BUILD A WEBSITE WORTH VISITING</h3>
+            <hr />
+        </div>
+
+        <div className='text'>
+            <img className="intro-img" src="coffee-2.png" alt="Coffee" title="Coffee" />
+            <p>The boxes used in this template are nested inbetween a normal Bootstrap row and the start of your column layout. 
+                    The boxes will be full-width boxes, so if you want to make them smaller then you will need to customize.</p>
+            <p>A huge thanks to Death to the Stock Photo for allowing us to use the beautiful photos that make this template really come to life. 
+                    When using this template, make sure your photos are decent. Also make sure that the file size on your photos is kept to a minumum to 
+                    keep load times to a minimum.</p>
+            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc placerat diam quis nisl vestibulum dignissim. In hac habitasse platea dictumst. 
+                    Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
+            <hr />
+        </div>
+            
+        <div className="intro">
+            <h3>BEAUTIFUL BOXES TO SHOWCASE YOUR CONTENT</h3>
+            <hr />
+        </div>
+        <div className="text">
+            <p>Use as many boxes as you like, and put anything you want in them! They are great for just about anything, the sky's the limit!</p> 
+            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc placerat diam quis nisl vestibulum dignissim. In hac habitasse platea dictumst. 
+            Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
+        </div>
+    </>
+</main>
+
+export default Main;

+ 0 - 0
src/index.css


+ 16 - 0
src/index.js

@@ -0,0 +1,16 @@
+import React from 'react';
+import ReactDOM from 'react-dom';
+import './index.css';
+import App from './App';
+
+ReactDOM.render(
+  <React.StrictMode>
+    <App />
+  </React.StrictMode>,
+  document.getElementById('root')
+);
+
+// If you want to start measuring performance in your app, pass a function
+// to log results (for example: reportWebVitals(console.log))
+// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
+App();