Форум программистов, компьютерный форум, киберфорум
JavaScript
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.71/7: Рейтинг темы: голосов - 7, средняя оценка - 4.71
0 / 0 / 0
Регистрация: 31.01.2019
Сообщений: 5

Баг при изменении количества товара в корзине

29.03.2019, 19:15. Показов 1510. Ответов 3

Студворк — интернет-сервис помощи студентам
В общем такая проблема, при изменении количества товара с общей стоимостью происходит что-то странное. С неопределенной периодичностью(рандомно) может измениться, а может и нет.

Вот ссылка на проект, запускал через OpenServer 5.2.2 : foryou.org.rar

P.S Не бейте за код)
0
IT_Exp
Эксперт
34794 / 4073 / 2104
Регистрация: 17.06.2006
Сообщений: 32,602
Блог
29.03.2019, 19:15
Ответы с готовыми решениями:

Динамическое изменение цены при изменении количества товара
Здравствуйте. Нужна помощь. Есть сайт, типа магазин, там 30 товаров, все на одной html странице. Они не берутся из базы. Нужен скрипт,...

Изменение цены товара при изменении его количества
Доброго времени суток, ув. Форумчане! Знаю что я не первый кто задаёт такой вопрос, но поиск и чтение похожих тем результата не дал. Суть...

Не работает изменение количества товара в корзине и не открывается заказ на сайте
Товар в корзину добавляется только в единичном экземпляре. Кнопки - и + не работают, вручную цифра ставится, но тут же исправляется на 1. ...

3
566 / 465 / 183
Регистрация: 14.10.2017
Сообщений: 1,259
30.03.2019, 03:29
Chyika,
код выкладывайте здесь, используя теги HTML, CSS, JS
0
0 / 0 / 0
Регистрация: 31.01.2019
Сообщений: 5
30.03.2019, 13:36  [ТС]
HTML5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<head>
        <meta charset="utf-8"></meta>
        <link  rel="stylesheet" type="text/css" href="../css/cart.css" />
        <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.0/css/all.css" integrity="sha384-Mmxa0mLqhmOeaE8vgOSbKacftZcsNYDjQzuCOm6D02luYSzBG8vpaOykv9lFQ51Y" crossorigin="anonymous">
        <link rel="stylesheet" href="../libs/magnific-popup/magnific-popup.css">
 
        <title>ForYou</title>  
    </head>
        
    <body>
        <div class="hidden fade">
                <form id="form">
                    <h3>Отправка заявки</h3>
                    <div class="inputs">
                        <input type="text" class="search-line" size="30" name="name" placeholder="Имя">
                        <input type="text" class="search-line" size="11" name="phone" placeholder="Телефон">
                        <span><input type="checkbox" id="role">Даю согласие на обработку персональных данных</span>
                    </div>
                    <a href="#" class="button submit">Отправить</a>
                </form>
            </div>
 
        <header>
            
            <!-- Первая -->
            <section class="header-lines">
                <div class="conteiner  first-line">
                    <a class="logo" href="../index.php"><img src="../images/logo.png" alt="Logo" ></a>
                    <p class="city">Ростов-на-Дону <span class="font-awesome"></span></p>
                </div>
            </section>
            
            <!-- Вторая -->
            <section class="header-lines">
                <div class="conteiner  second-line">
                    <form action="#">
                        <div class="search-conteiner">
                            <input type="text" class="search-line" placeholder="Поиск нужного подарка"> 
                            <img id="icon_search" src="../images/Icon_Search.png" alt="search">
                        </div>
                    </form>
                
                    <div class="button-list">
                        <div style="clear: both;">
                            <img src="../images/Icon_Person.png" alt="Person"> 
                            <a href="person.php">Личный кабинет</a>
                        </div>
                        <div class="cart" style="clear: both;">
                            <img  src="../images/Icon_Cart.png" alt="Cart"> 
                            <a href="cart.php" >Корзина</a>
                            <div class="count-goods"></div>
                        </div>
                    </div>
                </div>
            </section>
            
            <!-- Третия -->
            
            <section class="header-lines">
                <div class="conteiner third-line">
                    <div class="catalog">
                        <img src="../images/Icon_Burger.png" alt="Burger">
                        <p>Каталог</p>
                    </div>
 
                    <nav id="main-categories">
                        <ul>
                            <li><a href="">Для свободного времени</a></li>
                            <li><a href="">Домой</a></li>
                            <li><a href="">В офис</a></li>
                            <li><a href="">В машину</a></li>
                            <li><a href="">На день рождения</a></li>
                            <li><a href="">На свадьбу</a></li>
                        </ul>
                    </nav>
                </div>
            </section>
            
        </header>
        
        <main>
            <!-- <div class="conteiner empty-cart">
                <h3>Ваша корзина пуста</h3>
                <a href="../index.php" class="button">Перейти в каталог</a>
            </div> -->
            
            <!-- <div class="conteiner header-cart">
                    <h2 style="margin-left: 20px">Корзина</h2>
 
                    <h2>В корзине:</h2>
 
                    <h2>Сумма:</h2>
            </div>
 
            <div class="conteiner all-goods-cart">
                <div class="no-empty-cart">
                    <img style="margin-left: 20px" src="../images/goods/1.png" height="50px" alt="1">
                    <p>Кофейные зерна в шоколаде...</p>
                    <div class="count-change">
                        <button><</button>
                        <input type="text" size="2">
                        <button>></button>
                    </div>
                    <p>190 Р * 3 шт = 570 Р</p>
                    <img style="margin-right: 20px" class="Can" src="../images/Icon_Can.png" alt="Icon_Can">
                </div>
 
                <div class="no-empty-cart">
                    <img style="margin-left: 20px" src="../images/goods/1.png" height="50px" alt="1">
                    <p>Кофейные зерна в шоколаде...</p>
                    <div class="count-change">
                        <button><</button>
                        <input type="text" size="2">
                        <button>></button>
                    </div>
                    <p>190 Р * 3 шт = 570 Р</p>
                    <img style="margin-right: 20px" class="Can" src="../images/Icon_Can.png" alt="Icon_Can">
                </div>
            </div> -->
            
 
 
 
 
        </main>
 
        <footer>
            <div class="conteiner conteiner-footer">
                <section>
                        <p class="copiration">
                         © 2008-2019, foryou.ru
                         Интернет магазин подарков 
                         Ростове-на-Дону
                        </p>
                </section>
                <section>
                    
                    <h2>Мы в соцсетях</h2>
                    <div class="soc-icons">
                        <img src="../images/Icon_vk.png" alt="vkontakte">
                        <img src="../images/Icon_twetter.png" alt="twetter">
                        <img src="../images/Icon_instagram.png" alt="instagram">
                    </div>
                    
                </section>
                <section>
                    <h2>Обратная связь</h2>
                    <a href="">Написать директору</a><br>
                    <a href="">Сообщить об ошибке</a>
                </section>
                <section>
                    <h2>8 800 555 35 35</h2>
                    <a href="">info@foryou.ru </a>
                </section>
            </div>
        </footer>
        
        <script src="../js/jquery-3.3.1.min.js"></script>
        <script src="../libs/magnific-popup/jquery.magnific-popup.js"></script>
        <script src="../js/cart.js"></script>
 
    </body>
JavaScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
var cart = {};
var cost = 0;
var count = 0;
 
// Отключение перехода по ссылке
 
function noperevod(events) {
    events.preventDefault();
}
 
function loadCart() {
    if ( localStorage.getItem('cart')) {
        cart = JSON.parse(localStorage.getItem('cart'));
        cost = JSON.parse(localStorage.getItem('cost'));
        count = JSON.parse(localStorage.getItem('count'));
        showCart();
        showMiniCart();
    } else  {
        var out = '';
 
        out += '<div class="conteiner empty-cart">';
        out += '<h3>Ваша корзина пуста</h3>';
        out += '<a href="../index.php" class="button">Перейти в каталог</a>';
        out += '</div>';
 
        $('main').html(out);
        showMiniCart();
    }
}   
 
function check() {
    var work = true;
 
    if ($("input[name='name']").val() == '') {
        alert('Введите имя!');
        work = false;
    }
 
    if ($("input[name='phone']").val() == '') {
        alert('Введите номер телефона!');
        work = false;
    }
    
    if ($('#form').find("input:checkbox").prop("checked") == false) {
        alert('Согласие на обработку данных не дано.');
        work = false;
    }
 
 
    return work;
    
}
 
function showCart() {
    if (!isEmpty(cart)) {
        var out = '';
        
 
 
        out += '<div class="conteiner empty-cart">';
        out += '<h3>Ваша корзина пуста</h3>';
        out += '<a href="../index.php" class="button">Перейти в каталог</a>';
        out += '</div>';
 
        $('main').html(out);
        showMiniCart();
    } else {
        $.getJSON("../goods.json", function(data) {
            var out="";
            
            out += '<div class="conteiner header-cart">';
            out += '<h2 style="margin-left: 20px">Корзина</h2>';
            out += '<h2>В корзине:' + count + '</h2>';
            out += '<h2>Сумма:' + cost + '</h2>';
            out += '</div>';
            out += '<div class="conteiner all-goods-cart">';
 
            for (var key in cart) {
                out += '<div class="no-empty-cart">';
                out += '<img style="margin-left: 20px" src="../images/goods/' + data[key].img + '" height="50px">';
                out += '<p>' + data[key].name + '</p>';
                out += '<div class="count-change"> ';
                out += '<button class="minus-good" data-id="' + key + '"><</button>';
                out += '<input  class="change-Count" type="text" value="' + cart[key] + '" size="2">';
                out += '<button class="add-good" data-id="' + key + '">></button>';
                out += '</div>';
                out += '<p>' + data[key].cost + ' ₽ * ' + cart[key] +' шт. = ' + parseInt(data[key].cost) * parseInt(cart[key]) + ' Р</p>';
                out += '<img data-id="' + key + '"  style="margin-right: 20px" class="can" src="../images/Icon_Can.png" alt="Icon_Can">';
                out += '</div>';
            }
 
            out += '</div>';
        
            out += '<div class="conteiner empty-cart">';
            out += '<a href="#form" class="button popup">Оформить заказ</a>';
            out += '</div>';
 
            $('main').html(out);
            $('.can').on('click', delGoods); 
            $('.add-good').on('click', changeAddCount); 
            $('.minus-good').on('click', changeMinusCount); 
            $('.popup').magnificPopup();
            $('.submit').on('click', function() {
                if (check()) {
                    $.ajax({
                        type: "POST",
                        url: "mail.php",
                        data: $(this).serialize()
                    }).done(function() {
                        alert("Ожидайте звонка менеджера");
                        setTimeout(function() {
                            $.magnificPopup.close();
                        }, 1000);
                    });
                    return false;
                }
            });
        });
    }
}
 
function isEmpty(object) {
    for (var key in object)
    if (object.hasOwnProperty(key)) return true;
    return false;
}
 
function showMiniCart() {
    var out=""
 
    out += '<span style="margin-top: 3px; ">' + count + '</span>';
    $('.count-goods').html(out);
    
}
 
function delGoods() {
 
    var id = $(this).attr('data-id');
    count -= cart[id];
    
 
    $.getJSON('../goods.json', function(data) {
        cost -= parseInt(data[id].cost) * cart[id];
    });
 
    setInterval(delete(cart[id]), 50);
 
 
    saveCart();
    loadCart();
 
}
 
function changeAddCount() {
    var id = $(this).attr('data-id');
    cart[id]++;
    count++;
 
    $.getJSON("../goods.json", function(data) {
        cost += parseInt(data[id].cost);
    });
    saveCart();
    loadCart();
}
 
function changeMinusCount() {
    var id = $(this).attr('data-id');
    if (cart[id]==1) {
        delete cart[id];
    }
    else {
        cart[id]--;
    }
    $.getJSON("../goods.json", function(data) {
        cost -= parseInt(data[id].cost); 
    });
    count--;
    saveCart();
    loadCart();
}
 
 
function saveCart() {
    localStorage.setItem('cart', JSON.stringify(cart));
    localStorage.setItem('cost', JSON.stringify(cost));
    localStorage.setItem('count', JSON.stringify(count));
}
 
function changeCount(x) {
    count = x;
    saveCart();
    loadCart();
}
 
