Skip to content

Commit

Permalink
Производительность верстки (#16)
Browse files Browse the repository at this point in the history
* Производительность верстки

* Добавляет data-test

* Удаляет архив сборки
  • Loading branch information
OlegSulitskii authored Dec 6, 2024
1 parent e315864 commit 9a96f3c
Show file tree
Hide file tree
Showing 23 changed files with 149 additions and 60 deletions.
6 changes: 4 additions & 2 deletions source/catalog.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<link rel="icon" href="favicons/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="favicons/180.png">
<link rel="manifest" href="manifest.webmanifest">
<link rel="preload" href="fonts/lato/Lato-Regular.woff2" as="font" crossorigin="anonymous">
<link rel="preload" href="fonts/oswald/oswaldregular.woff2" as="font" crossorigin="anonymous">
</head>

<body class="page__body">
Expand Down Expand Up @@ -43,7 +45,7 @@
</nav>
</header>
<main class="main">
<section class="catalog">
<section class="catalog" data-test="catalog">
<div class="catalog__wrapper wrapper">
<h1 class="catalog__title">Каталог продукции</h1>
<div class="catalog__list-wrapper">
Expand Down Expand Up @@ -241,7 +243,7 @@ <h2 class="card-more__title">Показать еще 100500 товаров</h2>
</div>
</div>
</section>
<section class="sub-product wrapper">
<section class="sub-product wrapper" data-test="additional">
<h2 class="sub-product__title accent-line">Дополнительные товары</h2>
<div class="sub-product__container">
<ul class="sub-product__list">
Expand Down
2 changes: 1 addition & 1 deletion source/images/logo-cat-energy-text.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 9 additions & 7 deletions source/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
<link rel="icon" href="favicons/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="favicons/180.png">
<link rel="manifest" href="manifest.webmanifest">
<link rel="preload" href="fonts/lato/Lato-Regular.woff2" as="font" crossorigin="anonymous">
<link rel="preload" href="fonts/oswald/oswaldregular.woff2" as="font" crossorigin="anonymous">
</head>

<body class="page__body">
<header class="header wrapper">
<header class="header wrapper" data-test="header">
<a class="header__logo-image logo-image" href="index.html">
<picture>
<source type="image/svg+xml" media="(min-width: 1440px)" srcset="images/logo-cat-energy-img-desktop.svg" width="70" height="59">
Expand Down Expand Up @@ -43,7 +45,7 @@
</nav>
</header>
<main class="main">
<section class="intro">
<section class="intro" data-test="hero">
<div class="intro__wrapper wrapper">
<h1 class="intro__title">Функциональное питание для котов</h1>
<p class="intro__slogan">Занялся собой? Займись котом!</p>
Expand All @@ -58,7 +60,7 @@ <h1 class="intro__title">Функциональное питание для ко
<a class="intro__button button button--primary" href="#">Подобрать программу</a>
</div>
</section>
<section class="programs">
<section class="programs" data-test="programs">
<h2 class="visually-hidden">Программы питания</h2>
<ul class="programs__list wrapper">
<li class="programs__item">
Expand All @@ -73,7 +75,7 @@ <h3 class="programs__title programs__title--pro">Набор массы</h3>
</li>
</ul>
</section>
<section class="advantages wrapper">
<section class="advantages wrapper" data-test="features">
<h2 class="advantages__title">Как это работает</h2>
<ul class="advantages__list">
<li class="advantages__item">
Expand All @@ -90,7 +92,7 @@ <h2 class="advantages__title">Как это работает</h2>
</li>
</ul>
</section>
<section class="stats">
<section class="stats" data-test="proof">
<div class="stats__wrapper wrapper">
<h2 class="stats__title">Живой пример</h2>
<p class="stats__description">Борис сбросил 5&nbsp;кг за 2 месяца, просто заменив свой обычный корм на Cat Energy Slim. Отличный результат без&nbsp;изнуряющих тренировок! При этом он не менял своих привычек и по-прежнему спит по 16 часов в день.</p>
Expand Down Expand Up @@ -129,7 +131,7 @@ <h2 class="stats__title">Живой пример</h2>
</div>
</div>
</section>
<section class="address">
<section class="address" data-test="contacts">
<div class="address__wrapper wrapper">
<h2 class="address__title">Приглашаем к&nbsp;сотрудничеству дилеров!</h2>
<div class="address__description-wrapper">
Expand All @@ -150,7 +152,7 @@ <h2 class="address__title">Приглашаем к&nbsp;сотрудничест
</div>
</section>
</main>
<footer class="footer">
<footer class="footer" data-test="footer">
<div class="footer__wrapper wrapper">
<a class="footer__logo-text logo-text" href="index.html">
<img class="logo-text_picture" src="images/logo-cat-energy-text.svg" alt="Текстовый вариант логотипа Cat Energy" width="101" height="18">
Expand Down
10 changes: 9 additions & 1 deletion source/styles/blocks/accent-line.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@
@media (min-width: $tablet-width) {
.accent-line {
&::before {
top: 16px;
top: 14px;
}
}
}

@media (min-width: $desktop-width) {
.accent-line {
&::before {
top: 18px;
}
}
}
2 changes: 1 addition & 1 deletion source/styles/blocks/address.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
@media (min-width: $desktop-width) {
.address {
display: grid;
grid-template-rows: 95px auto 95px;
grid-template-rows: 95px auto 106px;
grid-template-columns: auto 565px 90px 565px auto;
min-width: 100%;
min-height: 400px;
Expand Down
10 changes: 7 additions & 3 deletions source/styles/blocks/advantages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

@media (min-width: $tablet-width) {
.advantages {
margin-bottom: 47px;
margin-bottom: 46px;
}

.advantages__title {
Expand All @@ -73,7 +73,7 @@
.advantages__list {
display: flex;
flex-flow: wrap;
gap: 37px 135px;
gap: 37px 134px;
margin: 0 auto;
}

Expand Down Expand Up @@ -117,6 +117,10 @@
}

.advantages__list {
column-gap: 73px;
column-gap: 80px;
}

.advantages__item {
width: 245px;
}
}
9 changes: 7 additions & 2 deletions source/styles/blocks/card-more.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,15 @@
background-size: 60px 60px;
width: 60px;
height: 60px;
margin-bottom: 50px;
margin-bottom: 49px;
}
}

.card-more__text {
font-size: 16px;
line-height: calc(18/16);
padding: 0 30px;
margin-top: 0;
}

.card-more__button {
Expand All @@ -75,12 +76,16 @@
}

@media (min-width: $desktop-width) {
.card-more__wrapper {
padding-bottom: 39px;
}

.card-more__title {
padding: 0 10px;
margin-bottom: 26px;

&::before {
margin-bottom: 40px;
margin-bottom: 38px;
}
}

Expand Down
18 changes: 15 additions & 3 deletions source/styles/blocks/card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
.card__wrapper {
display: grid;
grid-template-columns: repeat(2, 50%);
row-gap: 14px;
padding: 20px 0 25px;
row-gap: 5px;
padding: 20px 0 24px;
}

.card__link {
Expand Down Expand Up @@ -57,7 +57,7 @@
display: grid;
grid-template-columns: repeat(2, 50%);
font-size: 12px;
line-height: calc(16/12);
line-height: 1;
margin: 0;
}

Expand All @@ -67,6 +67,7 @@

.card__button {
grid-column: -1 / 1;
margin-top: 12px;
}

@media (min-width: $tablet-width) {
Expand Down Expand Up @@ -146,10 +147,21 @@
}

.card__title {
margin-top: 0;
margin-bottom: 13px;
}

.card__link {
width: 169px;
}

.card__characteristic {
row-gap: 7px;
}

.card__characteristic-term {
&::after {
margin-top: 5px;
}
}
}
6 changes: 4 additions & 2 deletions source/styles/blocks/catalog.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.catalog {
margin-bottom: 25px;
margin-bottom: 24px;
}

.catalog__wrapper {
Expand Down Expand Up @@ -30,6 +30,7 @@
.catalog {
width: calc($tablet-width - 60px);
margin: 0 auto 74px;
padding-top: 26px;
}

.catalog__wrapper {
Expand Down Expand Up @@ -62,6 +63,7 @@
.catalog {
width: calc($desktop-width - 220px);
margin: 0 auto 71px;
padding-top: 45px;
}

.catalog__list-wrapper {
Expand All @@ -72,6 +74,6 @@

.catalog__list {
grid-template-columns: repeat(4, 245px);
gap: 80px;
gap: 63px 80px;
}
}
6 changes: 6 additions & 0 deletions source/styles/blocks/footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,9 @@
margin-top: 0;
}
}

@media (min-width: $desktop-width) {
.footer {
min-height: 169px;
}
}
4 changes: 2 additions & 2 deletions source/styles/blocks/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

@media (min-width: $tablet-width) {
.header {
padding: 35 0 40px;
padding: 18px 0 31px;
flex-wrap: nowrap;
}

Expand All @@ -38,7 +38,7 @@
min-height: 59px;
padding-top: 50px;
padding-bottom: 0;
margin-bottom: 29px;
margin-bottom: 24px;
}

.header__logo-image {
Expand Down
2 changes: 1 addition & 1 deletion source/styles/blocks/input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
line-height: calc(3/2);
color: $text-color-base;
height: 56px;
padding: 10px;
padding: 12px;
box-sizing: border-box;
border: 1px solid $color-accent-7;

Expand Down
Loading

0 comments on commit 9a96f3c

Please sign in to comment.