Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

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.

+ add another resource

Packages

Add Packages

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.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class='wrapper'>
  <div class="container">
    <header id="home">
      <nav class="navbar">
        <h2 class='name'>Sachin Samal</h2>
        <ul class="navbar__ul">
          <li class='link'><a href="#portfolio">Projects</a></li>
          <li class='link'><a href="#skills">Skills</a></li>
          <li class='link'><a href="#contact">Contact</a></li>
          <li>
            <!-- Dark Theme Toggle  -->
            <button class='darkmode'><i class="fas fa-moon"></i></button>
          </li>
        </ul>
      </nav>
      <div class="header__container">
        <img src="https://avatars.githubusercontent.com/u/88958992?v=4" alt="profile-image">
        <div class="header__text__container">
          <p class="header__text">Hi! I am a front-end designer and developer. Here, I've created a simple beginner friendly portfolio template responsive across different browsers and devices. Feel free to use and make any changes as per your need.</p>
        </div>
      </div>
    </header>
  </div>

  <main class="portfolio" id='portfolio'>
    <h2 class='portfolio__header'>Projects</h2>
    <div class="portfolio__container">
      <article class='card'>
        <img src='https://cdn-icons-png.flaticon.com/512/3437/3437297.png' alt="page">
        <div class="text-container">
          <h2>Connection Page</h2>
          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
        </div>
      </article>

      <article class='card'>
        <img src='https://cdn-icons-png.flaticon.com/512/993/993725.png' alt="page">
        <div class="text-container">
          <h2>Data Collection App</h2>
          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
        </div>
      </article>

      <article class='card'>
        <img src='https://cdn-icons-png.flaticon.com/512/1055/1055645.png' alt="app">
        <div class="text-container">
          <h2>Search App</h2>
          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
        </div>
      </article>

      <article class='card'>
        <img src='https://cdn-icons-png.flaticon.com/512/4257/4257674.png' alt="app">
        <div class="text-container">
          <h2>Favorite Spots</h2>
          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
        </div>
      </article>

      <article class='card'>
        <img src='https://cdn-icons-png.flaticon.com/512/5956/5956494.png' alt="gallery">
        <div class="text-container">
          <h2>Project Gallery</h2>
          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
        </div>
      </article>

      <article class='card'>
        <img src='https://cdn-icons-png.flaticon.com/512/891/891175.png' alt="Calculator">
        <div class="text-container">
          <h2>Calculator</h2>
          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
        </div>
      </article>
    </div>

    <section class='skills' id='skills'>
      <h2>Skills</h2>
      <article class="skills-container">
        <div class="skills__item" data-aos='fade-up'>
          <img src="https://cdn-icons-png.flaticon.com/512/1199/1199124.png" alt="JS">
          <p>Javascript</p>
        </div>

        <div class="skills__item" data-aos='fade-up'>
          <img src="https://cdn-icons-png.flaticon.com/512/1051/1051277.png" alt="HTML5">
          <p>HTML5</p>
        </div>

        <div class="skills__item" data-aos='fade-up'>
          <img src="https://cdn-icons-png.flaticon.com/512/732/732190.png" alt="css">
          <p>CSS3</p>
        </div>

        <div class="skills__item" data-aos='fade-up'>
          <img src="https://cdn-icons-png.flaticon.com/512/5968/5968705.png" alt="figma">
          <p>Figma</p>
        </div>

        <div class="skills__item" data-aos='fade-up'>
          <img src="https://cdn-icons-png.flaticon.com/512/5968/5968559.png" alt="Github">
          <p>Github</p>
        </div>
      </article>
    </section>

    <footer>
      <div class="wrapper">
        <div class="footer__text-container" id='contact'>
          <h2>Contact</h2>
          <p>Lets connect if you want to collaborate...</p>
        </div>
        <div class="footer__text-container1">
          <p><span class='phone'>Phone</span> <strong>+1 (111) 222-3333</strong></p>
          <p><span class='email'>Email</span> <strong>123@gmail.com</strong></p>
        </div>
      </div>
      <hr class='footer__nav-hr'>
      <nav class="footer__nav">
        <h3>Sachin</h3>
        <ul class='footer__nav-links'>
          <li><a href="#home">Home</a></li>
          <li><a href="#portfolio">Projects</a></li>
        </ul>
        <p class='to-top'><a href="#top"><strong>BACK TO TOP</strong></a></p>
      </nav>
    </footer>
  </main>