$(document).ready(function () {
    
    loadCart();
 
});
CSS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
.clear-fix::after {
    content: '';
    display: block;
    clear: both;
    height: 0px;
    visibility: hidden;
}
 
.hidden {
    display: none;
 
}
/* ------------------------------------PopUp-------------------------------------------- */
 
.fade {
    -webkit-animation-name: fade;
    -webkit-animation-duration: 1.5s;
    animation-name: fade;
    animation-duration: 1.5s;
}
 
@-webkit-keyframes fade {
    from {opacity:0}
    to {opacity: 1}
}
 
@keyframes fade {
    from {opacity:0}
    to {opacity: 1}
}
 
.submit {
    align-self: end;
 
}
 
.inputs {
    display: grid;
    grid-template-rows: 1fr 1fr 0.3fr;
    justify-items: center;
    grid-row-gap: 7px;
}
 
#role {
    width: 20px;
}
 
.inputs input{
    width: 290px;
 
}
 
.inputs span{
    font-size: 14px;
}
 
#form {
    display: grid;
    grid-template-rows: 1fr 2fr 1.2fr;
    justify-items: center;
    position: relative;
    padding: 40px 20px;
    background-color: #fff;
    max-width: 320px;
    margin: auto;
}
 
/* ------------------------------------Основные контейнеры-------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    font-family: 'SF UI Display Medium';
    font-weight: normal;
    font-size: 14px;
}
 
body {
    display: grid;
    grid-template-rows: 190px 100vh 190px;
    grid-auto-rows: minmax(200px, auto); 
    grid-gap: 40px;
 
}
 
header {
    display: grid;
 
    grid-template-rows: 56px 76px 56px; 
 
}
 
main {
    display: grid;
    grid-template-rows: 55px auto;
    grid-auto-rows: minmax(55px, auto);
    grid-row-gap: 30px;
}
 
footer {
    background: #E5E5E5;
    display: grid;
    align-items: center;
}
 
.conteiner {
    width: 1110px;
    padding: 0 80px;
    margin: 0 auto;
}
/* ------------------------------------Шапка и её контент-------------------------------------------- */
.header-lines {
    display: grid;
    border-bottom: 1px solid #EFEFEF;
}
 
.header-lines:first-child {
    background: #F3F3F3;
}
 
/* ------------------------------------Шапка-Первая линия-------------------------------------------- */
.first-line {
    display: grid;
    justify-items: end;
    align-items: center;
    position: relative;
}
 
.first-line > p {
    color: #E11C1C;
}
 
.logo {
    position: absolute;
    left: 80px;
    top:18px;
}
 
.city {
    cursor: pointer;
 
}
 
/* ------------------------------------Шапка-Вторая линия-------------------------------------------- */
 
.second-line {
    display: grid;
    grid-template-columns: auto 342px;
    align-items: center;
    justify-items: end;
}
 
.button-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-items: end;
}
 
.button-list > div > a{
    text-decoration: none;
    margin-left: 15px;
    margin-top: 7px;
    color: #303030;
}
 
.button-list *:hover {
    color: #E11C1C;
}
 
.button-list > div > * {
    display: inline-block;
    float: left;
}
 
.search-conteiner {
    position: relative;
 
}
 
#icon_search {
    position: absolute;
    top: 9px;
    right: 12px;
 
}
 
.search-line {
    width: 490px;
    height: 40px;
    border: 1px solid #D1D1D1;
    border-radius: 6px;
    padding-left: 15px;
    padding-right: 15px;
}
 
.count-goods {
    position: absolute;
    left: 18px;
    bottom: -5px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: #E11C1C;
    text-align: center;
    color: #FFFFFF;
    font-family:'SF UI Display Bold';
    font-style: normal;
    font-size: 10px;
}
 
.cart{
    position: relative;
}
 
.count-goods span{
    color: #FFFFFF;
    font-family:'SF UI Display Medium';
    font-style: normal;
    font-size: 10px;
}
::-webkit-input-placeholder {
 
    font-family: 'SF UI Display Light';
    font-weight: normal;
    font-size: 15px;
    line-height: normal;
 
    color: #A4A4A4;
}
::-moz-placeholder          {
    font-family: 'SF UI Display Medium';
    font-weight: normal;
    font-size: 14px;
    line-height: normal;
 
    color: #A4A4A4;
}/* Firefox 19+ */
:-moz-placeholder           {
    font-family: 'SF UI Display Medium';
    font-weight: normal;
    font-size: 14px;
    line-height: normal;
 
    color: #A4A4A4;
}/* Firefox 18- */
:-ms-input-placeholder      {
    font-family: 'SF UI Display Medium';
    font-weight: normal;
    font-size: 14px;
    line-height: normal;
 
    color: #A4A4A4;
}
 
/* ------------------------------------Шапка-Третия линия-------------------------------------------- */
.third-line {
    display: grid;
    grid-template-columns: 1fr 4fr;
    align-items: center;
    justify-items: end;
}
 
 
.catalog {
 
    display: grid;
    justify-self: start;
    grid-template-columns: 1fr 3fr;
    align-items: center;
    margin-left: 15px;
}
 
.catalog p {
    font-size: 16px;
    margin-left: 15px;
}
 
.catalog:hover {
    color: #E11C1C;
}
 
.main-categories {
    
}
/* -------------Главное меню------------- */
 
nav ul li{
    list-style: none;
    float: left;
    display: inline;
    padding-right: 40px;
}
 
nav ul li:last-child{
    padding-right: 0;
    list-style: none;
    float: left;
    display: inline;
    
}
 
nav ul a{
    text-decoration: none;
    color: black;
    font-family:'SF UI Display Medium';
    font-weight:normal;
    font-size:16px;
    
}
 
nav ul a:hover{
    color: #E11C1C;
    
}
 
.font-awesome {
    font-family: 'f-awesome-solid';
    font-weight: normal;
    font-size: 14px;
}
 
/* ------------------------------------Основной контент-------------------------------------------- */
 
.change-Count {
    text-align: center;
 
}
 
.header-cart {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    background-color: #F3F3F3;
    align-items: center;
    padding: 0;
    height: 55px;
}
 
.empty-cart {
    justify-items: center;
    display: grid;
    grid-template-rows: 1fr 3fr;
    margin-top: 10px;
}
 
