adaminglis / adaminglis.github.io

Adam Inglis' Portfolio
https://adaminglis.github.io/
0 stars 0 forks source link

Using Position and Flex Layout #2

Open berryny opened 4 years ago

berryny commented 4 years ago

The HTML Code Layout Create a file inside the htmlclass/ named position.html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <link rel="stylesheet" href="css/position.css">
  <title>Position Layout</title>
</head>
<body>
  <div class="wrapper">
    <header class="header">
      <div class="banner-content">
        <img src="https://picsum.photos/id/1027/700" alt="company logo" class="logo round">
        <div class="banner-details">
          <h1>First Last</h1>
          <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
          <button onclick="window.location.href = 'https://github.com';" class="link-btn">Button Link</button>
          <a href="https://www.github.com" class="link-btn">Anchor Link</a>
          <nav class="socialmedia-icons">
            <ul>
              <li><a href="https://dribbble.com/" target="_blank"><i class="fab fa-dribbble"></i></a></li>
              <li><a href="https://www.behance.net/" target="_blank"><i class="fab fa-behance"></i></a></li>
              <li><a href="https://www.linkedin.com/" target="_blank"><i class="fab fa-linkedin-in"></i></a></li>
            </ul>
          </nav>
        </div>
        <a href="#main" class="arrow"><i class="fas fa-chevron-down"></i></a>
      </div>
    </header>

    <div class="site-content">

      <main id="main" class="main">
        <div id="projects" class="portfolio-container">
          <h2>Headline One</h2>
          <h3>Subheadline</h3>
          <section class="portfolio-projects flexCols">
            <div class="portfolio-project project">
              <img src="https://picsum.photos/id/0/700" alt="placeholder">
              <h4>Project Name</h4>
            </div>
          </section>
        </div>
        <div id="research" class="research-container">
          <h2>Headline Two</h2>
          <h3>Subheadline</h3>
          <section class="research-projects flexCols">
            <div class="research-project project">
              <img src="https://picsum.photos/id/201/700" alt="placeholder">
              <h4>Research Headline One</h4>
              <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
            </div>
            <div class="research-project project">
              <img src="https://picsum.photos/id/180/700" alt="placeholder">
              <h4>Research Headline Two</h4>
              <p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
            </div>
            <div class="research-project project">
              <img src="https://picsum.photos/id/160/700" alt="placeholder">
              <h4>Research Headline Three</h4>
              <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
            </div>
          </section>
        </div>
      </main>

      <footer>
        <h3>Contact</h3>
        <p>&copy; 2020 by First Last</p>
      </footer>

    </div> <!-- .site-content -->

  </div><!-- .wrapper -->

</body>
</html>
berryny commented 4 years ago

Create a file inside the htmlclass/css named position.css

@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css");
@import url('https://fonts.googleapis.com/css?family=PT+Sans:400,700&display=swap');
@import "normalize.css";

/* NOTE: Global Styles */
*, *:before, *:after {
  box-sizing: inherit;

}
html {
  box-sizing: border-box;
    /* NOTE: Smooth Scrolling */
    scroll-behavior: smooth;
}

body {
  font-family: 'PT Sans', sans-serif;
  font-weight: 400;
  font-size: 1em;
  line-height: 1.25em;
  color: #575454;

  -webkit-animation: fadein 3s; /* Safari, Chrome and Opera > 12.1 */
     -moz-animation: fadein 3s; /* Firefox < 16 */
      -ms-animation: fadein 3s; /* Internet Explorer */
       -o-animation: fadein 3s; /* Opera < 12.1 */
          animation: fadein 3s;
}

@keyframes fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Firefox < 16 */
@-moz-keyframes fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Safari, Chrome and Opera > 12.1 */
@-webkit-keyframes fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Internet Explorer */
@-ms-keyframes fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Opera < 12.1 */
@-o-keyframes fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

a, a:link, a:visited, a:focus {
  color: #575454;
}
a:hover {
  color: #4176FA;
}

ul {
  margin: 0;
  padding: 0;
}

/* NOTE: Custom Styles Area */
.wrapper {
  position: relative;
}
.header {
  height: 100vh;
  min-height: 320px;
  display: flex;
  align-items: center;
}

.link-btn, .link-btn:link {
  display: inline-block;
  background-color: rgb(255, 0, 0);
  color: rgb(255, 255, 255);
  border: 1px solid rgb(255, 255, 255);
  text-decoration: none;
  padding: .5em 1em;
  border-radius: .45em;
  cursor: pointer;
  font-size: 1.15em;
}

.link-btn:hover {
  background-color: rgb(255, 255, 255);
  color: rgb(255, 0, 0);
  border: 1px solid rgb(255, 0, 0);
}

.socialmedia-icons ul {
  margin: 2em 0;
}

.socialmedia-icons ul li {
  display: inline;
  font-size: 1.75em;
  margin-right: 1em;
  margin-bottom: 1em;
}
.socialmedia-icons ul li:last-child {
  margin-right: 0;
}

.socialmedia-icons .fa-dribbble:hover {
  color: rgb(250, 94, 151);
}
.socialmedia-icons .fa-behance:hover {
  color: rgb(65, 118, 250);
}
.socialmedia-icons .fa-linkedin-in:hover {
  color: rgb(0, 122, 185);
}

.flexCols img {
  display: block;
  width: 100%;
}

/* NOTE: Large Screens */
@media only screen and (min-width: 758px) and (min-height: 414px) {
  .header {
    position: fixed;
    top: 0;
    left: 0;
    width: 32vw;
  }
  .logo {
    display: block;
    width: 100%;
  }
  .round {
    border-radius: 50%;
  }
  .banner-content {
    padding: 0 20%;
  }
  .header .arrow { display: none; }

  .site-content {
    padding-left: 33%;
  }

  /* NOTE: Using flex to create columns */
  .flexCols {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 10px 0;
    margin-bottom: 20px;
    /* try resizing browser width to see the number of colums change */
    flex-flow: row wrap;
  }
  .flexCols .project {
    width: 33%;
    margin: 0;
  }

  .flexCols .project img {
    display: block;
    width: 100%;
  }

}

/* NOTE: Portable Devices */
@media only screen and (max-width: 758px), (max-height: 414px) {
  .header {
    border-bottom: 1px solid #eee;
    padding: 1%;
    position: relative;
  }
  .header .arrow {
    display: block;
    position: absolute;
    bottom: 0;
    left: 0; right: 0;
    text-align: center;
    color: rgb(255, 0, 0);
    font-size: 3em;
  }

  .banner-content {
    display: flex;
    justify-content: space-between;
    text-align: center;
    flex-flow: row;
    flex-wrap: wrap;
    width: 100%;
    align-items: center;
  }
  .banner-content img.logo {
    display: block;
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    height: 100%;
  }
  .banner-details {
    max-width: 350px;
    margin: 0 auto;
  }
}