Skip to content

Commit c31562d

Browse files
committed
feat: адаптив главной страницы (слайдер, форма, about-us) + чистка медиа-запросов
1 parent 4ca6664 commit c31562d

7 files changed

Lines changed: 68 additions & 39 deletions

File tree

app/static/css/index.css

Lines changed: 63 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
.slider {
22
background-color: var(--slider-bg);
3-
43
color: var(--color-white);
5-
64
padding-block: 40px;
75
}
86

@@ -24,12 +22,9 @@
2422

2523
.slider__bubble {
2624
padding: 5px;
27-
2825
width: 5px;
2926
height: 5px;
30-
3127
background-color: var(--bubble-bg);
32-
3328
border-radius: 50%;
3429
}
3530

@@ -40,6 +35,8 @@
4035
width: 100%;
4136
display: flex;
4237
align-items: center;
38+
flex-direction: column;
39+
justify-content: center;
4340
gap: 20px;
4441
opacity: 0;
4542
visibility: hidden;
@@ -52,7 +49,10 @@
5249
position: relative;
5350
visibility: visible;
5451
opacity: 1;
55-
display: block;
52+
display: flex;
53+
flex-direction: column;
54+
align-items: center;
55+
justify-content: center;
5656
}
5757

5858
.slides-wrapper {
@@ -66,9 +66,9 @@
6666
}
6767

6868
.slider__img {
69-
padding-inline: 97px;
70-
max-height: 140px;
71-
69+
height: 128px;
70+
width: auto;
71+
max-width: 128px;
7272
transition: transform 0.2s ease-in-out;
7373
}
7474

@@ -79,6 +79,7 @@
7979
.slider__title {
8080
padding-block: 18px;
8181
text-align: center;
82+
max-width: 160px;
8283
}
8384

8485
.slider__prev,
@@ -179,6 +180,7 @@
179180
gap: 9px;
180181
margin-bottom: 42px;
181182
align-self: center;
183+
flex-wrap: wrap;
182184
}
183185

184186
.menu__category {
@@ -345,7 +347,7 @@
345347
}
346348