.no-empty-cart {
    align-items: center;
    background-color: #F3F3F3;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 2fr 2fr;
    padding: 0;
    margin-top: 10px;
}
 
.count-change {
    display: grid;
    grid-template-columns: 20px 30px 20px;
    grid-auto-rows: auto;
}
 
.count-change button{
    width: 20px;
}
 
.Can {
    justify-self: end;
 
}
 
.button {
    height: 16px;
    text-decoration: none;
    padding: 20px;
    background-color: #E11C1C;
    text-transform: uppercase;
    font-family: 'SF UI Display Bold';
    font-weight: normal;
    font-size: 13px;
    color: #ffffff;
 
}
 
 
/* -------------Категории товаров------------- */
 
.categories {
    margin-top: 80px;
    display: grid;
    align-items: stretch;
    grid-template-rows: repeat( 3, 430px);
 
}
 
.container-goods {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}
 
/* -------------Карточка товара------------- */
 
h3 {
    font-family: 'SF UI Display Bold';
    font-weight: normal;
    font-size: 24px;
    /*margin-top: 40px;*/
    margin-bottom: 32px;
    color: #303030;
}
 
.red {
    color: #E11C1C;
}
 
.goods {
    max-width: 190px;
    position: relative;
 
}
 
.goods:hover {
    webkit-box-shadow: 0 4px 8px 3px rgba(0, 0, 0, 0.16);
    -moz-box-shadow: 0 4px 8px 3px rgba(0, 0, 0, 0.16);
    box-shadow: 0 4px 8px 3px rgba(0, 0, 0, 0.16);
    -webkit-transition: all 0.33s ease-out;
    -moz-transition: all 0.33s ease-out;
    -o-transition: all 0.33s ease-out;
    transition: all 0.33s ease-out;
}
 
 
.pluscart {
    position: absolute;
    right: 20px;
    bottom: 8px;
    
}
 
.icon_pluscart {
    position: absolute;
    right: 20px;
    bottom: 8px;
    background-image: url(../images/icon_pluscart.png);
    background-repeat: no-repeat;
    background-position: center;
    height: 30px;
    width: 30px;
    display: none;
}
 
div.showCart::before{
    content: "";
    background-image: url(../images/icon_pluscart.png);
    background-repeat: no-repeat;
    background-position: center;
    width: 30px;
    height: 30px;
    position: absolute;
    right: 20px;
    bottom: 8px;
    opacity: 1;
    transition: 0.3s ease;
    
}
 
div.hideCart::before{
    content: "";
    background-image: url(../images/icon_pluscart.png);
    background-repeat: no-repeat;
    background-position: center;
    width: 30px;
    height: 30px;
    position: absolute;
    right: 20px;
    bottom: 8px;
    opacity: 0;
    transition: 0.3s ease;
}
 
.price {
    margin-left: 15px;
}
.discription {
    max-width: 140px;
    text-align: center;
    color: #303030;
    font-family: 'SF UI Display Medium';
    font-weight: normal;
    font-size: 14px;
    margin: auto;
    margin-top: 16px;
    margin-bottom: 32px;
    
}
/* ------------------------------------Футер-------------------------------------------- */
 
.copiration {
    width: 160px;
    color: #A4A4A4;
    font-family: 'SF UI Display Light';
    font-weight: normal;
    font-size: 12px;
}
 
h2 {
    font-family: 'SF UI Display Bold';
    font-weight: normal;
    font-size: 18px;
    margin-bottom: 8px;
}
 
section > a {
    text-decoration: none;
    color: #A4A4A4;
    font-family: 'SF UI Display Light';
    font-weight: normal;
    font-size: 14px;
    margin-bottom: 5px;
}
 
section > p {
    margin-top: 10px;
}
 
.soc-icons > img {
 
    margin-left: 5px;
}
 
 
.conteiner-footer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}
 
/* ------------------------------------Подключение шрифтов-------------------------------------------- */
 
/* #### Generated By: http://www.cufonfonts.com #### */
 
@font-face {
font-family: 'f-awesome-regular';
font-style: normal;
font-weight: normal;
src: local('f-awesome-regular'), url('fonts/fa-regular-400.woff') format('woff');
}
 
@font-face {
font-family: 'f-awesome-solid';
font-style: normal;
font-weight: normal;
src: local('f-awesome-solid'), url('fonts/fa-solid-900.woff') format('woff');
}
 
@font-face {
font-family: 'f-awesome-brands';
font-style: normal;
font-weight: normal;
src: local('f-awesome-brands'), url('fonts/fa-brands-400.woff') format('woff');
}
 
