$(function() {
var aboutMePosition = $('.about-me').position().top;
$(window).scroll(function () {
var currentPosition = $(this).scrollTop();
if (currentPosition >= aboutMePosition) {
$('.topnav').addClass('changeColor')
} else {
$('.topnav').removeClass('changeColor')
}
});
});
@font-face {
font-family: 'Poiret One';
font-style: normal;
src: url(Fonts/PoiretOne-Regular.ttf);
}
@font-face {
font-family: 'Darker Grotesque';
src: url(Fonts/DarkerGrotesque-Light.ttf);
}
@font-face {
font-family: 'Pathway Gothic';
src: url(Fonts/PathwayGothicOne-Regular.ttf);
}
/* Add a black background color to the top navigation */
.topnav {
background-color: transparent;
overflow: hidden;
position: fixed;
top: 0;
width: 100%;
z-index: 1000;
font-family: 'Darker Grotesque', sans-serif;
transition: .5s;
}
/* Style the links inside the navigation bar */
.topnav a {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
/* Change the color of links on hover */
.topnav a:hover {
background-color: #ddd;
color: black;
}
/* Add an active class to highlight the current page */
.topnav a.active {
color: white;
}
/* Hide the link that should open and close the topnav on small screens */
.topnav .icon {
display: none;
}
/* When the screen is less than 600 pixels wide, hide all links, except for the first one ("Home"). Show the link that contains should open and close the topnav (.icon) */
@media screen and (max-width: 600px) {
.topnav a:not(:first-child) {display: none;}
.topnav a.icon {
float: right;
display: block;
}
}
/* The "responsive" class is added to the topnav with JavaScript when the user clicks on the icon. This class makes the topnav look good on small screens (display the links vertically instead of horizontally) */
@media screen and (max-width: 600px) {
.topnav.responsive {position: relative;}
.topnav.responsive a.icon {
position: absolute;
right: 0;
top: 0;
}
.topnav.responsive a {
float: none;
display: block;
text-align: left;
}
}
.card {
background: white;
margin-bottom: 2em;
}
.card a {
color: black;
text-decoration: none;
}
.card a:hover {
box-shadow: 3px 3px 8px hsl(0, 0%, 80%);
}
.card-content {
padding: 1.4em;
}
.card-content h2 {
margin-top: 0;
margin-bottom: .5em;
font-weight: bold;
}
.card-content p {
font-size: 80%;
}
/* Flexbox stuff */
.cards {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.card {
flex: 0 1 24%;
}
@media screen and (max-width: 600px) {
.services {
margin:20px
}
}
@media screen and (max-width:600px) {
.service-list {
flex: 0 1 50%;
}
}
body, html {
height: 100%;
}
/* The hero image */
.hero-image {
/* Use "linear-gradient" to add a darken background effect to the image (photographer.jpg). This will make the text easier to read */
background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("first-img.jpg");
/* Set a specific height */
height: 650px;
/* Position and center the image to scale nicely on all screens */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
margin: -10px;
}
/* Place text in the middle of the image */
.hero-text {
text-align: center;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
font-family: 'Poiret One';
}
.who-i-am {
display: flex;
width: 600px;
justify-content: center;
align-items: center;
}
.description {
flex: 1;
margin: 50px;
}
.about-me {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.centered-link a {
float: none;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.serv-desc {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.service {
flex-basis: 100%;
text-align: center;
margin: 30px;
font-family: 'Pathway Gothic';
}
@media screen and (min-width:600px) {
.service {
flex: 1;
}
}
h2 {
text-align: center;
font-family: 'Pathway Gothic';
}
.changeColor {
background: black;
}
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" type="image/png" href="dwaynes_logo_no_words.png">
<link rel="stylesheet" href="style.css">
<title>greenMist Web Solutions</title>
</head>
<body>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="topnav">
<a href="#home" class="active">Home</a>
<a href="#news">News</a>
<a href="#contact">Contact</a>
<a href="#about">About</a>
<div class="centered-link">
<a class="brand" href="#home">greenMist Web Solutions</a>
</div>
<a href="javascript:void(0);" class="icon" onclick="myFunction()">
<i class="fa fa-bars"></i>
</a>
</div>
<div class="hero-image">
<div class="hero-text">
<h1>I am Dwayne Rill, Jr.</h1>
<p></p>
<button></button>
</div>
</div>
<div class="about-me">
<div class="who-i-am">
<h1>About Me</h1>
</div>
<div class="description">
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. Duis aute irure dolor in reprehenderit
in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<br>
<br>
This is some more info
<br>
<br>
and some more
<br>
<br>
and another one!
</div>
</div>
<div class="services">
<h2>Services</h2>
<div class="serv-desc">
<div class="service">
<div id="frontEnd">
<h3>Front-End Development</h3>
<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. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.</p>
</div>
</div>
<div class="service">
<div id="responive">
<h3>Responsive Development</h3>
<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. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.</p>
</div>
</div>
<div class="service">
<div id="migration">
<h3>Host Migration</h3>
<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. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.</p>
</div>
</div>
</div>
</div>
<div class="pricing options">
words
</div>
<div class="contact me">
words
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</body>
</html>