Skip to content

Commit

Permalink
Merge pull request #7 from moevm/kharitonov_components
Browse files Browse the repository at this point in the history
Page: Components
  • Loading branch information
necitboss authored Nov 9, 2024
2 parents fc8dff8 + ce572ad commit bcc9522
Show file tree
Hide file tree
Showing 7 changed files with 429 additions and 0 deletions.
303 changes: 303 additions & 0 deletions main/_front/src/html/components.html

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions main/_front/src/js/components.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const choiceLists = document.querySelectorAll(".choice");

choiceLists.forEach((choiceList) => {
const choiceItems = choiceList.querySelectorAll(".choice__elem");
choiceItems.forEach((choice) => {
if (choice.classList.contains("active")) {
choiceList.dataset.value = choice.dataset.value;
// console.log(choice.dataset.value);
}
choice.addEventListener("click", (e) => {
choiceItems.forEach((choice) => {
if (choice === e.target) {
choiceList.dataset.value = choice.dataset.value;
choice.classList.add("active");
console.log(choice.dataset.value);
}else {
choice.classList.remove("active");
}
});
});
});
})
6 changes: 6 additions & 0 deletions main/_front/src/scss/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@ body {
max-width: 1170px;
margin: 0 auto;
padding: 0 15px;
}

.grey_background {
border: 1px solid #d8d8d8;
background-color: #F8F8F8;
border-radius: 10px;
}
37 changes: 37 additions & 0 deletions main/_front/src/scss/blocks/_card.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.cards {
display: flex;
gap: 20px;
flex-wrap: wrap;
}

.card {
width: 268px;
background-color: #fff;
box-shadow: 0 2px 10px 4px rgba(#727272, 0.25);
border-radius: 10px;
padding: 34px 16px 16px;
display: flex;
flex-direction: column;
align-items: center;
}

.card__description {
display: flex;
flex-direction: column;
align-items: center;
}

.card__name {
font-size: 16px;
text-align: center;
font-weight: 400;
line-height: 19px;
height: 65px;
margin: 8px 0 16px;
}

.card__price {
font-size: 24px;
font-weight: 500;
margin-bottom: 16px;
}
33 changes: 33 additions & 0 deletions main/_front/src/scss/blocks/_components.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.components {

}

.components__inner {
display: flex;
justify-content: space-between;
align-items: flex-start;
column-gap: 20px;
}

.components__choice {
width: 276px;
padding: 20px;
display: flex;
flex-direction: column;
gap: 15px;
}

.components__choice-title {
font-size: 24px;
line-height: 28px;
font-weight: 700;
text-align: center;
}

.components__main {
flex: 1;
}

.components__sort {
margin-bottom: 20px;
}
19 changes: 19 additions & 0 deletions main/_front/src/scss/blocks/_sort.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.sort {
display: flex;
align-items: center;
width: 100%;
padding: 13px 20px;
}

.sort__text {
font-size: 18px;
color: #000;
margin-right: 20px;
font-weight: 500;
}

.sort__block {
display: flex;
justify-content: space-between;
width: 100%;
}
9 changes: 9 additions & 0 deletions main/_front/src/scss/blocks/_title.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.title {
margin: 15px 0 20px;
}

.title__text {
font-size: 30px;
font-weight: 700;
line-height: 47px;
}

0 comments on commit bcc9522

Please sign in to comment.