@font-face {
font-family: 'SF UI Display Ultralight';
font-style: normal;
font-weight: normal;
src: local('SF UI Display Ultralight'), url('fonts/sf-ui-display-ultralight-58646b19bf205.woff') format('woff');
}
 
 
@font-face {
font-family: 'SF UI Display Thin';
font-style: normal;
font-weight: normal;
src: local('SF UI Display Thin'), url('fonts/sf-ui-display-thin-58646e9b26e8b.woff') format('woff');
}
 
 
@font-face {
font-family: 'SF UI Display Light';
font-style: normal;
font-weight: normal;
src: local('SF UI Display Light'), url('fonts/sf-ui-display-light-58646b33e0551.woff') format('woff');
}
 
 
@font-face {
font-family: 'SF UI Display Medium';
font-style: normal;
font-weight: normal;
src: local('SF UI Display Medium'), url('fonts/sf-ui-display-medium-58646be638f96.woff') format('woff');
}
 
 
@font-face {
font-family: 'SF UI Display Semibold';
font-style: normal;
font-weight: normal;
src: local('SF UI Display Semibold'), url('fonts/sf-ui-display-semibold-58646eddcae92.woff') format('woff');
}
 
 
@font-face {
font-family: 'SF UI Display Bold';
font-style: normal;
font-weight: normal;
src: local('SF UI Display Bold'), url('fonts/sf-ui-display-bold-58646a511e3d9.woff') format('woff');
}
 
 
@font-face {
font-family: 'SF UI Display Heavy';
font-style: normal;
font-weight: normal;
src: local('SF UI Display Heavy'), url('fonts/sf-ui-display-heavy-586470160b9e5.woff') format('woff');
}
 
 
@font-face {
font-family: 'SF UI Display Black';
font-style: normal;
font-weight: normal;
src: local('SF UI Display Black'), url('fonts/sf-ui-display-black-58646a6b80d5a.woff') format('woff');
}
0
0 / 0 / 0
Регистрация: 31.01.2019
Сообщений: 5
30.03.2019, 13:37  [ТС]
HTML5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<head>
        <meta charset="utf-8"></meta>
        <link  rel="stylesheet" type="text/css" href="css/style.css" />
        <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.0/css/all.css" integrity="sha384-Mmxa0mLqhmOeaE8vgOSbKacftZcsNYDjQzuCOm6D02luYSzBG8vpaOykv9lFQ51Y" crossorigin="anonymous">
        <link rel="stylesheet" href="libs/magnific-popup/magnific-popup.css">
 
 
        <title>ForYou</title>  
    </head>
        
    <body>
        <header>
            
            <!-- Первая -->
            <section class="header-lines">
                <div class="conteiner  first-line">
                    <a class="logo" href="../index.php"><img src="images/logo.png" alt="Logo" > </a>
                    <p class="city">Ростов-на-Дону <span class="font-awesome"></span></p>
                </div>
            </section>
            
            <!-- Вторая -->
            <section class="header-lines">
                <div class="conteiner  second-line">
                    <form action="#">
                        <div class="search-conteiner">
                            <input type="text" class="search-line" placeholder="Поиск нужного подарка"> 
                            <img id="icon_search" src="images/Icon_Search.png" alt="search">
                        </div>
                    </form>
                
                    <div class="button-list">
                        <div style="clear: both;">
                            <img src="images/Icon_Person.png" alt="Person"> 
                            <a href="pages/person.php">Личный кабинет</a>
                        </div>
                        <div class="cart" style="clear: both;">
                            <img  src="images/Icon_Cart.png" alt="Cart"> 
                            <a href="pages/cart.php" >Корзина</a>
                            <div class="count-goods"></div>
                        </div>
                    </div>
                </div>
            </section>
            
            <!-- Третия -->
            
            <section class="header-lines">
                <div class="conteiner third-line">
                    <div class="catalog">
                        <img src="images/Icon_Burger.png" alt="Burger">
                        <p>Каталог</p>
                    </div>
 
                    <nav id="main-categories">
                        <ul>
                            <li><a href="">Для свободного времени</a></li>
                            <li><a href="">Домой</a></li>
                            <li><a href="">В офис</a></li>
                            <li><a href="">В машину</a></li>
                            <li><a href="">На день рождения</a></li>
                            <li><a href="">На свадьбу</a></li>
                        </ul>
                    </nav>
                </div>
            </section>
            
        </header>
        
        <main>
            <div class="slider" onmouseover="showArrow()" onmouseout="hideArrow()">
                <div class="img-slider fade"></div>
                <div class="img-slider fade"></div>
                <div class="img-slider fade"></div>
                <a class="prev" onclick="plusSlides(-1)"><img src="images/prev.png" alt="prev"></a>
                <a class="next" onclick="plusSlides(1)"><img src="images/next.png" alt="next"></a>
                <div class="dots">
                    <span class="dot" onclick="currentSlides(1)"></span>
                    <span class="dot" onclick="currentSlides(2)"></span>
                    <span class="dot" onclick="currentSlides(3)"></span>
                </div>
            </div>
 
            <div class="categories conteiner">
                
            </div>
        </main>
        <footer>
            <div class="conteiner conteiner-footer">
                <section>
                        <p class="copiration">
                         © 2008-2019, foryou.ru
                         Интернет магазин подарков 
                         Ростове-на-Дону
                        </p>
                </section>
                <section>
                    
                    <h2>Мы в соцсетях</h2>
                    <div class="soc-icons">
                        <img src="images/Icon_vk.png" alt="vkontakte">
                        <img src="images/Icon_twetter.png" alt="twetter">
                        <img src="images/Icon_instagram.png" alt="instagram">
                    </div>
                    
                </section>
                <section>
                    <h2>Обратная связь</h2>
                    <a href="">Написать директору</a><br>
                    <a href="">Сообщить об ошибке</a>
                </section>
                <section>
                    <h2>8 800 555 35 35</h2>
                    <a href="">info@foryou.ru </a>
                </section>
            </div>
        </footer>
 
        
        <script src="js/jquery-3.3.1.min.js"></script>
        <script src="libs/magnific-popup/jquery.magnific-popup.min.js"></script>
        <script src="js/script.js"></script>
 
    </body>
JavaScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
var slideIndex = 1;
 
function showPlusCart() {
    $(this).css({"display":"block"});
}
 
function hidePlusCart() {
    $(this).css({"display":"none"});
}
 
function showArrow() {
    $('.prev').css({"display":"block"});
    $('.next').css({"display":"block"});
}
 
function hideArrow() {
    $('.prev').css({"display":"none"});
    $('.next').css({"display":"none"});
}
 
function showSlides(n) {
    var i;
    var slides = document.getElementsByClassName("img-slider");
    var dots = document.getElementsByClassName("dot");
 
    if (n > slides.length) {
        slideIndex = 1;
    }
 
    if (n < 1) {
        slideIndex = slides.length;
    }
 
    for (i = 0; i < slides.length; i++) {
        slides[i].style.display = "none";
    }
 
    for (i = 0; i < dots.length; i++) {
        dots[i].className = dots[i].className.replace("active", "");
    }
 
    slides[slideIndex-1].style.display = "block";
    dots[slideIndex-1].className += " active";
 }
 
function plusSlides(n) {
    showSlides(slideIndex += n);
}
 
function currentSlides(n) {
    showSlides(slideIndex = n);
}
 
function noperevod(events) {
    events.preventDefault();
};
 
 
 
 
 
 
 
 
 
 
var cart = {};
var cost = 0;
var count = 0;
 
function init() {
    $.getJSON("goods_1.json", goodsOut);
    loadCart();
    saveCart();
}
 
