Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

Save Automatically?

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

              
                <header id="header">
  <nav id="nav-bar" class="nav d-f justify-btw f-hrz-center w-100">
    <div data-linkTo="home" class="nav-logo">
      <a href="#home" class="nav-link">
            <i class="fab fa-3x fa-phoenix-framework"></i>
            <img id="header-img" src="#" onerror="this.style.display = 'none'" aria-hidden="true"/>
      </a>
    </div>
    <ul class="nav-list">
      <li data-linkTo="about" class="nav-item d-i-b">
        <a class="d-b nav-link" href="#presentation">ABOUT</a>
      </li>
      <li data-linkTo="video" class="nav-item d-i-b">
        <a class="d-b nav-link" href="#video-presentation">VIDEO</a>
      </li>
      <li data-linkTo="pricing" id="" class="nav-item d-i-b">
        <a class="d-b nav-link" href="#pricing">PRICING</a>
      </li>
      <li data-linkTo="reviews" class="nav-item d-i-b">
        <a class="d-b nav-link" href="#reviews">REVIEWS</a>
      </li>
    </ul>
  </nav>
</header>

<main id="app">
  <!-- Home -->
  <section id="home" class="section">
    <div class="app-title">
      <p class="app-heading-line1 text-center ">
        POTATO P203, THE NEW KID IN TOWN
      </p>
      <p class="app-heading-line2 text-center text-italic">
        A potato phone for potatoes
      </p>
    </div>
  </section>

  <!-- Presentation -->
  <section id="presentation" class="presentation section d-f flex-row justify-center f-hrz-center">
    <div class="presentation-descript w-50 text-white">
      <p>
        <i class="fa fa-cubes" aria-hidden="true"></i> Amazing design, round edges and latest technologies
      </p>
      <p>
        <i class="fa fa-child" aria-hidden="true"></i> Impressive impact resistance, you can throw it at your loved ones again, and again.
      </p>
      <p>
        <i class="fa fa-camera" aria-hidden="true"></i> The best part of this phone it's its camera! Inexistent! Now no one can see you naked.
      </p>
      <form id="form" class="order-form" class="" action="https://www.freecodecamp.com/email-submit" method="post">
        <header class="order-form-header bold underline">ORDER NOW!</header>
        <label for="email" class="order-email-label">
              <input
                id="email"
                name="email"
                type="email"
                placeholder="Your email"
                class="order-email-input"
                required
              />
            </label>
        <div>
          <input id="submit" class="order-submit btn-reset btn cursor-pointer" type="submit" value="I WANT ONE" />
        </div>
      </form>
    </div>
    <div class="w-50">
      <img class="item-image shadowed" src="http://pngimg.com/uploads/phone/phone_PNG454.png" alt="phone" />
    </div>
  </section>

  <!-- Video -->
  <section id="video-presentation" class="section d-f flex-row justify-center">
    <div class="video-src w-50 d-f f-hrz-center justify-center">
      <iframe id="video" width="75%" src="https://www.youtube.com/embed/aQzYjKWmgfg?controls=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope;" allowfullscreen></iframe>
    </div>
    <section class="video-descript w-50 d-f f-hrz-center">
      <ul class="video-tags-container text-center">
        <li class="video-tag">
          <div class="tag">
            <div class="tag-icon">
              <div class="tag-icon-element">
                <i class="fa fa-microchip" aria-hidden="true"></i>
              </div>
            </div>
            <div class="tag-body">
              <p class="tag-body-title">FAST RESPONSE TIME</p>
              <p class="tag-body-description">
                There is up to none processing happening here!
              </p>
            </div>
          </div>
        </li>
        <li class="video-tag">
          <div class="tag">
            <div class="tag-icon">
              <div class="tag-icon-element">
                <i class="fa fa-battery-three-quarters" aria-hidden="true"></i>
              </div>
            </div>
            <div class="tag-body">
              <p class="tag-body-title">LONG BATERY LIFE</p>
              <p class="tag-body-description">
                Basically, it never ends. Endless conversations with your mother.
              </p>
            </div>
          </div>
        </li>
        <li class="video-tag">
          <div class="tag">
            <div class="tag-icon">
              <div class="tag-icon-element">
                <i class="fa fa-bell" aria-hidden="true"></i>
              </div>
            </div>
            <div class="tag-body">
              <p class="tag-body-title">ALERTS</p>
              <p class="tag-body-description">
                Stop worrying about missing a conversation. The new alert system will resurrect you after death.
              </p>
            </div>
          </div>
        </li>
        <li class="video-tag">
          <div class="tag">
            <div class="tag-icon">
              <div class="tag-icon-element">
                <i class="fa fa-blind" aria-hidden="true"></i>
              </div>
            </div>
            <div class="tag-body">
              <p class="tag-body-title">VISION LOSS FRIENDLY</p>
              <p class="tag-body-description">
                Designed with great concern for visually impaired people. No screen, nothing to see. And bonus, you can't lose it!
              </p>
            </div>
          </div>
        </li>
      </ul>
    </section>
  </section>

  <!-- Pricing -->
  <section id="pricing" class="section d-f justify-center f-hrz-center">
    <div class="cards-container text-center">
      <div class="card card-price d-i-f">
        <header class="card-header d-f justify-center f-hrz-center">
          LIGHT
        </header>
        <div class="card-body d-f justify-center f-hrz-center">
          <p>Display Resolution: 1 pixel</p>
          <p>Size: It's a lot of it</p>
          <p>Processor: Yea right</p>
          <p>RAM: 0.001 Something</p>
          <p>Operating System: Wood OS</p>
          <p class="text-double">255$</p>
        </div>
        <div class="card-footer text-center">
          <button class="btn-reset btn">GET THIS</button>
        </div>
      </div>

      <div class="card card-price d-i-f">
        <header class="card-header d-f justify-center f-hrz-center">
          PRO
        </header>
        <div class="card-body d-f justify-center f-hrz-center">
          <p>Display Resolution: 2 pixels</p>
          <p>Size: Big enough</p>
          <p>Processor: 1 + 1 MHz</p>
          <p>RAM: 1 Teaspoon</p>
          <p>Operating System: Steel OS</p>
          <p class="text-double">322$</p>
        </div>
        <div class="card-footer text-center">
          <button class="btn-reset btn">GET THIS</button>
        </div>
      </div>

      <div class="card card-price d-i-f">
        <header class="card-header d-f justify-center f-hrz-center">
          ULTRA
        </header>
        <div class="card-body d-f justify-center f-hrz-center">
          <p>Display Resolution: 3 pixels</p>
          <p>Size: Throwable</p>
          <p>Processor: 1 + 1 + 1 MHz</p>
          <p>RAM: 2 buckets</p>
          <p>Operating System: Diamond OS</p>
          <p class="text-double">517$</p>
        </div>
        <div class="card-footer text-center">
          <button class="btn-reset btn">GET THIS</button>
        </div>
      </div>
    </div>
  </section>

  <!-- Reviews -->
  <section id="reviews" class="section d-f f-hrz-center">
    <div id="reviews-container" class="reviews-container w-100 d-f flex-column f-hrz-center justify-center">
      <div class="review-display">
        <article class="review d-f flex-column f-hrz-center">
          <img class="review-img" src="https://pbs.twimg.com/media/DYLuNt2UQAEqaOs.jpg" alt="Grumpy Cat" />
          <blockquote class="review-quote d-f f-hrz-center">
            <i class="quote">"I hate it. I really do. But I hate you more."</i
                >
              </blockquote>
            </article>
          </div>

          <div class="reviews-list-container">
            <ul class="reviews-list text-center">
              <li class="review-item d-i-b cursor-pointer" data-id="grumpy">
                <a href="#reviews">
                  <div class="tag">
                    <div class="tag-icon">
                      <div class="tag-icon-element">
                        <img
                          class="h-100"
                          src="https://pbs.twimg.com/media/DYLuNt2UQAEqaOs.jpg"
                          alt="Grumpy Cat"
                        />
                      </div>
                    </div>
                    <div class="tag-body">
                      <p class="tag-body-title">TARDAR SAUCE</p>
                      <p class="tag-body-description">
                        Commonly known as Grumpy Cat.
                      </p>
                    </div>
                  </div>
                </a>
              </li>

              <li class="review-item d-i-b cursor-pointer" data-id="graham">
                <a href="#reviews">
                  <div class="tag">
                    <div class="tag-icon">
                      <div class="tag-icon-element">
                        <img
                          class="h-100"
                          src="https://www.biography.com/.image/t_share/MTIwNjA4NjMzNzM5ODM4OTg4/alexander-graham-bell-9205497-2-402.jpg"
                          alt="Alexander Graham Bell"
                        />
                      </div>
                    </div>
                    <div class="tag-body">
                      <p class="tag-body-title">ALEXANDER GRAHAM BELL</p>
                      <p class="tag-body-description">AT&T Founder.</p>
                    </div>
                  </div>
                </a>
              </li>

              <li class="review-item d-i-b cursor-pointer" data-id="abraham">
                <a href="#reviews">
                  <div class="tag">
                    <div class="tag-icon">
                      <div class="tag-icon-element">
                        <img
                          class="h-100"
                          src="https://pbs.twimg.com/profile_images/740200432073641984/810BjZ-J_400x400.jpg"
                          alt="Abraham Lincoln"
                        />
                      </div>
                    </div>
                    <div class="tag-body">
                      <p class="tag-body-title">ABRAHAM LINCOLN</p>
                      <p class="tag-body-description">Vampire hunter</p>
                    </div>
                  </div>
                </a>
              </li>

              <li class="review-item d-i-b cursor-pointer" data-id="jack">
                <a href="#reviews">
                  <div class="tag">
                    <div class="tag-icon">
                      <div class="tag-icon-element">
                        <img
                          class="h-100"
                          src="https://memegenerator.net/img/images/400x/12118538.jpg"
                          alt="Jack Nicholson"
                        />
                      </div>
                    </div>
                    <div class="tag-body">
                      <p class="tag-body-title">JACK NICHOLSON</p>
                      <p class="tag-body-description">
                        American actor and filmmaker
                      </p>
                    </div>
                  </div>
                </a>
              </li>
            </ul>
          </div>
        </div>
      </section>
    </main>
    <footer class="footer d-f flex-column justify-center">
      <a
        class="copyright w-100 text-right"
        href="https://codepen.io/VicPopescu/"
        target="_blank"
      >
        Victor Popescu. December 2018. No rights reserved.
      </a>
    </footer>
    <script src="src/index.js"></script>
              
            