</div>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css2?family=Hind+Madurai:wght@300;400;500;600;700&family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap");

:root {
  --clr-background: rgb(247, 244, 244);
  --clr-gray: rgb(119, 114, 114);
  --font-main: "Montserrat", sans-serif;
  --clr-dark-gray: #262626;
  --clr-dark-black: #333;
  --clr-dark-text: rgb(226, 225, 225);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  font-family: "Hind Madurai", sans-serif;
  margin: 0 auto;
  overflow-x: hidden;
}

.wrapper {
  background-color: var(--clr-background);
}

/* -------------------------Header/Navbar */
header {
  font-family: var(--font-main);
  padding-top: 30px;
  width: 100%;
  margin: 0 auto;
}

.navbar {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 60px;
}

.navbar__ul {
  display: flex;
  flex-direction: column;
  align-items: center;
  list-style-type: none;
  width: 100%;
  max-width: 500px;
}

.navbar__ul .name {
  font-size: 23px;
  font-weight: 600;
}

.navbar__ul a {
  text-decoration: none;
  color: black;
}

.navbar__ul li {
  background: rgba(235, 230, 230, 0.3);
  width: 50%;
  text-align: center;
  margin-top: 2px;
  margin-bottom: 2px;
  padding-top: 5px;
  padding-bottom: 5px;
}

.link,
.portfolio__header,
footer h2 {
  text-transform: uppercase;
}

.header__container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 40px;
  margin-bottom: 15px;
  padding-bottom: 2rem;
  margin: 0 auto;
  max-width: 80%;
}

.header__container img {
  width: 70%;
}

.header__text {
  width: 100%;
  margin-top: 20px;
  line-height: 1.5rem;
  text-align: center;
}
/* End of Header/Navbar--------------------- */

/* Portfolio section ----------------------- */
.portfolio,
.portfolio__container {
  display: flex;
}

.portfolio {
  background-color: rgb(238, 237, 237);
  margin-top: 2.5rem;
  padding-top: 3rem;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 0 auto;
}

.portfolio__header {
  font-family: var(--font-main);
  font-size: 2rem;
  margin-bottom: 2.5rem;
}

.portfolio__container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto;
  place-items: center;
  grid-gap: 0.5rem;
  text-align: center;
  align-items: stretch;
  width: 100%;
  padding: 0.5rem;
}

.card {
  margin: 1rem 0;
  border: 1.5px solid #888;
  padding: 0.5rem;
  gap: 1rem;
  width: 350px;
  max-width: 100%;
  height: 100%;
}

.card img {
  width: 25%;
  margin-bottom: 1rem;
}

.card h2 {
  font-family: var(--font-main);
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 20px;
}

.text-container {
  width: 70%;
  margin: 0 auto;
}

/* End of services------------------------ */

/* Skills --------------------------------- */
.skills {
  text-align: center;
  margin-top: 2rem;
}

.skills h2 {
  font-family: var(--font-main);
  text-transform: uppercase;
  font-size: 2rem;
}

.skills-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 1rem;
  margin-top: 2rem;
  text-align: center;
}

.skills__item {
  margin-bottom: 1rem;
  cursor: pointer;
}

.skills__item img:hover {
  transform: scale(1.1);
  transition: ease-out 0.3s;
}

.skills img {
  max-width: 80px;
  margin-bottom: -5px;
}

/* Footer --------------------------------- */

footer {
  font-family: var(--font-main);
  display: flex;
  flex-direction: column;
  text-align: center;
  width: 100%;
  background-color: var(--clr-background);
}

.footer__nav {
  width: 100%;
  display: flex;
  min-height: 30px;
  padding: 10px;
  bottom: 0;
  text-align: center;
  justify-content: space-between;
}

footer h2 {
  font-size: 2rem;
  margin-top: 2rem;
}

.footer__nav-links {
  display: none;
}

.footer__nav-links li a {
  text-decoration: none;
  color: black;
  text-transform: uppercase;
}

.footer__nav-hr {
  width: 100%;
}

footer p {
  max-width: 400px;
  padding-bottom: 1rem;
  margin: 0 auto;
}

.to-top {
  list-style-type: none;
  margin-right: 10px;
  justify-self: flex-end;
}