function goodsOut(data) {
    
    
    var out='';
 
    for (var categories in data) {
        out += '<div>';
        out += '<h3 class="red">' + data[categories]['categories'] + '</h3>';
        out += '<div class="container-goods">';
        for (var key in data[categories])  {
            if (key != 'categories') {
                out +='<div class="goods hideCart">';
                out +='<img src="images/goods/' + data[categories][key].img +'" >';
                out +='<p class="discription">' + data[categories][key].name +' </p>';
                out +='<h2 class="price">' + data[categories][key].cost + '₽</h2>';
                out +='<a href="#" onclick="noperevod(event);" class="icon_pluscart add-to-cart" data-categories="'+ categories +'" data-id="' + key +'"></a>';
                out +='</div>';
            }
        }
        out += '</div>';
        out += '</div>';
    }
        
    
    $('.categories').html(out);
    $('.add-to-cart').on('click', addToCart);
    // $(".goods").hover(function() {
 //        $(this).next('.icon_pluscart').css({"display":"block"});
 //    }, function() {
 //        $(this).next('.icon_pluscart').css({"display":"block"});
 //    });
 
    $('.goods').on('mouseover', function (event) {
        event.preventDefault();
        $(this).find('.icon_pluscart').css({"display":"block"});
    });
 
    $('.goods').on('mouseout', function (event) {
        event.preventDefault();
        $(this).find('.icon_pluscart').css({"display":"none"});
    });
 
}
 
function addToCart() {
    
    var id = $(this).attr('data-id');
    var categories = $(this).attr('data-categories');
 
    if (cart[id]==undefined) {
        cart[id] = 1;
    } else {
        cart[id]++;
    }
 
    count ++;
    $.getJSON("goods_1.json", function(data) {
 
        cost += parseInt(data[categories][id].cost);
    });
    saveCart();
    showCart();
    showMiniCart();
}
 
function saveCart() {
    localStorage.setItem('cart', JSON.stringify(cart));
    localStorage.setItem('cost', JSON.stringify(cost));
    localStorage.setItem('count', JSON.stringify(count));
 
}
 
function loadCart() {
    if (localStorage.getItem('cart')) {
        cart = JSON.parse(localStorage.getItem('cart'));
        cost = JSON.parse(localStorage.getItem('cost'));
        count = JSON.parse(localStorage.getItem('count'));
        showCart();
 
    }
    
}
 
function showMiniCart() {
    $.getJSON("goods_1.json", function(data) {
        var out=""
        
        out += '<span style="margin-top: 3px; ">' + count + '</span>';
        
        $('.count-goods').html(out);
    
    });
}
 
function showCart() {
    $.getJSON("goods_1.json", function(data) {
        var count=0;
        var out=""
        var out_cost=""
        
        for (var categories in cart) {
            for (var key in cart[categories]) {
                count += cart[key];
                out+= '<li class="nav-side">' + data[categories][key].name + '</li>';
 
            }
        }
        out_cost = 'Итого: ' + cost + ' руб.';
        
        
        $('.goods_list').html(out);
        $('#cost').html(out_cost);
        $('.cart_h2').html('Корзина: ' + count);
    
    });
}
 
$(document).ready(function(){
 
    init();
    showSlides(slideIndex);
    showMiniCart();
    
 
});
CSS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
.clear-fix::after {
    content: '';
    display: block;
    clear: both;
    height: 0px;
    visibility: hidden;
}
 
/* ------------------------------------Основные контейнеры-------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    font-family: 'SF UI Display Medium';
    font-weight: normal;
    font-size: 14px;
}
 
body {
    display: grid;
    grid-template-rows: 190px auto 190px;
    grid-auto-rows: minmax(200px, auto); 
    grid-gap: 40px;
 
}
 
header {
    display: grid;
 
    grid-template-rows: 56px 76px 56px; 
 
}
 
main {
    display: grid;
    grid-template-rows: 283px auto;
    grid-auto-rows: minmax(200px, auto); 
 
}
 
footer {
    background: #E5E5E5;
    display: grid;
    align-items: center;
}
 
.conteiner {
    width: 1110px;
    padding: 0 80px;
    margin: 0 auto;
}
/* ------------------------------------Шапка и её контент-------------------------------------------- */
.header-lines {
    display: grid;
    border-bottom: 1px solid #EFEFEF;
}
 
.header-lines:first-child {
    background: #F3F3F3;
}
 
/* ------------------------------------Шапка-Первая линия-------------------------------------------- */
.first-line {
    display: grid;
    justify-items: end;
    align-items: center;
    position: relative;
}
 
.first-line > p {
    color: #E11C1C;
}
 
.logo {
    position: absolute;
    left: 80px;
    top:18px;
}
 
.city {
    cursor: pointer;
 
}
 
/* ------------------------------------Шапка-Вторая линия-------------------------------------------- */
 
.second-line {
    display: grid;
    grid-template-columns: auto 342px;
    align-items: center;
    justify-items: end;
}
 
.button-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-items: end;
}
 
.button-list > div > a{
    text-decoration: none;
    margin-left: 15px;
    margin-top: 7px;
    color: #303030;
}
 
.button-list *:hover {
    color: #E11C1C;
}
 
.button-list > div > * {
    display: inline-block;
    float: left;
}
 
.search-conteiner {
    position: relative;
 
}
 
#icon_search {
    position: absolute;
    top: 9px;
    right: 12px;
 
}
 
.search-line {
    width: 490px;
    height: 40px;
    border: 1px solid #D1D1D1;
    border-radius: 6px;
    padding-left: 15px;
    padding-right: 15px;
}
 
.count-goods {
    position: absolute;
    left: 18px;
    bottom: -5px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: #E11C1C;
    text-align: center;
    color: #FFFFFF;
    font-family:'SF UI Display Bold';
    font-style: normal;
    font-size: 10px;
}
 
.cart{
    position: relative;
}
 
.count-goods span{
    color: #FFFFFF;
    font-family:'SF UI Display Medium';
    font-style: normal;
    font-size: 10px;
}
::-webkit-input-placeholder {
 
    font-family: 'SF UI Display Light';
    font-weight: normal;
    font-size: 15px;
    line-height: normal;
 
    color: #A4A4A4;
}
::-moz-placeholder          {
    font-family: 'SF UI Display Medium';
    font-weight: normal;
    font-size: 14px;
    line-height: normal;
 
    color: #A4A4A4;
}/* Firefox 19+ */
:-moz-placeholder           {
    font-family: 'SF UI Display Medium';
    font-weight: normal;
    font-size: 14px;
    line-height: normal;
 
    color: #A4A4A4;
}/* Firefox 18- */
:-ms-input-placeholder      {
    font-family: 'SF UI Display Medium';
    font-weight: normal;
    font-size: 14px;
    line-height: normal;
 
    color: #A4A4A4;
}
 