!

CSS

              
                $dark-imperial-blue: #08415c;
$light-cornflower-blue: #48798d;
$wild-blue-yonder: #bcabd1;
$lavander-mist: #e8e1ef;
$white: #fefffe;

/* RESETS */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Raleway", sans-serif;
  letter-spacing: 1px;
}

ul {
  margin: 0;
  padding: 0;
  list-style-type: none;
}
p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

/* UTILITIES */
// Display
.d-b {
  display: block;
}

.d-i {
  display: inline;
}

.d-i-b {
  display: inline-block;
}

.d-f {
  display: flex;
}

.d-i-f {
  display: inline-flex;
}

.flex-row {
  flex-flow: row wrap;
}
.flex-column {
  flex-flow: column wrap;
}

.cursor-pointer {
  cursor: pointer;
}

// Alignment
.f-hrz-center {
  align-items: center;
}
.justify-btw {
  justify-content: space-between;
}
.justify-center {
  justify-content: center;
}
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

// Text format
.text-italic {
  font-style: italic;
}
.text-white {
  color: white;
}

.text-double {
  font-size: 200%;
}
.bold {
  font-weight: bold;
}
.underline {
  text-decoration: underline;
}


// Size
.w-100 {
  width: 100%;
}
.w-50 {
  width: 50%;
}
.w-75 {
  width: 75%;
}