.to-top a {
  text-decoration: none;
  color: black;
}

@media screen and (min-width: 768px) {
  .header__container {
    min-width: 600px;
  }

  header {
    padding-bottom: 4rem;
  }

  .navbar {
    width: 100%;
    display: flex;
    bottom: 0;
    justify-content: space-between;
    padding-left: 4rem;
    padding-right: 4rem;
  }

  .navbar ul {
    display: flex;
    flex-direction: row;
  }

  .navbar__ul li {
    padding: 5px 15px 15px 10px;
    background-color: transparent;
  }

  .header__container {
    display: flex;
    flex-direction: row-reverse;
    margin-bottom: 15px;
    align-items: center;
    justify-content: center;
  }

  .header__container img {
    max-width: 300px;
  }

  .header__container p {
    max-width: 350px;
    text-align: left;
  }

  /* Portfolio section at 768----------- */
  .portfolio__container {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 1165px;
  }

  /* Skills at 768 ------------------- */

  .skills-container {
    flex-direction: row;
    justify-content: center;
    flex-grow: 1;
    width: 100%;
  }

  .skills h2 {
    margin-bottom: -10px;
    text-transform: uppercase;
    font-size: 2rem;
  }

  .skills__item {
    margin-left: 20px;
    margin-right: 20px;
  }

  /* Footer at 768px ---------------- */
  footer {
    display: flex;
    align-items: center;
  }

  .phone,
  .email {
    margin-right: 8px;
  }

  .footer__nav {
    width: 95%;
  }

  .footer__nav h2 {
    text-transform: none;
  }

  .footer__nav-links {
    display: flex;
    flex-direction: row;
    list-style-type: none;
    margin-left: auto;
  }

  .footer__nav-links li {
    padding: 5px 10px 10px 10px;
    text-decoration: none;
  }

  .footer__nav-hr {
    width: 95%;
    border-color: rgb(255, 255, 255);
  }

  .to-top {
    display: none;
  }
}

/* min width 1024 ---------------------------------- */
@media screen and (min-width: 1024px) {
  .navbar,
  .navbar__ul,
  .header__container {
    display: flex;
  }

  .navbar {
    flex-direction: row;
    justify-content: space-between;
  }

  .navbar__ul {
    flex-direction: row;
  }

  .navbar__ul li {
    background-color: transparent;
  }

  .navbar__ul .link {
    margin: 0;
  }

  .header__container {
    flex-direction: row-reverse;
    margin-bottom: 15px;
    align-items: center;
    justify-content: center;
  }

  .header__container img {
    max-width: 330px;
  }

  .header__text {
    max-width: 400px;
    text-align: center;
  }

  /* Portfolio section------------------------- */
  .portfolio__container {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
  }

  /* End Portfolo------------------------------ */
}

/* Dark mode------------------------------- */
button[class="darkmode"] {
  width: 30px;
  height: 30px;
  cursor: pointer;
  background-color: white;
  border: 1px solid rgb(43, 43, 43);
  border-radius: 50%;
}

.darkmode .portfolio {
  background-color: var(--clr-dark-black);
  color: var(--clr-dark-text);
}

.darkmode footer {
  background-color: var(--clr-dark-black);
  color: var(--clr-dark-text);
}

.darkmode .wrapper {
  background-color: var(--clr-dark-black);
  color: var(--clr-dark-text);
}

.darkmode .navbar__ul li {
  color: var(--clr-dark-text);
  background-color: transparent;
}

.darkmode a[href] {
  color: var(--clr-dark-text);
}

@media screen and (min-width: 1500px) {
  body {
    max-width: 1500px;
  }
}

@media screen and (max-width: 1024px) {
  .portfolio__container {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

              
            
!

JS

              
                let btn = document.querySelector(".darkmode");

btn.addEventListener("click", () => {
  if (btn.innerHTML === `<i class="fas fa-moon"></i>`) {
    btn.innerHTML = `<i class="fas fa-sun"></i>`;
    btn.style.color = "orange";
    btn.style.backgroundColor = "rgb(43, 43, 43)";
    document.body.classList.add("darkmode");
  } else {
    btn.innerHTML = `<i class="fas fa-moon"></i>`;
    btn.style.color = "black";
    btn.style.backgroundColor = "white";
    document.body.classList.remove("darkmode");
  }
});

              
            
!
999px

Console