/* ------------------------------------Шапка-Третия линия-------------------------------------------- */
.third-line {
    display: grid;
    grid-template-columns: 1fr 4fr;
    align-items: center;
    justify-items: end;
}
 
 
.catalog {
 
    display: grid;
    justify-self: start;
    grid-template-columns: 1fr 3fr;
    align-items: center;
    margin-left: 15px;
}
 
.catalog p {
    font-size: 16px;
    margin-left: 15px;
}
 
.catalog:hover {
    color: #E11C1C;
}
 
.main-categories {
    
}
/* -------------Главное меню------------- */
 
nav ul li{
    list-style: none;
    float: left;
    display: inline;
    padding-right: 40px;
}
 
nav ul li:last-child{
    padding-right: 0;
    list-style: none;
    float: left;
    display: inline;
    
}
 
nav ul a{
    text-decoration: none;
    color: black;
    font-family:'SF UI Display Medium';
    font-weight:normal;
    font-size:16px;
    
}
 
nav ul a:hover{
    color: #E11C1C;
    
}
 
.font-awesome {
    font-family: 'f-awesome-solid';
    font-weight: normal;
    font-size: 14px;
}
 
/* ------------------------------------Основной контент-------------------------------------------- */
 
 
.button {
    text-decoration: none;
    padding: 20px;
    background-color: #E11C1C;
    text-transform: uppercase;
    font-family: 'SF UI Display Bold';
    font-weight: normal;
    font-size: 13px;
    color: #ffffff;
 
}
 
/* -------------Слайдер------------- */
 
.slider {
    position: relative;
    justify-self: center;
    max-width: 1110px;
    align-self: start;
}
 
.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    margin-top: -22px;  
    transition: 0.6s ease;
    display: none;
}
 
 
 
.next {
    right: 0;
}
 
 
.dot {
    cursor: pointer;
    width: 12px;
    height: 12px;
    margin: 0 8px;
    background-color: #fff;
    border: 2px solid #E11C1C;
    border-radius: 50%;
    display: inline-block;
    transition: background-color: 0.6s ease;
 
}
 
.dots {
    position: absolute;
    bottom: 5px;
    left: 48%;
}
 
.active, dot:hover {
    background-color: #E11C1C;
}
 
.fade {
    -webkit-animation-name: fade;
    -webkit-animation-duration: 1s;
    animation-name: fade;
    animation-duration: 1s;
}
 
@-webkit-keyframes fade {
    from {opacity:.4}
    to {opacity: 1}
}
 
@keyframes fade {
    from {opacity:.4}
    to {opacity: 1}
}
 
.img-slider:nth-child(1) {
    background-image: url(../images/slider.png);
    width: 1110px;
    height: 283px;
}
 
.img-slider:nth-child(2) {
    background-image: url(../images/slider_2.png);
    width: 1110px;
    height: 283px;
}
 
.img-slider:nth-child(3) {
    background-image: url(../images/slider_3.png);
    width: 1110px;
    height: 283px;
}
 
/* -------------Категории товаров------------- */
 
.categories {
    margin-top: 80px;
    display: grid;
    align-items: stretch;
    grid-template-rows: repeat( 3, 430px);
 
}
 
.container-goods {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}
 
/* -------------Карточка товара------------- */
 
h3 {
    font-family: 'SF UI Display Bold';
    font-weight: normal;
    font-size: 24px;
    /*margin-top: 40px;*/
    margin-bottom: 32px;
    color: #303030;
}
 
.red {
    color: #E11C1C;
}
 
.goods {
    max-width: 190px;
    position: relative;
 
}
 
.goods:hover {
    webkit-box-shadow: 0 4px 8px 3px rgba(0, 0, 0, 0.16);
    -moz-box-shadow: 0 4px 8px 3px rgba(0, 0, 0, 0.16);
    box-shadow: 0 4px 8px 3px rgba(0, 0, 0, 0.16);
    -webkit-transition: all 0.33s ease-out;
    -moz-transition: all 0.33s ease-out;
    -o-transition: all 0.33s ease-out;
    transition: all 0.33s ease-out;
}
 
 
.pluscart {
    position: absolute;
    right: 20px;
    bottom: 8px;
    
}
 
.icon_pluscart {
    position: absolute;
    right: 20px;
    bottom: 8px;
    background-image: url(../images/icon_pluscart.png);
    background-repeat: no-repeat;
    background-position: center;
    height: 30px;
    width: 30px;
    display: none;
}
 
div.showCart::before{
    content: "";
    background-image: url(../images/icon_pluscart.png);
    background-repeat: no-repeat;
    background-position: center;
    width: 30px;
    height: 30px;
    position: absolute;
    right: 20px;
    bottom: 8px;
    opacity: 1;
    transition: 0.3s ease;
    
}
 
div.hideCart::before{
    content: "";
    background-image: url(../images/icon_pluscart.png);
    background-repeat: no-repeat;
    background-position: center;
    width: 30px;
    height: 30px;
    position: absolute;
    right: 20px;
    bottom: 8px;
    opacity: 0;
    transition: 0.3s ease;
}
 
.price {
    margin-left: 15px;
}
.discription {
    max-width: 140px;
    text-align: center;
    color: #303030;
    font-family: 'SF UI Display Medium';
    font-weight: normal;
    font-size: 14px;
    margin: auto;
    margin-top: 16px;
    margin-bottom: 32px;
    
}
/* ------------------------------------Футер-------------------------------------------- */
 
.copiration {
    width: 160px;
    color: #A4A4A4;
    font-family: 'SF UI Display Light';
    font-weight: normal;
    font-size: 12px;
}
 
h2 {
    font-family: 'SF UI Display Bold';
    font-weight: normal;
    font-size: 18px;
    margin-bottom: 8px;
}
 
section > a {
    text-decoration: none;
    color: #A4A4A4;
    font-family: 'SF UI Display Light';
    font-weight: normal;
    font-size: 14px;
    margin-bottom: 5px;
}
 
section > p {
    margin-top: 10px;
}
 