.w-25 {
  width: 25%;
}

.h-100 {
  height: 100%;
}

// Resets
.btn-reset {
  border: none;
  margin: 0;
  padding: 0;
  width: auto;
  overflow: visible;

  background: transparent;
  color: inherit;
  font: inherit;
  line-height: normal;
  -webkit-font-smoothing: inherit;
  -moz-osx-font-smoothing: inherit;
  -webkit-appearance: none;
}

.btn {
  width: 200px;
  border: 1px solid $light-cornflower-blue;
  border-radius: 3%;
  padding: 8px 26px;
  cursor: pointer;
  transition: all 50ms ease-in-out;
  color: $dark-imperial-blue;
}

.btn:hover {
  border-color: $light-cornflower-blue;
  background-color: $light-cornflower-blue;
  color: white;
  -ms-transform: scale(1.1);
  -webkit-transform: scale(1.1);
  transform: scale(1.1);
}

.shadowed {
  -webkit-filter: drop-shadow(-35px 51px 15px rgba(0, 0, 0, 0.5));
  -ms-filter: "progid:DXImageTransform.Microsoft.Dropshadow(OffX=-35, OffY=51, Color='#444')";
  filter: "progid:DXImageTransform.Microsoft.Dropshadow(OffX=-35, OffY=51, Color='#444')";
}

