Skip to content

Instantly share code, notes, and snippets.

@thusmiley
Created April 20, 2021 19:42
Show Gist options
  • Save thusmiley/ab887163012640701613813f9290b8dc to your computer and use it in GitHub Desktop.
Save thusmiley/ab887163012640701613813f9290b8dc to your computer and use it in GitHub Desktop.
Personal Portfolio Page - FreeCodeCamp (solution)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Personal Portfolio</title>
<link rel="stylesheet" href="styles.css" />
<link
rel="stylesheet"
href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css"
integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p"
crossorigin="anonymous"
/>
</head>
<body>
<nav id="navbar">
<ul>
<li><a href="#">About</a></li>
<li><a href="#projects">Work</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
<!-- Welcome -->
<header>
<section id="welcome-section">
<h1>B. L. Gerber</h1>
<p>Editor | Photographer | Writer</p>
</section>
</header>
<!-- Projects -->
<section id="projects">
<h1>My projects</h1>
<div class="container">
<div class="project">
<img
src="https://images.pexels.com/photos/3225517/pexels-photo-3225517.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=500"
alt=""
class="img"
/>
<figcaption class="project-title">Tribute Page</figcaption>
</div>
<div class="project">
<img
src="https://images.pexels.com/photos/1770809/pexels-photo-1770809.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=500"
alt=""
class="img"
/>
<figcaption class="project-title">Random Quote Machine</figcaption>
</div>
<div class="project">
<img
src="https://images.pexels.com/photos/816608/pexels-photo-816608.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=500"
alt=""
class="img"
/>
<figcaption class="project-title">Javascript Calculator</figcaption>
</div>
<div class="project">
<img
src="https://images.pexels.com/photos/4319752/pexels-photo-4319752.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=500"
alt=""
class="img"
/>
<figcaption class="project-title">Map Data Across The Globe
</figcaption>
</div>
<div class="project">
<img
src="https://images.pexels.com/photos/1671325/pexels-photo-1671325.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=500"
alt=""
class="img"
/>
<figcaption class="project-title">Wikipedia Viewer</figcaption>
</div>
<div class="project">
<img
src="https://images.pexels.com/photos/1784578/pexels-photo-1784578.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=500"
alt=""
class="img"
/>
<figcaption class="project-title">Tic Tac Toe Game</figcaption>
</div>
</div>
<button>Show all ></button>
</section>
<!-- Contact -->
<section id="contact">
<h1>Let's work together...</h1>
<p>How do you take your coffee?</p>
<div id="profile-link">
<button class="social">
<!-- icons -->
<i class="fab fa-facebook"> Facebook</i>
</button>
<button class="social">
<i class="fab fa-github"> GitHub</i>
</button>
<button class="social">
<i class="fab fa-twitter"> Twitter</i>
</button>
<button class="social">
<i class="fab fa-mailchimp"> Send an email</i>
</button>
<button class="social">
<i class="fab fa-sellsy"> Call me</i> </button>
</div>
</section>
<!-- Footer -->
<footer>
<p class="left">
**This is just a fake portfolio. All the projects and contact details
given are not real.
</p>
<p class="right"></p>
© Created for freeCodeCamp
</p>
</footer>
</body>
</html>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: Verdana, Geneva, Tahoma, sans-serif;
overscroll-behavior-y: none;
}
a {
color: #f0eff4;
text-decoration: none;
font-size: 20px;
cursor: pointer;
padding: 20px;
}
li {
display: inline;
}
img {
width: 100%;
}
nav {
background-color: #fb3640;
width: 100%;
top: 0;
right: 0;
position: fixed;
align-items: center;
justify-content: center;
text-align: right;
padding: 20px;
z-index: 1;
}
nav a:hover {
background-color: #577399;
transition: linear;
}
header {
margin-top: 60px;
height: calc(100vh - 60px);
background-image: linear-gradient(
90deg,
rgba(0, 0, 0, 0.5),
rgba(0, 0, 0, 0.5)
),
url(./bg.jpeg);
background-repeat: no-repeat;
background-size: cover;
background-position: top;
font-family: fantasy;
color: #f0eff4;
position: relative;
}
header h1 {
font-size: 45px;
}
header p {
font-size: 20px;
}
#welcome-section {
position: absolute;
top: 50%;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%);
}
/* Projects */
#projects {
background-color: #f0eff4;
color: #577399;
padding: 40px 0 40px 0;
position: relative;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
#projects h1 {
width: fit-content;
margin-bottom: 40px;
padding: 0 10px 5px 10px;
border-bottom: solid 2px #577399;
text-align: center;
}
.container {
flex-wrap: wrap;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.project {
width: 350px;
height: 400px;
object-fit: cover;
background-color: #7389ae;
border-radius: 3px;
margin: 10px;
font-size: 20px;
cursor: pointer;
transition: 2s;
}
.project:hover {
transform: scale(0.97);
}
.project img {
max-height: 350px;
position: top;
}
.project-title {
color: #f0eff4;
display: block;
margin-block-start: 0.5em;
margin-block-end: 0.5em;
margin-inline-start: 0px;
margin-inline-end: 0px;
text-align: center;
}
#projects button {
background-color: #577399;
border-radius: 3px;
padding: 10px 25px;
margin-top: 20px;
color: #f0eff4;
border-style: none;
font-size: 20px;
font-weight: bolder;
cursor: pointer;
}
#projects button:hover {
color: #fb3640;
}
/* Contact */
#contact {
background-color: #7389ae;
height: calc(100vh - 140px);
line-height: 1.5;
color: #f0eff4;
text-align: center;
position: relative;
align-items: center;
justify-content: center;
display: flex;
flex-direction: column;
letter-spacing: 1.5px;
}
#contact h1 {
font-size: 50px;
}
#contact p {
font-size: 20px;
margin-bottom: 30px;
}
#contact button {
padding: 10px;
font-size: 27px;
font-weight: bold;
background-color: transparent;
border: none;
color: #f0eff4;
transition: 1s ease;
}
#contact button:hover {
cursor: pointer;
transform: translate(0, 10%);
}
footer {
border-top: solid 5px #fb3640;
background-color: #7389ae;
color: #f0eff4;
display: flex;
flex-direction: row;
width: 100%;
height: 80px;
padding: 10px 0 10px 0;
text-align: center;
justify-content: space-evenly;
align-items: center;
}
.left {
float: left;
width: 70%;
}
.right {
float: 30%;
padding-left: 30px;
}
@media screen and (max-width: 500px) {
#navbar {
text-align: center;
}
footer {
display: flex;
flex-direction: column;
height: 100px;
}
#contact {
height: calc(100vh - 160px);
}
.right {
margin-top: 5px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment