Skip to content

Commit

Permalink
clear comments
Browse files Browse the repository at this point in the history
  • Loading branch information
IrynaSlavinska committed Mar 17, 2024
1 parent e416d30 commit 4d76011
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 92 deletions.
21 changes: 1 addition & 20 deletions src/css/modal.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@
border: none;
background-color: transparent;
}
.modal-close-btn:hover,
.modal-close-btn:focus {
}
.modal-close-icon {
width: 24px;
height: 24px;
Expand Down Expand Up @@ -208,17 +205,6 @@
line-height: 1.28;
letter-spacing: -0.04em;
}
/* Прибирає личильник з інпута "намбер": */
/* Chrome, Safari, Edge, Opera */
/* input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
} */
/* Firefox */
/* input[type='number'] {
-moz-appearance: textfield;
} */
.modal-btn-send {
min-width: 92px;
padding: 12px 24px;
Expand Down Expand Up @@ -256,12 +242,7 @@ input::-webkit-inner-spin-button {
.check-input:checked ~ .check-label .check-span {
fill: var(--dark-green-color);
}
/* .modal-card-item .check-input:focus ~ .modal-content,
.modal-card-item:hover .modal-content {
border-color: var(--dark-green-color);
} */
/* MEDIA MEDIA MEDIA MEDIA MEDIA */
/* MEDIA MEDIA MEDIA MEDIA MEDIA */

/* MEDIA MEDIA MEDIA MEDIA MEDIA */
@media screen and (min-width: 375px) {
}
Expand Down
1 change: 0 additions & 1 deletion src/css/scroll-up.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
}

.scroll-up-btn.show {
/* display: block; */
opacity: 1;
height: 40px;
}
Expand Down
8 changes: 1 addition & 7 deletions src/css/styles.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/**
|============================
| include css partials with
| default @import url()
|============================
*/
@import url('./reset.css');

@import url('./header.css');
Expand All @@ -29,7 +23,7 @@
--transition: 300ms linear;
}
@font-face {
font-family: 'DM Sans', sans-serif;
font-family: DM Sans, sans-serif;
font-weight: 400;
font-style: normal;
font-display: swap;
Expand Down
15 changes: 0 additions & 15 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Veggie-boost</title>

<!-- <style media="screen, print">
@font-face {
font-family: 'DM Sans';
src: url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap');
}
</style> -->

<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/modern-normalize/2.0.0/modern-normalize.min.css"
Expand All @@ -30,28 +23,20 @@
<link rel="stylesheet" href="./css/styles.css" />
</head>
<body>
<!-- Ihor -->
<load ="partials/header.html" />

<main>
<!-- Denys -->
<load ="partials/hero.html" />
<section class="how-it section" id="how-it-works">
<!-- Roman -->
<load ="partials/about.html" />
<!-- Ira -->
<load ="partials/manual.html" />
</section>
<!-- Anastasia -->
<load ="partials/catalog.html" />
<!-- Kostia -->
<load ="partials/order.html" />
</main>

<!-- Dima -->
<load ="partials/footer.html" />

<!-- Maryna -->
<load ="partials/modal.html" />

<load ="partials/scroll-up.html" />
Expand Down
Empty file removed src/js/about.js
Empty file.
Empty file removed src/js/catalog.js
Empty file.
Empty file removed src/js/footer.js
Empty file.
Empty file removed src/js/hero.js
Empty file.
Empty file removed src/js/manual.js
Empty file.
49 changes: 25 additions & 24 deletions src/js/modal.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
let input = document.querySelector("#bank-card-input"),
numbers = /[0-9]/,
regExp = /[0-9]{4}/
let input = document.querySelector('#bank-card-input'),
numbers = /[0-9]/,
regExp = /[0-9]{4}/;

// добавляем слушатель события на инпут
input.addEventListener("input",(ev)=>{
// не позволяем ввести ничего, кроме цифр 0-9, ограничиваем размер поля 19-ю символами
if( ev.inputType === "insertText" && !numbers.test(ev.data) || input.value.length > 19){
input.value = input.value.slice(0, input.value.length - 1)
return
}
input.addEventListener('input', ev => {
if (
(ev.inputType === 'insertText' && !numbers.test(ev.data)) ||
input.value.length > 19
) {
input.value = input.value.slice(0, input.value.length - 1);
return;
}

// обеспечиваем работу клавиш "backspace","delete"
let value = input.value
if( ev.inputType === "deleteContentBackward" && regExp.test(value.slice(-4)) ){
input.value = input.value.slice(0, input.value.length - 1)
return
}
let value = input.value;
if (
ev.inputType === 'deleteContentBackward' &&
regExp.test(value.slice(-4))
) {
input.value = input.value.slice(0, input.value.length - 1);
return;
}

// добавяем пробел после 4 цифр подряд
if( regExp.test(value.slice(-4)) && value.length < 19){
input.value += " "
}
})
if (regExp.test(value.slice(-4)) && value.length < 19) {
input.value += ' ';
}
});


const modalCheckboxContainers = document.querySelectorAll(
const modalCheckboxContainers = document.querySelectorAll(
'.modal-checkbox-container'
);
const checkboxes = document.querySelectorAll('.check-input');
Expand All @@ -38,4 +39,4 @@ modalCheckboxContainers.forEach((container, index) => {
checkboxes[index].checked = !checkboxes[index].checked;
}
});
});
});
9 changes: 3 additions & 6 deletions src/js/scroll-up.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//Get the button
let mybutton = document.getElementById('btn-back-to-top');

// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function () {
scrollFunction();
};
Expand All @@ -11,16 +9,15 @@ function scrollFunction() {
document.body.scrollTop > 500 ||
document.documentElement.scrollTop > 500
) {
mybutton.classList.add('show'); // Add the 'show' class
mybutton.classList.add('show');
} else {
mybutton.classList.remove('show'); // Remove the 'show' class
mybutton.classList.remove('show');
}
}
// When the user clicks on the button, scroll to the top of the document
mybutton.addEventListener('click', backToTop);

function backToTop() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
mybutton.blur(); // Remove focus from the button
mybutton.blur();
}
5 changes: 0 additions & 5 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import './js/header';
import './js/hero';
import './js/about';
import './js/manual';
import './js/catalog';
import './js/order';
import './js/modal';
import './js/footer';
import './js/scroll-up';

(() => {
Expand Down
13 changes: 0 additions & 13 deletions src/partials/modal.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
<!-- ------------------MODAL--------------- -->

<!-- додати/прибрати is-hidden після backdrop -->
<div class="backdrop is-hidden" data-modal>
<div class="modal-box">
<p class="modal-title">Your Order</p>
Expand All @@ -10,11 +7,8 @@
</svg>
</button>

<!-- CARDS CARDS CARDS -->

<ul class="modal-cards list">
<li class="modal-card-item modal-checkbox-container">
<!-- checkbox -->
<input
type="checkbox"
class="check-input visually-hidden"
Expand All @@ -29,7 +23,6 @@
</svg>
</span>
</label>
<!-- кінець чекбокса -->

<div class="modal-content">
<p class="modal-subtitle">Cabbage Basket</p>
Expand Down Expand Up @@ -69,7 +62,6 @@
</div>
</li>
<li class="modal-card-item modal-checkbox-container">
<!-- checkbox -->
<input
type="checkbox"
class="check-input visually-hidden"
Expand All @@ -84,7 +76,6 @@
</svg>
</span>
</label>
<!-- кінець чекбокса -->

<div class="modal-content">
<p class="modal-subtitle">Tomato Basket</p>
Expand Down Expand Up @@ -124,7 +115,6 @@
</div>
</li>
<li class="modal-card-item modal-checkbox-container">
<!-- checkbox -->
<input
type="checkbox"
class="check-input visually-hidden"
Expand All @@ -139,7 +129,6 @@
</svg>
</span>
</label>
<!-- кінець чекбокса -->

<div class="modal-content">
<p class="modal-subtitle">Vegetables Basket</p>
Expand Down Expand Up @@ -180,8 +169,6 @@
</li>
</ul>

<!-- FORM FORM FORM -->

<div class="modal-form-box">
<form class="modal-form">
<input
Expand Down
1 change: 0 additions & 1 deletion src/partials/scroll-up.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<div class="scroll-up">
<!-- Back to top button -->
<button type="button" class="scroll-up-btn" id="btn-back-to-top">
<svg class="scroll-up-btn-icon" width="22" height="22">
<use href="./img/veggie-icons.svg#icon-arrow-up"></use>
Expand Down

0 comments on commit 4d76011

Please sign in to comment.