.card {
  border: 1px solid $light-cornflower-blue;
  border-radius: 2px;
  width: 300px;
  height: 360px;
  flex-direction: column;
  transition: all 60ms ease-in-out;
  margin: 0 20px 50px;
  padding-bottom: 20px;
  -webkit-box-shadow: 0px 6px 7px -4px #777;
  -moz-box-shadow: 0px 6px 7px -4px #777;
  box-shadow: 0px 6px 7px -4px #777;
  background-color: #fff;
}

.card:hover {
  background-color: #eff9ff;
  -ms-transform: scale(1.02);
  -webkit-transform: scale(1.02);
  transform: scale(1.02);
  -webkit-box-shadow: 0px 10px 16px -3px #777;
  -moz-box-shadow: 0px 10px 16px -3px #777;
  box-shadow: 0px 10px 16px -3px #777;
}
.card-header {
  background-color: $dark-imperial-blue;
  color: white;
  height: 15%;
  text-transform: uppercase;
}
.card-body {
  flex-grow: 1;
  flex-direction: column;
}

.card-body p {
  margin: 4px 0px;
}

.card-footer {
  height: 15%;
}
.card-btn {
}

$bg-hover-color: rgb(187, 224, 248);
.tag {
  display: flex;
  height: 100px;
  width: 260px;
  background-color: $dark-imperial-blue;
  border-radius: 5px;
  text-align: left;
  -webkit-box-shadow: 0px 6px 7px -4px #777;
  -moz-box-shadow: 0px 6px 7px -4px #777;
  box-shadow: 0px 6px 7px -4px #777;
  transition: all 60ms ease-in-out;

  &:hover,
  &.hover {
    background-color: #d3f6ff;
    -ms-transform: scale(1.02);
    -webkit-transform: scale(1.02);
    transform: scale(1.02);
    -webkit-box-shadow: 0px 10px 16px -3px #777;
    -moz-box-shadow: 0px 10px 16px -3px #777;
    box-shadow: 0px 10px 16px -3px #777;
    .tag-body-title {
      color: $dark-imperial-blue;
    }
    .tag-body-description {
      color: $dark-imperial-blue;
    }
    .tag-icon-element {
      background-color: $dark-imperial-blue;
    }
    .fa {
      color: white;
    }
  }

  &-icon,
  &-body,
  &-icon-element {
    display: inline-flex;
    justify-content: center;
  }

  &-icon {
    align-items: center;
    width: 30%;
    padding: 0 10px;
    &-element {
      align-items: center;
      height: 50px;
      width: 50px;
      border-radius: 50%;
      background-color: #fff;
      .fa {
        color: $dark-imperial-blue;
        font-size: 25px;
      }
    }
  }

  &-body {
    flex-direction: column;
    flex-grow: 1;
    padding: 6px;

    &-title {
      color: #fff;
      font-weight: bold;
      font-size: 76%;
    }

    &-description {
      margin-top: 5px;
      font-size: 75%;
      color: rgb(190, 190, 190);
    }
  }
}