.soc-icons > img {
 
    margin-left: 5px;
}
 
 
.conteiner-footer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}
 
/* ------------------------------------Подключение шрифтов-------------------------------------------- */
 
/* #### Generated By: http://www.cufonfonts.com #### */
 
@font-face {
font-family: 'f-awesome-regular';
font-style: normal;
font-weight: normal;
src: local('f-awesome-regular'), url('fonts/fa-regular-400.woff') format('woff');
}
 
@font-face {
font-family: 'f-awesome-solid';
font-style: normal;
font-weight: normal;
src: local('f-awesome-solid'), url('fonts/fa-solid-900.woff') format('woff');
}
 
@font-face {
font-family: 'f-awesome-brands';
font-style: normal;
font-weight: normal;
src: local('f-awesome-brands'), url('fonts/fa-brands-400.woff') format('woff');
}
 
@font-face {
font-family: 'SF UI Display Ultralight';
font-style: normal;
font-weight: normal;
src: local('SF UI Display Ultralight'), url('fonts/sf-ui-display-ultralight-58646b19bf205.woff') format('woff');
}
 
 
@font-face {
font-family: 'SF UI Display Thin';
font-style: normal;
font-weight: normal;
src: local('SF UI Display Thin'), url('fonts/sf-ui-display-thin-58646e9b26e8b.woff') format('woff');
}
 
 
@font-face {
font-family: 'SF UI Display Light';
font-style: normal;
font-weight: normal;
src: local('SF UI Display Light'), url('fonts/sf-ui-display-light-58646b33e0551.woff') format('woff');
}
 
 
@font-face {
font-family: 'SF UI Display Medium';
font-style: normal;
font-weight: normal;
src: local('SF UI Display Medium'), url('fonts/sf-ui-display-medium-58646be638f96.woff') format('woff');
}
 
 
@font-face {
font-family: 'SF UI Display Semibold';
font-style: normal;
font-weight: normal;
src: local('SF UI Display Semibold'), url('fonts/sf-ui-display-semibold-58646eddcae92.woff') format('woff');
}
 
 
@font-face {
font-family: 'SF UI Display Bold';
font-style: normal;
font-weight: normal;
src: local('SF UI Display Bold'), url('fonts/sf-ui-display-bold-58646a511e3d9.woff') format('woff');
}
 
 
@font-face {
font-family: 'SF UI Display Heavy';
font-style: normal;
font-weight: normal;
src: local('SF UI Display Heavy'), url('fonts/sf-ui-display-heavy-586470160b9e5.woff') format('woff');
}
 
 
@font-face {
font-family: 'SF UI Display Black';
font-style: normal;
font-weight: normal;
src: local('SF UI Display Black'), url('fonts/sf-ui-display-black-58646a6b80d5a.woff') format('woff');
}
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
BasicMan
Эксперт
29316 / 5623 / 2384
Регистрация: 17.02.2009
Сообщений: 30,364
Блог
30.03.2019, 13:37
Помогаю со студенческими работами здесь

Количества товара в корзине отображается после обновления страницы как исправить?
Добрый день! Возник такой вопрос на Virtuemart 2.0.14 при нажатии на кнопку Добавить в корзину ни чего не отображается (ни каких...

Вывод цены товара сразу же по изменении его количества
РЕбята! Всем привет! Нужна ваша помощь! Задача следующая: есть таблица из трех столбцов: количество овощей на складе, &quot;цена&quot;,...

Массив: При отправке гетом количества для определенного товара изменить количество товара в массиве по ID
Здравствуйте форумчане. Возникла такая проблема. Есть массив товаров array(2) { =&gt; array(11) { =&gt; string(1)...

При изменении цены в каталоге, не проставляется цена на странице товара
Добрый день, столкнулся с проблемой, не проставляется цена, при вводе через админку: каталог - элемент - торговый каталог. Меня базовую...

Отображение товара в корзине
Подскажите пожалуйста, каким образом можно сделать так, чтобы у каждого гостя сайта, при добавлении товара в корзину, отображалась своя...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
4
Ответ Создать тему
Новые блоги и статьи
Воспроизведение звукового файла с помощью SDL3_mixer при касании экрана Android
8Observer8 26.01.2026
Содержание блога SDL3_mixer - это библиотека я для воспроизведения аудио. В отличие от инструкции по добавлению текста код по проигрыванию звука уже содержится в шаблоне примера. Нужно только. . .
Установка Android SDK, NDK, JDK, CMake и т.д.
8Observer8 25.01.2026
Содержание блога Перейдите по ссылке: https:/ / developer. android. com/ studio и в самом низу страницы кликните по архиву "commandlinetools-win-xxxxxx_latest. zip" Извлеките архив и вы увидите. . .
Вывод текста со шрифтом TTF на Android с помощью библиотеки SDL3_ttf
8Observer8 25.01.2026
Содержание блога Если у вас не установлены Android SDK, NDK, JDK, и т. д. то сделайте это по следующей инструкции: Установка Android SDK, NDK, JDK, CMake и т. д. Сборка примера Скачайте. . .
Использование SDL3-callbacks вместо функции main() на Android, Desktop и WebAssembly
8Observer8 24.01.2026
Содержание блога Если вы откроете примеры для начинающих на официальном репозитории SDL3 в папке: examples, то вы увидите, что все примеры используют следующие четыре обязательные функции, а. . .
моя боль
iceja 24.01.2026
Выложила интерполяцию кубическими сплайнами www. iceja. net REST сервисы временно не работают, только через Web. Написала за 56 рабочих часов этот сайт с нуля. При помощи perplexity. ai PRO , при. . .
Модель сукцессии микоризы
anaschu 24.01.2026
Решили писать научную статью с неким РОманом
http://iceja.net/ математические сервисы
iceja 20.01.2026
Обновила свой сайт http:/ / iceja. net/ , приделала Fast Fourier Transform экстраполяцию сигналов. Однако предсказывает далеко не каждый сигнал (см ограничения http:/ / iceja. net/ fourier/ docs ). Также. . .
http://iceja.net/ сервер решения полиномов
iceja 18.01.2026
Выкатила http:/ / iceja. net/ сервер решения полиномов (находит действительные корни полиномов методом Штурма). На сайте документация по API, но скажу прямо VPS слабенький и 200 000 полиномов. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru