Browse Source

react-markup homework moved to new repo

miskson 3 years ago
commit
25fae69d7c

+ 23 - 0
hw0/.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
hw0/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)

File diff suppressed because it is too large
+ 39675 - 0
hw0/package-lock.json


+ 39 - 0
hw0/package.json

@@ -0,0 +1,39 @@
+{
+  "name": "hw0",
+  "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",
+    "node-sass": "^6.0.1",
+    "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
hw0/public/carpet.jpg


BIN
hw0/public/favicon.ico


+ 43 - 0
hw0/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
hw0/public/logo192.png


BIN
hw0/public/logo512.png


+ 25 - 0
hw0/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
hw0/public/robots.txt

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

+ 487 - 0
hw0/src/App.css

@@ -0,0 +1,487 @@
+body {
+  background-image: url("./img/mountians.jpg");
+  background-size: cover;
+  background-repeat: no-repeat;
+  background-attachment: fixed;
+}
+
+.logo {
+  display: -webkit-box;
+  display: -ms-flexbox;
+  display: flex;
+  -webkit-box-pack: justify;
+      -ms-flex-pack: justify;
+          justify-content: space-between;
+  -webkit-box-align: center;
+      -ms-flex-align: center;
+          align-items: center;
+  max-width: 160px;
+}
+
+@media (max-width: 767px) {
+  .logo {
+    /*
+      ADAPTIVE FONT FORMULA for min font-size
+      ---------------------------------------
+      (min-font-size - max-font-size) - distinctSize
+
+      calc(
+          min-font-size(px) + ((distinctSize) + (distinctSize) * 70%) * ((viewport-width(vw) - min-layout-width(px)) / layout-width)
+      )
+      */
+    font-size: calc(13px + 17 * ((100vw - 350px) / 1280));
+  }
+}
+
+@media (min-width: 767px) {
+  .logo {
+    /*
+      ADAPTIVE FONT FORMULA
+      ---------------------
+      calc(min-font-size(px) + (min-font-size - max-font-size) * (viewport-width(vw) / layout-width))
+      */
+    font-size: calc(13px + 10 * (100vw / 1280));
+  }
+}
+
+.logo img {
+  width: 100%;
+  height: auto;
+}
+
+.joinBtn {
+  font-weight: 700;
+  margin: 0 5%;
+  padding: 10px 25px;
+  background-color: orange;
+  text-shadow: 1px 1px 2px black;
+  color: white;
+  border-radius: 10px;
+  border: none;
+}
+
+@media (max-width: 767px) {
+  .joinBtn {
+    /*
+      ADAPTIVE FONT FORMULA for min font-size
+      ---------------------------------------
+      (min-font-size - max-font-size) - distinctSize
+
+      calc(
+          min-font-size(px) + ((distinctSize) + (distinctSize) * 70%) * ((viewport-width(vw) - min-layout-width(px)) / layout-width)
+      )
+      */
+    font-size: calc(13px + 11.9 * ((100vw - 350px) / 1280));
+  }
+}
+
+@media (min-width: 767px) {
+  .joinBtn {
+    /*
+      ADAPTIVE FONT FORMULA
+      ---------------------
+      calc(min-font-size(px) + (min-font-size - max-font-size) * (viewport-width(vw) / layout-width))
+      */
+    font-size: calc(13px + 7 * (100vw / 1280));
+  }
+}
+
+.highlight {
+  background-color: #ff4e33;
+}
+
+.header {
+  display: -webkit-box;
+  display: -ms-flexbox;
+  display: flex;
+  width: 100%;
+  -webkit-box-align: center;
+      -ms-flex-align: center;
+          align-items: center;
+  -webkit-box-pack: space-evenly;
+      -ms-flex-pack: space-evenly;
+          justify-content: space-evenly;
+  background: -webkit-gradient(linear, left top, left bottom, from(#171c1f), to(transparent));
+  background: linear-gradient(to bottom, #171c1f, transparent);
+}
+
+.header .logo {
+  padding-left: 7%;
+}
+
+.header a {
+  color: white;
+  font-size: 20px;
+}
+
+@media (max-width: 767px) {
+  .header a {
+    /*
+      ADAPTIVE FONT FORMULA for min font-size
+      ---------------------------------------
+      (min-font-size - max-font-size) - distinctSize
+
+      calc(
+          min-font-size(px) + ((distinctSize) + (distinctSize) * 70%) * ((viewport-width(vw) - min-layout-width(px)) / layout-width)
+      )
+      */
+    font-size: calc(13px + 11.9 * ((100vw - 350px) / 1280));
+  }
+}
+
+@media (min-width: 767px) {
+  .header a {
+    /*
+      ADAPTIVE FONT FORMULA
+      ---------------------
+      calc(min-font-size(px) + (min-font-size - max-font-size) * (viewport-width(vw) / layout-width))
+      */
+    font-size: calc(13px + 7 * (100vw / 1280));
+  }
+}
+
+.header__title {
+  font-size: 0.4em;
+  margin-left: 1%;
+  color: white;
+}
+
+.header__title h2 {
+  font-weight: 300;
+}
+
+.content {
+  border-top: 2px inset white;
+  width: 80%;
+  margin: 0 auto;
+  margin-top: 20px;
+  display: -webkit-box;
+  display: -ms-flexbox;
+  display: flex;
+  -webkit-box-orient: vertical;
+  -webkit-box-direction: normal;
+      -ms-flex-direction: column;
+          flex-direction: column;
+}
+
+.headline2 {
+  color: white;
+  text-align: center;
+}
+
+@media (max-width: 767px) {
+  .headline2 {
+    /*
+      ADAPTIVE FONT FORMULA for min font-size
+      ---------------------------------------
+      (min-font-size - max-font-size) - distinctSize
+
+      calc(
+          min-font-size(px) + ((distinctSize) + (distinctSize) * 70%) * ((viewport-width(vw) - min-layout-width(px)) / layout-width)
+      )
+      */
+    font-size: calc(25px + 17 * ((100vw - 350px) / 1280));
+  }
+}
+
+@media (min-width: 767px) {
+  .headline2 {
+    /*
+      ADAPTIVE FONT FORMULA
+      ---------------------
+      calc(min-font-size(px) + (min-font-size - max-font-size) * (viewport-width(vw) / layout-width))
+      */
+    font-size: calc(25px + 10 * (100vw / 1280));
+  }
+}
+
+.description {
+  display: block;
+  max-width: 50%;
+  text-align: justify;
+  text-shadow: 0px 0px 15px black;
+  font-weight: 300;
+  color: white;
+  margin: 0 auto;
+}
+
+@media (max-width: 767px) {
+  .description {
+    /*
+      ADAPTIVE FONT FORMULA for min font-size
+      ---------------------------------------
+      (min-font-size - max-font-size) - distinctSize
+
+      calc(
+          min-font-size(px) + ((distinctSize) + (distinctSize) * 70%) * ((viewport-width(vw) - min-layout-width(px)) / layout-width)
+      )
+      */
+    font-size: calc(19px + 10.2 * ((100vw - 350px) / 1280));
+  }
+}
+
+@media (min-width: 767px) {
+  .description {
+    /*
+      ADAPTIVE FONT FORMULA
+      ---------------------
+      calc(min-font-size(px) + (min-font-size - max-font-size) * (viewport-width(vw) / layout-width))
+      */
+    font-size: calc(19px + 6 * (100vw / 1280));
+  }
+}
+
+.placeCard {
+  float: left;
+  list-style: none;
+  background-color: #171c1fc7;
+  text-shadow: 1px 1px 3px black;
+  color: white;
+  padding: 1% 1% 2% 1%;
+  margin: 1% 0;
+  border-radius: 10px;
+}
+
+@media (max-width: 767px) {
+  .placeCard {
+    /*
+      ADAPTIVE FONT FORMULA for min font-size
+      ---------------------------------------
+      (min-font-size - max-font-size) - distinctSize
+
+      calc(
+          min-font-size(px) + ((distinctSize) + (distinctSize) * 70%) * ((viewport-width(vw) - min-layout-width(px)) / layout-width)
+      )
+      */
+    font-size: calc(15px + 13.6 * ((100vw - 350px) / 1280));
+  }
+}
+
+@media (min-width: 767px) {
+  .placeCard {
+    /*
+      ADAPTIVE FONT FORMULA
+      ---------------------
+      calc(min-font-size(px) + (min-font-size - max-font-size) * (viewport-width(vw) / layout-width))
+      */
+    font-size: calc(15px + 8 * (100vw / 1280));
+  }
+}
+
+.placeCard__wrapper {
+  display: -webkit-box;
+  display: -ms-flexbox;
+  display: flex;
+  text-align: justify;
+  -webkit-box-align: center;
+      -ms-flex-align: center;
+          align-items: center;
+}
+
+.placeCard h2 {
+  text-align: center;
+  font-weight: 300;
+}
+
+.placeCard a {
+  color: white;
+  display: block;
+  text-align: center;
+  -webkit-text-decoration: underline double orange;
+          text-decoration: underline double orange;
+}
+
+.placeCard div {
+  margin: 0 2%;
+}
+
+.placeCard div p {
+  font-weight: 300;
+}
+
+.placeCard .imgWrapper {
+  width: 700px;
+}
+
+.placeCard img {
+  min-width: 100%;
+  height: auto;
+  border-radius: 10px;
+  margin: 0 2%;
+}
+
+.banner {
+  position: relative;
+  margin-bottom: -4%;
+}
+
+@media (max-width: 767px) {
+  .banner {
+    /*
+      ADAPTIVE FONT FORMULA for min font-size
+      ---------------------------------------
+      (min-font-size - max-font-size) - distinctSize
+
+      calc(
+          min-font-size(px) + ((distinctSize) + (distinctSize) * 70%) * ((viewport-width(vw) - min-layout-width(px)) / layout-width)
+      )
+      */
+    font-size: calc(15px + 8.5 * ((100vw - 350px) / 1280));
+  }
+}
+
+@media (min-width: 767px) {
+  .banner {
+    /*
+      ADAPTIVE FONT FORMULA
+      ---------------------
+      calc(min-font-size(px) + (min-font-size - max-font-size) * (viewport-width(vw) / layout-width))
+      */
+    font-size: calc(15px + 5 * (100vw / 1280));
+  }
+}
+
+.banner__wrapper {
+  display: -webkit-box;
+  display: -ms-flexbox;
+  display: flex;
+  -webkit-box-align: center;
+      -ms-flex-align: center;
+          align-items: center;
+  -webkit-box-pack: space-evenly;
+      -ms-flex-pack: space-evenly;
+          justify-content: space-evenly;
+  width: 50%;
+  padding: 10px;
+  margin: 0 auto;
+  color: white;
+  background: -webkit-gradient(linear, left top, right top, from(orange), to(brown));
+  background: linear-gradient(to right, orange, brown);
+  border-radius: 10px;
+}
+
+.footer {
+  display: -webkit-box;
+  display: -ms-flexbox;
+  display: flex;
+  background: #171c1f;
+  color: white;
+  -webkit-box-align: center;
+      -ms-flex-align: center;
+          align-items: center;
+  -webkit-box-pack: space-evenly;
+      -ms-flex-pack: space-evenly;
+          justify-content: space-evenly;
+  padding-top: 100px;
+}
+
+.footer__text {
+  max-width: 30%;
+  text-align: center;
+  font-weight: 300;
+}
+
+@media (max-width: 767px) {
+  .footer__text {
+    /*
+      ADAPTIVE FONT FORMULA for min font-size
+      ---------------------------------------
+      (min-font-size - max-font-size) - distinctSize
+
+      calc(
+          min-font-size(px) + ((distinctSize) + (distinctSize) * 70%) * ((viewport-width(vw) - min-layout-width(px)) / layout-width)
+      )
+      */
+    font-size: calc(13px + 11.9 * ((100vw - 350px) / 1280));
+  }
+}
+
+@media (min-width: 767px) {
+  .footer__text {
+    /*
+      ADAPTIVE FONT FORMULA
+      ---------------------
+      calc(min-font-size(px) + (min-font-size - max-font-size) * (viewport-width(vw) / layout-width))
+      */
+    font-size: calc(13px + 7 * (100vw / 1280));
+  }
+}
+
+.footer__copyright {
+  font-weight: lighter;
+}
+
+@media (max-width: 767px) {
+  .footer__copyright {
+    /*
+      ADAPTIVE FONT FORMULA for min font-size
+      ---------------------------------------
+      (min-font-size - max-font-size) - distinctSize
+
+      calc(
+          min-font-size(px) + ((distinctSize) + (distinctSize) * 70%) * ((viewport-width(vw) - min-layout-width(px)) / layout-width)
+      )
+      */
+    font-size: calc(13px + 11.9 * ((100vw - 350px) / 1280));
+  }
+}
+
+@media (min-width: 767px) {
+  .footer__copyright {
+    /*
+      ADAPTIVE FONT FORMULA
+      ---------------------
+      calc(min-font-size(px) + (min-font-size - max-font-size) * (viewport-width(vw) / layout-width))
+      */
+    font-size: calc(13px + 7 * (100vw / 1280));
+  }
+}
+
+@media screen and (max-width: 548px) and (min-width: 0px) {
+  .joinBtn {
+    padding: 3%;
+  }
+  .description {
+    max-width: 90%;
+  }
+  .content {
+    width: 90%;
+  }
+  .placeCard {
+    width: -webkit-fit-content;
+    width: -moz-fit-content;
+    width: fit-content;
+    padding: 4% 1%;
+  }
+  .placeCard__wrapper {
+    -webkit-box-orient: vertical;
+    -webkit-box-direction: normal;
+        -ms-flex-direction: column;
+            flex-direction: column;
+  }
+  .placeCard .imgWrapper {
+    width: auto;
+  }
+  .banner {
+    margin-bottom: -17%;
+  }
+  .banner__wrapper {
+    width: 90%;
+  }
+  .banner .joinBtn {
+    padding: 2%;
+  }
+  .footer {
+    -webkit-box-orient: vertical;
+    -webkit-box-direction: normal;
+        -ms-flex-direction: column;
+            flex-direction: column;
+    -webkit-box-align: center;
+        -ms-flex-align: center;
+            align-items: center;
+  }
+  .footer__text {
+    max-width: 90%;
+  }
+}
+/*# sourceMappingURL=App.css.map */

File diff suppressed because it is too large
+ 10 - 0
hw0/src/App.css.map


+ 108 - 0
hw0/src/App.js

@@ -0,0 +1,108 @@
+import './App.css';
+import logo from './img/m-logo.png'
+import mount1 from './img/mount1.jpg'
+import mount2 from './img/mount2.jpg'
+import mount3 from './img/mount3.jpg'
+
+
+const Logo = () =>
+  <div className="logo">
+    <img src={logo} alt="logo"/>
+    <div className="header__title">
+      <h1>PEAKS</h1>
+      <h2>hiking club</h2>
+    </div>
+  </div>
+
+const Header = () =>
+  <div className="header">
+    <Logo/>
+    <button className="joinBtn">Join us</button>
+    <a href="#">Already has an account</a>
+  </div>
+
+const Content = ({children}) =>
+  <div className="content">
+    {children}
+  </div>
+
+const PlaceCard = ({url='#', img='#', title='Card', children}) =>
+  <div className="placeCard">
+    <div className="placeCard__wrapper">
+      <div className="imgWrapper"><img src={img}/></div>
+      <div>
+        <h2>{title}</h2>
+        <p>{children}</p>
+        <a href={url} target="_blank">Learn more...</a>
+      </div>
+    </div>
+  </div>
+
+const Banner = () =>
+  <div className="banner">
+    <div className="banner__wrapper">
+      <div>
+        <h2>Ready to <span className="highlight">start</span> your adventure?</h2>
+        <p>Start your journey for new impressions</p>
+      </div>
+      <button className="joinBtn">Join us</button>
+    </div>
+  </div>
+
+const Footer = () =>
+  <footer className="footer">
+    <Logo/>
+    <p className="footer__text">
+      We create content and curate adventures for people looking for a truly authentic encounter in the great
+      outdoors.
+    </p>
+    <p className="footer__copyright">
+      &copy; 2021 by PEAKS hiking club
+    </p>
+  </footer>
+
+function App() {
+    return (
+      <div className="App">
+        <Header/>
+        <h1 className="headline2">Join one of our <span className="highlight">awesome</span> hikes!</h1>
+        <p className="description">
+          Let us show you the hidden gems and adventurous trails our place has to offer.
+          Our mountains are much less explored than their Slovakian,
+          Polish or even Romanian counterparts. Add to that maps in Cyrillic and barely marked routes,
+          and you are up for a true adventure!
+        </p>
+        <Content>
+            <h2 className="headline2">Welcome to <span className="highlight">adventure!</span></h2>
+            <PlaceCard 
+              title="Tranquility cracks"
+              url="https://secretcapetown.co.za/tranquility-cracks-table-mountain/"
+              img={mount1}>
+                We go on a visually stimulating adventure through some of most scenic and popular ravines.
+                The incredibly impressive Tranquility Cracks shows off a complex series of paths, tunnel ways and
+                awe-inspiring views.
+            </PlaceCard>
+            <PlaceCard 
+              title="Skeleton gorge"
+              url="https://www.hikeaddicts.com/our-hikes/skeleton-gorge/"
+              img={mount2}>
+                Making our way through Skeleton Gorge's ravine, along the Smuts Track.
+                Navigating through a series of ladders and mossy river boulders, we arrive at one of the famous and
+                historical white beach sand dams atop the summit.
+            </PlaceCard>
+            <PlaceCard 
+              title="Devils peak"
+              url="https://en.wikipedia.org/wiki/Devil%27s_Peak_(Cape_Town)"
+              img={mount3}>
+                We commence at the base of the Tafelberg start point walking the contour.
+                With unique views and possibly the best vantage point to make out the entire Lion, lying below Table
+                Mountain.
+            </PlaceCard>
+        </Content>
+        <Banner/>
+        <Footer/>
+      </div>
+    )
+}
+
+export default App;

+ 224 - 0
hw0/src/App.scss

@@ -0,0 +1,224 @@
+@import './adaptivefonts.scss';
+
+body {
+    background-image: url("./img/mountians.jpg");
+    background-size: cover;
+    background-repeat: no-repeat;
+    background-attachment: fixed;
+}
+
+.logo {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    @include adaptive-font(23, 13);
+    max-width: 160px;
+
+    img {
+        width: 100%;
+        height: auto;
+    }
+}
+  
+.joinBtn {
+    @include adaptive-font(20, 13);
+    font-weight: 700;
+    margin: 0 5%;
+    padding: 10px 25px;
+    background-color: orange;
+    text-shadow: 1px 1px 2px black;
+    color: white;
+    border-radius: 10px;
+    border: none;
+}
+
+.highlight {
+    background-color: #ff4e33;
+}
+
+.header {
+    display: flex;
+    width: 100%;
+    align-items: center;
+    justify-content: space-evenly;
+    background: linear-gradient(to bottom, #171c1f, transparent);
+
+    .logo {
+        padding-left: 7%;
+    }
+
+    a {
+        color: white;
+        @include adaptive-font(20, 13);
+        font-size: 20px;
+    }
+
+    &__title {
+        font-size: 0.4em;
+        margin-left: 1%;
+        color: white;
+
+        h2 {
+            font-weight: 300;
+        }
+    }
+}
+
+.content {
+    border-top: 2px inset white;
+    width: 80%;
+    margin: 0 auto;
+    margin-top: 20px;
+    display: flex;
+    flex-direction: column;
+}
+
+.headline2 {
+    color: white;
+    @include adaptive-font(35, 25);
+    text-align: center;
+}
+
+.description {
+    display: block;
+    max-width: 50%;
+    text-align: justify;
+    text-shadow: 0px 0px 15px black;
+    @include adaptive-font(25, 19);
+    font-weight: 300;
+    color: white;
+    margin: 0 auto;
+}
+
+.placeCard {
+    float: left;
+    list-style: none;
+    background-color: #171c1fc7;
+    text-shadow: 1px 1px 3px black;
+    @include adaptive-font(23, 15);
+    color: white;
+    padding: 1% 1% 2% 1%;
+    margin: 1% 0;
+    border-radius: 10px;
+
+    &__wrapper {
+        display: flex;
+        text-align: justify;
+        align-items: center;    
+    }
+
+    h2 {
+        text-align: center;
+        font-weight: 300;
+    }
+
+    a {
+        color: white;
+        display: block;
+        text-align: center;
+        text-decoration: underline double orange;
+    }
+
+    div {
+        margin: 0 2%;
+        p {
+            font-weight: 300;
+        }
+    }
+
+    .imgWrapper {
+        width: 700px;    
+    }
+
+    img {
+        min-width: 100%;
+        height: auto;
+        border-radius: 10px;
+        margin: 0 2%;
+    }
+}
+
+.banner {
+    position: relative;
+    margin-bottom: -4%;
+    @include adaptive-font(20, 15);
+
+    &__wrapper {
+        display: flex;
+        align-items: center;
+        justify-content: space-evenly;
+        width: 50%;
+        padding: 10px;
+        margin: 0 auto;
+        color: white;
+        background: linear-gradient(to right, orange, brown);
+        border-radius: 10px;
+    }
+}
+
+.footer {
+    display: flex;
+    background: #171c1f;
+    color: white;
+    align-items: center;
+    justify-content: space-evenly;
+    padding-top: 100px;
+
+    &__text {
+        max-width: 30%;
+        @include adaptive-font(20, 13);
+        text-align: center;
+        font-weight: 300;
+    }
+
+    &__copyright {
+        @include adaptive-font(20, 13);
+        font-weight: lighter;
+    }
+}
+
+@media screen and (max-width: 548px) and (min-width: 0px) {
+    .joinBtn {
+        padding: 3%;
+    }
+    
+    .description {
+        max-width: 90%;
+    }
+
+    .content {
+        width: 90%;
+    }
+
+    .placeCard {
+        width: fit-content;
+        padding: 4% 1%;
+        &__wrapper {
+            flex-direction: column;
+        }
+
+        .imgWrapper {
+            width: auto;
+        }
+    }
+
+    .banner {
+        margin-bottom: -17%;
+        &__wrapper {
+            width: 90%;
+        }
+
+        .joinBtn {
+            padding: 2%;
+        }
+    }
+
+    .footer {
+        flex-direction: column;
+        align-items: center;
+
+        &__text {
+            max-width: 90%;
+        }
+    }
+}

+ 8 - 0
hw0/src/App.test.js

@@ -0,0 +1,8 @@
+import { render, screen } from '@testing-library/react';
+import App from './App';
+
+test('renders learn react link', () => {
+  render(<App />);
+  const linkElement = screen.getByText(/learn react/i);
+  expect(linkElement).toBeInTheDocument();
+});

+ 1 - 0
hw0/src/adaptivefonts.css

@@ -0,0 +1 @@
+/* No CSS *//*# sourceMappingURL=adaptivefonts.css.map */

+ 9 - 0
hw0/src/adaptivefonts.css.map

@@ -0,0 +1,9 @@
+{
+    "version": 3,
+    "mappings": "",
+    "sources": [
+        "adaptivefonts.scss"
+    ],
+    "names": [],
+    "file": "adaptivefonts.css"
+}

+ 28 - 0
hw0/src/adaptivefonts.scss

@@ -0,0 +1,28 @@
+$maxWidth: 1280;
+  @mixin adaptive-font($pcSize, $mobSize) {
+    $additionSize: $pcSize - $mobSize;
+    $additionMobSize: $additionSize + $additionSize * 0.7;
+    //  for all screen width less than 767px(iPad)
+    @media (max-width: 767px) {
+      /*
+      ADAPTIVE FONT FORMULA for min font-size
+      ---------------------------------------
+      (min-font-size - max-font-size) - distinctSize
+
+      calc(
+          min-font-size(px) + ((distinctSize) + (distinctSize) * 70%) * ((viewport-width(vw) - min-layout-width(px)) / layout-width)
+      )
+      */
+      font-size: calc(#{$mobSize + px} + #{$additionMobSize} * ((100vw - 350px) / #{$maxWidth}));
+    }
+    // for all screen width more than 767px
+    @media (min-width: 767px) {
+      /*
+      ADAPTIVE FONT FORMULA
+      ---------------------
+      calc(min-font-size(px) + (min-font-size - max-font-size) * (viewport-width(vw) / layout-width))
+      */
+      font-size: calc(#{$mobSize + px} + #{$additionSize} * (100vw / #{$maxWidth}));
+    }
+  }
+  

BIN
hw0/src/img/m-logo.png


BIN
hw0/src/img/mount1.jpg


BIN
hw0/src/img/mount2.jpg


BIN
hw0/src/img/mount3.jpg


BIN
hw0/src/img/mountians.jpg


+ 13 - 0
hw0/src/index.css

@@ -0,0 +1,13 @@
+body {
+  margin: 0;
+  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
+    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
+    sans-serif;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+
+code {
+  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
+    monospace;
+}

+ 17 - 0
hw0/src/index.js

@@ -0,0 +1,17 @@
+import React from 'react';
+import ReactDOM from 'react-dom';
+import './index.css';
+import App from './App';
+import reportWebVitals from './reportWebVitals';
+
+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
+reportWebVitals();

File diff suppressed because it is too large
+ 1 - 0
hw0/src/logo.svg


+ 13 - 0
hw0/src/reportWebVitals.js

@@ -0,0 +1,13 @@
+const reportWebVitals = onPerfEntry => {
+  if (onPerfEntry && onPerfEntry instanceof Function) {
+    import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
+      getCLS(onPerfEntry);
+      getFID(onPerfEntry);
+      getFCP(onPerfEntry);
+      getLCP(onPerfEntry);
+      getTTFB(onPerfEntry);
+    });
+  }
+};
+
+export default reportWebVitals;

+ 5 - 0
hw0/src/setupTests.js

@@ -0,0 +1,5 @@
+// jest-dom adds custom jest matchers for asserting on DOM nodes.
+// allows you to do things like:
+// expect(element).toHaveTextContent(/react/i)
+// learn more: https://github.com/testing-library/jest-dom
+import '@testing-library/jest-dom';