// MAIN
.nav {
  position: fixed;
  z-index: 1000;
  background-color: #11455e;
  height: 70px;
  top: 0;
  left: 0;
  right: 0;
  color: #d3f6ff;
  box-sizing: border-box;
  padding: 10px 10%;
  text-shadow: 0px 4px 3px rgba(0, 0, 0, 0.4), 0px 8px 13px rgba(0, 0, 0, 0.1),
    0px 18px 23px rgba(0, 0, 0, 0.1);
  &-item {
    margin: 0 14px;
    letter-spacing: 2px;
    border-bottom: 1.5px solid transparent;
    a {
      padding: 4px 0px;
    }
    &:hover,
    &.selected {
      border-color: #d3f6ff;
    }
  }
}
.section {
  padding: 0 6vw;
  min-height: 100vh;
}
/* Section 1 */
#home {
  background-image: linear-gradient(#08415c, #48798d);
  padding-top: 30vh;
  min-height: 100vh;
}
.app-title {
  color: #d3f6ff;
  text-shadow: 0px 4px 3px rgba(0, 0, 0, 0.4), 0px 8px 13px rgba(0, 0, 0, 0.1),
    0px 18px 23px rgba(0, 0, 0, 0.1);
}
.app-heading-line1 {
  letter-spacing: 6px;
  font-size: 60px;
}
.app-heading-line2 {
  letter-spacing: 3px;
  font-size: 30px;
  margin-top: 34px;
}

/* Section 2 */
#presentation {
  background-image: linear-gradient($light-cornflower-blue, #98d2eb);
}

.presentation-descript {
  font-size: 24px;
  color: #d3f6ff;
  text-align: center;
  vertical-align: top;
  min-width: 400px;
  margin-bottom: 10px;
  text-shadow: 0px 3px 6px rgba(0, 0, 0, 0.4);
  p {
    margin-bottom: 10px;
  }
  .order-form {
    margin-top: 50px;
    .order-email-label {
      margin-top: 10px;
    }
    .order-form-header {
      margin-bottom: 20px;
    }
    .order-email-input {
      padding: 10px 20px;
      width: 260px;
      color: #333;
      font-size: 16px;
      &:focus {
        outline-color: #a4eafc;
      }
    }
    .order-submit {
      margin-top: 25px;
      -webkit-box-shadow: 0px 6px 7px -4px #777;
      -moz-box-shadow: 0px 6px 7px -4px #777;
      box-shadow: 0px 6px 7px -4px #777;
    }
  }
}

.item-image {
  display: block;
  width: 75%;
  max-width: 600px;
  margin: 0 auto;
}

#video-presentation {
  background-image: linear-gradient(#98d2eb, #fff);
}

#video{
  height: 400px;
}

.video-descript {
  min-width: 400px;
}


.video-src {
  min-width: 400px;
}

.video-tags-container {
  max-width: 700px;
  display: block;
  margin: 0 auto;
}
.video-tag {
  display: inline-block;
  margin: 10px;
}

#pricing {
  background-image: linear-gradient(#fff, #98d2eb);
}

#reviews {
  background-image: linear-gradient(#98d2eb, $light-cornflower-blue);
}

.reviews-container {
  margin-bottom: 40px;
}
.review {
  &-display {
    min-height: 400px;
  }
  &-img {
    max-height: 200px;
  }
  &-quote {
    text-align: justify;
    max-width: 600px;
    min-height: 100px;
    font-size: 28px;
    color: #fff;
    text-shadow: 0px 4px 3px rgba(0, 0, 0, 0.4), 0px 8px 13px rgba(0, 0, 0, 0.1),
      0px 18px 23px rgba(0, 0, 0, 0.1);
  }
  &-item {
    margin: 10px;
    .tag-icon-element {
      height: 55px;
    }
  }
}