347349
.about-us__img {
348-
max-width: 630px;
350+
max-width: 50%;
349351
max-height: 590px;
350352
border-radius: 20px;
351353
}
@@ -396,7 +398,8 @@
396398
font-weight: 400;
397399
color: var(--color-white);
398400
padding-left: 10px;
399-
width: 640px;
401+
max-width: 640px;
402+
width: 100%;
400403
height: 50px;
401404
transition: transform 0.2s ease-in-out;
402405
}
@@ -444,7 +447,8 @@ span.error {
444447
border: none;
445448
border-radius: 12px;
446449
cursor: pointer;
447-
width: 640px;
450+
width: 100%;
451+
max-width: 640px;
448452
height: 50px;
449453
transition: transform 0.2s ease-in-out;
450454
}
@@ -889,6 +893,9 @@ body.modal-open header {
889893
.modal-top,
890894
.modal-controls {
891895
padding-inline: 16px;
896+
display: grid;
897+
grid-template-columns: 1fr 1fr;
898+
gap: 10px;
892899
}
893900
.modal-block {
894901
padding-inline: 16px;
@@ -904,6 +911,11 @@ body.modal-open header {
904911
grid-column: 2;
905912
justify-content: flex-end;
906913
}
914+
.modal-cancel,
915+
.modal-submit {
916+
width: 100%;
917+
padding-inline: 8px;
918+
}
907919
}
908920
.cart__form label,
909921
.delivery-field label {
@@ -990,22 +1002,14 @@ body.modal-open header {
9901002
text-align: center;
9911003
color: rgba(36, 25, 19, 0.7);
9921004
}
993-
994-
@media (max-width: 600px) {
995-
.modal-controls {
996-
display: grid;
997-
grid-template-columns: 1fr 1fr;
998-
gap: 10px;
1005+
@media (max-width: 1024px) {
1006+
:root {
1007+
--card-max-width: 404px;
9991008
}
10001009

1001-
.modal-cancel,
1002-
.modal-submit {
1003-
width: 100%;
1004-
padding-inline: 8px;
1010+
.form {
1011+
padding-block: 30px 50px;
10051012
}
1006-
}
1007-
1008-
@media (max-width: 1024px) {
10091013
.features__list {
10101014
grid-template-columns: 1fr;
10111015
}
@@ -1025,21 +1029,46 @@ body.modal-open header {
10251029
.feature {
10261030
padding: 2%;
10271031
}
1028-
}
1032+
.form__container {
1033+
grid-template-columns: 1fr;
1034+
gap: 24px;
1035+
}
10291036

1030-
@media (max-width: 991px) {
1031-
:root {
1032-
--card-max-width: 404px;
1037+
.form-group {
1038+
width: 100%;
10331039
}
1034-
}
10351040

1036-
@media (max-width: 768px) {
1037-
}
1041+
.form__info,
1042+
.form-block {
1043+
display: flex;
1044+
flex-direction: column;
1045+
text-align: center;
1046+
}
1047+
.form-entry,
1048+
.form-button {
1049+
width: 100%;
1050+
}
10381051

1039-
@media (max-width: 520px) {
1052+
.form-group input {
1053+
align-self: center;
1054+
}
10401055
}
10411056

1042-
@media (max-width: 450px) {
1057+
@media (max-width: 768px) {
1058+
.about-us__container {
1059+
flex-direction: column;
1060+
justify-content: center;
1061+
}
1062+
.about-us__img {
1063+
max-width: 100%;
1064+
}
1065+
.form-title,
1066+
.form__info-title,
1067+
.about-us__title,
1068+
.menu__title,
1069+
.features__title {
1070+
font-size: 24px;
1071+
}
10431072
}
10441073

10451074
.loading {
13.1 KB
Loading
37 KB
Loading
32.9 KB
Loading
32.2 KB
Loading
-13.1 KB
Binary file not shown.

app/templates/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,31 +144,31 @@
144144
<div class="slide active">
145145
<img
146146
class="slider__img"
147-
src="{{ url_for('static', filename='img/slider/1.png') }}"
147+
src="{{ url_for('static', filename='img/slider/ico_0000_electric.png') }}"
148148
alt=""
149149
/>
150150
<p class="slider__title">Готовим за 3 минуты</p>
151151
</div>
152152
<div class="slide">
153153
<img
154154
class="slider__img"
155-
src="{{ url_for('static', filename='img/slider/salad.png') }}"
155+
src="{{ url_for('static', filename='img/slider/ico_0001_salad.png') }}"
156156
alt=""
157157
/>
158158
<p class="slider__title">Свежие ингредиенты каждый день</p>
159159
</div>
160160
<div class="slide">
161161
<img
162162
class="slider__img"
163-
src="{{ url_for('static', filename='img/slider/pin.png') }}"
163+
src="{{ url_for('static', filename='img/slider/ico_0002_pin.png') }}"
164164
alt=""
165165
/>
166166
<p class="slider__title">13 точек по всей Чите</p>
167167
</div>
168168
<div class="slide">
169169
<img
170170
class="slider__img"
171-
src="{{ url_for('static', filename='img/slider/giftbox.png') }}"
171+
src="{{ url_for('static', filename='img/slider/ico_0003_giftbox.png') }}"
172172
alt=""
173173
/>
174174
<p class="slider__title">Скидка 10% на первый заказ</p>
@@ -314,7 +314,7 @@ <h3 class="form-title">Получайте акции первыми</h3>
314314
{% endfor %} {{ form.email(size=32, class="form-entry", placeholder="Email") }}
315315
</div>
316316

317-
<p>{{ form.submit(class="form-button") }}</p>
317+
{{ form.submit(class="form-button") }}
318318
</form>
319319
</div>
320320
</div>

0 commit comments

Comments
 (0)