HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URL's added here will be added as <link>
s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
If the stylesheet you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<!-- images by https://placeimg.com/ -->
<body>
<nav>
<ul>
<li><a href="#home">home</a></li>
<li><a href="#about">about</a></li>
<li><a href="#portfolio">portfolio</a></li>
<li><a href="#contact">contact</a></li>
</ul>
</nav>
<div class="container-all">
<div class="welcome" id="home">
<div id="particles"></div>
<button class="menu-button">
<svg class="hamburger" x="0px" y="0px"
viewBox="0 0 30 17" height="17" width="30" >
<g transform="translate(-15 -15)">
<rect x="15" y="16" class="st0" width="30" height="2"/>
</g>
<g transform="translate(-15 -9)">
<rect x="15" y="16" class="st0" width="30" height="2"/>
</g>
<g transform="translate(-15 -3)">
<rect x="15" y="16" class="st0" width="30" height="2"/>
</g>
</svg>
<svg class="close-icon" x="0px" y="0px"
viewBox="0 0 30 17" height="17" width="30">
<g transform="translate(-15 -15)">
<polygon class="st0" points="31.2,23.5 37,29.3 35.8,30.5 30,24.7 24.2,30.5 23,29.3 28.8,23.5 23,17.7 24.2,16.5 30,22.3
35.8,16.5 37,17.7 "/>
</g>
</svg>
</button>
<h1>Welcome to my<span>Portfolio</span></h1>
</div>
<section class="intro">
<div class="intro-left">
<img src="https://placeimg.com/640/480/tech" alt="random image">
</div>
<div class="intro-middle">
<h2>Making it happen</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sit amet eleifend justo. Quisque non magna vel justo eleifend imperdiet</p>
</div>
<div class="intro-right">
<img src="https://placeimg.com/640/480/tech/sepia" alt="random image">
</div>
</section>
<section class="about-me" id="about">
<h1 class="about-title">Joe Portfolio</h1>
<h2 class="about-subtitle">Designer & Developer</h2>
<div class="about-text">
<p>Aenean mattis tristique elementum. Duis massa tellus, tempus non fermentum at, venenatis et augue. Phasellus tristique purus sed sagittis interdum. Duis luctus sapien justo, vel viverra ex convallis et. Maecenas suscipit lacus ut lectus mattis
ornare. Vestibulum faucibus purus sit amet erat lobortis, tristique fringilla leo sodales. Interdum et malesuada fames ac ante.</p>
<p>Aenean mattis tristique elementum. Duis massa tellus, tempus non fermentum at, venenatis et augue. Phasellus tristique purus sed sagittis interdum. Duis luctus sapien justo, vel viverra ex convallis et. Maecenas suscipit lacus ut lectus mattis
ornare. Vestibulum faucibus purus sit amet erat lobortis, tristique fringilla leo sodales. Interdum et malesuada fames ac ante.</p>
</div>
</section>
<section class="portfolio" id="portfolio">
<h1 class="white">My Work </h1>
<div class="portfolio-items">
<!-- Portfolio item 1 -->
<figure class="portfolio-item">
<img class="portfolio-image" src="https://placeimg.com/640/480/tech/sepia" alt="portfolio item">
<figcaption>
<h2 class="portfolio-title">Project Name</h2>
<p class="portfolio-desc">A short description could go right here</p>
<a href="#" class="portfolio-link">More info</a>
</figcaption>
<!-- Portfolio modal 1 -->
<div class="portfolio-modal">
<button class="modal-close">
<svg x="0px" y="0px"
viewBox="0 0 30 17" height="17" width="30">
<g transform="translate(-15 -15)">
<polygon class="st0" points="31.2,23.5 37,29.3 35.8,30.5 30,24.7 24.2,30.5 23,29.3 28.8,23.5 23,17.7 24.2,16.5 30,22.3
35.8,16.5 37,17.7 "/>
</g>
</svg>
</button>
<div class="portfolio-header header-one">
<div class="portfolio-title-box">
<h2 class="portfolio-title">Project Name</h2>
<p class="portfolio-subtitle">Subtitle goes here</p>
</div>
</div>
<!-- / portfolio-header -->
<div class="portfolio-content">
<p>Aenean mattis tristique elementum. Duis massa tellus, tempus non fermentum at, venenatis et augue. Phasellus tristique purus sed sagittis interdum. Duis luctus sapien justo, vel viverra ex convallis et. Maecenas suscipit lacus ut lectus
mattis ornare. Vestibulum faucibus purus sit amet erat lobortis, tristique fringilla leo sodales. Interdum et malesuada fames ac ante.</p>
<img class="portfolio-full-width" src="https://placeimg.com/640/480/tech/sepia" alt="an image">
<p>Aenean mattis tristique elementum. Duis massa tellus, tempus non fermentum at, venenatis et augue. Phasellus tristique purus sed sagittis interdum. Duis luctus sapien justo, vel viverra ex convallis et. Maecenas suscipit lacus ut lectus
mattis ornare. Vestibulum faucibus purus sit amet erat lobortis, tristique fringilla leo sodales. Interdum et malesuada fames ac ante.</p>
<p>Aenean mattis tristique elementum. Duis massa tellus, tempus non fermentum at, venenatis et augue. Phasellus tristique purus sed sagittis interdum. Duis luctus sapien justo, vel viverra ex convallis et. Maecenas suscipit lacus ut lectus
mattis ornare. Vestibulum faucibus purus sit amet erat lobortis, tristique fringilla leo sodales. Interdum et malesuada fames ac ante.</p>
<img class="portfolio-pull-left" src="https://placeimg.com/640/480/tech/sepia" alt="an image">
<p>Aenean mattis tristique elementum. Duis massa tellus, tempus non fermentum at, venenatis et augue. Phasellus tristique purus sed sagittis interdum. Duis luctus sapien justo, vel viverra ex convallis et. Maecenas suscipit lacus ut lectus
mattis ornare. Vestibulum faucibus purus sit amet erat lobortis, tristique fringilla leo sodales. Interdum et malesuada fames ac ante.</p>
<p>Aenean mattis tristique elementum. Duis massa tellus, tempus non fermentum at, venenatis et augue. Phasellus tristique purus sed sagittis interdum. Duis luctus sapien justo, vel viverra ex convallis et. Maecenas suscipit lacus ut lectus
mattis ornare. Vestibulum faucibus purus sit amet erat lobortis, tristique fringilla leo sodales. Interdum et malesuada fames ac ante.</p>
<img class="portfolio-pull-right" src="https://placeimg.com/640/480/tech/sepia" alt="an image">
</div>
</div>
<!-- /modal -->
</figure>
<!-- Portfolio item 2 -->
<figure class="portfolio-item">
<img class="portfolio-image" src="https://placeimg.com/640/480/people/grayscale" alt="portfolio item">
<figcaption>
<h2 class="portfolio-title">Project Name</h2>
<p class="portfolio-desc">A short description could go right here</p>
<a href="#" class="portfolio-link">More info</a>
</figcaption>
<div class="portfolio-modal">
<button class="modal-close">
<svg x="0px" y="0px"
viewBox="0 0 30 17" height="17" width="30">
<g transform="translate(-15 -15)">
<polygon class="st0" points="31.2,23.5 37,29.3 35.8,30.5 30,24.7 24.2,30.5 23,29.3 28.8,23.5 23,17.7 24.2,16.5 30,22.3
35.8,16.5 37,17.7 "/>
</g>
</svg>
</button>
<div class="portfolio-header header-two">
<div class="portfolio-title-box">
<h2 class="portfolio-title">Project Name 2</h2>
<p class="portfolio-subtitle">Subtitle goes here</p>
</div>
</div>
<!-- / portfolio-header -->
<div class="portfolio-content">
<p>Aenean mattis tristique elementum. Duis massa tellus, tempus non fermentum at, venenatis et augue. Phasellus tristique purus sed sagittis interdum. Duis luctus sapien justo, vel viverra ex convallis et. Maecenas suscipit lacus ut lectus
mattis ornare. Vestibulum faucibus purus sit amet erat lobortis, tristique fringilla leo sodales. Interdum et malesuada fames ac ante.</p>
<img class="portfolio-full-width" src="https://placeimg.com/640/480/people/grayscale" alt="an image">
<p>Aenean mattis tristique elementum. Duis massa tellus, tempus non fermentum at, venenatis et augue. Phasellus tristique purus sed sagittis interdum. Duis luctus sapien justo, vel viverra ex convallis et. Maecenas suscipit lacus ut lectus
mattis ornare. Vestibulum faucibus purus sit amet erat lobortis, tristique fringilla leo sodales. Interdum et malesuada fames ac ante.</p>
<p>Aenean mattis tristique elementum. Duis massa tellus, tempus non fermentum at, venenatis et augue. Phasellus tristique purus sed sagittis interdum. Duis luctus sapien justo, vel viverra ex convallis et. Maecenas suscipit lacus ut lectus
mattis ornare. Vestibulum faucibus purus sit amet erat lobortis, tristique fringilla leo sodales. Interdum et malesuada fames ac ante.</p>
<img class="portfolio-pull-left" src="https://placeimg.com/640/480/people/grayscale" alt="an image">
<p>Aenean mattis tristique elementum. Duis massa tellus, tempus non fermentum at, venenatis et augue. Phasellus tristique purus sed sagittis interdum. Duis luctus sapien justo, vel viverra ex convallis et. Maecenas suscipit lacus ut lectus
mattis ornare. Vestibulum faucibus purus sit amet erat lobortis, tristique fringilla leo sodales. Interdum et malesuada fames ac ante.</p>
<p>Aenean mattis tristique elementum. Duis massa tellus, tempus non fermentum at, venenatis et augue. Phasellus tristique purus sed sagittis interdum. Duis luctus sapien justo, vel viverra ex convallis et. Maecenas suscipit lacus ut lectus
mattis ornare. Vestibulum faucibus purus sit amet erat lobortis, tristique fringilla leo sodales. Interdum et malesuada fames ac ante.</p>
<img class="portfolio-pull-right" src="https://placeimg.com/640/480/people/grayscale" alt="an image">
</div>
</div>
</figure>
<!-- Portfolio item 3 -->
<figure class="portfolio-item">
<img class="portfolio-image" src="https://placeimg.com/640/480/arch" alt="portfolio item">
<figcaption>
<h2 class="portfolio-title">Project Name</h2>
<p class="portfolio-desc">A short description could go right here</p>
<a href="#" class="portfolio-link">More info</a>
</figcaption>
</figure>
<!-- Portfolio item 4 -->
<figure class="portfolio-item">
<img class="portfolio-image" src="https://placeimg.com/640/480/tech" alt="portfolio item">
<figcaption>
<h2 class="portfolio-title">Project Name</h2>
<p class="portfolio-desc">A short description could go right here</p>
<a href="#" class="portfolio-link">More info</a>
</figcaption>
</figure>
<!-- Portfolio item 5 -->
<figure class="portfolio-item featured">
<img class="portfolio-image" src="https://placeimg.com/640/480/tech/grayscale" alt="portfolio item">
<figcaption>
<h2 class="portfolio-title">Project Name</h2>
<p class="portfolio-desc">A short description could go right here</p>
<a href="#" class="portfolio-link">More info</a>
</figcaption>
</figure>
</div>
</section>
<section class="contact" id="contact">
<h1>Contact me</h1>
<form action="">
<label class="name" class="name">Name:
<input type="text" id="name">
</label>
<label class="email" class="email">Email:
<input type="email" id="email">
</label>
<label message="message" class="message">Message:
<textarea name="" id="message"></textarea>
</label>
<input class="button form-button" type="submit" value="SEND">
</form>
</section>
<footer>
<p>Follow me on social media</p>
<div class="social-icons">
<div class="social-icon fa fa-twitter"></div>
<div class="social-icon fa fa-linkedin"></div>
<div class="social-icon fa fa-github"></div>
</div>
<p class="copyright">Pasteleft 2049 Joe</p>
</footer>
</div>
</body>
@import url("https://fonts.googleapis.com/css?family=Merriweather:400,900|Six+Caps");
/* base */
body {
color: #a7a7a7;
font-family: "Merriweather", serif;
line-height: 1.6;
background: #ffffff;
font-size: 0.875rem;
overflow-x: hidden;
}
@media (min-width: 50em) {
body {
font-size: 1.125rem;
}
}
img {
max-width: 100%;
}
h1,
h2,
p {
margin-top: 0;
margin-bottom: 1em;
}
h1 {
color: #03afc2;
line-height: 1;
font-size: 3.125rem;
}
@media (min-width: 50em) {
h1 {
font-size: 4.25rem;
}
}
h2 {
font-size: 2rem;
letter-spacing: 0.15em;
color: #606060;
text-transform: uppercase;
line-height: 1;
font-family: "Six Caps", sans-serif;
font-weight: 400;
}
@media (min-width: 50em) {
h2 {
font-size: 3rem;
}
}
/* navigation */
.menu-button {
position: absolute;
top: 3em;
left: 3em;
background: transparent;
border: 0;
transition: transform ease-in-out 250ms;
cursor: pointer;
outline: none;
}
nav {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 20%;
z-index: 10;
transform: translateX(-100%);
transition: transform ease-out 250ms;
}
nav li,
nav a {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
width: 100%;
}
nav ul {
margin: 0;
padding: 0;
list-style: none;
display: flex;
flex-direction: column;
height: 100vh;
justify-content: space-around;
align-items: stretch;
background: #03afc2;
}
nav li {
text-align: center;
}
nav li:not(:last-of-type) {
border-bottom: 1px solid #223843;
}
nav li:hover {
background: rgba(0, 0, 0, 0.2);
}
nav a {
font-size: 4rem;
letter-spacing: 0.15em;
color: #223843;
text-transform: uppercase;
line-height: 1;
font-family: "Six Caps", sans-serif;
font-weight: 400;
text-decoration: none;
}
.close-icon {
display: none;
}
.nav-is-open nav {
transform: translateX(0);
}
.nav-is-open .container-all {
transform: translateX(80%);
}
.nav-is-open .hamburger {
display: none;
}
.nav-is-open .close-icon {
display: block;
}
.nav-is-open .menu-button {
transform: translateX(-70%);
}
.container-all {
transition: transform ease-out 250ms;
transition: transform ease-out 250ms, -webkit-transform ease-out 250ms;
}
/* home */
.welcome {
background-image: url(../img/header-bg.png);
background-size: cover;
background-position: center;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.welcome h1 {
font-size: 1.5rem;
font-weight: 400;
color: #223843;
line-height: 2;
text-align: center;
}
@media (min-width: 50em) {
.welcome h1 {
font-size: 3vw;
}
}
.welcome h1 span {
font-size: 5.5rem;
letter-spacing: 0.15em;
color: #03afc2;
text-transform: uppercase;
line-height: 1;
font-family: "Six Caps", sans-serif;
font-weight: 400;
display: block;
}
@media (min-width: 50em) {
.welcome h1 span {
font-size: 10vw;
}
}
.welcome h1::before,
.welcome h1::after {
content: "";
display: block;
width: 60%;
height: 1px;
background: #223843;
}
.welcome h1::before {
margin: 0 auto 2em;
}
.welcome h1::after {
margin: 2em auto 0;
}
.intro {
display: flex;
color: rgba(255, 255, 255, 0.7);
}
.intro h2 {
color: #ffffff;
}
.intro h2::after {
content: "";
width: 20%;
height: 1px;
background: rgba(255, 255, 255, 0.5);
display: block;
margin: 1em auto 0;
}
@supports (display: grid) {
.intro {
display: grid;
grid-template-columns: minmax(4em, 1fr) minmax(auto, 30em) minmax(4em, 1fr);
}
}
.intro-middle {
background: #223843;
padding: 2.5em 5vw;
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
}
.intro-left img,
.intro-right img {
object-fit: cover;
min-height: 100%;
min-width: 100%;
display: block;
}
/* About */
.about-me {
width: 90%;
margin: 0 auto;
max-width: 50em;
margin-top: 5em;
margin-bottom: 5em;
}
.about-me::after {
content: "";
display: block;
clear: both;
}
.about-img {
max-height: 25em;
}
@media (min-width: 42em) {
.about-img {
float: left;
margin-right: 1em;
}
}
.about-title {
margin-bottom: 0.25em;
}
.about-subtitle {
margin: 0.5em 0;
}
@supports (display: grid) {
.about-me {
display: grid;
grid-template-columns: [port-start] minmax(6em, 1fr) [name-start] minmax(
6em,
1fr
) [img-end] 2fr [port-end];
grid-column-gap: 0.5em;
}
.about-img {
grid-column: port / img;
grid-row: 1 / 2;
}
@media (min-width: 50em) {
.about-img {
grid-row: 1 / 4;
}
}
.about-title {
grid-column: name / port;
grid-row: 1 / 2;
align-self: end;
}
.about-subtitle,
.about-text {
grid-column: port / port;
}
@media (min-width: 50em) {
.about-subtitle,
.about-text {
grid-column: image-end / port-end;
}
}
.about-subtitle {
grid-row: 2 / 3;
}
.about-text {
grid-row: 3 / 4;
}
}
/* Portfolio */
.portfolio {
text-align: center;
background: #223843; /* #e8e9eb;*/
padding: 5em 0;
}
.portfolio-items {
display: flex;
flex-wrap: wrap;
width: 90%;
margin: 0 auto;
max-width: 75em;
}
.portfolio-item {
position: relative;
overflow: hidden;
flex: 1 1 20rem;
}
.portfolio-item .portfolio-image {
display: block;
width: 100%;
}
.portfolio-item figcaption {
position: absolute;
top: 100%;
bottom: 0;
right: 0;
left: 0;
padding: 1em;
background: rgba(3, 175, 194, 0.75);
color: #ffffff;
text-align: left;
display: flex;
flex-direction: column;
transition: top ease-in-out 0.65s;
}
.portfolio-item:hover figcaption,
.portfolio-item:focus figcaption {
top: 0;
}
.portfolio-title {
color: #ffffff;
font-size: 1.5rem;
margin-bottom: auto;
}
@media (min-width:42em){
.portfolio-title{
font-size: 2.5rem;
}
}
.portfolio-desc {
display: none;
}
.portfolio-link {
color: white;
font-weight: 900;
font-size: .7rem;
text-decoration: none;
border-bottom: 3px solid #ffffff;
align-self: flex-start;
}
@media (min-width:42em){
.portfolio-link{
font-size: 1.1rem;
}
}
.portfolio-link::after {
content: url(../img/arrow-white.svg);
display: inline-block;
height: 0.8em;
width: 0.8em;
margin-left: 0.5em;
}
@supports (display: grid) {
.portfolio-items {
display: grid;
grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 50em) {
.portfolio-items {
grid-template-columns: repeat(4, 1fr);
}
}
.portfolio-item.featured {
grid-column: 1 / span 2;
grid-row: 1 / span 2;
}
.featured .portfolio-title {
font-size: 5rem;
}
.featured .portfolio-desc {
display: block;
}
}
.portfolio-modal {
position: fixed;
z-index: 10;
top: 2em;
bottom: 2em;
left: 2em;
right: 2em;
background: white;
box-shadow: 0 0 0 3em rgba(0, 0, 0, 0.5);
overflow-y: scroll;
overflow-x: hidden;
display: none;
}
.portfolio-modal.is-open {
display: block;
}
.modal-close {
background: white;
position: fixed;
left: 1em;
top: 1em;
border: 0;
width: 2em;
height: 2em;
padding: 4px 0 0;
border-radius: 50%;
cursor: pointer;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}
.portfolio-header {
text-align: left;
padding: 5em 0;
margin-bottom: 2em;
background-size: cover;
background-position: center;
}
.header-one {
background-image: url(https://placeimg.com/640/480/tech);
}
.header-two {
background-image: url(https://placeimg.com/640/480/tech);
}
.portfolio-title-box {
background: rgba(3, 175, 194, 0.75);
padding: 3em 0 3em 3em;
color: white;
width: 70%;
}
.portfolio-title-box .portfolio-title {
font-size: 3.5rem;
display: inline-block;
}
.portfolio-title-box .portfolio-title::after {
content: "";
display: block;
height: 1px;
margin: 0.5em 0;
background: white;
width: 100%;
}
.portfolio-subtitle {
font-size: 1rem;
}
.portfolio-content {
text-align: left;
width: 85%;
margin: 0 auto;
padding-bottom: 2em;
}
.portfolio-full-width {
width: 100vw;
max-width: initial;
margin: 2em calc(50% - 50vw);
height: 20vh;
object-fit: cover;
}
@media (min-width: 50em) {
.portfolio-pull-left {
width: 65%;
float: left;
margin-right: 2em;
}
.portfolio-pull-right {
width: 65%;
float: right;
margin-left: 2em;
}
}
@keyframes modalIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes modalOut {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
/* Contact */
.contact {
width: 90%;
margin: 0 auto;
max-width: 50em;
padding: 5em 0;
}
.contact h1 {
text-align: center;
}
form {
display: flex;
flex-direction: column;
}
@supports (display: grid) {
@media (min-width: 50em) {
form {
display: grid;
grid-template-columns: 50% 50%;
grid-column-gap: 1em;
grid-template-areas: "name email" "message message" " . button";
}
form .name {
grid-area: name;
}
form .email {
grid-area: email;
}
form .message {
grid-area: message;
}
form .message textarea {
height: 10em;
}
form .button {
grid-area: button;
}
}
}
label {
display: block;
margin-top: 1em;
color: #606060;
}
input,
textarea {
box-sizing: border-box;
display: block;
padding: 0.75em;
width: 100%;
min-width: 15em;
background: #fbfbfc;
border: 1px solid #e8e9eb;
font-size: 1.2rem;
}
textarea {
resize: vertical;
outline: none;
}
.button {
display: inline-block;
width: auto;
min-width: auto;
margin-top: 1em;
margin-left: auto;
background: #03afc2;
border: none;
font-size: 2.5rem;
letter-spacing: 0.15em;
color: #ffffff;
text-transform: uppercase;
line-height: 1;
font-family: "Six Caps", sans-serif;
font-weight: 400;
padding: 0.5em 1.5em;
}
/* Footer */
footer {
background: #223843;
padding: 5em 0;
text-align: center;
}
.social-icons {
width: 90%;
margin: 0 auto;
max-width: 15em;
display: flex;
justify-content: space-between;
margin: 1.75em auto 4em;
}
.social-icon {
font-size: 2em;
}
.social-icon:hover {
color: white;
transform: scale(1.1);
transition: all 0.5s ease-in;
cursor: pointer;
}
.copyright::before {
content: "";
display: block;
height: 1px;
background: rgba(255, 255, 255, 0.15);
margin: 4em auto;
width: 25%;
}
/* utility classes */
.white{
color:white;
}
#particles {
position: absolute;
display: block;
top: 0;
left: 0;
height: 100%;
width:100%;
z-index: -1;
}
// Navigation
const navToggle = document.querySelector('.menu-button')
const nav = document.querySelector('nav')
const containerAll = document.querySelector('.container-all')
const containerAllStyle = containerAll.style
const bodyClassList = document.body.classList
navToggle.addEventListener('click', _ => {
containerAllStyle.transition = 'transform 250ms ease-in-out'
bodyClassList.toggle('nav-is-open')
})
nav.addEventListener('click', _ => {
containerAllStyle.transition = '0ms'
bodyClassList.remove('nav-is-open')
})
// modal
const portfolioContainer = document.querySelector('.portfolio-items')
portfolioContainer.addEventListener('click', e => {
// console.log(e)
e.preventDefault()
const modalToggle = e.target.closest('.portfolio-link')
// console.log(modalToggle)
if (! modalToggle) return
const modal = modalToggle.parentNode.nextElementSibling
const closeButton = modal.querySelector('.modal-close')
const modalOpen = _ => {
modal.classList.add('is-open')
modal.style.animation = 'modalIn 500ms forwards'
//document.body.style.overflowY = 'hidden'
}
const modalClose = _ => {
modal.classList.remove('is-open')
modal.removeEventListener('animationend', modalClose)
}
closeButton.addEventListener('click', _ => {
modal.style.animation = 'modalOut 500ms forwards'
modal.addEventListener('animationend', modalClose)
//document.body.style.overflowY = 'scroll'
})
document.addEventListener('keydown', e => {
if ( e.keyCode === 27 ) {
modal.style.animation = 'modalOut 500ms forwards'
modal.addEventListener('animationend', modalClose)
document.body.style.overflowY = 'scroll'
}
})
modalOpen()
})
//Particles JS config
particlesJS("particles", {
particles: {
number: { value: 160, density: { enable: true, value_area: 800 } },
color: { value: "#03afc2" },
shape: {
type: "circle",
stroke: { width: 0, color: "#000000" },
polygon: { nb_sides: 5 }
},
opacity: {
value: 1,
random: true,
anim: { enable: true, speed: 1, opacity_min: 0, sync: false }
},
size: {
value: 3,
random: true,
anim: { enable: false, speed: 4, size_min: 0.3, sync: false }
},
line_linked: {
enable: false,
distance: 150,
color: "#ffffff",
opacity: 0.4,
width: 1
},
move: {
enable: true,
speed: 1,
direction: "none",
random: true,
straight: false,
out_mode: "out",
bounce: false,
attract: { enable: false, rotateX: 600, rotateY: 600 }
}
},
interactivity: {
detect_on: "canvas",
events: {
onhover: { enable: true, mode: "bubble" },
onclick: { enable: true, mode: "repulse" },
resize: true
},
modes: {
grab: { distance: 400, line_linked: { opacity: 1 } },
bubble: { distance: 250, size: 0, duration: 2, opacity: 0, speed: 3 },
repulse: { distance: 400, duration: 0.4 },
push: { particles_nb: 4 },
remove: { particles_nb: 2 }
}
},
retina_detect: true
});
var count_particles, stats, update;
stats = new Stats();
stats.setMode(0);
stats.domElement.style.position = "absolute";
stats.domElement.style.left = "0px";
stats.domElement.style.top = "0px";
document.body.appendChild(stats.domElement);
count_particles = document.querySelector(".js-count-particles");
update = function() {
stats.begin();
stats.end();
if (window.pJSDom[0].pJS.particles && window.pJSDom[0].pJS.particles.array) {
count_particles.innerText = window.pJSDom[0].pJS.particles.array.length;
}
requestAnimationFrame(update);
};
requestAnimationFrame(update);
Also see: Tab Triggers