.footer {
  height: 100px;
  padding: 0 6vw;
  background-color: $dark-imperial-blue;
  font-size: 14px;
  color: #d3f6ff;
}

.copyright:hover {
  color: $wild-blue-yonder;
}

@media (max-width: 840px) {
  .section {
    padding-bottom: 60px;
  }

  #video {
    height: 300px;
  }
}

              
            
!

JS

              
                const projectName = "product-landing-page";
const is_explorer =
  navigator.userAgent.indexOf("MSIE") > 0 ||
  !!navigator.userAgent.match(/Trident.*rv\:11\./);
if (is_explorer) {
  alert(
    "Stop living in the past... the future is free! Why you ask for the IEmpossible..."
  );
}
const reviews = [
  {
    id: "grumpy",
    iconUrl: "https://pbs.twimg.com/media/DYLuNt2UQAEqaOs.jpg",
    quote: "I hate it. I really do. But I hate you more."
  },
  {
    id: "graham",
    iconUrl:
      "https://www.biography.com/.image/t_share/MTIwNjA4NjMzNzM5ODM4OTg4/alexander-graham-bell-9205497-2-402.jpg",
    quote:
      "I dream of one day ordering pizza over the telephone and also learning what a 'pizza' is."
  },
  {
    id: "jack",
    iconUrl:
      "https://lwlies.com/wp-content/uploads/2017/02/jack-nicholson-about-schmidt-1108x0-c-default.jpg",
    quote:
      "Now I can slam my phone down when I hang up on somebody! Violently pressing 'END CALL' just doesn't do it for me..."
  },
  {
    id: "abraham",
    iconUrl:
      "https://pbs.twimg.com/profile_images/740200432073641984/810BjZ-J_400x400.jpg",
    quote:
      "Don't believe everything you read on the internet just because there's a picture with a quote next to it."
  }
];

/**
 * During initialization
 */
document
  .querySelector(".review-item")
  .getElementsByClassName("tag")[0]
  .classList.add("hover");

/**
 * Handling reviews
 */
const reviewContainer = document.getElementById("reviews-container");
const node = document.getElementsByClassName("review");

var list = document.getElementsByClassName("review-item");
for (var i = 0; i < list.length; i++) {
  list[i].addEventListener("click", displayReview, false);
}

function displayReview(event) {
  const target = event.target;
  const parent = findAncestor(event.target, "review-item");
  const id = parent.getAttribute("data-id");
  const review = reviews.find(x => x.id === id);
  const cNode = node[0].cloneNode(true);
  cNode.getElementsByClassName("review-img")[0].src = review.iconUrl;
  cNode.getElementsByClassName("quote")[0].innerHTML = '"' + review.quote + '"';
  node[0].replaceWith(cNode);

  const items = document.getElementsByClassName("review-item");
  for (var i = 0; i < items.length; i++) {
    items[i].getElementsByClassName("tag")[0].classList.remove("hover");
  }
  parent.getElementsByClassName("tag")[0].classList.add("hover");
}

/**
 * Handle menu item selection
 */
var selectedSection = window.location.hash.substring(1);
const menuItems = document.getElementsByClassName("nav-item");
for (var i = 0; i < menuItems.length; i++) {
  menuItems[i].addEventListener("click", selectFromNav, false);
  if (menuItems[i].getAttribute("data-linkTo") === selectedSection) {
    menuItems[i].classList.add("selected");
  }
}
function selectFromNav(event) {
  const target = event.target;
  const parent = findAncestor(target, "nav-item");
  for (var i = 0; i < menuItems.length; i++) {
    menuItems[i].classList.remove("selected");
  }
  parent.classList.add("selected");
}
document.querySelector(".nav-logo").addEventListener(
  "click",
  function() {
    for (var i = 0; i < menuItems.length; i++) {
      menuItems[i].classList.remove("selected");
    }
  },
  false
);

/**
 * Utilities
 */
function findAncestor(el, cls) {
  while ((el = el.parentElement) && !el.classList.contains(cls));
  return el;
}

              
            
!
999px

Console