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

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

              
                <html>

<head>
  <meta charset="utf-8">
  <title>ROG Strix Wireless</title>

  <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,700" rel="stylesheet">
</head>

<body>

  <div class="wrapper">
    <div id="bag__cart" style="display:flex;align-items:center;justify-content: space-around;padding:19px;width: 300px; height: 100px; background-color: #1d1d1f; position: absolute; right: 10px; border-radius: 0px 0px 15px 15px;box-shadow: 5px 5px 30px 5px #1d1d1fd9;text-align:center;"><img src="https://www.apple.com/ac/globalnav/6/ru_RU/images/be15095f-5a20-57d0-ad14-cf4c638e223a/globalnav_bag_image__bmix8075eg4i_small.svg" style="width:36px;height:auto;">
      <div class="bag__title" style="color:white;">1 x ROG Strix Wireless</div>
      <div id="bag__delete" style="color:white;font-size:30px;border:0.4px solid white;padding:0px 5px;;border-radius:10%;">-</div>
      <div id="bag__add" style="color:white;font-size:30px;border:0.4px solid white;padding:0px 5px;border-radius:10%;">+</div>
    </div>
    <div class="card">
      <div class="card__header card__header__airpodsmax">
        <div class="card__watermark"></div>

        <img src="https://cdn.bitrix24.ru/b10755502/landing/72e/72eb014d44db6e6767023de39c17e7d4/1P-768x517_2x.png" alt="AIRPODS MAX" class="card__logo">

        <span class="card__price">$600</span>

        <h1 class="card__title">ROG Strix Wireless</h1>
        <span class="card__subtitle">Помимо высокого качества звука гарнитура ROG Strix Wireless может похвастать прекрасными эргономическими характеристиками.</span>

      </div>

      <div class="card__body">
        <img src="https://dlcdnwebimgs.asus.com/gain/8D3BC850-053B-4F0C-B2FE-A4D593C2E8C5/w717/h525" alt="AIRPODS_MAX" class="card__image">
        <div class="card__buy card__buy__airpodsmax" id="logo">Купить</div>

        <span class="card__buy__subtitle">Элегантный дизайн и полный комфорт</span>
      </div>
    </div>

  </div>
  <div>Все права на изображения и текст принадлежат <a href="https://rog.asus.com/ru/headsets-audio/headsets/wireless-headsets/rog-strix-wireless-model/">https://rog.asus.com/ru/headsets-audio/headsets/wireless-headsets/rog-strix-wireless-model/</a> и использованы здесь в обучающих целях</div>
</body>

</html>
              
            
!

CSS

              
                html,
body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;

  font-family: "Roboto", "Helvetica", sans-serif;

  background: linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.15) 0%,
      rgba(0, 0, 0, 0.15) 100%
    ),
    radial-gradient(
        at top center,
        rgba(255, 255, 255, 0.4) 0%,
        rgba(0, 0, 0, 0.4) 120%
      )
      #989898;
  background-blend-mode: multiply, multiply;
  color: #1d1d1f;
}

.wrapper {
  position: relative;
  overflow-x: hidden;
  width: 100%;
  height: 100%;
  display: flex;

  justify-content: center;
}

.card {
  display: block;
  position: absolute;
  top: 25px;
  margin: 0 auto;
  width: 350px;
  background-color: #1d1d1f;
  border-radius: 15px;

  box-shadow: 5px 5px 30px 5px #1d1d1fd9;
}

.card__header {
  position: relative;
  height: 170px;
  padding: 30px 30px 260px;
  border-top-right-radius: 15px;
  border-top-left-radius: 15px;
  color: #1d1d1f;
}

.card__header__airpodsmax {
  background-color: #00dbde;
  background-image: linear-gradient(135deg, #00dbde 0%, #fc00ff 100%);
}

.card__watermark {
  overflow: hidden;
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 100%;
}

.card__watermark::after {
  content: "STRIX";
  position: relative;
  left: -20px;
  color: rgba(0, 0, 0, 0.3);
  font-size: 260px;
  font-weight: 700;
  text-transform: uppercase;
}

.card__logo {
  width: 36px;
  height: auto;
  margin-top: -10px;
}

.card__price {
  float: right;
  font-size: 16px;
  font-weight: 300;
}

.card__title {
  text-align: center;
  margin-top: 5px;
  font-size: 15px;
  line-height: 1.1em;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.card__subtitle {
  display: block;
  font-size: 13px;
  text-align: center;
  font-weight: 300;
}

.card__body {
  position: relative;
  padding: 40px 30px 20px;
}

.card__image {
  z-index: 1;
  position: absolute;
  top: -319px;
  left: -90px;
  width: 130%;
}

.card__buy {
  display: block;
  width: 50%;
  margin: 0 auto 15px;
  padding: 15px;
  border: 2px solid #fff;
  border-radius: 20px;
  text-align: center;
  text-transform: uppercase;
  font-size: 14px;
}

.card__buy__airpodsmax {
  color: #00dbde;
  border-color: #00dbde;
}

.card__buy__subtitle {
  display: block;
  font-size: 12px;
  color: #aeaeae;
  text-transform: uppercase;
  text-align: center;
}

              
            
!

JS

              
                var buy = document.querySelector(".card__buy");
buy.addEventListener("click", addBagPosition);
bagVisibility = false;

var bagCart = document.querySelector("#bag__cart");
bagCart.style.visibility = "hidden";
function visibleBag() {
  if ((bagVisibility = true)) {
    bagCart.style.visibility = "visible";
  } else {
    bagCart.style.visibility = "hidden";
  }
}
buy.addEventListener("click", visibleBag);
var contentdiv = document.querySelector(".wrapper");
var bagDelete = document.querySelector("#bag__delete");
bagDelete.addEventListener("click", deleteBagPosition);
var countBag = 0;
function deleteBagPosition() {
  var bagTitle = document.querySelector(".bag__title");

  if (countBag > 1) {
    countBag = countBag - 1;

    bagTitle.innerHTML = countBag + " x ROG Strix Wireless";
  } else {
    countBag = 0;
    bagTitle.innerHTML = "Добавьте наушники";
  }
}

var bagAdd = document.querySelector("#bag__add");
bagAdd.addEventListener("click", addBagPosition);
function addBagPosition() {
  var bagTitle = document.querySelector(".bag__title");
  if (countBag >= 0) {
    countBag = countBag + 1;
    bagTitle.innerHTML = countBag + " x ROG Strix Wireless";
  }
}
function addcart() {
  /*alert("Hello");
  var cartdiv = document.createElement("div");*/

  /*cartdiv.style.width = "100px";
  cartdiv.style.height = "100px";
  cartdiv.style.backgroundColor = "orange";
  cartdiv.style.position = "absolute";
  cartdiv.style.right = "10px";
  cartdiv.innerHTML = "!";
  contentdiv.appendChild(cartdiv);*/
  contentdiv.insertAdjacentHTML(
    "afterBegin",
    '<div style="width: 100px; height: 100px; background-color: orange; position: absolute; right: 10px; border-bottom-radius: 15px;">!</div>'
  );
}

              
            
!
999px

Console